    $(function() {
		if ( document.getElementById("slideshow") )
		{
			$('#slideshow').cycle({
			fx: 'fade',
			speed: 'slow',
			timeout: 10000,
			//timeout: 0,
			pager: '#ad-nav',
			slideExpr: 'img'
			//next: '#rightButton',
			//prev: '#leftButton'
			});
			$('#pauseButton').click(function() { 
				$('#slideshow').cycle('pause'); 
			});
			$('#leftButton').click(function() { 
				$('#slideshow').cycle('prev'); 
			});
			$('#rightButton').click(function() { 
				$('#slideshow').cycle('next'); 
			});
		}
	});
	function forgotpass_results(results){
		if (results.indexOf("SUCCESS:") > -1){
			arr = results.split("SUCCESS:");
			document.getElementById('errinfo').innerHTML=arr[1];
		}
		else{
			document.getElementById('errinfo').innerHTML="<b>ERROR</b>: "+results;
		}
	}
	function forgotpass_validation(){
		var frm = document.frmForgotPass;
	
		document.getElementById('errinfo').innerHTML="Logging In...";
		//postwithresults(frm,'','','forgotpass_results');	
		$.ajax({
		  type: 'POST',
		  url: frm.action,
		  data: 'issubmit=true&email='+frm.email.value,
		  success: function( data ){ forgotpass_results(data) }
		});

	}
	function forgotpass(){
		//getCalendarContent('_forgotpass.php?what=nothing');
		//$.fn.colorbox.close();
		//parent.$.fn.colorbox.close();
		setTimeout( "showForgotPass()" , 500 );
	}
	function showForgotPass()
	{
		$.fn.colorbox({
			href:'_forgotpass.php',
			open:true,
			inline:false,
			iframe:false,
			width:'600px',
			height:'200px',
			onLoad:function(){ $("#repHomePageVideo").hide(); }, 
            onClosed:function(){ $("#repHomePageVideo").show(); } 
		});
	}
	function showRegister()
	{
		$.fn.colorbox({
			href:'/forms/index.php?act=register&hide_header=true',
			open:true,
			inline:false,
			iframe:true,
			width:'800px',
			height:'900px',
			onLoad:function(){ $("#repHomePageVideo").hide(); }, 
            onClosed:function(){ $("#repHomePageVideo").show(); } 
		});
	}
	function showLogin()
	{
		$.fn.colorbox({
			href:'#loginForm',
			inline:true, open:true,
			iframe:false,
			width:'400px',
			height:'300px',
			onLoad:function(){ $("#repHomePageVideo").hide(); }, 
            onClosed:function(){ $("#repHomePageVideo").show(); } 
		});
	}
	function doLogin( isEagle )
	{
		var frm = document.frmLogin;
		if ( isEagle )
		{
			var frm = document.frmLoginEagle;
		}

		$.ajax({
		  type: 'POST',
		  url: frm.action,
		  data: 'username='+frm.username.value+'&password='+frm.password.value+'&ajax_confirm=true',
		  success: function( data ){
			  	if ( data == "true" )
				{
					frm.submit();
				}
				else
				{
					$.fn.colorbox({href:'_loginerror.php', open:true, iframe:false, inline:false, width:'500px' , height:'150px'});
					return false;
				}
			}
		});
	}
	function doQLogin( isEagle )
	{
		var frm = document.frmFarmLogin;
		if ( isEagle ){
			var frm = document.frmFarmLoginEagle;
		}

		if ( frm.customernumber.value == "" ){
			frm.customernumber.focus();
			alert( "Password is required" );
			return false;
		}

		$.ajax({
		  type: 'POST',
		  url: "/forms/index.php?formselection=customerservice", //frm.action,
		  data: 'customernumber='+frm.customernumber.value+'&formfunction=instant_login&location='+frm.location.value+'&ajax_confirm=true',
		  success: function( data ){
			  	if ( data == "true" )
				{
					frm.submit();
				}
				else
				{
					$.fn.colorbox({href:'_loginerror.php', open:true, iframe:false, width:'500px' , height:'150px'});
					return false;
				}
			}
		});
	}
