/*script for jammu club made by Er. Pradeep kr. */



////////////////////////////////////////////////////

/********function for main flash**********************/

function mainflash()
{
document.write('<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 height="316" width="666">');
document.write('<param name="Movie" value="main_flash.swf">');
document.write('<param name="Src" value="main_flash.swf">');
document.write('<param name="WMode" value="Transparent">');
document.write('<param name="Quality" value="High">');
document.write('<param name="Menu" value="0">');
document.write('<param name="Scale" value="NoBorder">');
document.write('<param name="ProfilePort" value="0">');
document.write('<embed src="main_flash.swf" menu="false" quality="best"  wmode="transparent" bgcolor="#000000" WIDTH="666" HEIGHT="316" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write('</OBJECT>');

}

//////////////////////////////////////////////////////////////////////////////

function check_loginform()
{
	docf=document.getElementById("frm");
	if(docf.txt_username.value=='')
	{
		alert("Please enter UserName");
		docf.txt_username.focus();
		return false;
	}	
	if(docf.txt_password.value=='')
	{
		alert("Please enter Password");
		docf.txt_password.focus();
		return false;
	}
	

return validate_form(docf);
}


/////////////////////////////////////////////////////


/********function for main flash**********************/

function intmainflash()
{
document.write('<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 height="198" width="666">');
document.write('<param name="Movie" value="int_flash.swf">');
document.write('<param name="Src" value="int_flash.swf">');
document.write('<param name="WMode" value="Transparent">');
document.write('<param name="Quality" value="High">');
document.write('<param name="Menu" value="0">');
document.write('<param name="Scale" value="NoBorder">');
document.write('<param name="ProfilePort" value="0">');
document.write('<embed src="int_flash.swf" menu="false" quality="best"  wmode="transparent" bgcolor="#000000" WIDTH="666" HEIGHT="198" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write('</OBJECT>');

}
///////////////////////////////////////////////////////////////////////////



/********function for main flash**********************/

function intmainflash2()
{
document.write('<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 height="198" width="666">');
document.write('<param name="Movie" value="int_flash1.swf">');
document.write('<param name="Src" value="int_flash1.swf">');
document.write('<param name="WMode" value="Transparent">');
document.write('<param name="Quality" value="High">');
document.write('<param name="Menu" value="0">');
document.write('<param name="Scale" value="NoBorder">');
document.write('<param name="ProfilePort" value="0">');
document.write('<embed src="int_flash1.swf" menu="false" quality="best"  wmode="transparent" bgcolor="#000000" WIDTH="666" HEIGHT="198" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write('</OBJECT>');

}
///////////////////////////////////////////////////////////////////////////


/******function for partnerform**********************/

function partnerenquiry()
{
	docf=document.getElementById("frm");
	if(docf.name.value=='')
	{
		alert("Please enter your Name");
		docf.name.focus();
		return false;
	}	
	if(docf.clubname.value=='')
	{
		alert("Please enter your Club name");
		docf.clubname.focus();
		return false;
	}
	if(docf.address.value=='')
	{
		alert("Please enter your address");
		docf.address.focus();
		return false;
	}
	if(docf.city.value=='')
	{
		alert("Please enter your city");
		docf.city.focus();
		return false;
	}
	if(docf.phone.value=='')
	{
		alert("Please enter phone");
		docf.phone.focus();
		return false;
	}
	if(docf.email.value=='')
	{
		alert("Please enter email Address");
		docf.email.focus();
		return false;
	}
if(docf.code_field.value=='')
	{
		alert("Please enter the code in above figure");
		docf.code_field.focus();
		return false;
	}

return validate_form(docf);
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}
////////////////////////////////////////////////////////////////////////////////////

/******************function for enquiry*****************/

function checkenquiry()
{
	docf=document.getElementById("frm");
	if(docf.name.value=='')
	{
		alert("Please enter your Name");
		docf.name.focus();
		return false;
	}	
	if(docf.company.value=='')
	{
		alert("Please enter your Company");
		docf.company.focus();
		return false;
	}
	if(docf.address.value=='')
	{
		alert("Please enter your address");
		docf.address.focus();
		return false;
	}
	if(docf.phone.value=='')
	{
		alert("Please enter phone");
		docf.phone.focus();
		return false;
	}
	if(docf.email.value=='')
	{
		alert("Please enter email Address");
		docf.email.focus();
		return false;
	}
if(docf.code_field.value=='')
	{
		alert("Please enter the code in above figure");
		docf.code_field.focus();
		return false;
	}

return validate_form(docf);
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}

/////////////////////////////////////////////////////////////////////////


/******************FUNCTION FOR FEEDBACK FORM***************************/


function check_feedbackform()
{
	
	docf=document.getElementById("frm3");
	
	if(docf.name.value=='')
	{
		alert("Please enter your Name");
		docf.name.focus();
		return false;
	}
	
	if(docf.email.value=='')
	{
		alert("Please enter your Email ID");
		docf.email.focus();
		return false;
	}

	if(docf.city.value=='')
	{
		alert("Please enter City Name");
		docf.city.focus();
		return false;
	}
	if(docf.country.value=='Select a country')
	{
		alert("Please enter Country Name");
		docf.country.focus();
		return false;
	}
	
	/*if(docf.restaurant.value=='')
	{
		alert("Please enter Restaurant / Bar Rating Factor");
		docf.restaurant.focus();
		return false;
	}

  if(docf.guesthouse.value=='excellent')
	{
		alert("Please enter Guest House Rating Factor");
		docf.guesthouse.focus();
		return false;
	}

	if(docf.sports.value=='excellent')
	{
		alert("Please enter Sports Rating Factor");
		docf.sports.focus();
		return false;
	}
	if(docf.library.value=='excellent')
	{
		alert("Please enter Library Rating Factor");
		docf.library.focus();
		return false;
	}
	if(docf.partyhall.value=='excellent')
	{
		alert("Please enter Party Hall Rating Factor");
		docf.partyhall.focus();
		return false;
	}
	if(docf.cardroom.value=='excellent')
	{
		alert("Please enter Card Rooms Rating Factor");
		docf.cardroom.focus();
		return false;
	}*/
	if(docf.phone.value=='')
	{
		alert("Please enter your Phone");
		docf.phone.focus();
		return false;
	}
if(docf.comments.value=='')
	{
		alert("Please enter your Comments");
		docf.comments.focus();
		return false;
	}

	


if(docf.code_field.value=='')
	{
		alert("Please enter the Code above in Figure");
		docf.code_field.focus();
		return false;
	}


	 return validate_form(docf);
	
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}


function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}

///////////////////////////////////////////////////////////////////////////////////////

/******************function for membership form*****************/

function checkmembership()
{
	docf=document.getElementById("mfrm");
	if(docf.name.value=='')
	{
		alert("Please enter your Name");
		docf.name.focus();
		return false;
	}	
	if(docf.fname.value=='')
	{
		alert("Please enter your Father's Name");
		docf.fname.focus();
		return false;
	}
	if(docf.dob.value=='')
	{
		alert("Please enter your Date of Birth");
		docf.dob.focus();
		return false;
	}

	if(docf.occupation.value=='')
	{
		alert("Please enter your Occupation");
		docf.occupation.focus();
		return false;
	}
	if(docf.address.value=='')
	{
		alert("Please enter your address");
		docf.address.focus();
		return false;
	}
	if(docf.phone.value=='')
	{
		alert("Please enter phone");
		docf.phone.focus();
		return false;
	}
	if(docf.qualification.value=='')
	{
		alert("Please enter Qualification");
		docf.qualification.focus();
		return false;
	}
	if(docf.email.value=='')
	{
		alert("Please enter Email");
		docf.email.focus();
		return false;
	}

if(docf.code_field.value=='')
	{
		alert("Please enter the code in above figure");
		docf.code_field.focus();
		return false;
	}

return validate_form(docf);
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}

/////////////////////////////////////////////////////////////////////////

/******************function for guest form*****************/

function checkguestform()
{
	docf=document.getElementById("gfrm");
	if(docf.name.value=='')
	{
		alert("Please enter your Name");
		docf.name.focus();
		return false;
	}	
	if(docf.address.value=='')
	{
		alert("Please enter your Address");
		docf.address.focus();
		return false;
	}
	if(docf.phone.value=='')
	{
		alert("Please enter your Phone");
		docf.phone.focus();
		return false;
	}

	if(docf.occupation.value=='')
	{
		alert("Please enter your Occupation");
		docf.occupation.focus();
		return false;
	}
	if(docf.email.value=='')
	{
		alert("Please enter your Email");
		docf.email.focus();
		return false;
	}
	if(docf.affclub.value=='')
	{
		alert("Please enter Affiliated Club Name");
		docf.affclub.focus();
		return false;
	}
	if(docf.memno.value=='')
	{
		alert("Please enter your Membership No");
		docf.memno.focus();
		return false;
	}
	if(docf.affclub.value=='')
	{
		alert("Please enter Affiliated Club Name");
		docf.affclub.focus();
		return false;
	}
	if(docf.norooms.value=='')
	{
		alert("Please enter NO. of Rooms");
		docf.norooms.focus();
		return false;
	}
	if(docf.typeofroom.value=='Select the Type of Room')
	{
		alert("Please enter the Room Type");
		docf.typeofroom.focus();
		return false;
	}

	if(docf.date.value=='')
	{
		alert("Please enter the Date for In");
		docf.date.focus();
		return false;
	}
	if(docf.date1.value=='')
	{
		alert("Please enter the Date for Out");
		docf.date1.focus();
		return false;
	}

if(docf.information.value=='')
	{
		alert("Please enter any other information");
		docf.information.focus();
		return false;
	}
if(docf.code_field.value=='')
	{
		alert("Please enter the code in above figure");
		docf.code_field.focus();
		return false;
	}

return validate_form(docf);
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}

/////////////////////////////////////////////////////////////////////////
