function resize(h) {
	
            document.getElementById("content_ifr").style.height=h+35+"px";

}


function CheckDate(objyear,objmonth, objday)
{

var txtYear=document.getElementById(objyear)
var txtDay=document.getElementById(objday)
var txtMonth=document.getElementById(objmonth)


   if(Page_ClientValidate()==true)
   {
        var szDay=txtDay.value;
        var szMonth=txtMonth.value
        var szYear=txtYear.value;
        if(szDay == 0 || szMonth == 0 || szYear == 0)
        {
            alert("Please Enter a Date!!");
            txtMonth.focus();
            return false;
        }
        var day = parseInt(szDay);
        var month = parseInt(szMonth) - 1;
        var year = parseInt(szYear);
	      dteDate=new Date(year,month,day);
	      var datevalid = ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()));
	      if(!datevalid) 
          {
          alert("Invalid Date!");
          txtMonth.focus();
          return false;
          }
          else
          {
//             var PastYearDate=new Date();
//             var Pastyear = PastYearDate.getFullYear() - 18;
//             var mon = PastYearDate.getMonth() ;
//             var dy = PastYearDate.getDate();
//             PastYearDate.setFullYear(Pastyear,mon,dy);
//              if(Date.parse(dteDate.toDateString())  > Date.parse(PastYearDate.toDateString()))
//             {
//                        alert("You Must be At least 18 Years Old to Enter!");
//              txtMonth.focus();
//              return false;
//              }
          }
	  
	  //Country and State part
	     /*    if((document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_STATE').selectedIndex < 53 
            && document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_COUNTRY').selectedIndex == 3)
            ||
            (document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_STATE').selectedIndex > 53 
            && document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_COUNTRY').selectedIndex == 2)
            ||
            (document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_STATE').selectedIndex == 53 
            || document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_COUNTRY').selectedIndex == 1)
            )
            {
            alert("Invalid Country For the State Selected!");
            document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_COUNTRY').selectedIndex=0;
            document.getElementById('ctl00_ctl00_BodyContent_OffersContent_DreamDestination_COUNTRY').focus();
            return false;
            }
            */
	  }
	  
	  
	  
}
function CheckDateandState(objyear,objmonth, objday,objState,objCountry)
{

var txtYear=document.getElementById(objyear)
var txtDay=document.getElementById(objday)
var txtMonth=document.getElementById(objmonth)
var txtState=document.getElementById(objState)
var txtCountry=document.getElementById(objState)


   if(Page_ClientValidate()==true)
   {
        var szDay=txtDay.value;
        var szMonth=txtMonth.value
        var szYear=txtYear.value;
        if(szDay == 0 || szMonth == 0 || szYear == 0)
        {
            alert("Please Enter a Date!!");
            txtMonth.focus();
            return false;
        }
        var day = parseInt(szDay);
        var month = parseInt(szMonth) - 1;
        var year = parseInt(szYear);
	      dteDate=new Date(year,month,day);
	      var datevalid = ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()));
	      if(!datevalid) 
          {
          alert("Invalid Date!");
          txtMonth.focus();
          return false;
          }
          else
          {
             var PastYearDate=new Date();
             var Pastyear = PastYearDate.getFullYear() - 18;
             var mon = PastYearDate.getMonth() ;
             var dy = PastYearDate.getDate();
             PastYearDate.setFullYear(Pastyear,mon,dy);
              if(Date.parse(dteDate.toDateString())  > Date.parse(PastYearDate.toDateString()))
             {
                        alert("You Must be At least 18 Years Old to Enter!");
              txtMonth.focus();
              return false;
              }
          }
	  
	  //Country and State part
	     if((txtState.selectedIndex < 53 && txtCountry.selectedIndex == 3)
            || (txtState.selectedIndex > 53  && txtCountry.selectedIndex == 2)
            || (txtState.selectedIndex == 53 || txtCountry.selectedIndex == 1))
            {
            alert("Invalid Country For the State Selected!");
            txtCountry.selectedIndex=0;
            txtCountry.focus();
            return false;
            }
            
	  }
	  
	  
	  
}
