// Declaring required variables
var chkdigits=/^-?\d+(\.\d+)?$/;
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;
var phoneNumberDelimiters = "()- " 
var validWorldPhoneChars = phoneNumberDelimiters + "+"
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
var bracket=3
strPhone=trim(strPhone)
if(strPhone.indexOf("+")>1) return false
if(strPhone.indexOf("-")!=-1)bracket=bracket+1
if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false
var brchr=strPhone.indexOf("(")
if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false
if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function chksignup(f)
{
	var eemailRegxp=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;	
	var Name=f.name.value;
	var Email=f.email.value;
	var REmail=f.remail.value;
	if(Name.length==0)
	{
		alert("Enter Your Name ");
		f.name.focus();
		return false;
	}	
	if(Email.length==0)
	{
		alert("Enter Your Email address ");
		f.email.focus();
		return false;
	}	
	if (eemailRegxp.test(Email) != true)
	{
       alert("Email address appears to be incorrect");
	   f.email.focus();
	   return false;
	}
	if(Email!= REmail)
	{
		alert(" Email addresses must be the same");
		f.remail.focus();
		return false;
	}
	return true;
}

//Uploading ad Validation
function chkad(f)
{		
	if(f.imgn.value.length==0)
	{
		alert("Browse Logo");
		f.imgn.focus();
		return false;
	}
	var catgmgtype=f.imgn.value.substr(f.imgn.value.length-3);
	if (!(catgmgtype=='jpg'||catgmgtype=='gif'||catgmgtype=='JPG'||catgmgtype=='GIF'))
	{
	   alert("Logo should be JPEG or GIF");
	   f.imgn.focus();
	   return false;
	}
	return true;			
}

function chkreg(f)
{
	if(f.fname.value.length==0) {
		alert("Enter First name");
		f.fname.focus();
		return false;
	}
	if(f.lname.value.length==0) {
		alert("Enter Last name");
		f.lname.focus();
		return false;
	}
	if(f.uname.value.length<6) {
		alert("Enter User name (atleast 6 or more characters)");
		f.uname.focus();
		return false;
	}
	f.uname.value=f.uname.value.replace(/\s/g, "");
	if(!isNaN(f.uname.value)) {
		alert("User Name completely should not be a number");
		f.uname.focus();
		return false;
	}
	if(!isNaN(f.uname.value.substr(0,1))) {
		alert("User Name First letter should not be a number");
		f.uname.focus();
		return false;
	}
	if(f.pword.value.length<6) {
		alert("Enter Password (atleast 6 or more characters)");
		f.pword.focus();
		return false;
	}
	f.pword.value=f.pword.value.replace(/\s/g, "");
	if(f.rpword.value.length==0) {
		alert("Retype your Password");
		f.rpword.focus();
		return false;
	}
	if(f.pword.value!=f.rpword.value) {
		alert("Passwords didnot match");
		f.rpword.focus();
		return false;
	}
	
	if(f.squestion.value.length==0)
	{
		alert("Select Security Question");
		f.squestion.focus();
		return false;
	}
	if(f.sanswer.value.length==0)
	{
		alert("Enter Security Answer");
		f.sanswer.focus();
		return false;
	}
	if(f.rcode.value.length==0) {
		alert("Enter Verification Code");
		f.rcode.focus();
		return false;
	}
	if(f.rcode.value!=f.rndcode.value) {
		alert("Verification Code not matching");
		f.rcode.focus();
		return false;
	}	
}


function chkregb(f)
{	
	if(f.cname.value.length==0)
	{
		alert("Enter Comapny Name");
		f.cname.focus();
		return false;
	}
	if(f.ctname.value.length==0)
	{
		alert("Enter Country");
		f.ctname.focus();
		return false;
	}
	if(f.timezone.value.length==0)
	{
		alert("Enter Timezone");
		f.timezone.focus();
		return false;
	}
	/*if(f.acode.value.length==0)
	{
		alert("Enter Area Code");
		f.acode.focus();
		return false;
	}
	if(isNaN(f.acode.value)) 
	{
		alert("Enter Area Code must be number");
		f.acode.focus();
		return false;
	}*/
	/*if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}*/
	if(f.bbusn.value.length==0)
	{
		alert("Select Best describes your business ");
		f.bbusn.focus();
		return false;
	}
	if(f.self_reported_employees.value.length==0)
	{
		alert("Select No.of Employees");
		f.self_reported_employees.focus();
		return false;
	}
	if(f.self_reported_revenue.value.length==0)
	{
		alert("Enter your Companies Annual Revenue");
		f.self_reported_revenue.focus();
		return false;
	}
	if(f.hear.value.length==0)
	{
		alert("Enter you hear about us ");
		f.hear.focus();
		return false;
	}
	return true;
}

function chkregp1(f)
{
	if(f.tprov.value=="Affiliated Company")  {
		if(f.cname.value.length==0)
		{
			alert("Enter Comapny Name");
			f.cname.focus();
			return false;
		}
		if(f.nopeple.value.length==0)
		{
			alert("Select No. of people");
			f.nopeple.focus();
			return false;
		}
		if(f.posi.value.length==0)
		{
			alert("Select Position");
			f.posi.focus();
			return false;
		}	
		if(f.clogo.value.length!=0)	{
			var catgmgtype=f.clogo.value.substr(f.clogo.value.length-3);
			if (!(catgmgtype=='jpg'||catgmgtype=='gif'||catgmgtype=='JPG'||catgmgtype=='GIF'))
			{
			   alert("Company Logo should be JPEG or GIF image");
			   f.clogo.focus();
			   return false;
			}	
		}		
	}
	if(f.tprov.value=="Individual Provider") {
		if(f.plogo.value.length!=0)	{
			var catgmgtype=f.plogo.value.substr(f.plogo.value.length-3);
			if (!(catgmgtype=='jpg'||catgmgtype=='gif'||catgmgtype=='JPG'||catgmgtype=='GIF'))
			{
			   alert("Profile Logo should be JPEG or GIF image");
			   f.plogo.focus();
			   return false;
			}	
		}
	}	
	if(f.ctname.value.length==0)
	{
		alert("Enter Country");
		f.ctname.focus();
		return false;
	}
	if(f.timezone.value.length==0)
	{
		alert("Enter Timezone");
		f.timezone.focus();
		return false;
	}
	/*if(f.acode.value.length==0)
	{
		alert("Enter Area Code");
		f.acode.focus();
		return false;
	}
	if(isNaN(f.acode.value)) 
	{
		alert("Enter Area Code must be number");
		f.acode.focus();
		return false;
	}
	var Phone=f.phone;
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Phone Number")
		Phone.focus()
		return false
	}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}*/
	if(f.hear.value.length==0)
	{
		alert("Enter you hear about us ");
		f.hear.focus();
		return false;
	}
	return true;
}


function chkregp3(f)
{
	if(f.prole.value.length==0) {
		alert("Select Primary Role ");
		f.prole.focus();
		return false;
	}
	if(f.curn.value.length==0) {
		alert("Select Currency");
		f.curn.focus();
		return false;
	}
	if(f.hrate.value.length==0) {
		alert("Enter Hourly Rate");
		f.hrate.focus();
		return false;
	}	
	if(chkdigits.test(f.hrate.value)==false) {
		alert("Hourly Rate must be in numbers");
		f.hrate.focus();
		return false;
	}
	thrate(f);
	if(f.avblty.value.length==0) {
		alert("Select Availability");
		f.avblty.focus();
		return false;
	}
	if(f.ptitle.value.length==0) {
		alert("Enter Profile Title");
		f.ptitle.focus();
		return false;
	}
	if(f.agree.checked==false)
	{
	alert("Please Read the  terms and conditions of osource"); 
	return false; 
	} 	
	return true;
}

//CURRENCY
function shcurn(f) {
	if(f.bbusn.selectedIndex==1) f.curcmb.value="$";
	else if(f.bbusn.selectedIndex==2) f.curcmb.value="£";
	else  f.curcmb.value="";
}
//HOURLY RATE
function thrate(f) {
	if(f.hrate.value.length==0) {
		f.hrate.focus();
		return false;
	}	
	if(chkdigits.test(f.hrate.value)==false) {
		f.hrate.focus();
		return false;
	}	
	var r=f.hrate.value;
	var p=0;
	var t=0;
	//p=r*(5/100);
	p = 1.00;
	t=parseFloat(r)+parseFloat(p);
	f.prate.value=p;
	f.trate.value=t;
}


function chkregp2(f)
{
	if(f.tprov.value=="Affiliated Company" || f.treg.value=="Buyer") 
		if(f.cname.value.length==0)
		{
			alert("Enter Company Name");
			f.cname.focus();
			return false;
		}
	if(f.tprov.value=="Affiliated Company")  {
		if(f.nopeple.value.length==0)
		{
			alert("Select No. of people");
			f.nopeple.focus();
			return false;
		}
		if(f.posi.value.length==0)
		{
			alert("Select Position");
			f.posi.focus();
			return false;
		}	
		if(f.clogo.value.length!=0)	{
			var catgmgtype=f.clogo.value.substr(f.clogo.value.length-3);
			if (!(catgmgtype=='jpg'||catgmgtype=='gif'||catgmgtype=='JPG'||catgmgtype=='GIF'))
			{
			   alert("Company Logo should be JPEG or GIF image");
			   f.clogo.focus();
			   return false;
			}	
		}		
	}
	if(f.tprov.value=="Individual Provider") {
		if(f.plogo.value.length!=0)	{
			var catgmgtype=f.plogo.value.substr(f.plogo.value.length-3);
			if (!(catgmgtype=='jpg'||catgmgtype=='gif'||catgmgtype=='JPG'||catgmgtype=='GIF'))
			{
			   alert("Profile Logo should be JPEG or GIF image");
			   f.plogo.focus();
			   return false;
			}	
		}
	}	
	if(f.treg.value=="Provider" )  {
		if(f.educ.value.length==0)
		{
			alert("Select Education");
			f.educ.focus();
			return false;
		}
		if(f.scatg.value.length==0)
		{
			alert("Enter Category");
			f.scatg.focus();
			return false;
		}
		if(f.syears.value.length==0)
		{
			alert("Select Years");
			f.syears.focus();
			return false;
		}
		if(f.smonths.value.length==0)
		{
			alert("Select Months");
			f.smonths.focus();
			return false;
		}
	}
	if(f.ctname.value.length==0)
	{
		alert("Enter Country");
		f.ctname.focus();
		return false;
	}
	if(f.timezone.value.length==0)
	{
		alert("Enter Timezone");
		f.timezone.focus();
		return false;
	}
	if(f.acode.value.length==0)
	{
		alert("Enter Area Code");
		f.acode.focus();
		return false;
	}
	if(isNaN(f.acode.value)) 
	{
		alert("Enter Area Code must be number");
		f.acode.focus();
		return false;
	}
	var Phone=f.phone
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Phone Number")
		Phone.focus()
		return false
	}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}
	if(f.treg.value=="Buyer" )  {
		if(f.self_reported_employees.value.length==0)
		{
			alert("Enter  your organization have ");
			f.self_reported_employees.focus();
			return false;
		}
		if(f.self_reported_revenue.value.length==0)
		{
			alert("Enter your Companies Annual Revenue");
			f.self_reported_revenue.focus();
			return false;
		}
	}
	if(f.hear.value.length==0)
	{
		alert("Enter you hear about us ");
		f.hear.focus();
		return false;
	}
	if(!document.f.agree.checked)
	{
	alert("Please Read the  terms and conditions of osource "); 
	return false; 
	} 
	return true;
}


function chkregb2(f)
{
	
	if(f.cname.value.length==0)
	{
		alert("Enter Company Name");
		f.cname.focus();
		return false;
	}
	if(f.ctname.value==0)
	{
		alert("Enter Country");
		f.ctname.focus();
		return false;
	}
	if(f.timezone.value==0)
	{
		alert("Enter Timezone");
		f.timezone.focus();
		return false;
	}
	if(f.acode.value.length==0)
	{
		alert("Enter Area Code");
		f.acode.focus();
		return false;
	}
	if(isNaN(f.acode.value)) 
	{
		alert("Enter Area Code must be number");
		f.acode.focus();
		return false;
	}
	var Phone=document.f.phone
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Phone Number")
		Phone.focus()
		return false
	}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}
	if(f.self_reported_employees.value==0)
	{
		alert("Enter  your organization have ");
		f.self_reported_employees.focus();
		return false;
	}
	if(f.self_reported_revenue.value==0)
	{
		alert("Enter your Companies Annual Revenue");
		f.self_reported_revenue.focus();
		return false;
	}
	if(f.hear.value==0)
	{
		alert("Enter you hear about us ");
		f.hear.focus();
		return false;
	}
	if(!document.f.agree.checked)
	{
	alert("Please Read the  terms and conditions of osource "); 
	return false; 
	} 
	return true;
}

function getctcode_temp(f) {	
		var cnames=[
		["Afghanistan",93],
		["Albania",355],
		["Algeria",213],
		["American Samoa",1],
		["Andorra",376],
		["Angola",244],
		["Anguilla",1],
		["Antarctica",672],
		["Antigua and Barbuda",1],
		["Argentina",54],
		["Armenia",374],
		["Aruba",297],
		["Australia",61],
		["Austria",43],
		["Azerbaijan",994],
		["Bahamas",1],
		["Bahrain",973],
		["Bangladesh",880],
		["Barbados",1],
		["Belarus",375],
		["Belgium",32],
		["Belize",501],
		["Benin",229],
		["Bermuda",1],
		["Bhutan",975],
		["Bolivia",591],
		["Bosnia and Herzegovina",387],
		["Botswana",267],
		["Bouvet Island",''],
		["Brazil",'55'],
		["British Indian Ocean Territory",''],
		["Brunei Darussalam",673],
		["Bulgaria",359],
		["Burkina Faso",226],
		["Burundi",257],
		["Cambodia",855],
		["Cameroon",237],
		["Canada",1],
		["Cape Verde",238],
		["Cayman Islands",1],
		["Central African Republic",236],
		["Chad",235],
		["Chile",56],
		["China",86],
		["Christmas Island",61],
		["Cocos (Keeling) Islands",61],
		["Colombia",57],
		["Comoros",269],
		["Congo",242],
		["Cook Islands",682],
		["Costa Rica",506],
		["Cote d'osource",225],
		["Croatia",385],
		["Cuba",53],
		["Cyprus",357],
		["Czech Republic",420],
		["Denmark",45],
		["Djibouti",253],
		["Dominica",1],
		["Dominican Republic",1],
		["Ecuador",593],
		["Egypt",20],
		["Ecuador",593],
		["El Salvador",503],
		["Equatorial Guinea",240],
		["Eritrea",291],
		["Estonia",372],
		["Ethiopia",251],
		["Falkland Islands (Malvinas)",500],
		["Faroe Islands",298],
		["Fiji",679],
		["Finland",358],
		["France",33],
		["France, Metropolitan",''],
		["French Guiana",594],
		["French Polynesia",689],
		["French Southern and Antarctic Lands",''],
		["Gabon",241],
		["Gambia",220],
		["Georgia",995],
		["Germany",49],
		["Ghana",233],
		["Gibraltar",350],
		["Greece",30],
		["Greenland",299],
		["Grenada",1],
		["Guadeloupe",590],
		["Guam",1],
		["Guatemala",502],
		["Guinea",224],
		["Guinea-Bissau",245],
		["Guyana",592],
		["Haiti",509],
		["Heard Island and McDonald Islands",''],
		["Holy See (Vatican City State)",418],
		["Honduras",504],
		["Hong Kong",852],
		["Hungary",36],
		["Iceland",354],
		["India",91],
		["Indonesia",62],
		["Iran",98],
		["Iraq",964],
		["Ireland",353],
		["Israel",972],
		["Italy",39],
		["Jamaica",1],
		["Japan",81],
		["Jordan",962],
		["Kazakhstan",7],
		["Kenya",254],
		["Kiribati",686],
		["Korea, Democratic People's Republic of",850],
		["Korea, Republic of",82],
		["Kuwait",965],
		["Kyrgyzstan",996],
		["Lao People's Democratic Republic",856],
		["Latvia",371],
		["Lebanon",961],
		["Lesotho",266],	
		["Liberia",231],
		["Libyan Arab Jamahiriya",218],
		["Liechtenstein",423],
		["Lithuania",370],
		["Luxembourg",352],
		["Macao",853],
		["Macedonia, the former Yugoslav Republic of",''],
		["Macedonia",389],
		["Madagascar",261],
		["Malawi",265],
		["Malaysia",60],
		["Maldives",960],
		["Mali",223],
		["Malta",356],
		["Marshall Islands",692],
		["Martinique",596],
		["Mauritania",222],
		["Mauritius",230],
		["Mayotte",262],
		["Mexico",52],
		["Micronesia, Federated States of",691],
		["Moldova, Republic of",373],
		["Monaco",377],
		["Mongolia",976],
		["Montserrat",1],
		["Morocco",212],
		["Mozambique",258],
		["Myanmar",95],
		["Namibia",264],
		["Nauru",674],
		["Nepal",977],
		["Netherlands",31],
		["Netherlands Antilles",599],
		["New Caledonia",687],
		["New Zealand",64],
		["Nicaragua",505],
		["Niger",227],
		["Nigeria",234],
		["Niue",683],
		["Norfolk Island",672],
		["Northern Mariana Islands",1],
		["Norway",47],
		["Oman",968],
		["Pakistan",92],
		["Palau",680],
		["Palestinian Territory",970],
		["Panama",507],
		["Papua New Guinea",675],
		["Paraguay",595],
		["Peru",51],
		["Philippines",63],
		["Pitcairn",''],
		["Poland",48],
		["Portugal",351],
		["Puerto Rico",1],
		["Qatar",974],
		["Reunion",262],
		["Romania",40],
		["Russia",7],
		["Rwanda",250],
		["Saint Helena",290],
		["Saint Kitts and Nevis",1],
		["Saint Lucia",1],
		["Saint Pierre and Miquelon",508],
		["Saint Vincent and the Grenadines",1],
		["Samoa",685],
		["San Marino",378],
		["Sao Tome and Principe",239],
		["Saudi Arabia",966],
		["Senegal",221],
		["Serbia",381],
		["Seychelles",248],
		["Sierra Leone",232],
		["Singapore",65],
		["Slovakia",421],
		["Slovenia",386],
		["Solomon Islands",677],
		["Somalia",252],
		["South Africa",27],
		["Spain",34],
		["Sri Lanka",94],
		["Sudan",249],
		["Suriname",597],
		["Svalbard and Jan Mayen",''],
		["Swaziland",268],
		["Sweden",46],
		["Switzerland",41],
		["Syrian Arab Republic",963],
		["Taiwan, Province of China",886],
		["Tajikistan",992],
		["Tanzania, United Republic of",255],
		["Thailand",66],
		["Timor-Leste",670],
		["Togo",228],
		["Tokelau",690],
		["Tonga",676],
		["Trinidad and Tobago",1],
		["Tunisia",216],
		["Turkey",90],
		["Turkmenistan",993],
		["Turks and Caicos Islands",1],
		["Tuvalu",688],
		["Uganda",256],
		["Ukraine",380],
		["United Arab Emirates",971],
		["United Kingdom",44],
		["United States",1],
		["United States Minor Outlying Islands",1],
		["Uruguay",598],
		["Uzbekistan",998],
		["Vanuatu",678],
		["Venezuela",58],
		["Vietnam",84],
		["Virgin Islands, British",1],
		["Virgin Islands, U.S.",1],
		["Wallis and Futuna",681],
		["Western Sahara",212],
		["Yemen",967],
		["Yugoslavia",''],
		["Zaire",243],
		["Zambia",260],
		["Zimbabwe",263]
		];
		
		var i,j
		f.ccode.value=""
		for(i=0;i<cnames.length;i++)
			if(cnames[i][0]==f.ctname.value) {
				f.ccode.value=cnames[i][1]			
				break;	
			}
	}
	
	


//CHECK ALL SUBCATEGORIES
function chkall(f,n) {
	var cg=f.elements["pcatg[]"];
	var scg=f.elements["pscatg"+n+"[]"];	
	var sc=f.elements["pcatc[]"];
	for(var i=0;i<sc[n].value;i++) {
		if(cg[n].checked==true)
			scg[i].checked=true;	
		else scg[i].checked=false;		
	}
} 
	
	
	
//CHECK CATEGORY
function checkcatg(f,n,x) {
	var cg=f.elements["pcatg[]"];
	var scg=f.elements["pscatg"+n+"[]"];	
	var sc=f.elements["pcatc[]"];
	var e=0;
	if(scg[x-1].checked==true && cg[n].checked==false)
		cg[n].checked=true;	
	else {
		for(var i=0;i<sc[n].value;i++) 
			if(scg[i].checked==true) return;
		if(e==0) cg[n].checked=false;	
	}
}


//MIX ALL CATEGORIES
function mixsc(f) {
	var cg=f.elements["pcatg[]"];
	var scg;	
	var sc=f.elements["pcatc[]"];
	var cv="";
	var scv="";
	for(var i=1;i<=9;i++) 
		if(cg[i].checked==true) {
			cv+=cg[i].value+"-";
			scg=f.elements["pscatg"+i+"[]"];	
			for(var j=0;j<sc[i].value;j++) 
				if(scg[j].checked==true) scv+=scg[j].value+"-";
		}	
	cv=cv.substr(0,cv.length-1)	;
	scv=scv.substr(0,scv.length-1)	;
	f.cids.value=cv;
	f.scids.value=scv;
	return true;
} 




//MYACCOUNT 
function chkmac(f)
{
	if(f.ptitle.value.length==0) {
		alert("Enter Title");
		f.ptitle.focus();
		return false;
	}
	var eemailRegxp=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;	
	var Email=f.email.value;
	if(Email.length==0)
	{
		alert("Enter Your Email address ");
		f.email.focus();
		return false;
	}	
	if (eemailRegxp.test(Email) != true)
	{
       alert("Email address appears to be incorrect");
	   f.email.focus();
	   return false;
	}
	if(f.hrate.value.length==0) {
		alert("Enter Hourly Rate");
		f.hrate.focus();
		return false;
	}	
	if(chkdigits.test(f.hrate.value)==false) {
		alert("Hourly Rate must be in numers");
		f.hrate.focus();
		return false;
	}
	thrate(f);
	return true;
}


//PROFILE UPDATE
function chkprf(f)
{
	if(f.fname.value.length==0) {
		alert("Enter First name");
		f.fname.focus();
		return false;
	}
	if(f.lname.value.length==0) {
		alert("Enter Last name");
		f.lname.focus();
		return false;
	}
	if(f.prole.value.length==0) {
		alert("Select Primary Role ");
		f.prole.focus();
		return false;
	}
	if(f.avblty.value.length==0) {
		alert("Select Week availability");
		f.avblty.focus();
		return false;
	}
	if(f.englevel.value.length==0) {
		alert("Select Level of English");
		f.englevel.focus();
		return false;
	} 	
	if(f.noyears.value.length==0) {
		alert("Select Experiance");
		f.noyears.focus();
		return false;
	} 	
	return true;
}


//PROJECT PORTFOLIO
function chkppf(f)
{
	if(f.ptitle.value.length==0) {
		alert("Enter Project Title");
		f.ptitle.focus();
		return false;
	}
	if(f.imgn.value.length!=0)	{
		var catgmgtype=f.imgn.value.substr(f.imgn.value.length-3);
		if (!(catgmgtype=='jpg'||catgmgtype=='gif'||catgmgtype=='JPG'||catgmgtype=='GIF'))
		{
		   alert("Image should be JPEG or GIF image");
		   f.imgn.focus();
		   return false;
		}	
	}	
	if(f.docm.value.length!=0) {
		var catgmgtype=f.docm.value.substr(f.docm.value.length-3);
		if (!(catgmgtype=='rtf'|| catgmgtype=='txt'|| catgmgtype=='doc'||catgmgtype=='docx'||catgmgtype=='DOC'||catgmgtype=='DOCX'||catgmgtype=='RTF'||catgmgtype=='TXT' ||catgmgtype=='PDF'||catgmgtype=='pdf'))
		{
		   alert("Attachment should be Word Document or Wordpad or Notepad or PDF");
		   f.docm.focus();
		   return false;
		}
	}	
	if(f.cpdate.value.length==0) {
		alert("Select Project Completion Date");
		f.cpdate.focus();
		return false;
	}
	if(f.catg.value.length==0) {
		alert("Select Category");
		f.catg.focus();
		return false;
	}
	if(f.scatg.value.length==0) {
		alert("Select Sub Category");
		f.scatg.focus();
		return false;
	}/*
	if(f.purl.value.length==0) {
		alert("Enter Project Url");
		f.purl.focus();
		return false;
	}*/
	return true;
}




//APPLY PAGE1
function chkaply(f)
{	
	if(f.docm.value.length!=0) {
		var catgmgtype=f.docm.value.substr(f.docm.value.length-3);
		var catgmgtype1=f.docm.value.substr(f.docm.value.length-4);
		if (!(catgmgtype=='rtf'|| catgmgtype=='txt'|| catgmgtype=='doc'||catgmgtype1=='docx'||catgmgtype=='DOC'||catgmgtype1=='DOCX'||catgmgtype=='RTF'||catgmgtype=='TXT' ||catgmgtype=='PDF'||catgmgtype=='pdf'))
		{
		   alert("Attachment should be Word document file, Wordpad or Notepad or PDF");
		   f.docm.focus();
		   return false;
		}
	}	
	if(f.pjtype.value=="Hourly") {
		if(f.hrate.value.length==0) {
			alert("Enter Hourly Rate");
			f.hrate.focus();
			return false;
		}	
		if(chkdigits.test(f.hrate.value)==false) {
			alert("Hourly Rate must be in numers");
			f.hrate.focus();
			return false;
		}
		thrate(f);
		if(f.curn.value.length==0) {
			alert("Select Currency");
			f.curn.focus();
			return false;
		} 	
	} else if(f.pjtype.value=="Fixed") {
		if(f.ebudjet.value.length==0) {
			alert("Enter Estimation of Budget");
			f.ebudjet.focus();
			return false;
		}	
		if(chkdigits.test(f.ebudjet.value)==false) {
			alert("Estimation of Budget must be in numers");
			f.ebudjet.focus();
			return false;
		}
		if(f.ecurn.value.length==0) {
			alert("Select Currency");
			f.ecurn.focus();
			return false;
		} 	
		if(f.estdays.value.length==0) {
			alert("Enter Estimation Days");
			f.estdays.focus();
			return false;
		}	
		if(isNaN(f.estdays.value)) {
			alert("Estimation days must be in numers");
			f.estdays.focus();
			return false;
		}
		if(parseInt(f.estdays.value)<=0) {
			alert("Estimation Days should not be zero");
			f.estdays.focus();
			return false;
		}
	}
	if(f.agree.checked==false)
	{
	alert("Please Read the  terms and conditions of osource "); 
	return false; 
	} 
	return true;
}


//APPLY PAGE2
function chkapply2(f)
{	
	if(f.pjtype.value=="Hourly") {
		if(f.hrate.value.length==0) {
			alert("Enter Hourly Rate");
			f.hrate.focus();
			return false;
		}	
		if(chkdigits.test(f.hrate.value)==false) {
			alert("Hourly Rate must be in numers");
			f.hrate.focus();
			return false;
		}
		thrate(f);
		if(f.curn.value.length==0) {
			alert("Select Currency");
			f.curn.focus();
			return false;
		} 	
	} else if(f.pjtype.value=="Fixed") {
		if(f.ebudjet.value.length==0) {
			alert("Enter Estimation of Budget");
			f.ebudjet.focus();
			return false;
		}	
		if(chkdigits.test(f.ebudjet.value)==false) {
			alert("Estimation of Budget must be in numers");
			f.ebudjet.focus();
			return false;
		}
		if(f.ecurn.value.length==0) {
			alert("Select Currency");
			f.ecurn.focus();
			return false;
		} 	
		if(f.estdays.value.length==0) {
			alert("Enter Estimation Days");
			f.estdays.focus();
			return false;
		}	
		if(isNaN(f.estdays.value)) {
			alert("Estimation days must be in numers");
			f.estdays.focus();
			return false;
		}
		if(parseInt(f.estdays.value)<=0) {
			alert("Estimation Days should not be zero");
			f.estdays.focus();
			return false;
		}
	}
	return true;
}


//POST MESSAGE
function chkpostmsg(f)
{	
	if(f.docm.value.length!=0) {
		var catgmgtype=f.docm.value.substr(f.docm.value.length-3);
		var catgmgtype1=f.docm.value.substr(f.docm.value.length-4);
		if (!(catgmgtype=='rtf'|| catgmgtype=='txt'|| catgmgtype=='doc'||catgmgtype1=='docx'||catgmgtype=='DOC'||catgmgtype1=='DOCX'||catgmgtype=='RTF'||catgmgtype=='TXT' ||catgmgtype=='PDF'||catgmgtype=='pdf'))
		{
		   alert("Attachment should be Worddocument file or Wordpad or Notepad or PDF");
		   f.docm.focus();
		   return false;
		}
	}		
	return true;
}



//EMPLOYMENT HISTORY
function chkemh(f)
{
	if(f.cname.value.length==0) {
		alert("Enter Company Name");
		f.cname.focus();
		return false;
	}	
	if(f.title.value.length==0) {
		alert("Enter Title");
		f.title.focus();
		return false;
	}
	if(f.role.value.length==0) {
		alert("Select Role");
		f.role.focus();
		return false;
	}
	if(f.fmonth.value.length==0) {
		alert("Select Month from");
		f.fmonth.focus();
		return false;
	}
	if(f.fyear.value.length==0) {
		alert("Select Year from");
		f.fyear.focus();
		return false;
	}
	return true;
}


//EDUCATION
function chkedc(f)
{
	if(f.fmonth.value.length==0) {
		alert("Select Month from");
		f.fmonth.focus();
		return false;
	}
	if(f.fyear.value.length==0) {
		alert("Select Year from");
		f.fyear.focus();
		return false;
	}
	if(f.schname.value.length==0) {
		alert("Enter School Name");
		f.schname.focus();
		return false;
	}	
	if(f.degree.value.length==0) {
		alert("Select Degree");
		f.degree.focus();
		return false;
	}
	if(f.astudy.value.length==0) {
		alert("Enter Area of Study");
		f.astudy.focus();
		return false;
	}	
	return true;
}


//CERTIFICATIONS
function chkcrt(f)
{
	if(f.certid.value.length==0) {
		alert("Enter Certification ID");
		f.certid.focus();
		return false;
	}
	if(f.certname.value.length==0) {
		alert("Enter Certification Name");
		f.certname.focus();
		return false;
	}
	if(f.fmonth.value.length==0) {
		alert("Select Month from");
		f.fmonth.focus();
		return false;
	}
	if(f.fyear.value.length==0) {
		alert("Select Year from");
		f.fyear.focus();
		return false;
	}	
	return true;
}

//SKILLS
function chksk(f)
{
	if(f.scatg.value.length==0) {
		alert("Enter Skill");
		f.scatg.focus();
		return false;
	}
	if(f.syears.value.length==0) {
		alert("Select Years of Experience");
		f.syears.focus();
		return false;
	}
	if(f.slevel.value.length==0) {
		alert("Select Level");
		f.slevel.focus();
		return false;
	}
	if(f.lstused.value.length==0) {
		alert("Select Last used");
		f.lstused.focus();
		return false;
	}	
	return true;
}


//OTHER EXPERIENCES
function chkoexp(f)
{
	if(f.subj.value.length==0) {
		alert("Enter Subject");
		f.subj.focus();
		return false;
	}
	return true;
}

//OTHER EXPERIENCES
function chkoexp(f)
{
	if(f.subj.value.length==0) {
		alert("Enter Subject");
		f.subj.focus();
		return false;
	}
	return true;
}

//HIRE NOTICE
function chkhired(f)
{	
	var hrd=f.elements["rdhired"];
	var i,j=0,s="";
	for(i=0;i<hrd.length;i++) 
		if(hrd[i].checked==true) {
			j=1;
			s=hrd[i].value;
			s=s.substr(s.indexOf("_")+1,s.length-1);
			if(confirm("Are you sure - You want to Hire "+ s +" to complete this ASSIGNMENT ")==true) 			{
				return true;
			} else return false;
		}
	if(j==0)
	{
		alert("Please select Applicant");
		return false;
	}
	return false;
}

//HIRE NOTICE
function hired(pid,uid)
{
	
	if(confirm("Are you sure - You want to award the job "+pid+" to "+uid+"[BuyerDI/ProviderID] for this assignment ")==true) 		return true; 
	else return false;
}


//INVITE NOTICE
function chkinvts(f)
{	
	var invt=f.elements["chkinvite[]"];
	var i,j=0,ids="";
	for(i=0;i<invt.length;i++) 
		if(invt[i].checked==true) {
			j++; 
			ids+=invt[i].value+"_";
		}
	
	if(j>0)
		{				
			ids=ids.substr(0,ids.length-1);			
			MM_openBrWindow('osource_bcompose.php?a=i&aid='+ids,'','width=800,height=560');			
		}
	if(j==0)
	{
		alert("Please select Applicant");
		return false;
	}	
	return false;
}


//LEFT LINKS1
function chkleft(f)
{
	if(f.catg.value.length==0) {
		alert("Select Category");
		f.catg.focus();
		return false;
	}
	if(f.scatg.value.length==0) {
		alert("Select Sub Category");
		f.scatg.focus();
		return false;
	}
	return true;
}


//FIND WORK
function chkfwork(f)
{
	if(f.catg1.value.length==0) {
		alert("Select Category");
		f.catg1.focus();
		return false;
	}
	if(f.scatg1.value.length==0) {
		alert("Select Sub Category");
		f.scatg1.focus();
		return false;
	}
	return true;
}

//NEWSLETTER
function chknletter(f)
{
	if(f.nemail.value.length==0) {
		alert("Enter email address");
		f.nemail.focus();
		return false;
	}
	var eemailRegxp=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;	
	if (eemailRegxp.test(f.nemail.value) == false)
	{
       alert("Email address appears to be incorrect");
	   f.nemail.focus();
	   return false;
	}
	f.submit();
	return true;
}


//HELP LIST
function chkhelp(f)
{
	if(f.topic1.value.length==0) {
		alert("Select Topic 1");
		f.topic1.focus();
		return false;
	}
	if(f.topic2.value.length==0) {
		alert("Select Topic 2");
		f.topic2.focus();
		return false;
	}
	if(f.topic3.value.length==0) {
		alert("Select Topic 3");
		f.topic3.focus();
		return false;
	}
	return true;
}


//PAYMENT REQUEST
function chkprequest(f)
{
	if(f.purp.value.length==0) {
		alert("Select Category");
		f.purp.focus();
		return false;
	}
	if(f.purp.value=="Project Completion/Advance") {
		if(f.catgc.value.length==0) {
			alert("Select Project Type");
			f.catgc.focus();
			return false;
		}
		if(f.scatgc.value.length==0) {
			alert("Select Sub Project Type");
			f.scatgc.focus();
			return false;
		}
	} else if(f.purp.value=="Membership Plans/ Extra Bids") {
		var bdt=f.elements["bidtype"];	
		if(bdt[0].checked==false && bdt[1].checked==false) {
			alert("Select Plans or Extra Bids");
			return false;
		}		
		if(bdt[0].checked==true) {
			if(f.plan.value.length==0) {
				alert("Select Plan");
				f.plan.focus();
				return false;
			}
		} else if(bdt[1].checked==true) {
			if(f.bids.value.length==0) {
				alert("Select No. of Bids");
				f.bids.focus();
				return false;
			}
		}		
	}
	if(f.paidtype.value.length==0) {
		alert("Select Paid Through");
		f.paidtype.focus();
		return false;
	}
	if(f.pref.value.length==0) {
		alert("Enter Payment Reference");
		f.pref.focus();
		return false;
	}
	if(f.paid.value.length==0) {
		alert("Select Paid Amount");
		f.paid.focus();
		return false;
	}
	if(chkdigits.test(f.paid.value)==false) {
		alert("Paid Amount must be in Numbers");
		f.paid.focus();
		return false;
	}
	if(f.pdate.value.length==0) {
		alert("Select Paid Date");
		f.pdate.focus();
		return false;
	}
	if(f.docm.value.length!=0) {
		var catgmgtype=f.docm.value.substr(f.docm.value.length-3);
		var catgmgtype1=f.docm.value.substr(f.docm.value.length-4);
		if (!(catgmgtype=='rtf'|| catgmgtype=='txt'|| catgmgtype=='doc'||catgmgtype1=='docx'||catgmgtype=='DOC'||catgmgtype1=='DOCX'||catgmgtype=='RTF'||catgmgtype=='TXT' ||catgmgtype=='PDF'||catgmgtype=='pdf'))
		{
		   alert("Attachment should be Word document or Wordpad or Notepad or PDF");
		   f.docm.focus();
		   return false;
		}
	}	
	return true;
}


//PLAN AMOUNTS
function getplanvalue(f)
{
	if(f.plan.value=="Gold Plan") { f.paid.value=9; f.bids.value=10; }
	else if(f.plan.value=="Silver Plan") { f.paid.value=12; f.bids.value=20; }
	else if(f.plan.value=="Premium Plan") { f.paid.value=16; f.bids.value=40; }	
}



//BUYER UPDATE
function chkbuyer(f)
{
	if(f.fname.value.length==0) {
		alert("Enter First name");
		f.fname.focus();
		return false;
	}
	if(f.lname.value.length==0) {
		alert("Enter Last name");
		f.lname.focus();
		return false;
	}
	var eemailRegxp=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;	
	if(f.email.value.length==0)
	{
		alert("Enter Your Email address ");
		f.email.focus();
		return false;
	}	
	if (eemailRegxp.test(f.email.value) != true)
	{
       alert("Email address appears to be incorrect");
	   f.email.focus();
	   return false;
	}
	if(f.squestion.value.length==0)
	{
		alert("Select Security Question");
		f.squestion.focus();
		return false;
	}
	if(f.sanswer.value.length==0)
	{
		alert("Enter Security Answer");
		f.sanswer.focus();
		return false;
	}
	if(f.cname.value.length==0)
	{
		alert("Enter Comapny Name");
		f.cname.focus();
		return false;
	}
	if(f.ctname.value.length==0)
	{
		alert("Enter Country");
		f.ctname.focus();
		return false;
	}
	if(f.timezone.value.length==0)
	{
		alert("Enter Timezone");
		f.timezone.focus();
		return false;
	}
	if(f.bbusn.value.length==0)
	{
		alert("Select Best describes your business ");
		f.bbusn.focus();
		return false;
	}
	if(f.self_reported_employees.value.length==0)
	{
		alert("Select No.of Employees");
		f.self_reported_employees.focus();
		return false;
	}
	if(f.self_reported_revenue.value.length==0)
	{
		alert("Enter your Companies Annual Revenue");
		f.self_reported_revenue.focus();
		return false;
	}
	return true;
	
}


//Checking Create topic
function checktopic(f)
{	
	if(f.mcatg.value.length==0) {
		alert("Select Category");
		f.mcatg.focus();
		return false;
	}
	if(f.mscatg.value.length==0) {
		alert("Select Sub Category");
		f.mscatg.focus();
		return false;
	}
	if(f.topic.value.length==0)
	{
		alert("Your Topic Field is Empty");
		f.topic.focus();
		return false;
	}	
	if(f.detail.value.length==0)
	{
		alert("Your Detail Field is Empty");
		f.detail.focus();
		return false;
	}
	return true;			
}


//Check Answer
function checkanswer(f)
{
		
	if(f.a_answer.value.length==0)
	{
		alert("Your Answer box is Empty");
		f.a_answer.focus();
		return false;
	}
	return true;		
}
//openbrwindow
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//JUMPMENU
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//Checking Forgot password
function checkforgetpwd(f,v)
{	
	if(v==1)
	if(f.usname.value.length==0) {
		alert("Enter username");
		f.usname.focus();
		return false;
	}
	if(f.femail.value.length==0) {
		alert("Enter Email Address");
		f.femail.focus();
		return false;
	}
	var eemailRegxp=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;	
	if (eemailRegxp.test(f.femail.value) == false)
	{
       alert("Email address appears to be incorrect");
	   f.femail.focus();
	   return false;
	}
	if(f.fcountry.value.length==0)
	{
		alert("Select Country");
		f.fcountry.focus();
		return false;
	}	
	return true;			
}

//Checking Forgot password last page
function checkforgetpwdc(f)
{	
	if(f.fans.value.length==0) {
		alert("Enter Answer to Security Question");
		f.fans.focus();
		return false;
	}
	return true;			
}


//DELETE
function msgconfirm(itemname) {
	if(confirm("Are you sure to "+itemname+"?")==true)
		return true;
	else return false;
}


//End assignment by provider
function chkendwork(f)
{	
	if(f.resn.value.length==0) {
		alert("Select reason for ending assignment");
		f.resn.focus();
		return false;
	}
	return true;			
}

//FEEDBACK IMAGES
function showimages(f,p,r) {
	var imgs=f.elements["vstar"];	
	//alert(imgs.length);
	//alert(p);
	//alert(r);
	var s=5*p,e=parseInt(s)+4;
	for(i=1;i<=r;i++) 
		imgs[s++].style.display="block";
	for(;i<=5;i++) 
		imgs[s++].style.display="none";
}




//LEFT SEARCH BAR FOR PROVIDERS
function chksearch(f) {	
	var c=0;
	if(f.scbox.checked==true) {
		if(f.stitle.value.length==0) {
			alert("Enter Profile title");	
			f.stitle.focus();
			return false;
		}
		return true;
	}
	if(f.scatg.value.length>0) {
		if(f.sscatg.value.length==0) {
			alert("Select Sub Category");	
			f.sscatg.focus();
			return false;
		}
		c=1;
	}
	if(f.sfdback.value.length>0) c=1;	
	//hourly rate validation
	if(f.shrmin.value.length>0) {
		if(chkdigits.test(f.shrmin.value)==false) {
			alert("Minimum Hourly rate must be in numbersssss");	
			f.shrmin.focus();
			return false;
		}	
		if(f.shrmax.value.length==0) {
			alert("Enter Maximum Hourly rate");	
			f.shrmax.focus();
			return false;
		}
		if(chkdigits.test(f.shrmax.value)==false) {
			alert("Maximum Hourly rate must be in numbers");	
			f.shrmax.focus();
			return false;
		}
		if(parseFloat(f.shrmin.value)>parseFloat(f.shrmax.value)) {
			alert("Minimum Hourly rate not more than Maximum Hourly rate");	
			f.shrmin.focus();
			return false;
		}
		c=1;
	}
	if(f.scountry.value.length>0) c=1;
	if(f.sprvtype.value.length>0) c=1;
	if(f.slastact.value.length>0) c=1;
	if(c==0) {
		alert("Select search criteria");
		return false;
	} else return true;
}


//LEFT SEARCH BAR FOR JOBS
function chkjobsearch(f) {	
	var c=0;
	if(f.scbox.checked==true) {
		if(f.stitle.value.length==0) {
			alert("Enter Job title");	
			f.stitle.focus();
			return false;
		}
		return true;
	}
	var jrd=f.elements["jtype"];
	for(var i=0;i<jrd.length;i++)		
		if(jrd[i].checked==true) c=1;
		
	if(f.scatg.value.length>0) {
		if(f.sscatg.value.length==0) {
			alert("Select Sub Category");	
			f.sscatg.focus();
			return false;
		}
		c=1;
	}
	
	if(f.psdate.value.length>0) c=1;	
	if(f.jbstatus.value.length>0) c=1;
	if(f.bfactrate.value.length>0) c=1;
	if(f.bpaid.value.length>0) c=1;	
	if(c==0) {
		alert("Select search criteria");
		return false;
	} else return true;
}




//user login
function login(f)
{
	if(f.username.value.length==0) {
		alert("Enter User Name");
		f.username.focus();
		return false;
	}	
	if(f.psword.value.length==0) {
		alert("Enter Password");
		f.psword.focus();
		return false;
	}
}




//NEW PROJECT 
function projcheck(f)
{	
	if(f.title.value.length==0) {
		alert("Enter Title");
		f.title.focus();
		return false;
	}
	if(f.catg.value.length==0) {
		alert("Select Category");
		f.catg.focus();
		return false;
	}
	if(f.scatg.value.length==0) {
		alert("Select Sub Category");
		f.scatg.focus();
		return false;
	}
	if(f.skills.value.length==0) {
		alert("Enter Skills");
		f.skills.focus();
		return false;
	}
	if(f.atcfile.value.length!=0) {
		var catgmgtype=f.atcfile.value.substr(f.atcfile.value.length-3);
		var catgmgtype1=f.atcfile.value.substr(f.atcfile.value.length-4);
		if (!(catgmgtype=='rtf'|| catgmgtype=='txt'|| catgmgtype=='doc'||catgmgtype1=='docx'||catgmgtype=='DOC'||catgmgtype1=='DOCX'||catgmgtype=='RTF'||catgmgtype=='TXT'))
		{
		   alert("Attachment should be Word document, Wordpad, Notepad, or PDF");
		   f.atcfile.focus();
		   return false;
		}
	}
	var pt=f.elements["pjtype"];
	
	if(!(pt[0].checked==true || pt[1].checked==true)) {
		alert("Select Project Type");
		return false;
	}
	if(pt[0].checked==true) {
		if(f.startdate.value.length==0) {
			alert("Select Hourly Project Starting Date");
			f.startdate.focus();
			return false;
		}
		if(f.hdur.value.length==0) {
			alert("Enter Duration");
			f.hdur.focus();
			return false;
		}		
		if(isNaN(f.hdur.value)) {
			alert("Duration must be numbers");
			f.hdur.focus();
			return false;
		}		
		var wl=f.elements["wload"];
		if(wl[0].checked==false && wl[1].checked==false && wl[2].checked==false) {
			alert("Select Workload");
			return false;
		}
	}
	if(pt[1].checked==true) {
		if(f.estartdate.value.length==0) {
			alert("Select Fixed Project Starting Date");
			f.estartdate.focus();
			return false;
		}
		if(f.closedate.value.length==0) {
			alert("Select Fixed Project Starting Date");
			f.closedate.focus();
			return false;
		}
		if(f.budjet.value.length==0) {
			alert("Enter Budget");
			f.budjet.focus();
			return false;
		}		
		if(isNaN(f.budjet.value)) {
			alert("Budget must be in numbers");
			f.budjet.focus();
			return false;
		}		
		
	}	
	if(f.englevel.value.length==0) {
		alert("Select English Level");
		f.englevel.focus();
		return false;
	}
	if(f.envr.value.length==0) {
		alert("Select Working Environment");
		f.envr.focus();
		return false;
	} 
	return true;	
}
