/*************************************************************************************************************
File Name 		: jsignin.js

Created Date 	: 18-08-2008
Created By		: Rushabh Desai
************************************************************************************************************/
function checkvalid()
{
	if(Trim(document.formContact.vCompanyName.value)=="")
	{
    document.getElementById('show_company').innerHTML = "Please Enter IATA Number";
		document.getElementById('vCompanyName').className = 'input-red';
		document.formContact.vCompanyName.focus();
		return false;
	}
	
  if(Trim(document.formContact.vEmail.value)=="")
	{
    document.getElementById('show_email').innerHTML = "Please Enter Email";
		document.getElementById('vEmail').className = 'input-red';
		document.formContact.vEmail.focus();
		return false;
	}

	if(!isValidEmail_withoutalert(document.formContact.vEmail.value))
	{
		document.getElementById('show_email').innerHTML = "Please Enter Valid Email";
		document.getElementById('vEmail').className = 'input-red';
		document.formContact.vEmail.focus();
		return false;
	}

	if(Trim(document.formContact.vPassword.value)=="")
	{
		document.getElementById('show_password').innerHTML = "Please Enter Password";
		document.getElementById('vPassword').className = 'input-red';
		document.formContact.vPassword.focus();
		return false;
	}
	
	document.formContact.mode.value = 'login';
	return true;
}

function checkvalid_forget_pwd()
{
	if(Trim(document.formForgotPwd.Forget_Pwd_vEmail.value) == "")
	{
		document.getElementById('show_forgotpassword').innerHTML = "Please Enter Email";
		document.getElementById('Forget_Pwd_vEmail').className = 'input-red';
		document.formForgotPwd.Forget_Pwd_vEmail.focus();
		return false;
	}

	if(!isValidEmail_withoutalert(document.formForgotPwd.Forget_Pwd_vEmail.value))
	{
		document.getElementById('show_forgotpassword').innerHTML = "Please Enter Valid Email";
		document.getElementById('Forget_Pwd_vEmail').className = 'input-red';
		document.formForgotPwd.Forget_Pwd_vEmail.focus();
		return false;
	}
	document.formForgotPwd.mode.value = 'forget_pwd';
	//document.formContact.submit();
}
function chregister()
{
	window.location = site_url+'Registration/';
	return false;
}


function hidestyle1(val)
{
	if(Trim(document.getElementById(val).value) != '' )
	{
		if(val == 'vEmail')
		{
			if(!isValidEmail_withoutalert(document.getElementById(val).value))
			{
				document.getElementById('show_email').innerHTML = "Please Enter Valid Email";
				document.getElementById(val).className = 'input-red';
			}
			else
			{
				document.getElementById(val).className = 'input';
				document.getElementById('show_email').innerHTML = '';
			}
		}
		if(val == 'vCompanyName')
		{
			document.getElementById('show_company').innerHTML = '';
			document.getElementById(val).className = 'input';
		}
		
		if(val == 'vPassword')
		{
			document.getElementById('show_password').innerHTML = '';
			document.getElementById(val).className = 'input';
		}
		if(val == 'Forget_Pwd_vEmail')
		{
		
			if(!isValidEmail_withoutalert(document.getElementById(val).value))
			{
				document.getElementById('show_forgotpassword').innerHTML = "Please Enter Valid Email";
				document.getElementById(val).className = 'input-red';
			}
			else
			{
				document.getElementById(val).className = 'input';
				document.getElementById('show_forgotpassword').innerHTML = '';
			}
		}
	}
	else
	{
		if(val == 'vEmail')
		{
			document.getElementById('show_email').innerHTML = "Please Enter Email";
			document.getElementById(val).className = 'input-red';
		}
			if(val == 'vCompanyName')
		{
			document.getElementById('show_company').innerHTML = 'Please Enter IATA Number';
			document.getElementById(val).className = 'input-red';
		}
		if(val == 'vPassword')
		{
			document.getElementById('show_password').innerHTML = "Please Enter Password";
			document.getElementById(val).className = 'input-red';
		}
		if(val == 'Forget_Pwd_vEmail')
		{
			document.getElementById('show_forgotpassword').innerHTML = "Please Enter Email";
			document.getElementById(val).className = 'input-red';
		}
	}
}

