function validate_login(theform)
{
	
	if( !notEmpty(theform['username'], 'Enter username', true ) ) { return false; }
	
	if( !notEmpty(theform['password'], 'Enter password', true ) ) { return false; }
		 
	if( !isValideStr(theform['password'], "", 6, 0, 'Password must be atleast 6 char long',true )) { return false; }
			
	if( !notEmpty(theform['confirmpassword'], 'Enter confirm password', true ) ) { return false; }
			
	if( !compare_fileds(theform['password'], theform['confirmpassword'], 'match', '', '', ' Password and confirm password must  be same !', true ) ) { return false; }
			
	if(document.getElementById("companyid").value == 'others')
	{
		if( !notEmpty(theform['companyname'], 'Enter company name', true ) ) { return false;}
		
		if( !notEmpty(theform['cAddress1'], 'Enter company address', true ) ) { return false;}
			
		if( !notEmpty(theform['cCity'], 'Enter company City', true ) ) { return false;}
		
		if( !notEmpty(theform['cState'], 'Enter company state', true ) ) { return false;}
		
		if( !notEmpty(theform['cZip'], 'Enter company zip code', true ) ) {
		return false;}
	
		if( !notEmpty(theform['cPhone'], 'Enter company phone', true ) ) {
		return false;}
		if( !isNumber(theform['cPhone'], '^([0-9]+)$', 'Enter valid company phone', true ) ) {
			return false;}
		if( !notEmpty(theform['cCell'], 'Enter company cell phone', true ) ) {
		return false;}
		if( !isNumber(theform['cCell'], '^([0-9]+)$', 'Enter valid company cell phone', true ) ) {
			return false;}
			
        if( !notEmpty(theform['cEmail'], 'Enter company email address', true ) ) {
        	return false;}
			
        if( !checkEmail(theform['cEmail'], 'Enter valid  email address', true ) ) {
        	return false;}
			
		if(theform['cAltEmail'].value != '')
		{
				if( !checkEmail(theform['cAltEmail'], 'Enter valid email address', true ) ) {
        	return false;}
		}
		
		if(theform['cEmail'].value == theform['cAltEmail'].value) {
			alert("E-mail and alternate E-mail should be different");
			return false;
		}	
		
		
        
		
	}

        if( !notEmpty(theform['firstname'], 'Enter first name', true ) ) {
        	return false;}
			
        if( !notEmpty(theform['lastname'], 'Enter last name', true ) ) {
        	return false;}
			
		 if( !notEmpty(theform['city'], 'Enter city name', true ) ) {
        	return false;}
			
		 if( !notEmpty(theform['state'], 'Enter state name', true ) ) {
        	return false;}
			
		 if( !notEmpty(theform['country'], 'Enter country name', true ) ) {
        	return false;}
			
		 if( !notEmpty(theform['zipcode'], 'Enter zipcode', true ) ) {
        	return false;}
		
		
			
		 if( !notEmpty(theform['phonecode'], 'Enter phone code', true ) ) {
        	return false;}
		
		if( !isNumber(theform['phonecode'], '^([0-9]+)$', 'Enter valid phone code', true ) ) {
			return false;}
			
		 if( !notEmpty(theform['phone'], 'Enter phone number', true ) ) {
			return false;}
		if( !isNumber(theform['phone'], '^([0-9]+)$', 'Enter valid phone number', true ) ) {
			return false;}
		
		 if( !notEmpty(theform['cellcode'], 'Enter code', true ) ) {
			return false;}
		
		if( !isNumber(theform['cellcode'], '^([0-9]+)$', 'Enter valid cell code', true ) ) {
			return false;}
			
		 if( !notEmpty(theform['cell'], 'Enter cell number', true ) ) {
			return false;}
				
		if( !isNumber(theform['cell'], '^([0-9]+)$', 'Enter valid cell number', true ) ) {
			return false;}
			
        if( !notEmpty(theform['email'], 'Enter email address', true ) ) {
        	return false;}
			
        if( !checkEmail(theform['email'], 'Enter valid email address', true ) ) {
        	return false;}
		
		if(theform['email'].value == theform['altemail'].value) {
			alert("E-mail and alternate E-mail should be different");
			return false;
		}	

			
           return true;
		
		
    }
	

	
function Show(val , trId)
{	
	
	tblObj = document.getElementById(trId);
	
	if(val == 'others')
	{			
		tblObj.style.display = "block";
		document.signup.companyid.options[document.signup.companyid.selectedIndex].value = "others";
		document.signup.companyid.options[document.signup.companyid.selectedIndex].text = "Others";
	}else
	{		
		tblObj.style.display = "none";
	}
}
function validate_signup(theform)
{
	if(!notEmpty(theform['firstname'], 'Enter first name', true )) { 
		theform['firstname'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['firstname'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['lastname'], 'Enter last name', true ) ) { 
		theform['lastname'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['lastname'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['phonecode'], 'Enter Phone number', true ) ) { 
		theform['phonecode'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['phonecode'].style.background = "#FFFFFF";
	}
	if(!isNaN(theform['phonecode'].value)==false)
	{
		alert('Enter Only Numeric Value');
		theform['phonecode'].style.background = "#FFF000";
		theform['phonecode'].focus();
		return false;
	}
	else
	{
		theform['phonecode'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['phone'], 'Enter Phone number', true ) ) { 
		theform['phone'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['phone'].style.background = "#FFFFFF";
	}
	if(!isNaN(theform['phone'].value)==false)
	{
		alert('Enter Only Numeric Value');
		theform['phone'].style.background = "#FFF000";
		theform['phone'].focus();
		return false;
	}
	else
	{
		theform['phone'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['email'], 'Enter Email Address', true ) ) { 
		theform['email'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['email'].style.background = "#FFFFFF";
	}
	if(!checkEmail(theform['email'], 'Enter Valid Email Address', true ) ) { 
		theform['email'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['email'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['supplierjobtitle'], 'Enter job title', true ) ) { 
		theform['supplierjobtitle'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['supplierjobtitle'].style.background = "#FFFFFF";
	}
	if(theform['supplierjobtitle'].value=='other')
	{
		if(!notEmpty(theform['otherjob'], 'Enter other job title', true ) ) { return false; }
	}
	
	if(!notEmpty(theform['companyname'], 'Enter Company name or Property name', true ) ) { 
		theform['companyname'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['companyname'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['country'], 'Enter Country name', true ) ) { theform['country'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['country'].style.background = "#FFFFFF";
	}
	
	/*if(!notEmpty(theform['cphoneext'], 'Enter Phone number', true ) ) { theform['cphoneext'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['cphoneext'].style.background = "#FFFFFF";
	}
	
	if(!isNaN(theform['cphoneext'].value)==false) {
		alert('Enter Only Numeric Value');
		theform['cphoneext'].style.background = "#FFF000";
		theform['cphoneext'].focus();
		return false;
	}
	else
	{
		theform['cphoneext'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['cPhone'], 'Enter Phone number', true ) ) { theform['cPhone'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['cPhone'].style.background = "#FFFFFF";
	}
	
	if(!isNaN(theform['cPhone'].value)==false) {
		alert('Enter Only Numeric Value');
		theform['cPhone'].style.background = "#FFF000";
		theform['cPhone'].focus();
		return false;
	}
	else
	{
		theform['cPhone'].style.background = "#FFFFFF";
	}
	
	
	if(!notEmpty(theform['cfaxext'], 'Enter Fax Number', true ) ) { theform['cfaxext'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['cfaxext'].style.background = "#FFFFFF";	
	}
	
	if(!isNaN(theform['cfaxext'].value)==false)
	{
		alert('Enter Only Numeric Value');
		theform['cfaxext'].style.background = "#FFF000";
		theform['cfaxext'].focus();
		return false;
	}
	else
	{
		theform['cfaxext'].style.background = "#FFFFFF";
	}
	
	if(!notEmpty(theform['cFax'], 'Enter Fax Number', true ) ) { theform['cFax'].style.background = "#FFF000"; return false; }else { theform['cFax'].style.background = "#FFFFFF"; }
	if(!isNaN(theform['cFax'].value)==false)
	{
		alert('Enter Only Numeric Value');
		theform['cFax'].style.background = "#FFF000";
		theform['cFax'].focus();
		return false;
	}
	else { theform['cFax'].style.background = "#FFFFFF"; }
	
	if(!notEmpty(theform['cEmail'], 'Enter Email Address', true ) ) { theform['cEmail'].style.background = "#FFF000"; return false; } else { theform['cEmail'].style.background = "#FFFFFF"; }
	if(!checkEmail(theform['cEmail'], 'Enter Valid Email Address', true ) ) { theform['cEmail'].style.background = "#FFF000"; return false; } else { theform['cEmail'].style.background = "#FFFFFF"; }*/
	
	if(!notEmpty(theform['regionname'], 'Enter Area of service', true ) ) { theform['regionname'].style.background = "#FFF000";return false; } else { theform['regionname'].style.background = "#FFFFFF"; }
	
	
	if(!notEmpty(theform['txtcaptcha'], 'Please enter correct verification code.', true ) ) { theform['txtcaptcha'].style.background = "#FFF000";
		return false; 
	}
	else
	{
		theform['txtcaptcha'].style.background = "#FFFFFF";
	}
	
	
	if(theform['vRentalUnitCount'].value<=9)
	{
		if(!confirm('Please confirm that you have '+theform['vRentalUnitCount'].value +' furnished rental units'))
		{
			theform['vRentalUnitCount'].style.background = "#FFF000";
			return false;
		}
		else
		{
			theform['vRentalUnitCount'].style.background = "#FFFFFF";
		}
	}
	
	return true;
}

