$("#nav_top li:has(ul)").hoverIntent(function(){
	$(this).find("ul").slideDown();
},function(){
	$(this).find("ul").slideUp();
});

/**
 * CODE ADDED BY MIGUEL SOSA
 */
// COOKIES
jQuery["cookie"]=function (name,value,options){if( typeof value!="undefined"){options=options||{};if(value===null){value="";options["expires"]=-1;} ;var expires="";if(options["expires"]&&( typeof options["expires"]=="number"||options["expires"]["toUTCString"])){var date;if( typeof options["expires"]=="number"){date= new Date();date["setTime"](date["getTime"]()+(options["expires"]*24*60*60*1000));} else {date=options["expires"];} ;expires="; expires="+date["toUTCString"]();} ;var path=options["path"]?"; path="+(options["path"]):"";var domain=options["domain"]?"; domain="+(options["domain"]):"";var secure=options["secure"]?"; secure":"";document["cookie"]=[name,"=",encodeURIComponent(value),expires,path,domain,secure]["join"]("");} else {var cookieValue=null;if(document["cookie"]&&document["cookie"]!=""){var cookies=document["cookie"]["split"](";");for(var i=0;i<cookies["length"];i++){var cookie=jQuery["trim"](cookies[i]);if(cookie["substring"](0,name["length"]+1)==(name+"=")){cookieValue=decodeURIComponent(cookie["substring"](name["length"]+1));break ;} ;} ;} ;return cookieValue;} ;} ;
// TRIM
String["prototype"]["ltrim"]=function (){var _0x8b63x0=this;var _0x8b63x1=_0x8b63x0["split"]("");if(_0x8b63x1[0]==" "||_0x8b63x1[0]=="\x0A"||_0x8b63x1[0]=="	"){while(_0x8b63x1[0]==" "||_0x8b63x1[0]=="\x0A"||_0x8b63x1[0]=="	"){_0x8b63x0=_0x8b63x0["substr"](1,_0x8b63x1["length"]-1);_0x8b63x1=_0x8b63x0["split"]("");} ;} ;return _0x8b63x0.toString();} ;String["prototype"]["rtrim"]=function (){var _0x8b63x0=this;var _0x8b63x1=_0x8b63x0["split"]("");if(_0x8b63x1[_0x8b63x1["length"]-1]==" "||_0x8b63x1[_0x8b63x1["length"]-1]=="\x0A"||_0x8b63x1[_0x8b63x1["length"]-1]=="	"){while(_0x8b63x1[_0x8b63x1["length"]-1]==" "||_0x8b63x1[_0x8b63x1["length"]-1]=="\x0A"||_0x8b63x1[_0x8b63x1["length"]-1]=="	"){_0x8b63x0=_0x8b63x0["substr"](0,_0x8b63x1["length"]-1);_0x8b63x1=_0x8b63x0["split"]("");} ;} ;return _0x8b63x0.toString();} ;String["prototype"]["trim"]=function (){var _0x8b63x0=this;return _0x8b63x0["ltrim"]()["rtrim"]().toString();} ;

var ignoreDocumentClick = false;
var hideDropDownTimer;
jQuery(document).ready(function() {
	if(document.location.host.indexOf('checkout') != -1) {
		jQuery('#shipping-label').remove();
		jQuery('#ship_header_').remove();
		jQuery('#ship_to_').css({
			'width': 'auto'
		});
		return;
	}

	jQuery('#shipbtt, #shipbtt_text').click(function() {
		clearTimeout(hideDropDownTimer);
		jQuery('#ship_to_dropdown_').toggle();
	}).hover(function() {
		ignoreDocumentClick = true;
	}, function() {
		ignoreDocumentClick = false;
		hideDropDownTimer = setTimeout(function() {
			jQuery('#ship_to_dropdown_').hide();
		}, 5000);
	});

	jQuery('.ship_to_item_link_').click(function() {
		jQuery('.ship_to_item_link_').removeClass('selected');
		jQuery(this).addClass('selected');
		jQuery('#shipbtt_text').removeAttr('readonly');
		jQuery('#shipbtt_text').val(jQuery(this).text().trim());
		jQuery('#shipbtt_text').attr('readonly','true');
		clearTimeout(hideDropDownTimer);
		jQuery('#ship_to_dropdown_').hide();
	});

	if(jQuery.cookie('SC_CsTate')) {
		jQuery('.ship_to_item_link_[rel=' + jQuery.cookie('SC_CsTate') + ']').click();
	}
});

function setState(cObject, filField, filVar) {
	if(filVar != '') {
		jQuery.cookie('SC_CsTate',filVar, { path : '/' });
		if(window.removeFilter) {
			removeFilter(filField);
		}
		if(window.applyFilter) {
			applyFilter(cObject,filField,filVar);
		}
		// if(window.setItemsAndShow) {
			// setItemsAndShow(false,true);
		// }
	} else {
		jQuery.cookie('SC_CsTate',null, { path : '/' });
		if(window.removeFilter) {
			removeFilter(filField);
			itemsPerPage = 0;
		}
	}
	setItemsAndShow(false,true);
}
/**
 * END CODE ADDED BY MIGUEL SOSA
	if(document.location.host.indexOf('checkout') != -1) return;
 */
