var $j = jQuery.noConflict();

$j(document).ready(function() {
	if ($j('#tweets').length	> 0){					   
		$j(".tweet").tweet({
				  join_text: "auto",
				  username: "LoveThoseShoes",
				  count: 3,
				  loading_text: "loading our latest LoveThoseShoes tweets..."
				});	

		window.setInterval("$j('.tweet').html(''); $j('.tweet').tweet({  join_text: 'auto',  username: 'LoveThoseShoes',  count: 3, loading_text: 'loading our latest LoveThoseShoes tweets...'});",60000);
	}
	
	$j("a[rel='chgcurr']").colorbox({width:400, height:250, opacity : 0.5});
	$j("a[rel='chgcurr2']").colorbox({width:400, height:250, opacity : 0.5});
	
	$j("a[rel='showadv']").colorbox({width:400, height:250, opacity : 0.5});
	
 	$j("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
 

 

	
 
	function megaHoverOver(){
		
		$j(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($j) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				jQuery(this).find("ul").each(function() {
					rowWidth += $j(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $j(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$j(this).find(".row").each(function() {							   
				$j(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			//$(this).find(".sub").css({'width' : biggestRow});
			//$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			//$(this).calcSubWidth();
			//Set Width
			//$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $j(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $j(this).hide(); 
	  });
	}
 
 
	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};
 
	$j("ul#topnav li .sub").css({'opacity':'0'});
	$j("ul#topnav li").hoverIntent(config);
 
 
});
function closeAndConvert(iCurrency){

window.location = "/updatecurrency.asp?Currency=" + iCurrency
parent.$.fn.colorbox.close();
return true;

}

function validateSearchTerms()
{
if (($('search').value == "Search Website...." || $('search').value == "") && $('bAdvanced').value == "false")
{
	alert("Please choose something to search for. Thanks!");
	return false;
}
else
{
	parent.$.fn.colorbox.close();
	return true;
}

}