var x;
function rr(strID)
{
	//hoteltype
	//alert('hotelcount'+strID)
	//alert(eval('document.all.hotelcount'+strID+'.id'))
	arr=document.all.tags("input")
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].id.indexOf("hotelcount")!="-1")
		{
			arr[i].style.display="none"
		}
	}

	eval('document.all.hotelcount'+strID+'.style.display=""')
}

function ee(strID)
{	
	//strID=document.all.HotelID.value.replace('.','')
	//alert(strID)
	strID=x
	arr=document.all.tags("span")
	
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].id.indexOf("hoton")!="-1")
		{
			arr[i].style.display="none"
		}
	}
	
	eval('document.all.hoton'+strID+'.style.display=""')
}

function ss(strID)
{
	
	arr=document.all.tags("span")
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].HotelIDs.indexOf(strID)!='-1')
		{
			//arr[i].checked=false
			//arr[i].src="images/hotels_dayuse/check.gif"
			//alert(arr[i].src)
			arr[i].innerHTML=""
		}
		else
		{
			//arr[i].checked=true
			arr[i].innerHTML="<img src='images/hotels_dayuse/check.gif'>"			
		}
		
	}
	
	//eval('document.all.hoteloption'+strID+'.style.display=""')
	
}

function aa(strClassID)
{
	arr=document.all.tags("select")
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].name=='ClassHotels'+strClassID)
		{
			arr[i].style.display=""
		}
		else if(arr[i].name!='ClassHotels'+strClassID && arr[i].name.indexOf("ClassHotels")!='-1')
		{
			arr[i].style.display="none"
		}
	}
}


function ff(strCityID)
{
	document.all.defaultstat.style.display="none"
	arr=document.all.tags("span")
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].id.indexOf("CityHotels")!='-1')
		{
			arr[i].style.display="none"
		}
	}
	eval('document.all.CityHotels'+strCityID+'.style.display=""')
}



function fff()
  {
	if(Validate())
	{
		strOptions=document.all.classes.value+"#"+document.all.Bases.value+"#"+document.all.CheckInTime.value+"#"+document.all.CheckOutTime.value
		
		arrradio=document.all.tags("input")
		for(i=0;i< arrradio.length;i++)
		{
			if(arrradio[i].name=="HotelType" && arrradio[i].checked || arrradio[i].name=="OptionalFacilities" && arrradio[i].checked)
			{
				strOptions=strOptions + "#" + arrradio[i].value////////////
			}
		}
		
		
		strOptions="@@"+strOptions
		strOptions=strOptions.replace("@@#","")
		strOptions=strOptions.replace("@@","")
		
		document.all.AddUserForm.Options.value=strOptions//*******************
		
		strRoomTypeID=document.all.IroomType.value+"!!"
		strRoomTypeID=strRoomTypeID.replace("#!!","")////////////
		document.all.AddUserForm.RoomTypeID.value=strRoomTypeID//*******************
		
		strRoomDescriotionID=document.all.IroomDescriptionID.value+"!!"
		
		strRoomDescriotionID=strRoomDescriotionID.replace("#!!","")////////////
		document.all.AddUserForm.RoomDescriptionID.value=strRoomDescriotionID//*******************
		
		strRoomCount=""
		strRoomPrice=""
		
	/*Replace 4 by the number of Room types + 1*/
		for(i=1;i<4;i++)
		{	
		
			for(j=1;j<7;j++)
			{
				strRoomCount=strRoomCount + "#" + eval('document.all.Desc'+i+'_'+j+'.value')
				strRoomPrice=strRoomPrice + "#" + eval('document.all.Pric'+i+'_'+j+'.value')
			}
		}
		strRoomCount="!!"+strRoomCount
		
		strRoomCount=strRoomCount.replace("!!#","")/////////////////
		document.all.AddUserForm.RoomCount.value=strRoomCount//*******************
		
		strRoomPrice="!!"+strRoomPrice
		
		strRoomPrice=strRoomPrice.replace("!!#","")/////////////////
		document.all.AddUserForm.Price.value=strRoomPrice//*******************
		
		strAccomodationID=document.all.IAccomodationID.value+"!!"
		
		strAccomodationID=strAccomodationID.replace("#!!","")////////////
		document.all.AddUserForm.AccommodationID.value=strAccomodationID//*******************
		
		strAccomodationPrice=""

	/*Please modify the number 4 to be a variable to indicate the number of accomodations*/
		for(i=1;i<4;i++)
		{
			
			if(eval('document.all.AccoPrice'+i+'.value!=""'))
			{
				strAccomodationPrice=strAccomodationPrice + "#"+ eval('document.all.AccoPrice'+i+'.value')
			}
			else
			{
				strAccomodationPrice=strAccomodationPrice + "#0"
			}
			
		}
		
			
		strAccomodationPrice="!!"+strAccomodationPrice
		
		strAccomodationPrice=strAccomodationPrice.replace("!!#","")/////////////////
		document.all.AddUserForm.strAccomodationPrice.value=strAccomodationPrice//*******************
		
		
		if(Validation())
		{
			document.all.AddUserForm.submit()
		}
		else
		{
			return false;
		}
	}
  }
  
  
function Validation()
{
  if(document.all.VDescription.value==""|| document.all.VOptions.value=="" ||document.all.VRoomTypeID.value=="" || document.all.VRoomCount.value=="" || document.all.VAccommodationID.value=="" || document.all.VPrice.value=="" || document.all.VstrAccomodationPrice.value=="")
  {
	alert('Please enter all parameters')
	return false
  }
  else
  {
	return true
  }
}
  
  
function getNormalFormat()
{
	strServerVal=document.all.selecteddays.value
	arrstrServerVal=strServerVal.split(",")
	strlocVal=""
	
	for(i=0;i<arrstrServerVal.length;i++)
	{
		if(arrstrServerVal[i]=='1')
		{
			strlocVal+=","+(i+1)+","
		}
	}
	//alert(strlocVal)
	document.all.selecteddays.value=strlocVal
}  
  //////////////////////////////////////////////////////////////////////
  function getdate(strSingle,strMonthD)
  {
	getNormalFormat()
	Month=new Array()
	Month[1]="Jan"
	Month[2]="Feb"
	Month[3]="Mar"
	Month[4]="Apr"
	Month[5]="May"
	Month[6]="Jun"
	Month[7]="Jul"
	Month[8]="Aug"
	Month[9]="Sep"
	Month[10]="Oct"
	Month[11]="Nov"
	Month[12]="Dec"
	var secondTitle=""
	d = new Date();
	var emptyFlag=0;
	var cellNum=2;
	strSelectbox=new Array();
	str=""
	var Nmonth=0;
	oneDay=24*60*60*1000;
	
	/*
	initVal=1072908000000 + 18*oneDay
	initVal=d.getTime()
	*/
	
	initVal=document.all.initDate.value
	d.setTime(parseInt(initVal))
	newNum=d.getDate()
	newYear=d.getYear()
	SpacCounter=d.getDay()
		strSpace=""
		for(j=0;j<SpacCounter+1;j++)
		{
			strSpace=strSpace + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
		}
		
	firstTitle=Month[parseInt(d.getMonth()+1)]+" - "+ newYear
	newNum= "<span class='Year'>" + firstTitle +"</span><br><span class='WeekDays'><img src='/Reservation/images/CalDays.gif'/><br>"+strSpace+"</span>"//+newNum
	str=str + newNum
	strSelectbox[0]=firstTitle
	for (i=1;i<366;i++)
	{
		initVal=parseInt(initVal) + parseInt(oneDay)
		d.setTime(initVal)
		if(cellNum==3)
		{
			if(secondTitle=="")
			{
				secondTitle=Month[parseInt(d.getMonth()+1)]+" - "+ newYear
			}
		}
		SpacCounter=d.getDay()
		strSpace=""
		for(j=0;j<SpacCounter;j++)
		{
			strSpace=strSpace + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
		}
		newNum2=d.getDate()
		if(newNum2<10)
		{
			newNum2="0"+newNum2
		}
		if(document.all.selecteddays.value.indexOf(","+i+",")!='-1')
		{
			strColor="red"
			strAddRemove=0
			strUnd="underline"
		}
		else
		{
			strColor="341C04"
			strAddRemove=1
			strUnd="none"
		}
		newNum="<span AddOrRemove='"+ strAddRemove +"' class='days' style=';cursor:hand;color:"+strColor+";TEXT-DECORATION:"+ strUnd +"' dateInt='"+ i +"' dateDay='"+d.getDate()+"' dateMonth='"+d.getMonth()+"' dateYear='"+d.getYear()+"'  dateid='"+d.toLocaleString()+"' onclick='addDate("+strSingle+",this.dateInt,this.dateid,this,this.dateDay,this.dateMonth,this.dateYear)'>&nbsp;"+ newNum2 +"&nbsp; </span>"
		newYear=d.getYear()
		if(newNum2==1)
		{
			Nmonth++
			cellNum++
			if(strSingle!="1")
			{
				if(cellNum%3==0)
				{
					newNum= "</td></tr><tr><td name='TD"+j+"' style='display:none;MARGIN: 0px; BORDER-BOTTOM: #999966 thin solid;BORDER-LEFT: #999966 thin solid;BORDER-RIGHT: #999966 thin solid;BORDER-TOP: #999966 thin solid' bgcolor='white' width='25%' valign='top'><span class='Year'>" + Month[parseInt(d.getMonth()+1)]+" - "+ newYear +"</span><br><span class='WeekDays'><img src='/Reservation/images/CalDays.gif'/><br>"+ " " + strSpace +"</span>"+ newNum
				}
				else
				{
					newNum= "</td><td  name='TD"+j+"'  style='display:none;MARGIN: 0px; BORDER-BOTTOM: #999966 thin solid;BORDER-LEFT: #999966 thin solid;BORDER-RIGHT: #999966 thin solid;BORDER-TOP: #999966 thin solid' bgcolor='white' width='25%' valign='top'><span class='Year'>" + Month[parseInt(d.getMonth()+1)]+" - "+ newYear +"</span><br><span class='WeekDays'><img src='/Reservation/images/CalDays.gif'/><br>"+ " " + strSpace +"</span>"+ newNum
				}
			}
			else
			{
				newNum= "</td><td  name='TD"+j+"' style='display:none;MARGIN: 0px; BORDER-BOTTOM: #999966 thin solid;BORDER-LEFT: #999966 thin solid;BORDER-RIGHT: #999966 thin solid;BORDER-TOP: #999966 thin solid' bgcolor='white' width='25%' valign='top'><span class='Year'>" + Month[parseInt(d.getMonth()+1)]+" - "+ newYear +"</span><br><span class='WeekDays'><img src='/Reservation/images/CalDays.gif'/></span><br>"+ " " + strSpace + newNum
			}
			strSelectbox[Nmonth]=Month[parseInt(d.getMonth()+1)]+" - "+ newYear
		}
		str=str + newNum
	}
	if(strSingle=="1")
	{
		
		str="<table valign='top' cellpadding='6' cellspacing='8' border='0' WIDTH='230'><tr><td id='firstTD' dis='1' name='TD' style='display:none;MARGIN: 0px; BORDER-BOTTOM: #999966 thin solid;BORDER-LEFT: #999966 thin solid;BORDER-RIGHT: #999966 thin solid;BORDER-TOP: #999966 thin solid' bgcolor='white' width='25%' valign='top'>"+str+"</td></tr></table>"
	}
	else
	{
		str="<table valign='top' cellpadding='6' cellspacing='8' border='0' WIDTH='660'><tr><td id='firstTD' dis='1' name='TD' style='display:none;MARGIN: 0px; BORDER-BOTTOM: #999966 thin solid;BORDER-LEFT: #999966 thin solid;BORDER-RIGHT: #999966 thin solid;BORDER-TOP: #999966 thin solid' bgcolor='white' width='25%' valign='top'>"+str+"</td></tr></table>"
	}
	document.all.calend.innerHTML=str
	arr=document.all.tags("td")
	strSearch=strMonthD

	if(strMonthD=="")
	{	
		strSearch=firstTitle
	}
	for(n=0;n<arr.length;n++)
	{
		
		if(strSingle=='1')
		{
			
			
			if(arr[n].name && arr[n].name.indexOf("TD")!="-1" && arr[n].innerHTML.indexOf(strSearch)!="-1")
			{
				arr[n].style.display=""
//				alert(strSearch)
			}
			
		}
		else
		{
			arr[n].style.display=""
		}
	}
	strSelect="<select onchange='changeCal()' id='DateSel' style='width:90px'>"
	
	
	
	
	
	initVals=initVal
	if(d.getMonth()==0)
	{
		initVals=parseInt(initVals) + parseInt(oneDay)
	}
	d.setTime(parseInt(initVals+ oneDay))
	nStart=0
	if(d.getDate()==1)
	{
	nStart=1
		document.all.firstTD.style.display="none"
		if(strSingle=="1")
		{
			arr=document.all.tags("td")
			
			
			strSearch=secondTitle
			if(strMonthD!="")
			{
				strSearch=strMonthD
			}
			
			
			for(n=0;n<arr.length;n++)
			{
				if(strSingle=='1')
				{
					if(arr[n].name && arr[n].name.indexOf("TD")!="-1" && arr[n].innerHTML.indexOf(strSearch)!="-1")
					{
						arr[n].style.display=""
					}
				}
				else
				{
					arr[n].style.display=""
				}
			}
		}
	}
	for(n=nStart;n<strSelectbox.length;n++)
	{
		if(strSelectbox[n]==strMonthD)
		{
			strOptionSel="selected"
		}
		else
		{
			strOptionSel=""
		}
		strSelect=strSelect + "<option "+strOptionSel+" value='"+strSelectbox[n]+"'>"+strSelectbox[n]+"</option>"
	}
	strSelect=strSelect +"</select>"
	if(strSingle=="1")
	{
		document.all.selectTD.innerHTML=strSelect
	}
	
	
  }
  
  var strAllDates=""//document.all.selecteddays.value
  var AddRemove=1
  
  function AddOrRemove(num)
  {
	AddRemove=num
  }
  
  function addDate(strSingle,strInt,strT,obj,strDay,strMonth,strYear)
  {
  strI=document.all.strInput.value
  
  //alert(strI)
  if(strSingle=='1')
  {
	strMonth=parseInt(strMonth)+1
	eval('window.opener.'+strI+'ST.value=strDay+"/"+strMonth+"/"+strYear')
	eval('window.opener.'+strI+'Int.value=strInt')
	window.close()
  }
  
  
  strAllDates=document.all.selecteddays.value
  //strAllDates=strAllDates.replace("$,","").replace(",$","")
	//if(AddRemove==1)
	if(obj.AddOrRemove==1)
	{
		if(strAllDates.indexOf("," + strInt + ",")==-1)
		{
			strAllDates=strAllDates + "," + strInt + ","
			obj.style.color="red"
			document.all.selecteddays.value=strAllDates
			obj.AddOrRemove=0
			obj.style.textDecoration ="underline"
		}
	}
	else
	{
		if(strAllDates.indexOf("," + strInt + ",")!=-1)
		{
			strAllDates=strAllDates .replace("," + strInt + ",","")
			obj.style.color="341C04"
			document.all.selecteddays.value=strAllDates
			obj.AddOrRemove=1
			obj.style.textDecoration ="none"
			

		}
	}
  }
  
  function fillDaysInp()
  {
	if(document.all.selecteddays.value!="")
	{
		rawData=document.all.selecteddays.value
		strOnesZeros=""
		for(i=1;i<366;i++)
		{
			if(rawData.indexOf(','+i+',')!='-1')
			{
				strOnesZeros=strOnesZeros + ",1"
			}
			else
			{
				strOnesZeros=strOnesZeros + ",0"
			}
		}
		strOnesZeros="$"+strOnesZeros
		strOnesZeros=strOnesZeros.replace("$,","")
		//alert(strOnesZeros)
		document.all.Days.value=strOnesZeros
		//document.all.Days.value=document.all.selecteddays.value
	}
  }
  
  function GetCheckInOutDate(target,n,strD)
  {
	str2=parseInt(strD)+ 24*60*60*1000*n
	strD2=new Date()
	strD2.setTime(str2)	
	strr=strD2.getDate() +"/"+ parseInt(strD2.getMonth()+1) +"/"+ strD2.getYear()
	eval('document.all.'+target+'.innerHTML=strr')
  }
 function GetCheckInOutDateValue(target,n,strD)
  {
	str2=parseInt(strD)+ 24*60*60*1000*n
	strD2=new Date()
	strD2.setTime(str2)	
	strr=strD2.getDate() +"/"+ parseInt(strD2.getMonth()+1) +"/"+ strD2.getYear()
	eval('document.all.'+target+'.value=strr')
  }

function GetCheckOutDateValue(n,strD)
  {
	str2=parseInt(strD)+ 24*60*60*1000*n
	strD2=new Date()
	strD2.setTime(str2)	
	strr=strD2.getDate() +"/"+ parseInt(strD2.getMonth()+1) +"/"+ strD2.getYear()
	
return strr
  }

  
  function DisAccom(strID,strPos)
  {
	//alert(strID)
	
	//alert(eval('document.all.AccoPrice'+strPos+''))
	if(eval('document.all.Check'+strPos+'.checked'))
	{
		eval('document.all.AccoPrice'+strPos+'.disabled=false')
	}
	else
	{
		eval('document.all.AccoPrice'+strPos+'.disabled=true')
		eval('document.all.AccoPrice'+strPos+'.value=""')
	}
  }
  
  function ResForm()
  {
	
	if(Validate())
	{
		strRoomTypes=""		
		strRoomDesc=""
		strRoomCounts=""
		arr=document.all.tags("input")
		for(i=0;i<arr.length;i++)
		{
			if(arr[i].name=="Rcount" && arr[i].value!="")
			{
				strRoomTypes=strRoomTypes +","+ arr[i].RT
				strRoomDesc=strRoomDesc +","+ arr[i].RD
				strRoomCounts=strRoomCounts+","+arr[i].value
			}
		}
		strRoomTypes="$$" + strRoomTypes
		strRoomDesc="$$" + strRoomDesc
		strRoomCounts="$$" + strRoomCounts
		strRoomTypes=strRoomTypes.replace("$$,","")
		strRoomDesc=strRoomDesc.replace("$$,","")
		strRoomCounts=strRoomCounts.replace("$$,","")
		strRoomCounts=strRoomCounts.replace("$$","")
		document.all.RoomTypeID.value=strRoomTypes
		document.all.RoomDesc.value=strRoomDesc
		document.all.RoomCount.value=strRoomCounts
		if(strRoomCounts=="")
		{
			alert("Please specify the number of rooms you need to reserve")
			return false
		}
		document.all.SubForm.submit()
	}
  }
  
  function changeCal()
  {
	str=document.all.DateSel.value
	getdate('1',str)
  }
  
  
  function RemoveSupplement()
  {
	strSelected=document.all.Bases.value
	arr=document.all.tags("input")
	arrTR=document.all.tags("tr")
	
	
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].id.indexOf("Check")!=-1)
		{	
			arr[i].checked=true
			if(arr[i].Bases.indexOf(","+strSelected+",")!=-1)
			{
				arr[i].checked=false
			}
		}
	}
	
	for(j=0;j<arrTR.length;j++)
	{
		if(arrTR[j].Bases)
		{
			arrTR[j].style.display=""
			if(arrTR[j].Bases.indexOf(","+strSelected+",")!=-1)
			{	
				arrTR[j].style.display="none"
			}
			else
			{
				arrTR[j].style.display=""
			}
		}
	}
	
	
	for(j=0;j<arr.length;j++)
	{
		if(arr[j].Bases)
		{
			arr[j].style.display=""
			if(arr[j].Bases.indexOf(","+strSelected+",")!=-1)
			{	
				if( arr[j].value=="")
				{
					arr[j].value="0"
				}
			}
			else
			{
				if(arr[j].value=="0")
				{
					arr[j].value=""
				}
			}
		}
	}
	
	
	
  }
  
  function arrangeIDs(strCounter)
  {
	/*Please replace 4 with the count of types + 1*/
	var strTypes=""
	var strDescs=""
	var strCounts=""
	
	arr=document.all.tags("input")
	arrchecked=0
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].type=="checkbox" && arr[i].checked)
		{
			arrchecked++
		}
	}
	if(arrchecked==0)
	{
		alert("Please Accept at least one selection to book")
		return false;
	}
	
	for(i=1;i<4;i++)
	{
	/*Please replace 4 with the count of descriptions + 1*/
	
		for(j=1;j<strCounter;j++)
		{
			if(eval('document.all.Check_'+i+'_'+j+'.checked'))
			{
				strTypes=strTypes+","+eval('document.all.Check_'+i+'_'+j+'.actType')
				strDescs=strDescs+","+eval('document.all.Check_'+i+'_'+j+'.actDesc')
				strCounts=strCounts+","+eval('document.all.Check_'+i+'_'+j+'.LocCount')
			}
		}	
	}
	document.all.Types.value=strTypes
	document.all.Descs.value=strDescs
	document.all.Counts.value=strCounts
	document.all.confirm.submit()
  }
  
  function CruseOptions(strPage)
  {
	arr=document.all.tags("input")
	arr2=document.all.tags("span")
	arr3=document.all.tags("tr")
	
	
	
	if(strPage=='2')
	{
		if(document.all.HotelOptions.value.indexOf('02BE186DDCC8D5EF01E1EC86D703E0A8')!=-1 || document.all.HotelOptions.value.indexOf('02BE186DDCC8D5EF01E1EC86D703E0A9')!=-1)
		{
			for(j=0;j<arr2.length;j++)
			{
				if(arr2[j].name=='nosail')
				{						
					arr2[j].style.display="none"
				}
				if(arr2[j].name=='issail')
				{
					arr2[j].style.display=""
				}
			}
		}
		else
		{
			for(n1=0;n1<arr2.length;n1++)
			{
				if(arr2[n1].name=='nosail')
				{						
					arr2[n1].style.display=""
				}
				if(arr2[n1].name=='issail')
				{
					arr2[n1].style.display="none"
				}
			}
		}
	}
	else
	{
		for(i=0;i<arr.length;i++)
		{
			if(arr[i].checked)
			{
				if(arr[i].sail=='1')
				{
					for(j=0;j<arr2.length;j++)
					{
						if(arr2[j].name=='nosail')
						{						
							arr2[j].style.display="none"
						}
						if(arr2[j].name=='issail')
						{
							arr2[j].style.display=""
						}
					}
					
					
					
					for(k=0;k<arr3.length;k++)
					{
						
						if(arr3[k].name=='nosail')
						{	
							arr3[k].style.display="none"
						}
						if(arr3[k].name=='issail')
						{
							arr3[k].style.display=""
						}
					}
					
					if(strPage!='pageload')
					{
						for(k=0;k<arr.length;k++)
						{
							if(arr[k].name2=='nosail')
							{	
								arr[k].value="1"
							}
							if(arr[k].name2=='issail')
							{
								arr[k].value=""
							}
						}
					}
					
					
					
					
					
				}
				if(arr[i].sail=='0')
				{
					for(n1=0;n1<arr2.length;n1++)
					{
						if(arr2[n1].name=='nosail')
						{						
							arr2[n1].style.display=""
						}
						if(arr2[n1].name=='issail')
						{
							arr2[n1].style.display="none"
						}
					}
					
					
					for(n3=0;n3<arr3.length;n3++)
					{
						if(arr3[n3].name=='nosail')
						{						
							arr3[n3].style.display=""
						}
						if(arr3[n3].name=='issail')
						{
							arr3[n3].style.display="none"
						}
					}
					
					/*if(strPage!='pageload')
					{*/
						for(n3=0;n3<arr.length;n3++)
						{
							if(arr[n3].name2=='nosail' && strPage!='pageload')
							{						
								arr[n3].value=""
							}
							if(arr[n3].name2=='issail')
							{
								arr[n3].value="1"
							}
						}
					//}
				}
			}
		}
	}	
  }
  
function Validate(strfrm)
{
	
	var strContainer
	
	if(!strfrm)
	{
		strContainer="all"
	}
	else
	{
		strContainer=strfrm
	}
	
	
	arr=eval('document.'+strContainer+'.tags("input")')
	arrTA=eval('document.'+strContainer+'.tags("textarea")')
	arrST=eval('document.'+strContainer+'.tags("select")')
	
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].valstr)
		{
			if(arr[i].valstr.indexOf('empty')!=-1)
			{
				if(arr[i].value=='')
				{
					alert(arr[i].emptystr.replace("Update",""))
					arr[i].focus()
					return false;
				}
			}
			if(arr[i].valstr.indexOf('numeric')!=-1)
			{
				if(isNaN(arr[i].value))
				{
					alert(arr[i].NANstr.replace("Update",""))
					arr[i].focus()
					return false;
				}
			}
		}
	}
	
	
	
	
	for(i=0;i<arrTA.length;i++)
	{
		if(arrTA[i].valstr)
		{
			if(arrTA[i].valstr.indexOf('empty')!=-1)
			{
				if(arrTA[i].value.replace(" ","")=='')
				{
					alert(arrTA[i].emptystr.replace("Update",""))
					arrTA[i].focus()
					return false;
				}
			}
		}
	}
	
	
	for(i=0;i<arrST.length;i++)
	{
		if(arrST[i].valstr)
		{
			if(arrST[i].valstr.indexOf('empty')!=-1)
			{
				if(arrST[i].value.replace(" ","")=='')
				{
					alert(arrST[i].emptystr.replace("Update",""))
					arrST[i].focus()
					return false;
				}
			}
		}
	}
	
	
				
	return true;
}

function ListImgFrmSubmit()
{
	
	arr=document.all.tags("input")
	var numChecked
	numChecked=0
	
	for(i=0;i<arr.length;i++)
	{
		if(arr[i].checked)
		{
			numChecked++
			
		}
		
	}
	
	
	
	if(numChecked==0)
	{
		alert("Please Select an image to be set as the over view one")
		return false;
	}
	else
	{
		document.all.ListImgFrm.submit()
	}
}

function checkTimeOrder(strCal2ID,strCal1ID)
{

	if(eval('document.all.'+strCal2ID+'.value')!="")
	{
	
		if(eval('document.all.'+strCal1ID+'.value')=="")
		{
			alert("Please enter Check-in date first")
			eval('document.all.'+strCal2ID+'.value=""')
			eval('document.all.'+strCal2ID.replace("Int","ST")+'.value=""')
		}
	
		else if(parseInt(eval('document.all.'+strCal2ID+'.value')) < parseInt(eval('document.all.'+strCal1ID+'.value')))
		{
			alert("Check-out date can't be before that of Check-in")
			eval('document.all.'+strCal2ID+'.value=""')
			eval('document.all.'+strCal2ID.replace("Int","ST")+'.value=""')
		}
	}
}

function submitfrm1()
{
	if(Validate('frm2'))
	{
		document.all.frm2.submit()
	}
}



 function SbForm()
  {
document.all.SubForm.submit()
  }
  
function checkDateOrder(strCal2ID,strCal1ID)
{

	if(eval('document.all.'+strCal2ID+'.value')!="")
	{
	
		if(eval('document.all.'+strCal1ID+'.value')=="")
		{
			alert("Please enter Depart Date first")
			eval('document.all.'+strCal2ID+'.value=""')
			eval('document.all.'+strCal2ID.replace("Int","ST")+'.value=""')
		}
	
		else if(parseInt(eval('document.all.'+strCal2ID+'.value')) < parseInt(eval('document.all.'+strCal1ID+'.value')))
		{
			alert("Return Date can't be before that of Depart Date")
			eval('document.all.'+strCal2ID+'.value=""')
			eval('document.all.'+strCal2ID.replace("Int","ST")+'.value=""')
		}
	}
}

 function GetCheckInOutDateSTR(target,n,strD)
  {
	str2=parseInt(strD)+ 24*60*60*1000*n
	strD2=new Date()
	strD2.setTime(str2)	
	strr=strD2.getDate() +"/"+ parseInt(strD2.getMonth()+1) +"/"+ strD2.getYear()
	eval('document.all.'+target+'.innerHTML=strr')
  }



function validationForm()
  {	
		
		if(Validations())
		{
			document.all.FlightForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function Validations()
{
	if(document.all.departairportST.value=="")
		{
			alert('Please Enter Departure Airport')
			return false
		}
	  else
	if (document.all.arrivalairportST.value=="")
 	 {
		alert('Please Enter Arrival Airport')
		return false
  	}
 	 else
	if (document.all.departdateST.value=="")
  	{
	alert('Please Enter Depart Date')
	return false
 	 }
 	 else
	if (document.all.returndateST.value=="")
	  {
		alert('Please Enter Return Date')
		return false
 	 }
 	 else	
	
	
 	 {
	return true
 	 }

}


function validationFormPK()
  {	
		
		if(ValidationsPK())
		{
			document.all.PackageForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsPK()
{
	if(document.all.departairportpkST.value=="")
		{
			alert('Please Enter Departure Airport')
			return false
		}
	  else
	if (document.all.arrivalairportpkST.value=="")
 	 {
		alert('Please Enter Arrival Airport')
		return false
  	}
 	 else
	if (document.all.departdatepkST.value=="")
  	{
	alert('Please Enter Depart Date')
	return false
 	 }
 	 else
	if (document.all.returndatepkST.value=="")
	  {
		alert('Please Enter Return Date')
		return false
 	 }
 	 else	
	
	
 	 {
	return true
 	 }

}

function validationFormUmrah()
  {	
		
		if(ValidationsUM())
		{
			document.all.umrahForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsUM()
{
	if(document.all.TotalNightsST.value=="")
		{
			alert('Please Enter Package Period')
			return false
		}
	  else
	if (document.all.umrahclassST.value=="")
 	 {
		alert('Please Enter Package Class')
		return false
  	}
 	 else
	if(document.all.departairportumST.value=="")
		{
			alert('Please Enter Departure Airport')
			return false
		}
	  else
	if (document.all.arrivalairportumrahST.value=="")
 	 {
		alert('Please Enter Arrival Airport')
		return false
  	}
 	 else
	if (document.all.departdateST.value=="")
  	{
	alert('Please Enter Depart Date')
	return false
 	 }
 	 else
	
	
 	 {
	return true
 	 }

}

function validationFormFamily()
  {	
		
		if(ValidationsFM())
		{
			document.all.Familyform.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsFM()
{
	if(document.all.ResortST.value=="")
		{
			alert('Please Select Resort Name')
			return false
		}
	  else
	if (document.all.VacMonthST.value=="")
 	 {
		alert('Please Select Month')
		return false
  	}
 	 else
	if(document.all.UTypeST.value=="")
		{
			alert('Please Select Unit Type')
			return false
		}
	  
 	 else
	
	
 	 {
	return true
 	 }

}

function validationFormSOFFERS()
  {	
		
		if(ValidationsSOFFERS())
		{
			document.all.SOffersForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsSOFFERS()
{
	if(document.all.departdatesoST.value=="")
		{
			alert('Please Enter Check-in Date')
			return false
		}
	  
 	 else
	
	
 	 {
	return true
 	 }

}

function validationFormMain()
  {	
		
		if(ValidationsMain())
		{
			document.all.Mainnfrm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsMain()
{
	if(document.all.hotelST.value=="")
		{
			alert('Please Select Type')
			return false
		}
	  
 	 else
	
	
 	 {
	return true
 	 }

}

function requirementsForm()
  {	
		
		if(requirements())
		{
			document.all.requirementsFM.submit()
		}
		else
		{
			return false;
		}
  }
  
function requirements()
{
	if(document.all.nameST.value=="")
		{
			alert('Please Enter Full Name')
			return false
		}
	  else
	if (document.all.companyNameST.value=="")
 	 {
		alert('Please Enter Company Name')
		return false
  	}
 	 
 	 else
if(document.all.telST.value=="")
		{
			alert('Please Enter Tel No.')
			return false
		}
	  else
	if (document.all.faxST.value=="")
 	 {
		alert('Please Enter Fax No.')
		return false
  	}
 	 
 	 else		
	if (document.all.emailST.value=="")
 	 {
		alert('Please Enter Email Address')
		return false
  	}
 	 
 	 else
if(document.all.destinationST.value=="")
		{
			alert('Please Enter Destination')
			return false
		}
	  else
	
	if (document.all.arrivalDateST.value=="")
 	 {
		alert('Please Enter Arrival Date')
		return false
  	}
 	else
 if(document.all.nationalityST.value=="")
		{
			alert('Please Enter Nationality')
			return false
		}
	  
	  else
 if(document.all.numNightsST.value=="")
		{
			alert('Please Enter No. OF Nights')
			return false
		}
	  
	  else
 if(document.all.cfmEmailST.value=="")
		{
			alert('Please Confirm Your Email')
			return false
		}
	  
	  else
 	 {
	return true
 	 }

}

function ContactUsVALID()
  {	
		
		if(ContactUs())
		{
			document.all.ContactUsForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ContactUs()
{
	if(document.all.firstnameST.value=="")
		{
			alert('Please Enter First Name')
			return false
		}
	  else
	if (document.all.lastnameST.value=="")
 	 {
		alert('Please Enter Last Name')
		return false
  	}
 	 
 	 else
        if(document.all.AddressST.value=="")
		{
			alert('Please Enter Address')
			return false
		}
	  else
	if (document.all.emailST.value=="")
 	 {
		alert('Please Enter email.')
		return false
  	}	
	else
	if (document.all.Telephone.value=="")
 	 {
		alert('Please Enter Telephone Number.')
		return false
  	}

 	 else
 	
 	 {
	return true
 	 }

}


function CreateAccountFormVALID()
  {	
		
		if(CreateAccountVALID())
		{
			document.all.CreateAccountForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function CreateAccountVALID()
  {
	if(document.all.frst_nameST.value=="")
		{
			alert('Please Enter First Name')
			return false
		}
	  else
if(document.all.last_nameST.value=="")
		{
			alert('Please Enter Last Name')
			return false
		}
	  else
if(document.all.AddressST.value=="")
		{
			alert('Please Enter Address')
			return false
		}
	  else
if(document.all.pers_ctryST.value=="")
		{
			alert('Please Select Country')
			return false
		}
	  else
if(document.all.LoginNameST.value=="")
		{
			alert('Please Enter Login Name')
			return false
		}
	  else
if(document.all.es_passwdST.value=="")
		{
			alert('Please Enter Password')
			return false
		}
	  else
if(document.all.Confirm_passwdST.value=="")
		{
			alert('Please Confirm Your Password')
			return false
		}
	  else
if(document.all.email_addrST.value=="")
		{
			alert('Please Enter email Address')
			return false
		}
	  else
if(document.all.email_addr_confirmST.value=="")
		{
			alert('Please Confirm Your email Address')
			return false
		}
	/*  else
	  if(document.all.sndsmsST.value=="ON" && document.all.MobileNoST.value==""){
	alert('Please type your Mobile ')
			return false
	  }*/
	  else

 	 {
	return true
 	 }

}
function ValidateSendingSMS()
{
		if(document.MobileNoST.value=="")
		{
			alert('Please type your Mobile ')
			return false
		}else 
		{
	return true
 	 }
}


function validationTransferForm()
  {	
		
		if(ValidationsTransfer())
		{
			document.all.TransferForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsTransfer()
{
	if(document.all.TransferDestinationST.value=="")
		{
			alert('Please Select Destination')
			return false
		}
	  
 	 else
	if(document.all.CarTypeST.value=="")
		{
			alert('Please Select Transfer Type')
			return false
		}
	  
 	 else
	
 	 {
	return true
 	 }

}

function validationFlightFormOW()
  {	
		
		if(ValidationsflightOW())
		{
			document.all.FlightFormOW.submit()
		}
		else
		{
			return false;
		}
  }
  
function ValidationsflightOW()
{
	if(document.all.departairportowST.value=="")
		{
			alert('Please Enter Departure Airport')
			return false
		}
	  else
	if (document.all.arrivalairportowST.value=="")
 	 {
		alert('Please Enter Arrival Airport')
		return false
  	}
 	 else
	if (document.all.departdateowST.value=="")
  	{
	alert('Please Enter Depart Date')
	return false
 	 }
 	 else	
	
	
 	 {
	return true
 	 }

}



function ResarveHotelFormVALID()
  {	
		
		if(ResarveHotelVALID())
		{
			document.all.ResarveHotelForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function ResarveHotelVALID()
  {if(document.all.CheckinST.value=="")
		{
			alert('Please Enter Check-In Date')
			return false
		}
	  else
if(document.all.CheckoutST.value=="")
		{
			alert('Please Enter Check-out Date')
			return false
		}
	 

	  else

	
 	 {
	return true
 	 }

}


function BookForm()
  {	
		
		if(BookFormValid())
		{
			document.all.HotelBooKForm.submit()

		}
		else
		{
			return false;
		}
  }
  
function BookFormValid()
{
	if(!document.all.AGREE.checked)
		{
			alert('Please Agree to the rules and restrictions first')
			return false
		}
	  else	
	
 	 {
return true
 	 }

}


function mailListFormVALID()
  {	
		
		if(mailListVALID())
		{
			document.all.mailListForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function mailListVALID()
  {if(document.all.mail.value=="")
		{
			alert('Please Enter Your E-Mail')
			return false
		}
	  else
	
 	 {
	return true
 	 }

}


function LimoTransferForm()
  {	
		
		if(LimoTransferVALID())
		{
			document.all.LimoForm.submit()
		}
		else
		{
			return false;
		}
  }
  
function LimoTransferVALID()
  {
  if(document.all.departdate.value=="")
		{alert('Please Enter Depart Date')
			return false
		}
	  else	
 	   if(document.all.returndate.value=="")
		{alert('Please Enter Return Date')
			return false
		}
	  else{
	return true
 	 }

}
