function validate1()
{
if ((document.GENERALSEARCH.CI.value == ""))
  { 
    alert("Kindly fill the City Name");
    document.GENERALSEARCH.CI.focus();
    return false;
  }
if ((document.GENERALSEARCH.DA.value == "0" ) && (document.GENERALSEARCH.MO.value == "0" ) && (document.GENERALSEARCH.YE.value == "0" ))
  { 
    alert("Kindly fill the Check-in Date");
    document.GENERALSEARCH.DA.focus();
    return false;
  }
if ((document.GENERALSEARCH.DA.value == "0" ) || (document.GENERALSEARCH.MO.value == "0" ) || (document.GENERALSEARCH.YE.value == "0" ))
  { 
    alert("Kindly fill the correct date for hotel search");
    return false;
  }
else
  return true;
}

function checkcityanddate1()
{
  
if ((document.HSEARCHFORM1.CI.value.length < 3 ) || (alphanumeric(document.HSEARCHFORM1.CI.value,document.HSEARCHFORM1.CI.value.length) == 1))
  { 
    alert("City name should have minimum three characters without blank spaces.");
    document.HSEARCHFORM1.CI.focus();
    return false;
  }
if ((document.HSEARCHFORM1.DA.value == 0) && (document.HSEARCHFORM1.MO.value == 0) && (document.HSEARCHFORM1.YE.value == 0))
  { 
    alert("Kindly select 'Check-in Date'");
    document.HSEARCHFORM1.DA.focus();
    return false;
  }

if ((document.HSEARCHFORM1.DA.value == 0) || (document.HSEARCHFORM1.MO.value == 0) || (document.HSEARCHFORM1.YE.value == 0))
  { 
    alert("'Check-in Date' seems to be invalid, Kindly check.");
    document.HSEARCHFORM1.DA.focus();
    return false;
  }
else
  return true;
}



function alphanumeric(str,txtLen)
{
	var ctr=0;
	var j=0;
	for(var i=0;i<txtLen;i++)
	{
		if (str.charAt(i)!=" ")
		{
			ctr=ctr+1;
		}
		else {
			j=j+1;
		}
	}  
	if (ctr==0)
	{
		return 1;
	}
	else if(j>=1)
	{
		return 2;
	}
}


