/*jQuery.noConflict();
jQuery(document).ready(function($)
{ 	
	$("ul.sf-menu").supersubs({ 
		minWidth: 14,
		maxWidth: 14,
		extraWidth: 1 // ensure lines don't break due to slight rounding differences and fonts
	}).superfish({ 
		delay: 300,
		animation: { opacity:'show', height:'show' },
		speed: 300,
		autoArrows: true,
		dropShadows: true
	});
	
	$(".scrollable").scrollable();
	
	$("#gallery .items a").fancybox({
		'overlayOpacity'	: 0.75,
		'overlayColor'		: '#030100', 
		'imageScale'		: true,
		'padding'			: 0
	});
	
	$('#rotator').jshowoff({ speed: 5000, links: false, changeSpeed: 1200 });
});*/

function reload()
{
	location.reload();	
}

function launch(url)
{
	alert(url);
	
	//window.open(url, 'popup', 'width=640,height=480,menubar=no,location=no,scrollbars=no,resizable=no'); 
	//window.blur(); 
	return false;
}

function popUp(link, width, height) {
   winStats='toolbar=yes,location=no,directories=no,menubar=no,scrollbars=yes'
   if (navigator.appName.indexOf("Microsoft")>=0) {
	  winStats+=',left=50,top=100,width=' + width + ',height=' + height
	}else{
	  winStats+=',screenX=50,screenY=100,width=' + width + ',height=' + height
	}
   win=window.open(link,"",winStats)
}

var rotatorCounter = "";
function changeBGImage(slug, direction)
{
	var imgPath = document.getElementById("container").style.background;
	
	if(direction == "back")
	{
		if(rotatorCounter == "")
			rotatorCounter = 5;
		else if(rotatorCounter == 1)
			rotatorCounter = 5;
		else
			rotatorCounter = Number(rotatorCounter) - 1;
	}
	else if(direction == "next")
	{
		if(rotatorCounter == "")
			rotatorCounter = 2;
		else if(rotatorCounter == 5)
			rotatorCounter = 1;
		else
			rotatorCounter = Number(rotatorCounter) + 1;
	}
	
	document.getElementById("container").style.background = "url(/wp-content/themes/canyonriverspa/images/page-backgrounds/" + slug + "_bg" + String(rotatorCounter) + ".jpg)";
	document.getElementById("container").style.paddingBottom = "75px";
}

