var nigh4_Aswan = new Array();
var nigh4_Luxor = new Array();
var nigh6_Aswan = new Array();
var nigh6_Luxor = new Array();

var WeekDaysArray = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
/*
	var xmlDoc;
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch(e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch(e)
		{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	  }
	  
	xmlHttp.open("GET","/xml/cruisedates.xml",true);
	xmlHttp.onreadystatechange = readMyXML;
	xmlHttp.send(null);
	
	function readMyXML()
	{
	//alert(xmlHttp.readyState)
	 if(xmlHttp.readyState == 4)
	  {	  
	     xmlDoc=xmlHttp.responseXML;
	    readXML(xmlDoc.documentElement)
	  }
	}
	function readXML(tree)
		{		   		  
		   //alert(xmlDoc)
		    //if (tree==undefined)
		     //tree=xmlDoc.documentElement;
			 //alert(tree.hasChildNodes())
			 if(tree.hasChildNodes()) {
                //document.write('<ul><li>');
                //document.write('<b>'+tree.tagName+' : </b>');
                var nodes=tree.childNodes.length;
				//alert(tree.childNodes.length)
                for(var i=0; i<tree.childNodes.length; i++)
				{   					
				  if(tree.parentNode.tagName=="fournights" && tree.parentNode.parentNode.tagName=="aswan_philae")			
				  {
					nigh4_Aswan[nigh4_Aswan.length]=tree.text;	
					document.write("nigh4_Aswan["+nigh4_Aswan.length+"]='"+tree.text+"';<br>");
				  }
				else if(tree.parentNode.tagName=="sixnights" && tree.parentNode.parentNode.tagName=="aswan_philae")			
				  {
					nigh6_Aswan[nigh6_Aswan.length]=tree.text;	
					document.write("nigh6_Aswan["+nigh6_Aswan.length+"]='"+tree.text+"';<br>");
				  }
				else if(tree.parentNode.tagName=="fournights" && tree.parentNode.parentNode.tagName=="luxor_philae")			
				  {
					nigh4_Luxor[nigh4_Luxor.length]=tree.text;	
					document.write("nigh4_Luxor["+nigh4_Luxor.length+"]='"+tree.text+"';<br>");
				  }
				else if(tree.parentNode.tagName=="sixnights" && tree.parentNode.parentNode.tagName=="luxor_philae")			
				  {
					nigh6_Luxor[nigh6_Luxor.length]=tree.text;	
					document.write("nigh6_Luxor["+nigh6_Luxor.length+"]='"+tree.text+"';<br>");
				  } 				
				readXML(tree.childNodes[i]);						  
				
                //document.write('</li></ul>'+tree.parentNode.tagName+'---'+tree.parentNode.parentNode.tagName+'<br>');
			}
		}  
	
	}
*/


var GetUrl = document.location.pathname.split("/");
var  Folder_From_GetUrl = GetUrl[1];
var  File_From_GetUrl = GetUrl[2];
if(GetUrl[3] != "")
   SubFile_From_GetUrl = GetUrl[3];
   

if((Folder_From_GetUrl.match(/oberoi_Philae/gi) && File_From_GetUrl.match(/special_offers.asp/gi)) || (Folder_From_GetUrl.match(/oberoi_Philae/gi) && File_From_GetUrl.match(/special_offers/gi) && SubFile_From_GetUrl.match(/exotic_vacations_winter.asp/gi)))
{

							var OfferEndingDate = '20';
							var OfferEndingMonth = '3';
							var OfferEndingyear = '2011';
							for (var ik=0;ik<2;ik++)
							{
									var jj =1;	
									for (var i=0;i<jj;i++)
									{
									   var GetD = new Date();
									   GetD.setDate((i+37))
									   var Getyr = GetD.getFullYear();
									   var GetDy  = GetD.getDate();
									   var GetMon = GetD.getMonth();

										if (OfferEndingDate == GetDy && OfferEndingMonth == GetMon && OfferEndingyear == Getyr)
										  {
											 jj=0;
										  }	 
										   else
											  {		
														var GetDates = GetD.toDateString();
														var SplitDates = GetDates.split(" ");
														if (ik==0)
														   nigh4_Aswan[i] = SplitDates[2]+' '+SplitDates[1]+', '+SplitDates[3];
														else 
														   nigh6_Aswan[i] = SplitDates[2]+' '+SplitDates[1]+', '+SplitDates[3];	
														jj++;
											  } 
									}			 
							}

							for (var ik=0;ik<2;ik++)
							{
									var jj =1;	
									for (var i=0;i<jj;i++)
									{
									   var GetD = new Date();
									   GetD.setDate((i+37))
									   var Getyr = GetD.getFullYear();
									   var GetDy  = GetD.getDate();
									   var GetMon = GetD.getMonth();

										if (OfferEndingDate == GetDy && OfferEndingMonth == GetMon && OfferEndingyear == Getyr)
										  {
											 jj=0;
										  }	 
										   else
											  {		
														var GetDates = GetD.toDateString();
														var SplitDates = GetDates.split(" ");
														if (ik==0)
														   nigh4_Luxor[i] = SplitDates[2]+' '+SplitDates[1]+', '+SplitDates[3];
														else 
														   nigh6_Luxor[i] = SplitDates[2]+' '+SplitDates[1]+', '+SplitDates[3];	
														jj++;
											  } 
									}			 
							}

}
else
{
	nigh4_Aswan[1]='16 Jan, 2010';
	nigh4_Aswan[2]='26 Jan, 2010';
	nigh4_Aswan[3]='13 Feb, 2010';
	nigh4_Aswan[4]='23 Feb, 2010';
	nigh4_Aswan[5]='13 Mar, 2010';
	nigh4_Aswan[6]='23 Mar, 2010';
	nigh4_Aswan[7]='10 Apr, 2010';
	nigh4_Aswan[8]='20 Apr, 2010';
	nigh4_Aswan[9]='08 May, 2010';
	nigh4_Aswan[10]='18 May, 2010';
	//nigh4_Aswan[11]='05 Jun, 2010';
	//nigh4_Aswan[12]='15 Jun, 2010';
	nigh4_Aswan[13]='03 Jul, 2010';
	nigh4_Aswan[14]='13 Jul, 2010';
	nigh4_Aswan[15]='31 Jul, 2010';
	nigh4_Aswan[16]='10 Aug, 2010';
	nigh4_Aswan[17]='28 Aug, 2010';
	nigh4_Aswan[18]='07 Sept, 2010';
	nigh4_Aswan[19]='25 Sept, 2010';
	nigh4_Aswan[20]='05 Oct, 2010';
	nigh4_Aswan[21]='23 Oct, 2010';
	nigh4_Aswan[22]='02 Nov, 2010';
	nigh4_Aswan[23]='20 Nov, 2010';
	nigh4_Aswan[24]='30 Nov, 2010';
	nigh4_Aswan[25]='18 Dec, 2010';
	nigh4_Aswan[26]='28 Dec, 2010';
	nigh4_Aswan[27]='15 Jan, 2011';
	nigh4_Aswan[28]='25 Jan, 2011';
	nigh4_Aswan[29]='12 Feb, 2011';
	nigh4_Aswan[30]='22 Feb, 2011';
	nigh4_Aswan[31]='12 Mar, 2011';
	nigh4_Aswan[32]='22 Mar, 2011';
	nigh4_Aswan[33]='09 Apr, 2011';
	nigh4_Aswan[34]='19 Apr, 2011';
	nigh4_Aswan[35]='07 May, 2011';
	nigh4_Aswan[36]='17 May, 2011';
	nigh4_Aswan[37]='02 Jul, 2011';
	nigh4_Aswan[38]='12 Jul, 2011';
	nigh4_Aswan[39]='30 Jul, 2011';
	nigh4_Aswan[40]='09 Aug, 2011';
	nigh4_Aswan[41]='27 Aug, 2011';
	nigh4_Aswan[42]='06 Sept, 2011';
	nigh4_Aswan[43]='24 Sept, 2011';
	nigh4_Aswan[44]='04 Oct, 2011';
	nigh4_Aswan[45]='22 Oct, 2011';
//	nigh4_Aswan[46]='01 Nov, 2011';
//	nigh4_Aswan[47]='19 Nov, 2011';
//	nigh4_Aswan[48]='29 Nov, 2011';
//	nigh4_Aswan[49]='17 Dec, 2011';
//	nigh4_Aswan[50]='27 Dec, 2011';
	nigh6_Aswan[1]='06 Jan, 2010';
	nigh6_Aswan[2]='03 Feb, 2010';
	nigh6_Aswan[3]='03 Mar, 2010';
	nigh6_Aswan[4]='31 Mar, 2010';
	nigh6_Aswan[5]='28 Apr, 2010';
	nigh6_Aswan[6]='26 May, 2010';
	//nigh6_Aswan[7]='23 Jun, 2010';
	nigh6_Aswan[8]='21 Jul, 2010';
	nigh6_Aswan[9]='18 Aug, 2010';
	nigh6_Aswan[10]='15 Sept, 2010';
	nigh6_Aswan[11]='13 Oct, 2010';
	nigh6_Aswan[12]='10 Nov, 2010';
	nigh6_Aswan[13]='08 Dec, 2010';
	nigh6_Aswan[14]='05 Jan, 2011';
	nigh6_Aswan[15]='02 Feb, 2011';
	nigh6_Aswan[16]='02 Mar, 2011';
	nigh6_Aswan[17]='30 Mar, 2011';
	nigh6_Aswan[18]='27 Apr, 2011';
	nigh6_Aswan[19]='25 May, 2011';
	nigh6_Aswan[20]='20 Jul, 2011';
	nigh6_Aswan[21]='17 Aug, 2011';
	nigh6_Aswan[22]='14 Sept, 2011';
	nigh6_Aswan[23]='12 Oct, 2011';
	//nigh6_Aswan[24]='09 Nov, 2011';
//	nigh6_Aswan[25]='07 Dec, 2011';
	nigh4_Luxor[1]='02 Jan, 2010';
	nigh4_Luxor[2]='12 Jan, 2010';
	nigh4_Luxor[3]='30 Jan, 2010';
	nigh4_Luxor[4]='09 Feb, 2010';
	nigh4_Luxor[5]='27 Feb, 2010';
	nigh4_Luxor[6]='09 Mar, 2010';
	nigh4_Luxor[7]='27 Mar, 2010';
	nigh4_Luxor[8]='06 Apr, 2010';
	nigh4_Luxor[9]='24 Apr, 2010';
	nigh4_Luxor[10]='04 May, 2010';
	nigh4_Luxor[11]='22 May, 2010';
	//nigh4_Luxor[12]='01 Jun, 2010';
	//nigh4_Luxor[13]='19 Jun, 2010';
	//nigh4_Luxor[14]='29 Jun, 2010';
	nigh4_Luxor[15]='17 Jul, 2010';
	nigh4_Luxor[16]='27 Jul, 2010';
	nigh4_Luxor[17]='14 Aug, 2010';
	nigh4_Luxor[18]='24 Aug, 2010';
	nigh4_Luxor[19]='11 Sept, 2010';
	nigh4_Luxor[20]='21 Sept, 2010';
	nigh4_Luxor[21]='09 Oct, 2010';
	nigh4_Luxor[22]='19 Oct, 2010';
	nigh4_Luxor[23]='06 Nov, 2010';
	nigh4_Luxor[24]='16 Nov, 2010';
	nigh4_Luxor[25]='04 Dec, 2010';
	nigh4_Luxor[26]='14 Dec, 2010';
	nigh4_Luxor[27]='01 Jan, 2011';
	nigh4_Luxor[28]='11 Jan, 2011';
	nigh4_Luxor[29]='29 Jan, 2011';
	nigh4_Luxor[30]='08 Feb, 2011';
	nigh4_Luxor[31]='26 Feb, 2011';
	nigh4_Luxor[32]='08 Mar, 2011';
	nigh4_Luxor[33]='26 Mar, 2011';
	nigh4_Luxor[34]='05 Apr, 2011';
	nigh4_Luxor[35]='23 Apr, 2011';
	nigh4_Luxor[36]='03 May, 2011';
	nigh4_Luxor[37]='21 May, 2011';
	nigh4_Luxor[38]='16 Jul, 2011';
	nigh4_Luxor[39]='26 Jul, 2011';
	nigh4_Luxor[40]='13 Aug, 2011';
	nigh4_Luxor[41]='23 Aug, 2011';
	nigh4_Luxor[42]='10 Sept, 2011';
	nigh4_Luxor[43]='20 Sept, 2011';
	nigh4_Luxor[44]='08 Oct, 2011';
	nigh4_Luxor[45]='18 Oct, 2011';
	//nigh4_Luxor[46]='05 Nov, 2011';
//	nigh4_Luxor[47]='15 Nov, 2011';
//	nigh4_Luxor[48]='03 Dec, 2011';
//	nigh4_Luxor[49]='13 Dec, 2011';
//	nigh4_Luxor[50]='31 Dec, 2011';
	nigh6_Luxor[1]='20 Jan, 2010';
	nigh6_Luxor[2]='17 Feb, 2010';
	nigh6_Luxor[3]='17 Mar, 2010';
	nigh6_Luxor[4]='14 Apr, 2010';
	nigh6_Luxor[5]='12 May, 2010';
	//nigh6_Luxor[6]='09 Jun, 2010';
	nigh6_Luxor[7]='07 Jul, 2010';
	nigh6_Luxor[8]='04 Aug, 2010';
	nigh6_Luxor[9]='01 Sept, 2010';
	nigh6_Luxor[10]='29 Sept, 2010';
	nigh6_Luxor[11]='27 Oct, 2010';
	nigh6_Luxor[12]='24 Nov, 2010';
	nigh6_Luxor[13]='22 Dec, 2010';
	nigh6_Luxor[14]='19 Jan, 2011';
	nigh6_Luxor[15]='16 Feb, 2011';
	nigh6_Luxor[16]='16 Mar, 2011';
	nigh6_Luxor[17]='13 Apr, 2011';
	nigh6_Luxor[18]='11 May, 2011';
	nigh6_Luxor[19]='06 Jul, 2011';
	nigh6_Luxor[20]='03 Aug, 2011';
	nigh6_Luxor[21]='31 Aug, 2011';
	nigh6_Luxor[22]='28 Sept, 2011';
	nigh6_Luxor[23]='26 Oct, 2011';
	//nigh6_Luxor[24]='23 Nov, 2011';
//	nigh6_Luxor[25]='21 Dec, 2011';
}
	var offerenddate;
function AddCruiseDate()
{
	closeCalendarCruiseSail();
	if(document.getElementById('lcldt_offerenddate'))
	{
	  offerenddate=document.getElementById('lcldt_offerenddate').value;
	}
	else
	{
	  offerenddate=""
	}
	if(document.getElementById('lcldt_offerstartdate'))
	{
	  offerstartdate=document.getElementById('lcldt_offerstartdate').value;
	}
	else
	{
	  offerstartdate=new Date();
	}
	doc = document.frmReservCruise;
	nightsVal = doc.selNoOfNights.value;
	embarkationVal = doc.selEmbarkation.value;

	objErr_nights = document.getElementById("err_noofnights");
	objErr_Place_Embar = document.getElementById("err_Place_Embarkation");

	objErr_nights.style.display = "none"
	objErr_nights.innerHTML = "";
	objErr_Place_Embar.style.display = "none" 
	objErr_Place_Embar.innerHTML = "";

	docDatesobj = document.getElementById("selDateEmbar")
	doc.txtDateDisEmbarkation.value = "Date of disembarkation";

	for(i=docDatesobj.length-1;i>0;i--)
	{
		docDatesobj.options[i] = null;
	}

	if(rackratearr)
	{
		if(document.getElementById('hidrackrate') )
		{
			 if(embarkationVal == "ASWAN" && nightsVal == "FOUR NIGHTS")
			 {
				document.getElementById('hidrackrate').value=rackratearr['4A'];
			 }
			 else if(embarkationVal == "ASWAN" && nightsVal == "SIX NIGHTS")
			 {
			   document.getElementById('hidrackrate').value=rackratearr['6A'];
			 }
			 else if(embarkationVal == "LUXOR" && nightsVal == "SIX NIGHTS")
			 {
				document.getElementById('hidrackrate').value=rackratearr['6L'];
			 }
			 else if(embarkationVal == "LUXOR" && nightsVal == "FOUR NIGHTS")
			 { 
				document.getElementById('hidrackrate').value=rackratearr['4L'];
			 }
		}
    }
	
	if (offerenddate=="")
	{
			if(embarkationVal == "ASWAN" && nightsVal == "FOUR NIGHTS")
			{
				for(i=0;i<nigh4_Aswan.length;i++)
				{
					if(new Date(nigh4_Aswan[i]) >new Date())
					{
						tempval = new Date(nigh4_Aswan[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh4_Aswan[i]+", "+WeekDaysArray[new Date(nigh4_Aswan[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
			if(embarkationVal == "LUXOR" && nightsVal == "FOUR NIGHTS")
			{
				for(i=0;i<nigh4_Luxor.length;i++)
				{
					if(new Date(nigh4_Luxor[i]) >new Date())
					{
						tempval = new Date(nigh4_Luxor[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh4_Luxor[i]+", "+WeekDaysArray[new Date(nigh4_Luxor[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
			if(embarkationVal == "ASWAN" && nightsVal == "SIX NIGHTS")
			{
				for(i=0;i<nigh6_Aswan.length;i++)
				{
					if(new Date(nigh6_Aswan[i]) >new Date())
					{
						tempval = new Date(nigh6_Aswan[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh6_Aswan[i]+", "+WeekDaysArray[new Date(nigh6_Aswan[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
			if(embarkationVal == "LUXOR" && nightsVal == "SIX NIGHTS")
			{
				for(i=0;i<nigh6_Luxor.length;i++)
				{
					if(new Date(nigh6_Luxor[i]) >new Date())
					{
						tempval = new Date(nigh6_Luxor[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh6_Luxor[i]+", "+WeekDaysArray[new Date(nigh6_Luxor[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
	}
	
	else
	{
	  if(embarkationVal == "ASWAN" && nightsVal == "FOUR NIGHTS")
			{
				for(i=0;i<nigh4_Aswan.length;i++)
				{
					if(new Date(nigh4_Aswan[i]) >new Date() && new Date(nigh4_Aswan[i]) <= new Date(offerenddate) && new Date(nigh4_Aswan[i]) >= new Date(offerstartdate))
					{
						tempval = new Date(nigh4_Aswan[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh4_Aswan[i]+", "+WeekDaysArray[new Date(nigh4_Aswan[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
			if(embarkationVal == "LUXOR" && nightsVal == "FOUR NIGHTS")
			{
				for(i=0;i<nigh4_Luxor.length;i++)
				{
					if(new Date(nigh4_Luxor[i]) >new Date() && new Date(nigh4_Luxor[i]) <= new Date(offerenddate) && new Date(nigh4_Luxor[i]) >= new Date(offerstartdate))
					{
						tempval = new Date(nigh4_Luxor[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh4_Luxor[i]+", "+WeekDaysArray[new Date(nigh4_Luxor[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
			if(embarkationVal == "ASWAN" && nightsVal == "SIX NIGHTS")
			{
				for(i=0;i<nigh6_Aswan.length;i++)
				{
					if(new Date(nigh6_Aswan[i]) >new Date()  && new Date(nigh6_Aswan[i]) <= new Date(offerenddate) && new Date(nigh6_Aswan[i]) >= new Date(offerstartdate))
					{
						tempval = new Date(nigh6_Aswan[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh6_Aswan[i]+", "+WeekDaysArray[new Date(nigh6_Aswan[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
			if(embarkationVal == "LUXOR" && nightsVal == "SIX NIGHTS")
			{
				for(i=0;i<nigh6_Luxor.length;i++)
				{
					if(new Date(nigh6_Luxor[i]) >new Date()   && new Date(nigh6_Luxor[i]) <= new Date(offerenddate) && new Date(nigh6_Luxor[i]) >= new Date(offerstartdate))
					{
						tempval = new Date(nigh6_Luxor[i]).toDateString();
						tempval = tempval.substring(4);
						tempArr_val = tempval.split(" ");

						StoreOptionVal = tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];

						var optn = document.createElement("option")
						optn.text = nigh6_Luxor[i]+", "+WeekDaysArray[new Date(nigh6_Luxor[i]).getDay()]+"";
						optn.value = StoreOptionVal;
						docDatesobj.options.add(optn);		
					}
				}
			}
	  
	}
}

function getDisEmbaration(val)
{
	doc = document.frmReservCruise;
	var now_date = new Date(val);
	lclint_selDateEmbar=document.getElementById("selDateEmbar").value;
	if(val != "0" && val != "")
	{
		if(doc.selNoOfNights.value == "FOUR NIGHTS")
			now_date.setDate(now_date.getDate() + 4)
		else
			now_date.setDate(now_date.getDate() + 6)
		//alert(now_date);
		tempval = now_date.toDateString()
		tempval = tempval.substring(4)
		tempArr_val = tempval.split(" ");
		
		newdisembarkationday=tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2];
		newdisembarkationweekday=WeekDaysArray[new Date(tempArr_val[1] + " " + tempArr_val[0] + ", " + tempArr_val[2]).getDay()];
		document.frmReservCruise.txtDateDisEmbarkation.value = newdisembarkationday+", "+newdisembarkationweekday;	
	}
	else
		document.frmReservCruise.txtDateDisEmbarkation.value = "Date of disembarkation";

}

function doValidateCruiseRes()
{
	doc = document.frmReservCruise;
	objErr_nights = document.getElementById("err_noofnights");
	objErr_Place_Embar = document.getElementById("err_Place_Embarkation");
	objErr_DateEmbar = document.getElementById("err_Date_Embarkation");
	objErr_Pers = document.getElementById("err_Persons");
	objErr_Iata = document.getElementById("err_Iata");

	objErr_nights.style.display = "none";
	objErr_nights.innerHTML = "";
	objErr_Place_Embar.style.display = "none";
	objErr_Place_Embar.innerHTML = "";
	objErr_DateEmbar.style.display = "none";
	objErr_DateEmbar.innerHTML = "";
	objErr_Pers.style.display = "none";
	objErr_Pers.innerHTML = "";
	
	if(objErr_Iata)
	{
		objErr_Iata.style.display = "none";
		objErr_Iata.innerHTML = "";
	}

	flag_submit = true;

	if(doc.selNoOfNights.value == "0")
	{
		objErr_nights.style.display = "";
		objErr_nights.innerHTML = "Please select the number of nights";
		flag_submit = false;
	}
	if(doc.selEmbarkation.value == "0")
	{
		objErr_Place_Embar.style.display = "";
		objErr_Place_Embar.innerHTML = "Please select the place of embarkation";
		flag_submit = false;
	}
	if(doc.selDateEmbar.value == "0" || doc.selDateEmbar.value == "" || doc.selDateEmbar.value.length == 0 )
	{
		objErr_DateEmbar.style.display = "";
		objErr_DateEmbar.innerHTML = "<br>Please select the date of embarkation";
		flag_submit = false;
	}
	if(doc.selPersons.value == "0")
	{
		objErr_Pers.style.display = "";
		objErr_Pers.innerHTML = "Please select the number of persons";
		flag_submit = false;
	}
	if(doc.iatano)
	{
		if(doc.iatano.value.replace(/ /g,'') != "")
		{
			if(!isAlphaNumeric(doc.iatano.value))
			{
				objErr_Iata.style.display = "";
				objErr_Iata.innerHTML = "Please do not enter special characters in IATA No.";
				flag_submit = false;
			}
		}
	}
	if(flag_submit)
	{
		doc.method="post";
		doc.action="../../includes/Common_Reservation_cruise_phil_Ac.asp";

		doc.target="_new";
		doc.submit();
		doc.target="";
	}
}

function doValidateCruiseResOnBlur(thisObj)
{
	doc = document.frmReservCruise;
	objErr_nights = document.getElementById("err_noofnights");
	objErr_Place_Embar = document.getElementById("err_Place_Embarkation");
	objErr_DateEmbar = document.getElementById("err_Date_Embarkation");
	objErr_Pers = document.getElementById("err_Persons");
	objErr_Iata = document.getElementById("err_Iata");

	if(thisObj.id == "selNoOfNights")
	{
		if(doc.selNoOfNights.value == "0")
		{
			objErr_nights.style.display = "";
			objErr_nights.innerHTML = "Please select the number of nights";		
		}
		else
		{
			objErr_nights.style.display = "none";
			objErr_nights.innerHTML = "";
		}
	}
	if(thisObj.id == "selEmbarkation")
	{
		if(doc.selEmbarkation.value == "0")
		{
			objErr_Place_Embar.style.display = "";
			objErr_Place_Embar.innerHTML = "Please select the place of embarkation";			
		}
		else
		{
			objErr_Place_Embar.style.display = "none";
			objErr_Place_Embar.innerHTML = "";
		}
	}
	if(thisObj.id == "selDateEmbar")
	{
		if(doc.selDateEmbar.value == "0" || doc.selDateEmbar.value == "" || doc.selDateEmbar.value.length == 0)
		{
			objErr_DateEmbar.style.display = "";
			objErr_DateEmbar.innerHTML = "<br>Please select the date of embarkation";			
		}
		else
		{
			objErr_DateEmbar.style.display = "none";
			objErr_DateEmbar.innerHTML = "";
		}
	}
	if(thisObj.id == "selPersons")
	{
		if(doc.selPersons.value == "0")
		{
			objErr_Pers.style.display = "";
			objErr_Pers.innerHTML = "Please select the number of persons";
			
		}
		else
		{
			objErr_Pers.style.display = "none";
			objErr_Pers.innerHTML = "";
		}
	}
	if(thisObj.id == "iatano")
	{
		if(doc.iatano.value.replace(/ /g,'') != "")
		{
			if(!isAlphaNumeric(doc.iatano.value))
			{
				objErr_Iata.style.display = "";
				objErr_Iata.innerHTML = "Please do not enter special characters in IATA No.";				
			}
			else
			{
				objErr_Iata.style.display = "none";
				objErr_Iata.innerHTML = "";
			}
		}
		else
		{
			objErr_Iata.style.display = "none";
			objErr_Iata.innerHTML = "";
		}
	}	
}
