/*
  -------------------------------------------------------------------------
	                    JavaScript Form Validator 
                                Version 2.0.2
	Copyright 2003 JavaScript-coder.com. All rights reserved.
	You use this script in your Web pages, provided these opening credit
    lines are kept intact.
	The Form validation script is distributed free from JavaScript-Coder.com

	You may please add a link to JavaScript-Coder.com, 
	making it easy for others to find this script.
	Checkout the Give a link and Get a link page:
	http://www.javascript-coder.com/links/how-to-link.php

    You may not reprint or redistribute this code without permission from 
    JavaScript-Coder.com.
	
	JavaScript Coder
	It precisely codes what you imagine!
	Grab your copy here:
	http://www.javascript-coder.com/
    -------------------------------------------------------------------------  
*/

function CheckAllSpecialSkill() {
	for (var i=0; i<document.experience_frm.elements.length; i++) {
		if (document.experience_frm.elements[i].type == "checkbox" && document.experience_frm.elements[i].className=="special") {
			if (document.experience_frm.check_all.checked == true) {
				document.experience_frm.elements[i].checked = true;
			}
			if (document.experience_frm.check_all.checked == false) {
				document.experience_frm.elements[i].checked = false;
			}
		}
	}
}

function CheckAllLanguage() {
	for (var i=0; i<document.experience_frm.elements.length; i++) {
		if (document.experience_frm.elements[i].type == "checkbox" && document.experience_frm.elements[i].className=="language") {
			if (document.experience_frm.check_all_lang.checked == true) {
				document.experience_frm.elements[i].checked = true;
			}
			if (document.experience_frm.check_all_lang.checked == false) {
				document.experience_frm.elements[i].checked = false;
			}
		}
	}
}

function CheckFalse() {
	document.experience_frm.check_all.checked = false;
}

function CheckFalseLang() {
	document.experience_frm.check_all_lang.checked = false;
}

function ManageEvent(mf) {
	if (trim(mf.event_title.value) == "") {
		alert("Please enter event title.");
		mf.event_title.focus();
		return false;
	}
	if (trim(mf.event_date.value) == "") {
		alert("Please select event date.");
		mf.event_date.focus();
		return false;
	}
	if (trim(mf.short_desc.value) == "") {
		alert("Please enet short description.");
		mf.short_desc.focus();
		return false;
	}
	return true;
}

function ManageClientPayment(mf)
{
	if(trim(mf.first_name.value)=="")
	{
		alert("Please enter the first name.");
		mf.first_name.focus();
		return false;
	}
	if(trim(mf.last_name.value)=="")
	{
		alert("Please enter the last name.");
		mf.last_name.focus();
		return false;
	}
	if(trim(mf.company_name.value)=="")
	{
		alert("Please enter the company name.");
		mf.company_name.focus();
		return false;
	}
	if(trim(mf.address.value)=="")
	{
		alert("Please enter the address.");
		mf.address.focus();
		return false;
	}
	if(trim(mf.city.value)=="")
	{
		alert("Please enter the city.");
		mf.city.focus();
		return false;
	}
	if(mf.state.value=="")
	{
		alert("Please enter the state.");
		mf.state.focus();
		return false;
	}
	if(document.getElementById("billing_country").value=="")
	{
		alert("Please enter the country.");
		mf.country.focus();
		return false;
	}
	if(trim(mf.zip.value)=="")
	{
		alert("Please enter the zip code.");
		mf.zip.focus();
		return false;
	}
	if(trim(mf.phone.value)=="")
	{
		alert("Please enter the phone number.");
		mf.phone.focus();
		return false;
	}
	if(!isValidTelephone(mf.phone.value))
	  {
		mf.phone.focus();
		return false;
	  }
	if(trim(mf.email.value)=="")
	{
		alert("Please enter the email address.");
		mf.email.focus();
		return false;
	}
	if(!isAValidEmail(mf.email.value))
   {
	 alert("Invalid email address.")
	 mf.email.focus();
	 return false;
   }

	if(trim(mf.mailing_first_name.value)=="")
	{
		alert("Please enter the first name.");
		mf.mailing_first_name.focus();
		return false;
	}
	if(trim(mf.mailing_last_name.value)=="")
	{
		alert("Please enter the last name.");
		mf.mailing_last_name.focus();
		return false;
	}
	if(trim(mf.mailing_company_name.value)=="")
	{
		alert("Please enter the company name.");
		mf.mailing_company_name.focus();
		return false;
	}
	if(trim(mf.mailing_address.value)=="")
	{
		alert("Please enter the address.");
		mf.mailing_address.focus();
		return false;
	}
	if(trim(mf.mailing_city.value)=="")
	{
		alert("Please enter the city.");
		mf.mailing_city.focus();
		return false;
	}
	if(mf.mailing_state.value=="")
	{
		alert("Please enter the state.");
		mf.mailing_state.focus();
		return false;
	}
	if(mf.mailing_country.value=="")
	{
		alert("Please enter the country.");
		mf.mailing_country.focus();
		return false;
	}
	if(trim(mf.mailing_zip.value)=="")
	{
		alert("Please enter the zip code.");
		mf.mailing_zip.focus();
		return false;
	}
	if(trim(mf.mailing_phone.value)=="")
	{
		alert("Please enter the phone number.");
		mf.mailing_phone.focus();
		return false;
	}
	if(!isValidTelephone(mf.phone.value))
	  {
		mf.mailing_phone.focus();
		return false;
	  }
	if(trim(document.getElementById("mailing_email").value)=="")
	{
		alert("Please enter the email address.");
		mf.mailing_email.focus();
		return false;
	}
	if(!isAValidEmail(document.getElementById("mailing_email").value))
   {
	 alert("Invalid email address.")
	 mf.mailing_email.focus();
	 return false;
   }
   if(trim(document.getElementById("mailing_1_desc").value)=="")
	{
		alert("Please enter the description.");
		mf.mailing_1_desc.focus();
		return false;
	}
	return true;
}
function SameAs()
{
	if(document.getElementById("sameas").checked==true)
	{
		document.frmOrder.mailing_first_name.value=document.frmOrder.first_name.value;
		document.frmOrder.mailing_last_name.value=document.frmOrder.last_name.value;
		document.frmOrder.mailing_company_name.value=document.frmOrder.company_name.value;
		document.frmOrder.mailing_address.value=document.frmOrder.address.value;
		document.frmOrder.mailing_city.value=document.frmOrder.city.value;
		document.frmOrder.mailing_state.value=document.frmOrder.state.value;
		document.frmOrder.mailing_country.value=document.getElementById("billing_country").value;
		document.frmOrder.mailing_zip.value=document.getElementById("zip").value;
		document.frmOrder.mailing_phone.value=document.frmOrder.phone.value;
		document.frmOrder.mailing_email.value=document.frmOrder.email.value;
		//document.frmOrder.mailing_1_desc.value=document.frmOrder.
	}
	else
	{
		document.frmOrder.mailing_first_name.value="";
		document.frmOrder.mailing_last_name.value="";
		document.frmOrder.mailing_company_name.value="";
		document.frmOrder.mailing_address.value="";
		document.frmOrder.mailing_city.value="";
		document.frmOrder.mailing_state.value="";
		document.frmOrder.mailing_country.value="";
		document.frmOrder.mailing_zip.value="";
		document.frmOrder.mailing_phone.value="";
		document.frmOrder.mailing_email.value="";
		//document.frmOrder.mailing_1_desc.value=document.frmOrder.	
	}
}

function TalentRegisterStepFirst(mf)
	{
		if(trim(mf.f_name.value)=="")
		{
			alert("Please enter the first name.");
			mf.f_name.focus();
			return false;
		}
		if(trim(mf.l_name.value)=="")
		{
			alert("Please enter the last name.");
			mf.l_name.focus();
			return false;
		}
		if(trim(mf.gender.value)=="")
		{
			alert("Please select the gender.");
			mf.gender.focus();
			return false;
		}
		if(trim(mf.email.value)=="")
		{
			alert("Please enter the e-mail address.");
			mf.email.focus();
			return false;
		}
		if(!isAValidEmail(mf.email.value))
	   {
		 alert("Invalid email address.")
		 mf.email.focus();
		 return(false);
	   }
		if(trim(mf.conf_email.value)=="")
		{
			alert("Please enter the confirm e-mail address.");
			mf.conf_email.focus();
			return false;
		}
		if(!isAValidEmail(mf.conf_email.value))
	   {
		 alert("Invalid confirm email address.")
		 mf.conf_email.focus();
		 return(false);
	   }
	   
	   if(mf.email.value!='' && mf.conf_email.value!="" && mf.email.value != mf.conf_email.value)
	 {
	 	alert("Email Address and Confirm email Address does not match. Please enter again.");
		 mf.email.focus();
		 return false;
	 }
	 
		
		if(trim(mf.mobile.value)=="")
		{
			alert("Please enter the mobile number.");
			mf.mobile.focus();
			return false;
		}
		if(!isValidMobile(mf.mobile.value))
		  {
			mf.mobile.focus();
			return false;
		  }
		if(trim(mf.phone.value)=="")
		{
			alert("Please enter the phone number.");
			mf.phone.focus();
			return false;
		}
		if(!isValidTelephone(mf.phone.value))
		  {
			mf.phone.focus();
			return false;
		  }
		if(trim(mf.address.value)=="")
		{
			alert("Please enter the mailing address.");
			mf.address.focus();
			return false;
		}
		if(trim(mf.city.value)=="")
		{
			alert("Please enter the city.");
			mf.city.focus();
			return false;
		}
		/*if(trim(mf.state.value)=="")
		{
			alert("Please select state.");
			mf.state.focus();
			return false;
		}*/
		//alert(mf.country.value);
		if(mf.country.value=="United States")
		{
			//alert(mf.state.value);
			//return false;
			if(document.getElementById("state").value == ""){
				alert("Please select state.");
				//mf.state.focus();
				return false;
			}
		}
		else
		{
			if(trim(mf.oth_state.value)=="")
			{
				alert("Please enter state.");
				mf.oth_state.focus();
				return false;
			}
		}	
		
		if(trim(mf.country.value)=="")
		{
			alert("Please select country.");
			mf.country.focus();
			return false;
		}
			
		if(trim(mf.zip.value)=="")
		{
			alert("Please enter the zip code.");
			mf.zip.focus();
			return false;
		}
		/*if(trim(mf.zip.value).length<5){

			alert("Please enter 5 digits for zip code");

			mf.zip.focus();

			return false;

		}*/
		else {
			if (isZip(mf.zip.value) == false) {
			alert("Zip Code Is Not Valid");
			mf.zip.focus();
			return false;
		}
		}
		if(trim(mf.travel.value)=="")
		{
			alert("Please select travel distance.");
			mf.travel.focus();
			return false;
		}
		if(trim(mf.find_us.value)=="")
		{
			alert("Please select how'd you find us.");
			mf.find_us.focus();
			return false;
		}
		return true;
	}
	
function validateFileExtension(fldVal,type)
  {
	switch(type)
	{
		case 'picture':
			if(!/(\.png|\.PNG|\.gif|\.GIF|\.jpg|\.JPG|\.jpeg|\.JPEG|\.giff|\.GIFF)$/i.test(fldVal)) {
				return false;
			}
			break;
		case 'pdf':
			if(!/(\.pdf|\.PDF)$/i.test(fldVal)) {
				return false;
			}	
			break;
		case 'mp3':
			if(!/(\.mp3|\.MP3)$/i.test(fldVal)) {
				return false;
			}	
			break;
		case 'flash':
			if(!/(\.swf|\.SWF)$/i.test(fldVal)) {
				return false;
			}
			break;
		case 'video':
			if(!/(\.avi|\.AVI |\.mpg|\.MPG |\.wmv|\.WMV)$/i.test(fldVal)) {
				return false;
			}	
			break;
		case 'worddocument':
			if(!/(\.doc|\.DOC |\.rtf|\.RTF)$/i.test(fldVal)) {
				return false;
			}	
			break;
		default:
			alert('Please specify a valid file extension');
			return false	
	}
	return true;
}

function isURL(string) {
	// function to check valid format of url
	if (!string) {
		return false;
	}
	string = string.toLowerCase();
	urlRegExp = /^\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]$/i;
	return urlRegExp.test(string);
}

function isValidTelephone(strTmp) {
	var valid = "+-()0123456789 ";
	for (var i=0; i<strTmp.length; i++) {
		temp = strTmp.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") {
			alert("Invalid phone number.");
			return false;
		}
	}
	return true;
}

function isValidMobile(strTmp) {
	var valid = "+-()0123456789 ";
	for (var i=0; i<strTmp.length; i++) {
		temp = strTmp.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") {
			alert("Invalid mobile number.");
			return false;
		}
	}
	return true;
}

function CheckClientFormEdit(mf)
{
	if(trim(mf.agency_name.value)=="")
	{
		alert("Please enter the company name.");
		mf.agency_name.focus();
		return false;
	}
	if(trim(mf.agency_type.value)=="")
	{
		alert("Please enter the company type.");
		mf.agency_type.focus();
		return false;
	}
	/*if(trim(mf.dba.value)=="")
	{
		alert("Please enter the DBA (Doing Business As).");
		mf.dba.focus();
		return false;
	}
	*/
	if(trim(mf.owner_firstname.value)=="")
	{
		alert("Please enter first name.");
		mf.owner_firstname.focus();
		return false;
	}
	if(trim(mf.owner_lastname.value)=="")
	{
		alert("Please enter last name.");
		mf.owner_lastname.focus();
		return false;
	}
	
	if(trim(mf.address1.value)=="")
	{
		alert("Please enter the address1.");
		mf.address1.focus();
		return false;
	}
	if(trim(mf.city.value)=="")
	{
		alert("Please enter city.");
		mf.city.focus();
		return false;
	}
	if(trim(mf.state.value)=="")
	{
		alert("Please select state.");
		mf.state.focus();
		return false;
	}
	if(trim(mf.country.value)=="")
	{
		alert("Please select country.");
		mf.country.focus();
		return false;
	}
	if(trim(mf.zip.value)=="")
	{
		alert("Please enter zip code.");
		mf.zip.focus();
		return false;
	}
	if(trim(mf.phone.value)=="")
	{
		alert("Please enter phone number.");
		mf.phone.focus();
		return false;
	}
	if(!isValidTelephone(mf.phone.value))
	  {
		mf.phone.focus();
		return false;
	  }
	/*	  
	if(trim(mf.mobile.value)=="")
	{
		alert("Please enter mobile number.");
		mf.mobile.focus();
		return false;
	}
	if(!isValidMobile(mf.mobile.value))
	  {
		mf.mobile.focus();
		return false;
	  }
	*/
	if(trim(mf.email1.value)=="")
	{
		alert("Please enter email address1.");
		mf.email1.focus();
		return false;
	}
	
	if(!isAValidEmail(mf.email1.value))
   {
	 alert("Invalid email address1.")
	 mf.email1.focus();
	 return(false);
   }
   if(mf.email2.value!="")
   {
	   if(!isAValidEmail(mf.email2.value))
	   {
		 alert("Invalid email address2.")
		 mf.email2.focus();
		 return(false);
	   }
   }
   
   if(mf.email3.value!="")
   {
	   if(!isAValidEmail(mf.email3.value))
	   {
		 alert("Invalid email address3.")
		 mf.email3.focus();
		 return(false);
	   }
   }
   
   if(trim(mf.website1.value)!='')
	{
		if(isURL(mf.website1.value)==false)
		{
			alert("Invalid website url.");
			mf.website1.focus();
			return false;
		}
	}	
	
	if(trim(mf.website2.value)!='')
	{
		if(isURL(mf.website2.value)==false)
		{
			alert("Invalid website url.");
			mf.website2.focus();
			return false;
		}
	}	
	
	if(trim(mf.website3.value)!='')
	{
		if(isURL(mf.website3.value)==false)
		{
			alert("Invalid website url.");
			mf.website3.focus();
			return false;
		}
	}
	return true;
}

function CheckClientForm(mf) {
	if (trim(mf.agency_name.value) == "") {
		alert("Please enter the company name.");
		mf.agency_name.focus();
		return false;
	}
	if (trim(mf.phone.value) == "") {
		alert("Please enter phone number.");
		mf.phone.focus();
		return false;
	}
	if (!isValidTelephone(mf.phone.value)) {
		mf.phone.focus();
		return false;
	}
	if (trim(mf.agency_type.value) == "") {
		alert("Please enter the company type.");
		mf.agency_type.focus();
		return false;
	}
	if (trim(mf.mobile.value) !="") {
		if (!isValidMobile(mf.mobile.value)) {
			mf.mobile.focus();
			return false;
		}
	}
	if (trim(mf.username.value) == "") {
		alert("Please enter the username.");
		mf.username.focus();
		return false;
	}
	if (trim(mf.password.value) == "") {
		alert("Please enter the password.");
		mf.password.focus();
		return false;
	}
	if (trim(mf.email1.value) == "") {
		alert("Please enter email address1.");
		mf.email1.focus();
		return false;
	}
	if (!isAValidEmail(mf.email1.value)) {
		alert("Invalid email address1.");
		mf.email1.focus();
		return false;
	}
	if (trim(mf.owner_firstname.value) == "") {
		alert("Please enter first name.");
		mf.owner_firstname.focus();
		return false;
	}
	if (trim(mf.email2.value) != "") {
		if (!isAValidEmail(mf.email2.value)) {
			alert("Invalid email address2.");
			mf.email2.focus();
			return false;
		}
	}
	if (trim(mf.owner_lastname.value) == "") {
		alert("Please enter last name.");
		mf.owner_lastname.focus();
		return false;
	}
	if (trim(mf.email3.value) !="") {
		if (!isAValidEmail(mf.email3.value)) {
			alert("Invalid email address3.");
			mf.email3.focus();
			return(false);
		}
	}
	if (trim(mf.address1.value) == "") {
		alert("Please enter the address1.");
		mf.address1.focus();
		return false;
	}
	if (trim(mf.website1.value) != '') {
		if (isURL(mf.website1.value) == false) {
			alert("Invalid website url.");
			mf.website1.focus();
			return false;
		}
	}
	if (trim(mf.website2.value) != '') {
		if (isURL(mf.website2.value) == false) {
			alert("Invalid website url 2.");
			mf.website2.focus();
			return false;
		}
	}
	if (trim(mf.city.value) == "") {
		alert("Please enter city.");
		mf.city.focus();
		return false;
	}
	if (trim(mf.website3.value) != '') {
		if (isURL(mf.website3.value) == false) {
			alert("Invalid website url 3.");
			mf.website3.focus();
			return false;
		}
	}
	if (trim(mf.state.value) == "") {
		alert("Please select state.");
		mf.state.focus();
		return false;
	}
	if (trim(mf.zip.value) == "") {
		alert("Please enter zip code.");
		mf.zip.focus();
		return false;
	}
	if (isZip(mf.zip.value) == false) {
		alert("Zip Code Is Not Valid");
		mf.zip.focus();
		return false;
	}
	if (trim(mf.country.value) == "") {
		alert("Please select country.");
		mf.country.focus();
		return false;
	}
	if (trim(mf.logo.value) != "") {
		var imagePath = mf.logo.value;
		var pathLength = imagePath.length;
		var lastDot = imagePath.lastIndexOf(".");
		var fileType1 = imagePath.substring(lastDot, pathLength);
		var fileType = fileType1.toLowerCase();
		if ((fileType == ".gif") || (fileType == ".jpg") || (fileType == ".jpeg") || (fileType == ".png") || (fileType == ".GIF") || (fileType == ".JPG") || (fileType == ".PNG") || (fileType == ".JPEG")) {
			//return true;
		} else {
			alert("Please select valid logo. Use only extensions .jpg, .gif, .png");
			mf.logo.focus();
			return false;
		}
	}
	if (mf.term_chk.checked == false) {
		alert("Please check terms and conditions.");
		mf.term_chk.focus();
		return false;
	}
	return true;
}

function isZip(s) {
	// Check for correct zip code
	reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
	if (!reZip.test(s)) {
		return false;
	}
	return true;
}

function CheckClientFormAdmin(mf)
{
	if(trim(mf.agency_name.value)=="")
	{
		alert("Please enter the company name.");
		mf.agency_name.focus();
		return false;
	}
	if(trim(mf.agency_type.value)=="")
	{
		alert("Please enter the company type.");
		mf.agency_type.focus();
		return false;
	}
	/*if(trim(mf.dba.value)=="")
	{
		alert("Please enter the DBA (Doing Business As).");
		mf.dba.focus();
		return false;
	}*/
	if(trim(mf.username.value)=="")
	{
		alert("Please enter the username.");
		mf.username.focus();
		return false;
	}
	if(trim(mf.password.value)=="")
	{
		alert("Please enter the password.");
		mf.password.focus();
		return false;
	}
	if(trim(mf.owner_firstname.value)=="")
	{
		alert("Please enter first name.");
		mf.owner_firstname.focus();
		return false;
	}
	if(trim(mf.owner_lastname.value)=="")
	{
		alert("Please enter last name.");
		mf.owner_lastname.focus();
		return false;
	}
	
	if(trim(mf.address1.value)=="")
	{
		alert("Please enter the address1.");
		mf.address1.focus();
		return false;
	}
	if(trim(mf.city.value)=="")
	{
		alert("Please enter city.");
		mf.city.focus();
		return false;
	}
	if(trim(mf.state.value)=="")
	{
		alert("Please select state.");
		mf.state.focus();
		return false;
	}
	if(trim(mf.country.value)=="")
	{
		alert("Please select country.");
		mf.country.focus();
		return false;
	}
	if(trim(mf.phone.value)=="")
	{
		alert("Please enter phone number.");
		mf.phone.focus();
		return false;
	}
	if(!isValidTelephone(mf.phone.value))
	  {
		mf.phone.focus();
		return false;
	  }
	/*  
	if(trim(mf.mobile.value)=="")
	{
		alert("Please enter mobile number.");
		mf.mobile.focus();
		return false;
	}
	if(!isValidMobile(mf.mobile.value))
	  {
		mf.mobile.focus();
		return false;
	  }
	  */
	if(trim(mf.zip.value)=="")
	{
		alert("Please enter zip code.");
		mf.zip.focus();
		return false;
	}
	if(trim(mf.email1.value)=="")
	{
		alert("Please enter email address1.");
		mf.email1.focus();
		return false;
	}
	
	if(!isAValidEmail(mf.email1.value))
   {
	 alert("Invalid email address1.")
	 mf.email1.focus();
	 return(false);
   }
   if(mf.email2.value!="")
   {
	   if(!isAValidEmail(mf.email2.value))
	   {
		 alert("Invalid email address2.")
		 mf.email2.focus();
		 return(false);
	   }
   }
   
   if(mf.email3.value!="")
   {
	   if(!isAValidEmail(mf.email3.value))
	   {
		 alert("Invalid email address3.")
		 mf.email3.focus();
		 return(false);
	   }
   }
   
   if(trim(mf.website1.value)!='')
	{
		if(isURL(mf.website1.value)==false)
		{
			alert("Invalid website url.");
			mf.website1.focus();
			return false;
		}
	}	
	
	if(trim(mf.website2.value)!='')
	{
		if(isURL(mf.website2.value)==false)
		{
			alert("Invalid website url.");
			mf.website2.focus();
			return false;
		}
	}	
	
	if(trim(mf.website3.value)!='')
	{
		if(isURL(mf.website3.value)==false)
		{
			alert("Invalid website url.");
			mf.website3.focus();
			return false;
		}
	}
	if(mf.logo.value!="")
	{
		var imagePath = mf.logo.value;
		var pathLength = imagePath.length;
		var lastDot = imagePath.lastIndexOf(".");
		var fileType1 = imagePath.substring(lastDot,pathLength);
		var fileType=fileType1.toLowerCase();
		if((fileType == ".gif") || (fileType == ".jpg") || (fileType == ".jpeg") || (fileType == ".png") || (fileType == ".GIF") || (fileType == ".JPG") || (fileType == ".PNG") || (fileType == ".JPEG"))
		 {
			//return true;
		} 
		else 
		{
			alert("Please select valid logo.");
			mf.logo.focus();
			return false;
		}
	}
	return true;
}

function change_password(mf)
{
     if(mf.old_pass.value=="")
	 {
		 alert("Please enter the old password.");
		 mf.old_pass.focus();
		 return false;
	 }
	 if(mf.new_pass.value=="")
	 {
	 	alert("Please enter the new password.");
		mf.new_pass.focus();
		return false;
	 }
	 if(mf.conf_pass.value=="")
	 {
		alert("Please enter the confirm password.");
		mf.conf_pass.focus();
		return false;
	}
	 if(mf.new_pass.value!='' && mf.conf_pass.value!="" && mf.new_pass.value != mf.conf_pass.value)
	 {
	 	alert("New password and confirm password does not matched. Please try again.");
		 mf.new_pass.value='';
		 mf.conf_pass.value='';
		 mf.new_pass.focus();
		 return false;
	 }
	 return true;
   }
   
   function change_email(mf)
	{
		  if(trim(mf.email.value)=="")
		 {
			alert("Please enter the email address.");
			mf.email.focus();
			return false;
		 }
		   if(!isAValidEmail(mf.email.value))
		   {
			 alert("Invalid email address.")
			 mf.email.focus();
			 return(false);
		   }
		 return true;
	   }
   
function PopupWindow(filename) {
	window.open(filename, 'newwindow', config='height=788,width=980,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
}

function PopupWindow1(filename) {
	window.open(filename, 'newwindow', config='height=400,width=650,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
}

function isAValidEmail(emailField) {
	var emailregex = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var match = emailField.match(emailregex);
	if (!match) {
		return false;
	} else {
		return true;
	}
}

function ForgotPass(mf)
{
		var uname=mf.username.value;
		var uemail=mf.email.value;
		if(trim(uname)=="" && trim(uemail)=="")
		{
			alert("Please enter username or email address.");
			mf.username.focus();
			return false;
		}
		
		if(trim(uemail)!="")
		{
		  if(!isAValidEmail(mf.email.value))
		   {
			 alert("Invalid Email ID.")
			 mf.email.focus();
			 return false;
		   }
		}
	return true;
}

function ForgotPass1(mf)
{
		var uname=mf.txtUserName.value;
		var uemail=mf.txtEmail.value;
		if(trim(uname)=="" && trim(uemail)=="")
		{
			alert("Please enter username or email address.");
			mf.txtUserName.focus();
			return false;
		}
		
		if(trim(uemail)!="")
		{
		  if(!isAValidEmail(mf.txtEmail.value))
		   {
			 alert("Invalid Email ID.")
			 mf.txtEmail.focus();
			 return false;
		   }
		}
	return true;
}

/*=====================Ajax=============== */
	//var url_email = GetURL()+"/setsession.php"; // The server-side script 
	
function ajaxFunction(val)
{
	var xmlHttp;
	try
	{  
		xmlHttp=new XMLHttpRequest();  // Firefox, Opera 8.0+, Safari 
	}
	catch (e)
	{  
		// Internet Explorer  try
		try
		{   
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");   
		}
		catch (e)
		{    
			try
			{      
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  
			}
			catch (e)
			{      
				alert("Your browser does not support AJAX!");     
				return false;
			} 
		}
	}
	xmlHttp.onreadystatechange=function(val)
    {
		if(xmlHttp.readyState==4)
		{
		 var res=xmlHttp.responseText;
		}
		else
		{
			alert("fail");
		}
    }
	var act;
	if(act!=undefined)
	{
	  xmlHttp.open("GET","setsession.php?act="+val,true);
	  xmlHttp.send(null);  
	}
 }
	
	function handleHttpResponseMyJob()
	{    
		alert(MyJobhttp.readyState);
		if (MyJobhttp.readyState == 4)
		{ 
		 	if(MyJobhttp.status==200)
			  var resultsEmail=MyJobhttp.responseText; 
			else
			alert("fail staus");
		 }
		 else
		 alert("fail ready state");
	} 
	var cmplurl="http://68.178.171.13/mint/setsession.php?act=";
	function MyJob(val) 
	{  
		MyJobhttp.open("GET", cmplurl+escape(val), true); 
		
		MyJobhttp.onreadystatechange = handleHttpResponseMyJob; 
		MyJobhttp.send(null); 
	} 
	
/*=====================Ajax=============== */	
	function gup(name)
	{  
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
		var regexS = "[\\?&]"+name+"=([^&#]*)";  
		var regex = new RegExp( regexS );  
		var results = regex.exec( window.location.href );  
		if( results == null ) 
			return "";
		else 
			return results[1];
	}
	var frank_param = gup('action');
	//alert(frank_param);
	
function show()
{
	MyJob('show'); // ajax
	//ajaxFunction('show');
	window.location.reload();
}
function hide()
{
	MyJob('hide'); // ajax
	//ajaxFunction('hide');
	window.location.reload();
}

function Validator(frmname)
{
  	this.formobj=document.forms[frmname];
	if(!this.formobj)
	{
	  	alert("BUG: couldnot get Form object "+frmname);
		return;
	}
	if(this.formobj.onsubmit)
	{
	 this.formobj.old_onsubmit = this.formobj.onsubmit;
	 this.formobj.onsubmit=null;
	}
	else
	{
	 this.formobj.old_onsubmit = null;
	}
	this.formobj.onsubmit=form_submit_handler;
	this.addValidation = add_validation;
	this.setAddnlValidationFunction=set_addnl_vfunction;
	this.clearAllValidations = clear_all_validations;
}
function set_addnl_vfunction(functionname)
{
  this.formobj.addnlvalidation = functionname;
}
function clear_all_validations()
{
	for(var itr=0;itr < this.formobj.elements.length;itr++)
	{
		this.formobj.elements[itr].validationset = null;
	}
}
function form_submit_handler()
{
	for(var itr=0;itr < this.elements.length;itr++)
	{
		if(this.elements[itr].validationset &&
	   !this.elements[itr].validationset.validate())
		{
		  return false;
		}
	}
	if(this.addnlvalidation)
	{
	  str =" var ret = "+this.addnlvalidation+"()";
	  eval(str);
    if(!ret) return ret;
	}
	return true;
}
function add_validation(itemname,descriptor,errstr)
{
  	if(!this.formobj)
	{
	  alert("BUG: the form object is not set properly");
		return;
	}//if
	var itemobj = this.formobj[itemname];
  if(!itemobj)
	{
	  alert("BUG: Couldnot get the input object named: "+itemname);
		return;
	}
	if(!itemobj.validationset)
	{
	  itemobj.validationset = new ValidationSet(itemobj);
	}
  itemobj.validationset.add(descriptor,errstr);
}
function ValidationDesc(inputitem,desc,error)
{
    this.desc=desc;
	this.error=error;
	this.itemobj = inputitem;
	this.validate=vdesc_validate;
}
function vdesc_validate()
{
 if(!V2validateData(this.desc,this.itemobj,this.error))
 {
    this.itemobj.focus();
		return false;
 }
 return true;
}
function ValidationSet(inputitem)
{
    this.vSet=new Array();
	this.add= add_validationdesc;
	this.validate= vset_validate;
	this.itemobj = inputitem;
}
function add_validationdesc(desc,error)
{
  this.vSet[this.vSet.length]= new ValidationDesc(this.itemobj,desc,error);
}
function vset_validate()
{
   for(var itr=0;itr<this.vSet.length;itr++)
	 {
	   if(!this.vSet[itr].validate())
		 {
		   return false;
		 }
	 }
	 return true;
}
function validateEmailv2(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}
function V2validateData(strValidateStr,objValue,strError) 
{ 
	var epos = strValidateStr.search("="); 
    var  command  = ""; 
    var  cmdvalue = ""; 
    if(epos >= 0) 
    { 
     command  = strValidateStr.substring(0,epos); 
     cmdvalue = strValidateStr.substr(epos+1); 
    } 
    else 
    { 
     command = strValidateStr; 
    } 
    switch(command) 
    { 
        case "req": 
        case "required": 
         { 
			if(trim(objValue.value)=="" && (objValue.name!="parent_id"))
			{
				alert(strError);
				objValue.focus();
				
				return false;
			}
           if(eval(objValue.value.length) == 0) 
           { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : Required Field"; 
              }//if 
              alert(strError); 
              return false; 
           }//if 
           break;             
         }//case required 
        case "maxlength": 
        case "maxlen": 
          { 
             if(eval(objValue.value.length) >  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : "+cmdvalue+" characters maximum "; 
               }//if 
               alert(strError); 
               return false; 
             }//if 
             break; 
          }//case maxlen 
        case "minlength": 
        case "minlen": 
           { 
             if(eval(objValue.value.length) <  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : " + cmdvalue + " characters minimum  "; 
               }//if               
               alert(strError); 
               return false;                 
             }//if 
             break; 
            }//case minlen 
        case "alnum": 
        case "alphanumeric": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9_]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
               if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alpha-numeric characters allowed "; 
                }//if 
                alert(strError); 
                return false; 
              }//if 
              break; 
           }//case alphanumeric 
        case "num": 
        case "numeric": 
           { 
		    var myregexp = /[^0-9]/;
              var charpos = objValue.value.search(myregexp); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Please enter a valid number"; 
                }//if               
                alert(strError); 
                return false; 
              }//if 
              break;               
           }//numeric 
		   
		    case "phonenumber": 
           { 
		    var myregexp = /[^0-9\(\)\-\+\.\s]/;
              var charpos = objValue.value.search(myregexp); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Please enter a valid phone number"; 
                }//if               
                alert(strError); 
                return false; 
              }//if 
              break;               
           }//n
		   
		   
		   
        case "alphabetic": 
        case "alpha": 
           { 
              var charpos = objValue.value.search("[^A-Za-z]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alpha 
		case "alnumhyphen":
			{
              var charpos = objValue.value.search("[^A-Za-z0-9\-_]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _"; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 			
			break;
			}
        case "email": 
          { 
               if(!validateEmailv2(objValue.value)) 
               { 
                 if(!strError || strError.length ==0) 
                 { 
                    strError = objValue.name+": Enter a valid Email address "; 
                 }//if                                               
                 alert(strError); 
                 return false; 
               }//if 
           break; 
          }//case email 
        case "lt": 
        case "lessthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.name+": Should be a number "); 
              return false; 
            }//if 
            if(eval(objValue.value) >=  eval(cmdvalue)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : value should be less than "+ cmdvalue; 
              }//if               
              alert(strError); 
              return false;                 
             }//if             
            break; 
         }//case lessthan 
        case "gt": 
        case "greaterthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.name+": Should be a number "); 
              return false; 
            }//if 
             if(eval(objValue.value) <=  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : value should be greater than "+ cmdvalue; 
               }//if               
               alert(strError); 
               return false;                 
             }//if             
            break; 
         }//case greaterthan 
        case "regexp": 
         { 
		 	if(objValue.value.length > 0)
			{
	            if(!objValue.value.match(cmdvalue)) 
	            { 
	              if(!strError || strError.length ==0) 
	              { 
	                strError = objValue.name+": Invalid characters found "; 
	              }//if                                                               
	              alert(strError); 
	              return false;                   
	            }//if 
			}
           break; 
         }//case regexp 
        case "dontselect": 
         { 
            if(objValue.selectedIndex == null) 
            { 
              alert("BUG: dontselect command for non-select Item"); 
              return false; 
            } 
            if(objValue.selectedIndex == eval(cmdvalue)) 
            { 
             if(!strError || strError.length ==0) 
              { 
              strError = objValue.name+": Please Select one option "; 
              }//if                                                               
              alert(strError); 
              return false;                                   
             } 
             break; 
         }//case dontselect 
    }//switch 
    return true; 
}

function conf_email()
{
	if(document.model_frm.email.value!=document.model_frm.conf_email.value)
		{
			alert("Confirm email not matching.");
			document.model_frm.conf_email.focus();
			return false;
		}
	
}

function check_skill()
{

	var benter = false;
	var i;

	for(i=0; i<document.statistic_frm.elements.special_skill.length ; i++)
	{

		if(document.statistic_frm.elements.special_skill[i].checked==true)	
		{
			
				benter=true;
			
		}
		
	}
	if(!benter)
	{
	alert("please select at least one special skill");
	return false;
	}
	
	
	// sport skill
	
	var senter = false;
	var i;

	for(i=0; i<document.statistic_frm.elements.sport_skill.length ; i++)
	{

		if(document.statistic_frm.elements.sport_skill[i].checked==true)	
		{
			
				senter=true;
			
		}
		
	}
	if(!senter)
	{
	alert("please select at least one sport skill");
	return false;
	}
	

	
}


function editcheck_skill()
{

	var benter = false;
	var i;

	for(i=0; i<document.editstatistic_frm.elements.special_skill.length ; i++)
	{

		if(document.editstatistic_frm.elements.special_skill[i].checked==true)	
		{
			
				benter=true;
			
		}
		
	}
	if(!benter)
	{
	alert("please select at least one special skill");
	return false;
	}
	
	
	// sport skill
	
	var senter = false;
	var i;

	for(i=0; i<document.editstatistic_frm.elements.sport_skill.length ; i++)
	{

		if(document.editstatistic_frm.elements.sport_skill[i].checked==true)	
		{
			
				senter=true;
			
		}
		
	}
	if(!senter)
	{
	alert("please select at least one sport skill");
	return false;
	}
	

	
}


function suredelete(msg)
		{
			if(confirm(msg))
		{
		sub_cat_del=confirm("Deleting this category will delete its subcategory too.");
			if(sub_cat_del)
			{
				
			return true;
			}
			else
			{
				
			 return false;	
			}
		}
		else
		{
			
		return false;
		}
		}
		
		
function conf(msg)
{
			if(confirm(msg))
			{
				return true;
			}
			else
			{
				 return false;	
			}
		
}
		
function trim(str) {
	return str.replace(/^\s*|\s*$/g, "");
}

function delete_photo(id)
{
	if(id)
	{
		if(confirm("Do you really want to delete this photo."))
		{
		return true;
		}
		else
		{
		return false;
		}
	}
	else
	{
		alert("please select image to delete");
		return false;
	}
}

	function showdiv(id,f)
	{
	document.getElementById(id).style.display='';
	}
	function ShowHide()
	{
		if(document.getElementById("other_pro_affiliate").checked==true)
		{
			document.getElementById("other").style.display="";
		}
		else if(document.getElementById("other_pro_affiliate").checked==false)
		{
			document.getElementById("other").style.display="none";
		}
	}


function hidediv(id,f)
{
 document.getElementById(id).style.display='none';	
 f.another_affiliate.value='';
}


function showhidediv(show_id,hide_id)
{
	document.getElementById(show_id).style.display='';	
	document.getElementById(hide_id).style.display='none';	
	
}

	  
function check_image()
{

if(document.client_frm.logo.value=="")
{
//alert("Please upload a picture");
//return false;
}
	else
	{
			
			if(!validateFileExtension(document.client_frm.logo.value,'picture'))
			{
			 alert("Please upload a valid picture file");
			document.client_frm.logo.focus();
			
			 return false;
			}
	}

}

function validateFileExtension(fld,type) {
	switch(type)
	{
		case 'picture':
		
			if(!/(\.png|\.PNG|\.gif|\.GIF|\.jpg|\.JPG|\.jpeg|\.JPEG|\.giff|\.GIFF)$/i.test(fld)) {
				return false;
			}
			break;
		case 'pdf':
			if(!/(\.pdf|\.PDF)$/i.test(fld)) {
				return false;
			}	
			break;
		case 'mp3':
			if(!/(\.mp3|\.MP3|\.swf|\.SWF)$/i.test(fld)) {
				return false;
			}	
			break;
		case 'video':
			if(!/(\.swf|\.SWF)$/i.test(fld)) {
				return false;
			}	
			break;	
		default:
			alert('Please specify a valid file extension');
			return false	
	}
	return true;
}



/* for show hide div in model_registration */
function showhidedivs(showid)
{
	
	
	var alldiv= document.getElementsByTagName("div");
	for (var i = 0; i < alldiv.length; i++) 
	{ 
		if(alldiv[i].className=='steps')
		{
			alldiv[i].style.display='none';
			if(alldiv[i].id==showid)
			{
								
				alldiv[i].style.display='';
			}
						
			
		}
		
	}
	
}	


/* for show email already exist in model registration*/
function getHTTPObject() { 
  var xmlhttp; 

  if(window.XMLHttpRequest){ 
    xmlhttp = new XMLHttpRequest(); 
  } 
  else if (window.ActiveXObject){ 
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
    if (!xmlhttp){ 
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    } 
    
} 
  return xmlhttp; 
} 
var http = getHTTPObject(); // We create the HTTP Object 
var MyJobhttp = getHTTPObject(); // We create the HTTP Object 

    	function handleHttpResponse_email()
	    {    
        	if (http.readyState == 4)
		 	{ 
              if(http.status==200)
			   { 
                  var resultsEmail=http.responseText; 
					
				  document.getElementById('divEmailInfo').innerHTML = resultsEmail; 
				  if(resultsEmail!='')
				  {
					document.model_frm.email.value='';
					document.getElementById('divEmailInfo').style.display = 'block'; 
				  }
				  else
				  	document.getElementById('divEmailInfo').style.display = 'none'; 
              }
             } 
        } 
		
		function checkEmailAddress()
		 {      
            var emid = document.getElementById("email").value; 
			if(emid!="")
			{
				var url_email = "check_email.php?emid="+emid;
				http.open("GET", url_email, true); 
				http.onreadystatechange = handleHttpResponse_email; 
				http.send(null); 
			}
        } 
		
		/*function chkcountry()
		{
		
		
			if((document.model_frm.country.value)!="United States")
			{
				
				document.model_frm.getElementById("otherstate").style.display='';
				document.model_frm.getElementById("stateus").style.display='none';
			}
		}*/
		
function validation()
{
	var pval;
	if(trim(document.reg_frm.f_name.value)=='')	
	{
		alert("enter first name.");
		document.reg_frm.f_name.focus();
		return false;
		
	}
	if(trim(document.reg_frm.l_name.value)=='')	
	{
		alert("enter last name.");
		document.reg_frm.l_name.focus();
		return false;
		
	}
	
	var rxp =/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/;
  if(document.reg_frm.email_address.value == "")
  {
     alert("Please enter  email address.");
	 document.reg_frm.email_address.focus();
	 return false;
  }
  else if(rxp.test(document.reg_frm.email_address.value)!=true)
	{
		alert('Invalid email address.');
		document.reg_frm.email_address.focus();
		return false;
	}
	
	if(document.reg_frm.dob.value=='')	
	{
		alert("Please enter date of birth.");
		document.reg_frm.dob.focus();
		return false;
		
	}
	
	if(document.reg_frm.gender.value=='')	
	{
		alert("Please select gender.");
		document.reg_frm.gender.focus();
		return false;
		
	}
	
	if(trim(document.reg_frm.city.value)=='')	
	{
		alert("Please enter city name.");
		document.reg_frm.city.focus();
		return false;
		
	}
	
	if(trim(document.reg_frm.state.value)=='')	
	{
		alert("Please enter state name.");
		document.reg_frm.state.focus();
		return false;
		
	}
	
	if(trim(document.reg_frm.country.value)=='')	
	{
		alert("Please select country.");
		document.reg_frm.country.focus();
		return false;
		
	}
	
	if(document.reg_frm.phone.value=='')
	{
		alert("enter phone no.");
		document.reg_frm.phone.focus();
		return false;
	}
	if(document.reg_frm.phone.value!="")
	{
		 var pval=document.reg_frm.phone.value;
		 if(!ValidChars("1234567890()-,",pval))
		  {
			alert("Please insert valid phone number.");
			document.reg_frm.phone.focus();
			return false;
		  }
	}
	if(document.reg_frm.zip.value=='')
	{
		alert("enter zip no.");
		document.reg_frm.zip.focus();
		return false;
	}
	if(document.reg_frm.zip.value!="")
	{
		
		var  pval= document.reg_frm.zip.value;
		
		 if(!ValidChars("1234567890()-,",pval))
		  {
			alert("Please insert valid zip number.");
			document.reg_frm.zip.focus();
			return false;
		  }
	}
	
	if(document.reg_frm.travel.value=='')
	{
		alert("Please select travel distance.");
		document.reg_frm.travel.focus();
		return false;
	}
	
	if(document.reg_frm.find_us.value=='')
	{
		alert("Please select how'd you find us.");
		document.reg_frm.find_us.focus();
		return false;
	}

	/*------------- show div ------------------*/
	showhidedivs('step_2');
	/*----------------end------------*/
}

function ValidChars(validchars,value) 
 { // v3.0
 
	var key='', keychar='';
	for(i=0;i<value.length;i++)
	{
		keychar = value.charAt(i);
		keychar = keychar.toLowerCase();
		validchars = validchars.toLowerCase();
		if (validchars.indexOf(keychar) == -1)
		{
			key=keychar;
		}
	}
	if(key!='')
		return false;
	else
		return true;
}

function checkcountry(frm)
{

	
	
if((frm.country.value)!="United States")
{
	
document.getElementById('state').style.display="none";
 document.getElementById("oth_state").style.display='';
 
}
else
{

document.getElementById('state').style.display='';
 document.getElementById("oth_state").style.display="none";	

}

}


function changefield()
{
	
}
function checkstate()
{
		/*var frmmodelreg = document.forms["model_frm"];
		var editfrmmodelreg = document.forms["editmodel_frm"];
	if(frmmodelreg.state.style.display=='')
	{
		if(frmmodelreg.state.value=="")
		{
	 alert("select state");
	 frmmodelreg.state.focus();
	 return false;
		}	
	}
	if(frmmodelreg.oth_state.style.display=='')
	{
		if(frmmodelreg.oth_state.value=='')
		{
	 alert("Please enter state.");
	 frmmodelreg.oth_state.focus();
	 return false;
		}
	}
	
	if(editfrmmodelreg.state.style.display=='')
	{
		if(editfrmmodelreg.state.value=="")
		{
	 alert("select state");
	 editfrmmodelreg.state.focus();
	 return false;
		}	
	}
	if(editfrmmodelreg.oth_state.style.display=='')
	{
		if(editfrmmodelreg.oth_state.value=='')
		{
	 alert("Please enter state.");
	 editfrmmodelreg.oth_state.focus();
	 return false;
		}
	}*/
	if(document.postjob_frm.state.style.display=='')
	{
		if(document.postjob_frm.state.value=="")
		{
	 alert("please select state.");	
	 return false;
		}
	}
	else
	{
		if(document.postjob_frm.oth_state.value=="")
		{
	 alert("please enter state.");	
	 return false;
		}
	}
	
	
}
function editcheckstate()
{
	if(document.editpostjob_frm.state.style.display=='')
	{
		if(document.editpostjob_frm.state.value=="")
		{
	 alert("please select state.");	
	 return false;
		}
	}
	else
	{
		if(document.editpostjob_frm.oth_state.value=="")
		{
	 alert("please enter state.");	
	 return false;
		}
	}
	
	
}



function check_termcondition()
{

	if(document.client_frm.term_chk.checked==false)
	{
	 alert("please accept terms and conditions.");	
	 return false;
	}
}

function checkjobdeletion(val)
 {

 if(val=='1')
 {
  document.getElementById("auto").style.display='';
  document.getElementById("manual").style.display="none";
  }
  else
  {
  document.getElementById("auto").style.display='none';
  document.getElementById("manual").style.display='';
  }
 }

function manageGender(val)
{
	var frm = val;
	
if((frm.gender.value)=="female")
{
	
document.getElementById("bust").style.display='';
document.getElementById("cup").style.display='';
document.getElementById("hips").style.display='';
}
	if((frm.gender.value)=="male")
	{
	document.getElementById("bust").style.display='none';
	document.getElementById("cup").style.display='none';
	document.getElementById("hips").style.display='none';
	}
	if((frm.gender.value)=="")
	{
	document.getElementById("bust").style.display='';
	document.getElementById("cup").style.display='';
	document.getElementById("hips").style.display='';
	}
}

function goback() {
	history.back();
}

/*
	Copyright 2003 JavaScript-coder.com. All rights reserved.
*/