// JavaScript Document
function findDateString1()
	{
	var DptDateString=currDate1.getDate()+"/"+currDate1.getMonth()+"/"+currDate1.getFullYear();
	var day=currDate1.getDate();
	var mon=currDate1.getMonth()+1;
	var year=currDate1.getFullYear();
	if(mon<=9 && day<=9)
		{
	   DptDateString ="0"+day+"/"+"0"+mon+"/"+year; //day+"-"+
		}
		else if(mon<=9 && day>9)
		{
		DptDateString =day+"/"+"0"+mon+"/"+year; //day+"-"+
		}
		else if(mon>9 && day<=9)
		{
   		DptDateString ="0"+day+"/"+mon+"/"+year; //day+"-"+
		}
		else
		{
		DptDateString =day+"/"+mon+"/"+year;
		}
	return DptDateString;
}
function getAdult()
{
	for(i=2;i<=9;i++)
		{
		document.write("<option value=\""+i+"\">"+i+"</option>");
		}
}

function getChild()
{
	for(i=1;i<=9;i++)
		{
		document.write("<option value=\""+i+"\">"+i+"</option>");
		}
}
function getInfant()
{
	for(i=1;i<=9;i++)
		{
		document.write("<option value=\""+i+"\">"+i+"</option>");
		}
}

function selectFieldValue(field,FClsType)
{
	var F;
	for(F=0;F<document.getElementById(field.id).length;F++)
		{
		if(document.getElementById(field.id).options[F].value.toUpperCase()==FClsType.toUpperCase())
			{
			document.getElementById(field.id).options[F].selected=true;
			break;
			}
		}
}
function selectFieldValueTo(field,FClsType)
{
	var F;	
	for(F=0;F<document.getElementById(field.id).length;F++)
		{
		if(document.getElementById(field.id).options[F].value.toUpperCase()==FClsType.toUpperCase())
			{
			document.getElementById(field.id).options[F].selected=true;
			break;
			}
		}
}

function sendSubScript(num)
{
if(emailCheck(document.getElementById("reqMail").value)!=true)
    {
        document.getElementById("reqMail").focus();
    }
	else
	{
		sendMail(document.getElementById("reqMail").value,num);
	}

}



function sendMail(emailID,num)
{
xHttp=GetXmlHttpObject();
if (xHttp==null) 
{
alert("Your browser does not support Ajax");
return;
}
if(num==1){var address="subscript.aspx";}
else {var address="../subscript.aspx";}
address=address+"?requiredMail="+emailID;
xHttp.onreadystatechange=function()
{
  if (xHttp.readyState==4)
    {
    if (xHttp.status==200)
        {
              document.getElementById("result").style.visibility="visible";
        }
    }
};

xHttp.open("GET",address,true);
xHttp.send(null); 
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}

catch (e)
{

try
{
xmlHttp=new  ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
