function tryValidateForm()
{
    debugger;
	var yes =1;
	country=escape(document.searchForm.cmbCountry.options[document.searchForm.cmbCountry.selectedIndex].value);
		city=escape(document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value);
		hotel=escape(document.searchForm.cmbHotel.options[document.searchForm.cmbHotel.selectedIndex].value);
		 cuisine=escape(document.searchForm.cmbCuisine.options[document.searchForm.cmbCuisine.selectedIndex].value);
		//alert(hotel);
		var htlid;
		htlid=hotel.split("-");
		var hotellink;
		hotellink=htlid[1];
		var hoteldupid;
		hoteldupid=htlid[0];
	if (document.searchForm.cmbCountry.selectedIndex==0)
	{
	
	alert ("Please Select a Country");
	document.searchForm.cmbCountry.focus();
	yes=0;
   
	}
	 else
     {
	if (document.searchForm.cmbCity.selectedIndex==0)
	{
		
		if (document.searchForm.cmbCountry.options[document.searchForm.cmbCountry.selectedIndex].value=='INDIA')
		{
		//alert("a");
		//alert ("Please select a City");
		//document.searchForm.cmbCity.focus();
		//yes=0;
		    var s = "select";
		    document.searchForm.action = "results.asp?country=" + country + "&city=" + city + "&hotel=" + s + "&cuisine=" + cuisine + "";
		    document.searchForm.submit();
		    yes = 0;
		}
		else if(document.searchForm.cmbCountry.options[document.searchForm.cmbCountry.selectedIndex].value=='MAURITIUS')
		{
		 window.open("../TajHotelFinder/mauritiuspopup.html","Theme","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=680,height=230,top=230,left=170");
		}
		
		else
		{
		    var s="select";
	        document.searchForm.action="results.asp?country="+country+"&city="+city+"&hotel="+s+"&cuisine="+cuisine+"";
			document.searchForm.submit();
			yes=0;
		}
	}
	else
	{  
	  if(document.searchForm.cmbHotel.options[document.searchForm.cmbHotel.selectedIndex].value=="select")
	  {
	   var hotelname = hotelcount(document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].text);
	    var st=new Array();
		   st=hotelname.split("|");
	    if(hotelname!="abc")
		{
		  
		  if(st[1]=="The Gateway Hotel Rawalkot Jaisalmer" || st[1]=="The Gateway Hotel Fatehabad Road Agra" || st[1]=="The Gateway Hotel Church Road Coonoor" || st[1]=="The Gateway Hotel Pasumalai Madurai" || st[1]=="The Gateway Hotel Residency Road Bangalore" || st[1]=="The Gateway Hotel Ramgarh Lodge Jaipur" || st[1]=="The Gateway Hotel Beach Road Calicut" || st[1]=="The Gateway Hotel Ambad Nashik" || st[1]=="The Gateway Hotel Beach Road Visakhapatnam" || st[1]=="The Gateway Hotel Old Port Road Mangalore" || st[1]=="The Gateway Hotel Akota Gardens Vadodara" || st[1]=="The Gateway Hotel Athwalines Surat" || st[1]=="The Gateway Hotel KM Road Chikmagalur" || st[1]=="The Gateway Hotel Ganges Varanasi" ||  st[1]=="The Gateway Hotel Ummed Ahmedabad" || st[1]=="The Gateway Hotel M G Road Vijayawada" || (st[1]=="The Gateway Hotel Janardhanapuram Varkala" && st[0]=="HLTTRVGR") ||(st[1]=="The Gateway Hotel Marine Drive Ernakulam" && st[0]=="HLTCOKTR") || st[1]=="The Gateway Hotel Jodhpur")
								
	  // if(city=="JAISALMER" || city=="AGRA" || city=="COONOOR" || city=="MADURAI" || city=="CALICUT" || city=="NASHIK" || city=="VISAKHAPATNAM" || city=="MANGALORE" || city=="VADODARA" || city=="SURAT" || city=="CHIKMAGALUR" || city=="VIJAYAWADA")
	       {
	       window.location.href="http://www.thegatewayhotels.com/index.htm?hotelId="+st[0].substring(2)+"&page=Dining";
	       yes=0;
	       }
	      
	      else if (country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="BANDHAVGARH NATIONAL PARK" )
		   {
			location.href= "../Leisure/Mahua%20Kothi,BANDHAVGARH%20NATIONAL%20PARK/dining.asp";
			yes=0;
		   }
		  else if (country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="PENCH NATIONAL PARK" ) 		
		   {
			location.href= "../Leisure/Baghvan%2CPENCH%20NATIONAL%20PARK/dining.asp";
			yes=0;
		   }
		  else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="KANHA NATIONAL PARK")
		  {
		    location.href="../Leisure/Banjaar Tola%2CKanha National Park/dining.asp";
		    yes=0;
		  }
		  else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="PANNA")
		  {
		   location.href="../Leisure/Pashan Garh (Panna National Park)%2CPANNA/dining.asp";
		   yes=0;
		  }
		
		   /*else if (country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="VIJAYAWADA" ) 		
		   {
			location.href= "../Business/The%20Gateway%20Hotel%20MG%20Road%20Vijayawada,VIJAYAWADA/dining.asp";
			yes=0;
		   }*/
		  //else if (unescape(country)=="UNITED STATES OF AMERICA" && unescape(city)=="NEW YORK" ) 
		   //{
			//window.open("../Luxury/The Pierre,New York/Restaurant_popup.htm","Theme","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=570,height=370,top=120,left=200");
			//yes=0;
		   //}
		   else if(country=="MAURITIUS" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="MAURITIUS")
		   {
		   window.open("../TajHotelFinder/mauritiuspopup.html","Theme","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=680,height=230,top=230,left=170");
		   }
		 
		  else
	       {
	        document.searchForm.action="results.asp?country="+country+"&city="+city+"&hotel="+st[2]+"&cuisine="+cuisine+"";
			document.searchForm.submit();
			yes=0;
	       }
	    }
	else
	    {
	        st[2]="select";
	        document.searchForm.action="results.asp?country="+country+"&city="+city+"&hotel="+st[2]+"&cuisine="+cuisine+"";
			document.searchForm.submit();
			yes=0;
	    }
     }
 }
    }	
	if (yes==1)
	{
	  	//country=escape(document.searchForm.cmbCountry.options[document.searchForm.cmbCountry.selectedIndex].value);
		//city=escape(document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value);
		//hotel=escape(document.searchForm.cmbHotel.options[document.searchForm.cmbHotel.selectedIndex].value);
		//alert(hotel);
		//var htlid;
		//htlid=hotel.split("-");
		//var hotellink;
		//hotellink=htlid[1];
		//var hoteldupid;
		//hoteldupid=htlid[0];
	   var htlname=document.searchForm.cmbHotel.options[document.searchForm.cmbHotel.selectedIndex].text;
	   var htlvalue=document.searchForm.cmbHotel.options[document.searchForm.cmbHotel.selectedIndex].value;
	   var htlarray=new Array();
	   htlarray = htlvalue.split('-');
	   if (htlarray[1] == "HLTHFLKU"/*Taj Falaknuma*/)
	   {
	       var falaknuma = window.open('../Common_PDF/Taj-Falaknuma-Factsheet.pdf', 'FalaknumaWindow1', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1');
	       return;
	   }
	   if(document.searchForm.cmbHotel.selectedIndex!=0)
	    {
	     if(htlname=="The Gateway Hotel Rawalkot Jaisalmer" || htlname=="The Gateway Hotel Fatehabad Road Agra" || htlname=="The Gateway Hotel Church Road Coonoor" || htlname=="The Gateway Hotel Pasumalai Madurai" || htlname=="The Gateway Hotel Residency Road Bangalore" || htlname=="The Gateway Hotel Ramgarh Lodge Jaipur" || htlname=="The Gateway Hotel Beach Road Calicut" || htlname=="The Gateway Hotel Ambad Nashik" || htlname=="The Gateway Hotel Beach Road Visakhapatnam" || htlname=="The Gateway Hotel Old Port Road Mangalore" || htlname=="The Gateway Hotel Akota Gardens Vadodara" || htlname=="The Gateway Hotel Ummed Ahmedabad" || htlname=="The Gateway Hotel Athwalines Surat" || htlname=="The Gateway Hotel KM Road Chikmagalur" || htlname=="The Gateway Hotel Ganges Varanasi" || htlname=="The Gateway Hotel M G Road Vijayawada" || (htlname=="The Gateway Hotel Janardhanapuram Varkala" && htlarray[1]=="HLTTRVGR") || (htlname=="The Gateway Hotel Marine Drive Ernakulam" && htlarray[1]=="HLTCOKTR") || htlname=="The Gateway Hotel Jodhpur")
            {
               window.location.href="http://www.thegatewayhotels.com/index.htm?hotelId="+hotellink.substring(2)+"&page=Dining";        
            }	 
		//}
		 else if(htlarray[0]=="H00032")
		 {
		  window.open("../TajHotelFinder/mauritiuspopup.html","Theme","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=680,height=230,top=230,left=170");
		 }
	     else
	       {
	        cuisine=escape(document.searchForm.cmbCuisine.options[document.searchForm.cmbCuisine.selectedIndex].value);
		
		   if ((country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="BANDHAVGARH NATIONAL PARK" && hoteldupid=="H00086") ||(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="BANDHAVGARH NATIONAL PARK" ))
		     {
			location.href= "../Leisure/Mahua%20Kothi,BANDHAVGARH%20NATIONAL%20PARK/dining.asp";
		     }
		   else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="KANHA NATIONAL PARK" && hoteldupid=="H00093")
	       {
	        location.href="../Leisure/Banjaar Tola%2CKanha National Park/dining.asp";
	        //popupwin.focus();
	       }
	       else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="BANGALORE" && hoteldupid=="H00097")
	       {
	        location.href="../TajGroup/Vivanta by Taj - Whitefield,BANGALORE/dining.htm";
	       }
	        else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="GOA" && hoteldupid=="H00100")
	       {
	        location.href="../TajGroup/Vivanta by Taj - Panaji,GOA/dining.htm";
	       }
	        else if(country=="MALDIVES" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="MALDIVES" && hoteldupid=="H00028")
	       {
	        location.href="../TajGroup/Vivanta-taj-maldives-coral-reef/dining.htm";
	       }
	       else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="PANNA" && hoteldupid=="H00094")
	       {
	        location.href="../Leisure/Pashan Garh (Panna National Park)%2CPANNA/dining.asp";
	       }
	      else if(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="VARANASI" && hoteldupid=="H00095")
		  {
		   window.open("../Palace/Nadesar Palace,Varanasi/NadesarPalaceBro.pdf");
		   yes=0;
		  }
		   else if ((country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="PENCH NATIONAL PARK" && hoteldupid=="H00087") ||(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="PENCH NATIONAL PARK" )) 		
		     {
			location.href= "../Leisure/Baghvan%2CPENCH%20NATIONAL%20PARK/dining.asp";
		     }
		   else if ((country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="VIJAYAWADA" && hoteldupid=="H00090") ||(country=="INDIA" && document.searchForm.cmbCity.options[document.searchForm.cmbCity.selectedIndex].value=="VIJAYAWADA" )) 		
		     {
			location.href= "../Business/The%20Gateway%20Hotel%20MG%20Road%20Vijayawada,VIJAYAWADA/dining.asp";
		     }
		   //else if ((unescape(country)=="UNITED STATES OF AMERICA" && unescape(city)=="NEW YORK" ) || (unescape(country)=="UNITED STATES OF AMERICA" && unescape(city)=="NEW YORK" && hoteldupid=="H00081" ))
		    // {
			//window.open("../Luxury/The Pierre,New York/Restaurant_popup.htm","Theme","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=570,height=370,top=120,left=200");
		     //}
		
		else if((unescape(country)=="UNITED ARAB EMIRATES" && unescape(city)=="DUBAI" && unescape(htlname)=="Taj Exotica Resort & Spa"))
		{
		window.open("../TajHotelFinder/Common_Inc/Taj Exotica Resort and Spa Dubai.pdf");
		}
		    else
		     {			
			document.searchForm.action="results.asp?country="+country+"&city="+city+"&hotel="+hoteldupid+"&cuisine="+cuisine+"";
			document.searchForm.submit();
		     }
		   }
		 }
	}
}

 
function loader()
{
document.searchForm.cmbCity.selectedIndex=0;
document.searchForm.cmbHotel.selectedIndex=0;
document.searchForm.cmbCuisine.selectedIndex=0;
document.searchForm.cmbCountry.selectedIndex=0;
}
