/*
	Module Name:- Model Application
	File Name  :- guys_model_application.js
	Create Date:- 15-Sep-2006
	Intially Create By :- 0014
	Update History:
*/

function model_app_validate()
{
	with(document.frm_model_app)
	{
		if(trim(txt_fname.value) == "")
		{
			alert("Please enter model name.");
			txt_fname.focus();
			return false;
		}
		if(trim(txt_email.value) == "")
		{
			alert("Please enter email address.");
			txt_email.focus();
			return false;
		}
		if(sValidateMailAddress(trim(txt_email.value)) == false)
		{
			alert("Please enter valid email address. Format:email@domainname.com");
			txt_email.select();
			txt_email.focus();
			return false;
		}
				if(trim(txturl.value) == "")
		{
			alert("Please enter website url");
			txturl.focus();
			return false;				
		}
		else
		{
			if(isValidUrl(trim(txturl.value)) == false)
			{
				txturl.select();
				txturl.focus();
				return false;
			}
		}		
		if(trim(txt_ethnicity.value) == "")
		{
			alert("Please enter ethnicity.");
			txt_ethnicity.focus();
			return false;
		}
		if(trim(cbo_m1.value) == "")
		{
			alert("Please select bust size.");
			cbo_m1.focus();
			return false;
		}
		if(trim(cbo_m2.value) == "")
		{
			alert("Please select cup size.");
			cbo_m2.focus();
			return false;
		}
		if(trim(cbo_m3.value) == "")
		{
			alert("Please select waist size.");
			cbo_m3.focus();
			return false;
		}
		if(trim(cbo_m4.value) == "")
		{
			alert("Please select hip size.");
			cbo_m4.focus();
			return false;
		}
		if(trim(cbo_age.value) == "")
		{
			alert("Please select age.");
			cbo_age.focus();
			return false;
		}
		if(trim(cbo_height_ft.value) == "")
		{
			alert("Please select height in feet.");
			cbo_height_ft.focus();
			return false;
		}
		if(trim(cbo_height_inch.value) == "")
		{
			alert("Please select height in inch.");
			cbo_height_inch.focus();
			return false;
		}
		if(trim(cbo_weight.value) == "")
		{
			alert("Please select weight.");
			cbo_weight.focus();
			return false;
		}		
		if(trim(cbo_eyecolor.value) == "")
		{
			alert("Please select eye color.");
			cbo_eyecolor.focus();
			return false;
		}
		if(trim(cbo_haircolor.value) == "")
		{
			alert("Please select hair color.");
			cbo_haircolor.focus();
			return false;
		}
		if(trim(cbo_skincolor.value) == "")
		{
			alert("Please select skin color.");
			cbo_skincolor.focus();
			return false;
		}		
		if(trim(cbo_shoe_size.value) == "")
		{
			alert("Please select shoe size.");
			cbo_shoe_size.focus();
			return false;
		}
		if(trim(cbo_dress_size.value) == "")
		{
			alert("Please select dress size.");
			cbo_dress_size.focus();
			return false;
		}
		if(trim(ta_desc.value) == "")
		{
			alert("Please enter biography.");
			ta_desc.focus();
			return false;
		}
		 var i,flagCheck,int_arr_ubound;
		 flagCheck = false;	 
		 int_arr_ubound = elements['cb_skill[]'].length;	 
		 if(int_arr_ubound)
		 {
			 for(i=0;i<int_arr_ubound;i++)
			 {
				if(elements['cb_skill[]'][i].checked)
				{
					flagCheck = true;			
				}
			 }	 
		 }
		 else
		 {
		 		 if(elements['cb_skill[]'].checked)
				 {
					flagCheck = true;			
				 } 
		 }
		if(flagCheck==false)
		{
			alert("Please select at least one types of modeling.");
			return false;
		}		
		
		if((ta_desc.value.length) > 8192)
		{
			alert("Maximum 8192 character can be entered.");
			ta_desc.select();
			ta_desc.focus();
			return false;
		}
		if(trim(ta_ambition.value) == "")
		{
			alert("Please enter ambition.");
			ta_ambition.focus();
			return false;
		}
		if((ta_ambition.value.length) > 4096)
		{
			alert("Maximum 4096 character can be entered.");
			ta_ambition.select();
			ta_ambition.focus();
			return false;
		}
		
		if(trim(file_image.value) == "")
		{
			alert("Please upload image # 1.");
			file_image.focus();
			return false;
		}
		else
		{
			if(checkExt(trim(file_image.value))==false)
			{
				file_image.select();
				file_image.focus();
				return false;
			}
		}
		
		if(trim(file_image1.value) == "")
		{
			alert("Please upload image # 2.");
			file_image1.focus();
			return false;
		}
		else
		{
			if(checkExt(trim(file_image1.value))==false)
			{
				file_image1.select();
				file_image1.focus();
				return false;
			}
		}
		
		//if(trim(txt_code.value)=="")
		//{
		//	alert("Please enter secret code.");
		//	txt_code.focus();
		//	return false;
		//}
		
		if(chk_agree.checked == false)
		{
			alert("Please read the site terms & conditions agree to the terms specified.");
			chk_agree.focus();
			return false;
		}
		if(chk_old.checked == false)
		{
			alert("Please agree to the 'At least 18 years old'.");
			chk_old.focus();
			return false;
		}
/*		if(chk_use_rockin.checked == false)
		{
			alert("Please agree to the 'Body-Rockin can use my photos in promotional banners'.");
			chk_use_rockin.focus();
			return false;
		} */
	}
	return true;
}

function show_details(url)
{
	window.open(url,'siteterms','left=50,top=20,scrollbars=yes,width=630,height=550,resizable=yes');
	return false;
}