//<!--

//this runs on everypage

if (document.images) {
seeit_off = new Image();
seeit_off.src = "images/blk/seeit.gif";
seeit_on = new Image();
seeit_on.src = "images/white/seeit.gif";

getit_off = new Image();
getit_off.src = "images/blk/getit.gif";
getit_on = new Image();
getit_on.src = "images/white/getit.gif";

buildit_off = new Image();
buildit_off.src = "images/blk/buildit.gif";
buildit_on = new Image();
buildit_on.src = "images/white/buildit.gif";

useit_off = new Image();
useit_off.src = "images/blk/useit.gif";
useit_on = new Image();
useit_on.src = "images/white/useit.gif";

talkaboutit_off = new Image();
talkaboutit_off.src = "images/blk/talkaboutit.gif";
talkaboutit_on = new Image();
talkaboutit_on.src = "images/white/talkaboutit.gif";

contact_off = new Image();
contact_off.src = "images/blk/contact.gif";
contact_on = new Image();
contact_on.src = "images/white/contact.gif";

home_off = new Image();
home_off.src = "images/blk/home.gif";
home_on = new Image();
home_on.src = "images/white/home.gif";

wedidit_off = new Image();
wedidit_off.src = "images/blk/wedidit.gif";
wedidit_on = new Image();
wedidit_on.src = "images/white/wedidit.gif";
}

function getBrowserWidth() {
var intMovWidth;
intMovWidth = "";


if (navigator.appName.indexOf("Microsoft") != -1) {
	//alert('ie');
	intMovWidth = document.body.scrollWidth
} else if (navigator.appName.indexOf("Netscape") != -1) {
	//alert('NS');
	intMovWidth = window.innerWidth
} else {
	alert('non-standard browser error, this page may not display right');
	intMovWidth = screen.width;
};
if (intMovWidth == "") { //just incase
	alert('unexpected error, this page may not display right');
	intMovWidth = 800;
};
var browAllow; browAllow = 60;
var forUseScreenSize;
var widOne; widOne = 800;
var widTwo; widTwo = 1024;
var widThree; widThree = 1152;
var widFour; widFour = 1280;
var widOneView; widOneView = widOne - browAllow;
var widTwoView; widTwoView = widTwo - browAllow;
var widThreeView; widThreeView = widThree - browAllow;
var widFourView; widFourView = widFour - browAllow;

if (intMovWidth <= widTwoView & screen.width == 800) { forUseScreenSize = widOne }
else if (intMovWidth <= widThreeView) { forUseScreenSize = widTwo }
else if (intMovWidth <= widFourView) { forUseScreenSize = widThree }
else if (intMovWidth > widThreeView) { forUseScreenSize = widFour }
else { alert(intMovWidth + "= intMovWidth"); forUseScreenSize = widOne };

forUseScreenSize = forUseScreenSize+''; // convert to string
//alert("hello, your browser use size will be " + forUseScreenSize);
return forUseScreenSize;
};


//end run on everypage

function turnOn(imageName) { if (document.images) { document[imageName].src = eval(imageName + "on.src"); }};
function turnOff(imageName) { if (document.images) { document[imageName].src = eval(imageName + "off.src"); }};


function newWindow(path){

smallWindow = window.open
(path,'info','status=no,resizable=yes,scrollbars=no,screenX=25,left=25,screenY=50,top=50,width=400,height=270');
smallWindow.focus();
}



// JavaScript Document




function SubmitContestForm()
{
//Check the form
// Submit the form if no errors
	if (CheckAddContestForm() == true )
		{					
		document.ContestForm.action = "contestformsubmitted.php";
		document.ContestForm.submit();
		}
}


function SubmitContactForm()
{
//Check the form
// Submit the form if no errors
	if (CheckAddContactForm() == true )
		{					
		document.ContactForm.action = "SubmitContact.php";
		document.ContactForm.submit();
		}
}


function CheckAddContactForm() 
{
	
	 if	(document.ContactForm.name_from.value 		== 	"")		
			{ 	
				alert("Please enter your name ");	
				return false;
			}
			
	else if		(document.ContactForm.email_from.value 		== 	"")		
			{ 	
				alert("Please enter your email address ");	
				return false;
			}
			
	else	if (document.ContactForm.email_from.value.indexOf("@") == -1) 
			{
				alert("Please enter your email address ");	
				return false;
			}
 
	else	{	
			return true;
			}
	
} 


function CheckAddContestForm() 
{
	
	 if	(document.ContestForm.name_from.value 		== 	"")		
			{ 	
				alert("Please enter your name ");	
				return false;
			}
			
	else if	(document.ContestForm.txtAddress.value 		== 	"")		
			{ 	
				alert("Please enter your address ");	
				return false;
			}
			
	else if	(document.ContestForm.txtCity.value 		== 	"")		
			{ 	
				alert("Please enter your city ");	
				return false;
			}
	else if	(document.ContestForm.txtStateProv.value 		== 	"")		
			{ 	
				alert("Please enter your State/Province ");	
				return false;
			}

	else if	(document.ContestForm.txtCountry.value 		== 	"")		
			{ 	
				alert("Please enter your Country ");	
				return false;
			}
			
	else if	(document.ContestForm.txtPhone.value 		== 	"")		
			{ 	
				alert("Please enter your phone number ");	
				return false;
		}		
			
	else if		(document.ContestForm.email_from.value 		== 	"")		
			{ 	
				alert("Please enter your email address ");	
				return false;
			}
			
	else if (document.ContestForm.email_from.value.indexOf("@") == -1) 
			{
				alert("Please enter your email address ");	
				return false;
			}
			
	else if	(document.ContestForm.file1.value 		== 	"")		
			{ 	
				alert("Please upload your database ");	
				return false;
			}
			
	else if	(document.ContestForm.agree.checked == false)		
			{ 	
				alert("Please agree to the terms");	
				return false;
			}
 
	else	{	
			return true;
			}
	
} 