/*
Copyright (C) 2005 ipsr solutions Ltd. All rights reserved.
*/
function __loadlocations(arg)
			 {
				 
				//var _stateId = document.getElementById("uxStateId");
				var _dis = document.getElementById("drpaccomodation");
				//_stateId.value = _dis.options[_dis.selectedIndex].value;
				
				//alert(document.getElementById("uxDistrict").value);
				var _locations = document.getElementById("drpclass");
				var _length = locations.length;
				
				//alert(locations.length)
				var _mlength, _District;
				_District = document.getElementById("drpaccomodation");
				var _price = document.getElementById("drpprice");
				_price.options.length=0
				_price.options.add(new Option(" ----Select Price Range----","0"));
				
				_price.options.add(new Option("Any","any"));

				if (3 == (_District.options[_District.selectedIndex].value))
				{	
				_price.options.add(new Option("Rs.4000-5000","4000-5000"));
				_price.options.add(new Option("Rs.5000-8000","5000-8000" ));
				_price.options.add(new Option("Rs.8000-12000","8000-12000" ));
				_price.options.add(new Option("Rs.12000-20000","12000-20000" ));
				_price.options.add(new Option("Above Rs.20000","20001" ));
				}
				else
				{
				_price.options.add(new Option("Below Rs.500","499"));
				_price.options.add(new Option("Rs.500-1000","500-1000" ));
				_price.options.add(new Option("Rs.1000-2000","1000-2000" ));
				_price.options.add(new Option("Rs.2000-5000","2000-5000" ));
				_price.options.add(new Option("Rs.5000-10000","5000-10000" ));
				_price.options.add(new Option("Above Rs.10000","10001" ));
				}
				document.getElementById("drpclass").options.length = 0;
				document.getElementById("drpclass").options.add(new Option(" --- Class Of Accomodation ---","0"));
				document.getElementById("drpclass").options.add(new Option("Any","any"));
				for(_mlength=0; _mlength<_length-1;_mlength++) 
					
				{
					
					//alert(locations[_mlength][2]);
					if (locations[_mlength][2] == _District.options[_District.selectedIndex].value)
					 {
						document.getElementById("drpclass").options.add(new Option(locations[_mlength][1], locations[_mlength][0]));
					 }
				}
			}
			function __fillloc() {
				var _locId = document.getElementById("uxLocId");
				var _locations = document.getElementById("drpclass");
				_locId.value = _locations.options[_locations.selectedIndex].value;
				
			}
			function _fillprice(){
			var _price = document.getElementById("price");
				var _pricerange = document.getElementById("drpprice");
				_price.value = _pricerange.options[_pricerange.selectedIndex].value;
				alert(_price.value)
			
			}
			function check()
		{	
		var _locId = document.getElementById("location");
		if (_locId.options[_locId.selectedIndex].value==0)
		{
		alert("Please select Destination");
		return false;
		}
		var _typeacc = document.getElementById("drpaccomodation");
		if (_typeacc.options[_typeacc.selectedIndex].value==0)
		{
		alert("Please select Type of Accommodation ");
		return false;
		}
		
		var _class = document.getElementById("drpclass");
		var _price = document.getElementById("drpprice");
		if (_class.options[_class.selectedIndex].value==_price.options[_price.selectedIndex].value)
		{ 
		  if (_class.options[_class.selectedIndex].value==0)
			{
			alert("Please select  class of accomodation or price Range");
			return false;
			}
		}
			return true;
			}
			
			function checkpack()
		{	

			//alert(document.getElementById("packcat").value);
		var _cat = document.getElementById("packcat");
		if (_cat.options[_cat.selectedIndex].value==0)
		{
		alert("Please select Category");
		return false;
		}

			return true;
			}




	function checkmail()
		{	

			
	
		if (document.getElementById("txtname").value=="")
		{
		alert("Enter Name");
		return false;
		}

		if (document.getElementById("txtemail").value=="")
		{
		alert("Enter Emailid");
		return false;
		}
		
else
			{
	var eadd,s
	var whitespace="\t\n\r";
	eadd=document.getElementById("txtemail").value;
	s=document.getElementById("txtemail").value;
	if(isWhitespace(eadd))
	{
     alert("White space is not allowed");
     document.getElementById("txtemail").focus();
	 document.getElementById("txtemail").select();
	  return false;
	}


//there must be >=1 character before @,so we start looking at character position 1
   //ie,second character
     var i=1;
     var slength=eadd.length;
	 //look for @
	 while((i<slength)&&(s.charAt(i)!= "@"))
	 {
	  i++;
	  }
	  if((i>=slength) || (s.charAt(i)!="@"))
	  {
	  alert("Id has no @");
	 // document.forms[0].elements[0].focus();
	   document.getElementById("txtemail").select();
	  return false;
       }
	  else
	  i+=2;


	  //look for period
     while((i<slength) && (s.charAt(i)!="."))
	  {
	  i++;
	  }
	  //there must be at least one character after the period
	  if((i>=slength-1) || (s.charAt(i)!="."))
	  {
	  alert("Id has no period");
	  document.getElementById("txtemail").focus();
	  document.getElementById("txtemail").select();
	  return false;
	  }


	
	  }
	  return true





	
	}


			function video()
			{
				//if(document.getElementById("category")
			}

