// COPYRIGHTED TURNER TEKNOLOGIES 2005
// Thursday, May 19, 2005 - 3:21 AM


var browser = navigator.appName;


//----MAIN MENU FADE CONTROL-----------------------------------------------------------------------------

function FadeIN(docObj) 
{ 
	if (document.all)
	{
		if (MAIN_MENU.filters.alpha.opacity < 100)
		{ 
			MAIN_MENU.filters.alpha.opacity = MAIN_MENU.filters.alpha.opacity + 10;
			setTimeout("FadeIN()",10);
		}
	}
	else if (docObj.style.MozOpacity < 1)
	{
		docObj.style.MozOpacity  = 1;
		//docObj.style.MozOpacity = Math.min(parseFloat(docObj.style.MozOpacity) + 0.1, 0.99);
		//setTimeout("FadeIN(docObj)",10);
	}
}

function FadeOUT(docObj) 
{ 
	if (document.all)
	{
		if (MAIN_MENU.filters.alpha.opacity > 20) 
		{
			MAIN_MENU.filters.alpha.opacity = MAIN_MENU.filters.alpha.opacity - 10;
			setTimeout("FadeOUT()",10);
		}
	} 
	else if (docObj.style.MozOpacity > 0.2)
	{
		docObj.style.MozOpacity = 0.2;
		//docObj.style.MozOpacity = Math.min(parseFloat(docObj.style.MozOpacity) - 0.1, 0.21);
		//setTimeout("FadeOUT(docObj)",10);
	}
}
//------ORDER FORM COMPLETION CHECK-------------------------------------------------------------------------

function validateComplete(formObj)
{
	ziploc = ""
	if (emptyField(formObj.odr_fname)) ziploc = "* Please fill in your first name!\n";
	if (emptyField(formObj.odr_lname)) ziploc += "* Please fill in your last name!\n";
	if (emptyField(formObj.odr_mail)) ziploc += "* Please fill in your email address!\n";
	if (emptyField(formObj.odr_model)) ziploc += "* Please select a base model!\n";
	if (!Valid_Email(formObj.odr_mail.value)) ziploc += "* Please fill in a Valid Email Address!\n";
	if (emptyField(formObj.odr_payment)) ziploc += "* Please select a payment option!\n";

	if (ziploc != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your description has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		alert(msg + ziploc + "\n\n");
		return false;
	}

	return true;
}

function Valid_Email(User_Email)
{
	var ValidTest = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return (ValidTest.test(User_Email));
}

function emptyField(textObj)
{
	if (textObj.value.length == 0) return true;
	for(var i=0; i<textObj.value.length; ++i)
	{
		var ch = textObj.value.charAt(i);
		if (ch != ' ' && ch != '\t') return false;
	}
	return true;
}
	
	
	
	
	