/*
	Module Name:- modtestimonial
	File Name  :- testomonial.js
	Create Date:- 16-MAY-2007
	Intially Create By :- 
	Update History:
*/
function frm_add_validateform()
{
	with(document.frm_reservation)
	{
		
		if(isEmpty(txt_fullname.value))
		{
			alert("Please enter your name.");
			txt_fullname.select();
			txt_fullname.focus();
			return false;
		}

		if(isEmpty(txt_occupation.value))
		{
			alert("Please enter Occupation Title.");
			txt_occupation.select();
			txt_occupation.focus();
			return false;
		}

		if(isEmpty(txt_companyname.value))
		{
			alert("Please enter Company Name.");
			txt_companyname.select();
			txt_companyname.focus();
			return false;
		}

		if(isEmpty(txt_workphone.value))
		{
			alert("Please enter Work Phone.");
			txt_workphone.select();
			txt_workphone.focus();
			return false;
		}

		if(isEmpty(txt_mobilephone.value))
		{
			alert("Please enter Other Phone.");
			txt_mobilephone.select();
			txt_mobilephone.focus();
			return false;
		}

		if(isEmpty(txt_emailid.value))
		{
			alert("Please enter Email Id.");
			txt_emailid.select();
			txt_emailid.focus();
			return false;
		}
		
		if(trim(txt_emailid.value)!="")
	   {
			if(!sValidateMailAddress(txt_emailid.value))
			{
				alert("Please enter valid email address. Format:email@domain.com");
				txt_emailid.select();
				txt_emailid.focus();
				return false;
			}
		}
		
		if(isEmpty(txt_cityname.value))
		{
			alert("Please enter City Name you reside?");
			txt_cityname.select();
			txt_cityname.focus();
			return false;
		}

		if(isEmpty(txt_citymeet.value))
		{
			alert("Please enter in Which city you like to meet?");
			txt_citymeet.select();
			txt_citymeet.focus();
			return false;
		}

		if(isEmpty(txt_addressmeet.value))
		{
			alert("Please enter what address would you like to meet?");
			txt_addressmeet.select();
			txt_addressmeet.focus();
			return false;
		}

		if(isEmpty(txt_whenmeet.value))
		{
			alert("Please enter When would you like to meet?");
			txt_whenmeet.select();
			txt_whenmeet.focus();
			return false;
		}

		if(txt_spendtogether.value=="0")
		{
			alert("Please Select How long would you like to spend together?");
			//txt_spendtogether.select();
			txt_spendtogether.focus();
			return false;
		}
		
		
		var counter,i,cnt;
		counter=hdn_deposit_count.value;
		cnt=0;
		for (i=0;i<counter;i++)
		{
			if (eval("chk_deposit_" + i).checked==true)
			{
				cnt++;
			}
		}
		if (cnt==0)
		{
			alert("Please select Payment Method to Pay Deposit.");
			return false;
		}


		var counter_r,i_r,cnt_r;
		counter_r=hdn_remain_count.value;
		cnt_r=0;
		for (i_r=0;i_r<counter_r;i_r++)
		{
			if (eval("chk_remain_" + i_r).checked==true)
			{
				cnt_r++;
			}
		}
		if (cnt_r==0)
		{
			alert("Please select Payment Method to Pay Remaining Fees.");
			return false;
		}
		

		if(isEmpty(txt_howfind.value))
		{
			alert("Please enter How did you find Taylor Paige?");
			txt_howfind.select();
			txt_howfind.focus();
			return false;
		}

		if(isEmpty(txt_referbyname.value))
		{
			alert("Please enter Reference Name");
			txt_referbyname.select();
			txt_referbyname.focus();
			return false;
		}

		if(isEmpty(txt_referbysite.value))
		{
			alert("Please enter Reference Site");
			txt_referbysite.select();
			txt_referbysite.focus();
			return false;
		}

		if(txt_code.value == "")
		{
			alert("Please enter Secret Code.");
			txt_code.focus();
			txt_code.select();
			return false;
		}		

		//if(isEmpty(txt_others.value))
		//{
		//	alert("Please enter Anything else I should know?");
		//	txt_others.select();
		//	txt_others.focus();
		//	return false;
		//}
	   	   
	}
	return true;
}


function show_details(url)
{
	window.open(url,'reservation','left=50,top=20,scrollbars=yes,width=570,height=520,resizable=yes');
	return false;
}

function frmAdd_Validate(no)
{
	if(no==1)
	{
		document.frm_test_add.hdnSubmit.value=1;
	}
	else 
	{
		document.frm_test_add.hdnSubmit.value=2;
	}
	return true;
}
