var MyControls = new Array("#word","#word2","#word3","#word4");

var Timer = 2000; 							
var FadeSpeed = 600; 

$(document).ready(function() {

	


if(MyControls[0] == null)
	{ alert('array cannot be empty'); } 
else 
	{
		$(MyControls[0]).show();
		
		for ( var i=0; i<=MyControls.length-1; i++ ){
			if(i != 0) { $(MyControls[i]).hide(); }
		}

		if(MyControls.length-1 > 0 )
		{ setTimeout ( "Fade(1)", Timer ); }
	}

});

//Lets figure out the animation
function Fade(arrayID)
{
	if(arrayID != 0)
	{
		$(MyControls[arrayID-1]).fadeOut(FadeSpeed, function() {												 
			$(MyControls[arrayID]).fadeIn(FadeSpeed);
		  });
	} 
	else 
	{
		$(MyControls[MyControls.length-1]).fadeOut(FadeSpeed, function() {												
			$(MyControls[arrayID]).fadeIn(FadeSpeed);
		  });
	}
	
	if(arrayID+1 > MyControls.length-1)
	{ setTimeout("Fade(0)",Timer); } 
	else 
	{
		var arrID = arrayID+1;
		setTimeout("Fade("+arrID+")",Timer);
	}
}

	var myWidth = document.documentElement.clientWidth;
	
	if(myWidth < 1024) { $(document).ready(function() { $(".squares").hide(); $(".nav").hide(); }); }
	
	var txt = '<form method="post" action="clientarea.php">Please enter your client login details below to continue.<br><br><label style="float: left; width: 100px; margin-bottom: 5px;">Username:</label><input type="text" name="user"><div style="clear: both;"></div><label style="float: left; width: 100px; margin-bottom: 5px;">Password:</label><input type="password" name="pass"><div style="clear: both;"></div><label style="float: left; width: 100px; margin-bottom: 5px;">&nbsp;</label><input type="submit" name="alogin" value="Login"><div style="clear: both;"></div></form>';
	function mycallbackfunc(v,m,f){
		if(v == true){
			window.location="/clientarea.php";
		}
	}
