function addOpt(tList,v,t){
	var newAdd = new Option();
	var lStr;
	(t.length>30)?lStr=t.substring(0,30) + '...':lStr=t.substring(0,30);
	newAdd.value = v;
	newAdd.text = lStr;
	tList.options[0]=null;
	tList.options[0]=newAdd;
	tList.options[0].selected=true;
}
function addOptMulti(tList,v,t){
	var newAdd = new Option();
	var lStr;
	(t.length>30)?lStr=t.substring(0,30) + '...':lStr=t.substring(0,30);
	newAdd.value = v;
	newAdd.text = lStr;
	//tList.options[]=null;
//	alert(tList.options.length);
	tList.options[tList.options.length]=newAdd;
	//tList.options[tList.options.length].selected=true;
}
function checkCond(){
	if(myform.country.value==""){
		alert("Select Country!");
		return false;
	}
	else if(myform.autofil.value.length<2){
		alert("Zip code length is a small!");
		return false;
	}
	return true;
}
function formatLang(){
var str="";
	for(var i=1;i<6;i++){
		if(document.getElementById("lang"+i).value!="")str+=";"+document.getElementById("lang"+i).value+":"+document.getElementById("langAbil"+i).value;
	}
	myform.language.value=str.substring(1,str.length);
	alert(myform.language.value);
}
function defineChecked(myObj){
var f=0;	
	for(var i=0;i<myObj.length;i++){
		if(myObj[i].checked)f++;
	}
	return f;
}
function checkAuthJob(thisForm){
	if(thisForm.company.value=="") {
		alert('Please enter You Company Name!');
		thisForm.company.focus();
		return false;
	}
//	else if(thisForm.person.value=="") {
//		alert('Please enter Contact Person Name!');
//		thisForm.person.focus();
//		return false;
//	}
	else if(thisForm.title.value=="") {
		alert('Please enter Contact Person\'s Title!');
		thisForm.title.focus();
		return false;
	}
	else if(thisForm.division.value=="") {
		alert('Please enter Contact Person\'s Division/Department!');
		thisForm.division.focus();
		return false;
	}
	else if(thisForm.industry.value=="") {
		alert('The Industry type is not selected!');
		thisForm.industry.focus();
		return false;
	}
//	else if(defineChecked(profile)==0){
//		alert('Your Profile type is not defined!');
//		thisForm.profile.focus();
//		return false;
//	}
	else if(thisForm.phone.value=="") {
		alert('Please enter Phone Number!');
		thisForm.phone.focus();
		return false;
	}
	else if(thisForm.email.value=="") {
		alert('Please enter Email!');
		thisForm.email.focus();
		return false;
	}
	else if(thisForm.address.value=="") {
		alert('Please enter Company Address!');
		thisForm.address.focus();
		return false;
	}
	else if(thisForm.referrer.value=="") {
		alert('The choice "How did you hear about New-Gen?" is not selected!');
		thisForm.referrer.focus();
		return false;
	}
	return true;
}
function checkAuthRes(thisForm){
	if(thisForm.fname.value=="") {
		alert('Please enter First Name!');
		thisForm.fname.focus();
		return false;
	}
	else if(thisForm.lname.value=="") {
		alert('Please enter Last Name!');
		thisForm.lname.focus();
		return false;
	}
	else if(thisForm.birth.value=="") {
		alert('Please enter Your Birth Day!');
//		thisForm.birth.focus();
		return false;
	}
	else if(thisForm.country.value=="") {
		alert('Please enter Last Name!');
		thisForm.country.focus();
		return false;
	}
	else if(thisForm.email.value=="") {
		alert('Please enter Your Email!');
		thisForm.email.focus();
		return false;
	}
	else if(thisForm.referrer.value=="") {
		alert('The choice "How did you hear about New-Gen?" is not selected!');
		thisForm.referrer.focus();
		return false;
	}
	return true;
}


