/////////////////////////////////////////////////////////////////////////////////////////////////
/////		 NWGUSA.com || WEV FORM VALIDATE v3			/////////////////////////////////////////
///// 				  COPYRIGHT © 2009					/////////////////////////////////////////
/////													/////////////////////////////////////////
/////	  Optimized Script by DCG. DiegoH Quintero		/////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////

//  Customer Form
function hideAllErrorsCustomer() 
{
	document.loginFormCuscomer.user.style.borderColor = "#FFF";
	document.loginFormCuscomer.pass.style.borderColor = "#FFF";
}

function validateLoginCustomer()
{
	hideAllErrorsCustomer();
	if(document.loginFormCuscomer.user.value=='')
	{
		document.loginFormCuscomer.user.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  CUSTOMER AREA</strong><br />Please indicate your User Name.');
		return false;
	} else if(document.loginFormCuscomer.pass.value=='')
	{
		document.loginFormCuscomer.pass.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  CUSTOMER AREA</strong><br />Please indicate your Password.');
		return false;
	}
	
	return true;
}

//  General Form
function hideAllErrorsForm() 
{
	document.MessageForm.name.style.borderColor = "#333";
	document.MessageForm.email.style.borderColor = "#333";
	document.MessageForm.Comments.style.borderColor = "#333";
}

function validateForm()
{
	hideAllErrorsForm();
	if(document.MessageForm.name.value=='')
	{
		document.MessageForm.name.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  CUSTOMER SERVICE</strong><br />Please indicate your Name.');
		return false;
	} else if(document.MessageForm.email.value=='')
	{
		document.MessageForm.email.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  CUSTOMER SERVICE</strong><br />Please indicate your E-mail.');
		return false;
	} else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.MessageForm.email.value))){
		document.MessageForm.email.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  CUSTOMER SERVICE</strong><br />Please indicate a valid E-mail Address.<br /><br /><small><em>eg. myname@mycompany.com</em></small>');
		return false;
	} else if(document.MessageForm.Comments.value=='')
	{
		document.MessageForm.Comments.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  CUSTOMER SERVICE</strong><br />Please write a message.');
		return false;
	}
	
	return true;
}

//  E-mail Configuration Form
function hideAllErrorsFormMail() 
{
	document.FormMailC.domain.style.borderColor = "#333";
	document.FormMailC.email.style.borderColor = "#333";
	document.FormMailC.password.style.borderColor = "#333";
}

function validateFormMail()
{
	hideAllErrorsFormMail();
	if(document.FormMailC.domain.value=='')
	{
		document.FormMailC.domain.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  SUPPORT</strong><br />Please indicate your Domain Name.');
		return false;
	} else if(!(/^\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.FormMailC.domain.value)))
	{
		document.FormMailC.domain.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  SUPPORT</strong><br />Please indicate a valid Domain Address.<br /><br /><small><em>eg. mycompany.com</em></small>');
		return false;
	} else if(document.FormMailC.email.value=='')
	{
		document.FormMailC.email.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  SUPPORT</strong><br />Please indicate your E-mail.');
		return false;
	} else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.FormMailC.email.value))){
		document.FormMailC.email.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  SUPPORT</strong><br />Please indicate a valid E-mail Address.<br /><br /><small><em>eg. myname@mycompany.com</em></small>');
		return false;
	} else if(document.FormMailC.password.value=='')
	{
		document.FormMailC.password.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  SUPPORT</strong><br />Please indicate your E-mail Password.<br />This information will be safe.');
		return false;
	}
	
	return true;
}


//  Get Quote Form
function hideAllErrorsQuote() 
{
	document.QuoteForm.first.style.borderColor = "#333";
	document.QuoteForm.last.style.borderColor = "#333";
	document.QuoteForm.phone.style.borderColor = "#333";
	document.QuoteForm.email.style.borderColor = "#333";
}

function validateGetQuote()
{
	hideAllErrorsQuote();
	if(document.QuoteForm.first.value=='')
	{
		document.QuoteForm.first.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  GET QUOTE</strong><br />Please indicate your First Name.');
		return false;
	} else if(document.QuoteForm.last.value=='')
	{
		document.QuoteForm.last.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  GET QUOTE</strong><br />Please indicate your Last Name.');
		return false;
	} else if(document.QuoteForm.phone.value=='')
	{
		document.QuoteForm.phone.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  GET QUOTE</strong><br />Please indicate your Phone Number.');
		return false;
	} else if(document.QuoteForm.email.value=='')
	{
		document.QuoteForm.email.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  GET QUOTE</strong><br />Please indicate your E-mail.');
		return false;
	} else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.QuoteForm.email.value))){
		document.QuoteForm.email.style.borderColor = "#C00";
		Sexy.alert('<strong>NWGUSA.com  ||  GET QUOTE</strong><br />Please indicate a valid E-mail Address.<br /><br /><small><em>eg. myname@mycompany.com</em></small>');
		return false;
	}
	
	return true;
}

//Lang Menu Code
function ShowLangMenu() {
	document.getElementById('container').className="on";
	clearTimeout(a);
}
function HiddeLangMenu() {
	a = setTimeout("document.getElementById('container').className='off'",500);
}


//video callers

function load(vd) {
var load = window.open('videos/videoshow.cfm?v='+vd,'','scrollbars=no,menubar=no,height=650,width=500,resizable=no,toolbar=no,location=no,status=no');
}

