Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape
var new_win;
var whiches = new Array();
whiches['pick_up_date'] = "pick up";
whiches['drop_off_date'] = "drop off";
var span_pick_up_date= 0;
var span_drop_off_date= 0;



function CheckOpenTimes(Which,layerid,popup_text)
{
    
 LocationObject = eval("" + Which + "Location");
  Location = LocationObject[LocationObject.selectedIndex].value;
  locSplit = Which.split(".")
 if (Location == "Same_as_pickup")
  {
  LocationObject = document.thrifty_search.pick_up_dateLocation;
  Location = LocationObject[LocationObject.selectedIndex].value;
  }
  if (Location == "0")
 {
 alert("Please choose a pick up location");return false;
 }
 
 return true;
//not doing this anymore
    
if(Which =="document.thrifty_search.pick_up_date")
{
var elementGroup = "pick_up_date";
}
else if(Which =="document.thrifty_search.drop_off_date")
{
var elementGroup = "drop_off_date";
}
  DaysObject = eval("" + Which + "Day");
  MonthObject = eval("" + Which + "Month");
  YearObject = eval("" + Which + "Year");
  
 
  
  TimeObject = eval("" + Which + "Time");
  Month = MonthObject[MonthObject.selectedIndex].value;
  Year = YearObject[YearObject.selectedIndex].value;
  Day = DaysObject[DaysObject.selectedIndex].value;
  Location = LocationObject[LocationObject.selectedIndex].value;




//ar inserted to allow logging of opening accounts - ny hitting the server into itemised enquiry 14/07/2006

// ends into itemised enquiry 14/07/2006

selected_time = TimeObject[TimeObject.selectedIndex].value;
c = new Date(Year,Month-1,Day);
var dayOfWeek = c.getDay();

var equivSplit =selected_time.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
selected_time_milli = c.getTime();

open_time = eval('open_'+Location+'['+dayOfWeek+']');
equivSplit = open_time.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
open_time_milli = c.getTime();
close_time = eval('close_'+Location+'['+dayOfWeek+']');
equivSplit = close_time.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
close_time_milli = c.getTime();


if (open_time == close_time)
{
//alert(open_time_milli +' ' +selected_time_milli + ' ' + selected_time_milli + ' '+close_time_milli);
valid_hours = 'Closed on ' + days[dayOfWeek];
alert ('This  location is closed all day on '+days[dayOfWeek]);
writeLayer(layerid,''+valid_hours);
}
else
{

if (open_time_milli <= selected_time_milli && selected_time_milli <= close_time_milli)
{
return true;
}
else
{
valid_hours = open_time+'-'+close_time;
alert (popup_text + ' '+selected_time+' falls outside '+days[dayOfWeek]+ '\'s opening hours: ' +valid_hours  );
writeLayer(layerid,''+valid_hours);
}
}



return false;
}





















function date_picker(Which)
  {
var elementGroup = Which.replace("document.thrifty_search.","");    
    
    
if(document.getElementById("pick_up_dateMonth"))
{
  DaysObject = eval("" + Which + "Day");
  MonthObject = eval("" + Which + "Month");
  YearObject = eval("" + Which + "Year");

var  month = MonthObject[MonthObject.selectedIndex].value;
var  year = YearObject[YearObject.selectedIndex].value;
var  day =DaysObject[DaysObject.selectedIndex].value;
var is_y_m = "0";


}
else{
    var pDO = document.getElementById(elementGroup +"Day");
var day = pDO[pDO.selectedIndex].value;
var pY_M = document.getElementById( elementGroup +"Year_Month");
var pYear_Month = pY_M[pY_M.selectedIndex].value;
var arrY_M = pYear_Month.split("-");
var year = arrY_M[0];
var month = arrY_M[1];
var is_y_m = "1";
}  
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

  	file = '/booking/cal.php?is_y_m='+is_y_m+'&dayField='+Which+'&GoToDay='+month+'\/'+day+'\/'+year;

	//alert(file);
	new_win = window.open( file, "dates", 'width=300,height=170','resizable=1, scrollbars=yes');
	if (window.focus) {new_win.focus()}
  }

function close_popup(){
	if (new_win!= null){
		new_win.close();
	}
}

//function for returning how many days there are in a month including leap years
function DaysInMonth(WhichMonth, WhichYear)
{
   
   if (WhichMonth == "Jan")WhichMonth = "January";
   else if (WhichMonth == "Feb")WhichMonth = "February";
   else if (WhichMonth == "Mar")WhichMonth = "March";
   else if (WhichMonth == "Apr")WhichMonth = "April";
   else if (WhichMonth == "May")WhichMonth = "May";
   else if (WhichMonth == "Jun")WhichMonth = "June";
   else if (WhichMonth == "Jul")WhichMonth = "July";
   else if (WhichMonth == "Aug")WhichMonth = "August";
   else if (WhichMonth == "Sep")WhichMonth = "September";
   else if (WhichMonth == "Oct")WhichMonth = "October";
   else if (WhichMonth == "Nov")WhichMonth = "November";
   else if (WhichMonth == "Dec")WhichMonth = "December";
   //else { alert("Unrecognised Month");   }
  var DaysInMonth = 31;
  
  if (WhichMonth == "April" || WhichMonth == "June" || WhichMonth == "September" || WhichMonth == "November") DaysInMonth = 30;
  if (WhichMonth == "February" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;
  if (WhichMonth == "February" && (WhichYear/4) == Math.floor(WhichYear/4))	DaysInMonth = 29;
  return DaysInMonth;
}

//function to change the available days in a months




function CheckClosedDates(Which,layerid,popup_text)
{

  DaysObject = eval("" + Which + "Day");
  MonthObject = eval("" + Which + "Month");
  YearObject = eval("" + Which + "Year");
  LocationObject = eval("" + Which + "Location");
  TimeObject = eval("" + Which + "Time");
  Month = MonthObject[MonthObject.selectedIndex].value;
  Year = YearObject[YearObject.selectedIndex].value;
  Day = DaysObject[DaysObject.selectedIndex].value;
  Location = LocationObject[LocationObject.selectedIndex].value;
  CurrentTime = TimeObject[TimeObject.selectedIndex].value;
//closed_4['2005-03-17'] = 'Bank Holiday';
if (Month <10)Month = '0' + Month;
if (Day <10)Day = '0' + Day;


if (Location == "Same_as_pickup")
  {
  LocationObject = document.thrifty_search.pick_up_dateLocation;
  Location = LocationObject[LocationObject.selectedIndex].value;
  }
//alert(Location +' here '+ Day + ' '+ Month + ' ' + Year);
if (eval('closed_'+Location+'[\''+Year+'-'+Month+'-'+Day+'\']')){
alert(popup_text + Day+'/'+Month+'/'+Year+' '+ eval('closed_'+Location+'[\''+Year+'-'+Month+'-'+Day+'\']'));
writeLayer(layerid,"closed");
return false;
}
else
{
//writeLayer(layerid,"");
}
return true;
}



function BaseDate(dateDay,dateMonth,dateYear,dateTime)
{
//
c = new Date(dateYear,dateMonth-1,dateDay);
datemin = (''+dateYear+','+dateMonth+','+dateDay + ' ' + dateTime);
//alert(''+dateYear+','+dateMonth+','+dateDay + ' ' + dateTime);
var equivSplit = dateTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
millimin = c.getTime();
return millimin;
}

function SetToDate(Which,dateDay,dateMonth,dateYear,dateTime)
{
if(Which =="document.thrifty_search.pick_up_date")
{
//alert("HERE");
var elementGroup = "pick_up_date";
}
else if(Which =="document.thrifty_search.drop_off_date")
{
var elementGroup = "drop_off_date";
}


 // DaysObject = eval("" + Which + "Day");

 //MonthObject = eval("" + Which + "Month");
  //YearObject = eval("" + Which + "Year");
  //YearObject[dateYear-NowYear].selected = true;
  
  
  if( document.getElementById(elementGroup+"Year"))
  {
  document.getElementById(elementGroup+"Year").options[dateYear-NowYear].selected = true;
  document.getElementById(elementGroup+"Year").selectedIndex = dateYear-NowYear;
  document.getElementById(elementGroup+"Month").options[dateMonth-1].selected = true;
  document.getElementById(elementGroup+"Month").selectedIndex = dateMonth-1;
  }
  //MonthObject[dateMonth-1].selected = true;
  if( document.getElementById(elementGroup+"Year_Month"))
  {
  var obj = document.getElementById(elementGroup+"Year_Month");
   for (var i=0; i < obj.length; i++)
   {
var string_to_set = dateYear + "-" + dateMonth;

if (obj.options[i].value == string_to_set) obj.selectedIndex = i;
   }
  
  //alert(obj.options[document.getElementById(elementGroup+"Year_Month").selectedIndex].value);
  }

    document.getElementById(elementGroup+"Day").options[dateDay-1].selected = true;
    document.getElementById(elementGroup+"Day").selectedIndex = dateDay-1;

  //DaysObject[dateDay-1].selected = true;

TimeObject = eval("" + Which + "Time");
var Time;
  for (var i=0; i < TimeObject.length; i++)
    {
       Time = TimeObject.options[i].value;
 //      alert(Time);alert(dateTime);
       if (Time ==dateTime)
       {
       //TimeObject.options[i].selected = true;
       //TimeObject.selectedIndex = i;
       document.getElementById(elementGroup+"Time").options[i].selected = true;
       document.getElementById(elementGroup+"Time").selectedIndex = i;
     //  alert("here" + Time);
       i = TimeObject.length -1;
       }


    }


}
//function to write option years plus x
function WriteYearOptions(YearsAhead)
{
  line = "";
  for (i=0; i<YearsAhead; i++)
  {
    line += "<OPTION>";
    line += NowYear + i;

  }
  return line;
}

var SearchStartYear;
function SearchWriteYearOptions(YearsBack,YearsAhead)
{
  line = "";
  k = NowYear+parseInt(YearsAhead);
  SearchStartYear = NowYear-parseInt(YearsBack);

  for (i=SearchStartYear;i<k; i++)
  {

//alert(i);
//alert(k);
	line += "<OPTION>";
    line += i;
  }
//alert(line);
return line;
}

function SearchSetToDate(Which,dateDay,dateMonth,dateYear,dateTime)
{
 //alert(Which);
  DaysObject = eval("" + Which + "Day");
  MonthObject = eval("" + Which + "Month");
  YearObject = eval("" + Which + "Year");
  YearObject[dateYear-SearchStartYear].selected = true;
  //YearObject[0].selected = true;
  MonthObject[dateMonth-1].selected = true;


  DaysObject[dateDay-1].selected = true;

  TimeObject = eval("" + Which + "Time");
var Time;
  for (var i=0; i < TimeObject.length; i++)
    {
       Time = TimeObject.options[i].value;
       //alert(Time);
       if (Time ==dateTime)
       {
       TimeObject[i].selected = true;
       i = TimeObject.length -1;
       }
    }


}
function writeLayer(layerID,txt){

   //alert(layerID +' ' + is_opener + ' ' + txt);
            if(document.getElementById){

                     document.getElementById(layerID).innerHTML=txt;


            }else if(document.all){
               document.all[layerID].innerHTML=txt;
            }
      }

function checkDaysinMonth(text_string,inDays,Month,Year)
{
//alert(inDays+','+Month+','+Year);
DaysFor  = DaysInMonth(Month, Year);
if (inDays > DaysFor)
{
alert(text_string + ' : '+Month + ' '+Year +' does not have ' +inDays +' days, it has '+ DaysFor +'. Please Fix.');
return false;
}
else
{
return true;
}
}
function check_year_months_days_and_change()
{
    
//return true;
//Not using this     
    
var pDO = document.getElementById("pick_up_dateDay");
var pDay = pDO[pDO.selectedIndex].value * 1;
var pT = document.getElementById("pick_up_dateTime");
var pTime = pT[pT.selectedIndex].value;
var pY_M = document.getElementById("pick_up_dateYear_Month");
var pYear_Month = pY_M[pY_M.selectedIndex].value;
var pYear_Month_Text = pY_M[pY_M.selectedIndex].text;
var arrY_M = pYear_Month.split("-");
var arrY_M_T = pYear_Month_Text.split(" ");
pYear = arrY_M[0] * 1;
pMonth = arrY_M[1] * 1;
var ptextMonth = arrY_M_T[0];
var ptextYear = arrY_M_T[1];

//alert (ptextMonth + ' ' + pYear_Month_Text); return false;


c = new Date(pYear,pMonth-1,pDay);
//alert();
var equivSplit = pTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
pMilli = c.getTime();

var dDO = document.getElementById("drop_off_dateDay");
var dDay = dDO[dDO.selectedIndex].value * 1;

var dT = document.getElementById("drop_off_dateTime");
var dTime = dT[dT.selectedIndex].value;

var dY_M = document.getElementById("drop_off_dateYear_Month");
var dYear_Month = dY_M[dY_M.selectedIndex].value ;
var dYear_Month_Text = dY_M[dY_M.selectedIndex].text;
var arrY_M = dYear_Month.split("-");
var arrY_M_T = dYear_Month_Text.split(" ");

dYear = arrY_M[0] * 1;
dMonth = arrY_M[1] * 1;
dtextMonth = arrY_M_T[0];
dtextYear = arrY_M_T[1];

c = new Date(dYear,dMonth-1,dDay);
//alert();
equivSplit = dTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
dMilli = c.getTime();


if (pMilli >= dMilli)
{
//alert("HERE" + dMonth + ' '+ pMonth);    
if(dMonth < pMonth)
{
    dY_M.selectedIndex = pY_M.selectedIndex ;
}
//if (dDay < pDay)dDaysObject.selectedIndex = pDaysObject.selectedIndex;
//if (dTime < pTime)dTimeObject.selectedIndex = pTimeObject.selectedIndex
//return false;
}


return true;
}
function check_days_and_change()
{
pDaysObject = eval("document.thrifty_search.pick_up_date" + "Day");
pMonthObject = eval("document.thrifty_search.pick_up_date" + "Month");
pYearObject = eval("document.thrifty_search.pick_up_date" + "Year");
pTimeObject = eval("document.thrifty_search.pick_up_date" + "Time");
pMonth = pMonthObject[pMonthObject.selectedIndex].value * 1;
ptextMonth = pMonthObject[pMonthObject.selectedIndex].text;
pYear = pYearObject[pYearObject.selectedIndex].value * 1;
pDay = pDaysObject[pDaysObject.selectedIndex].value * 1;
pTime = TimeObject[TimeObject.selectedIndex].value;



c = new Date(pYear,pMonth-1,pDay);
//alert();
var equivSplit = pTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
pMilli = c.getTime();

dDaysObject = eval("document.thrifty_search.drop_off_date" + "Day");
dMonthObject = eval("document.thrifty_search.drop_off_date" + "Month");
dYearObject = eval("document.thrifty_search.drop_off_date" + "Year");
dTimeObject = eval("document.thrifty_search.drop_off_date" + "Time");
dMonth = dMonthObject[dMonthObject.selectedIndex].value * 1;
dtextMonth = dMonthObject[dMonthObject.selectedIndex].text;
dYear = dYearObject[dYearObject.selectedIndex].value * 1;
dDay = dDaysObject[dDaysObject.selectedIndex].value * 1;
dTime = dTimeObject[dTimeObject.selectedIndex].value;
c = new Date(dYear,dMonth-1,dDay);
//alert();
equivSplit = dTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
dMilli = c.getTime();
//alert("here");
//status = checkDaysinMonth("Your Pick Up Date",pDay,ptextMonth,pYear);
//if (status ==false)return false;

//status = checkDaysinMonth("Your Drop Off Date",dDay,dtextMonth,dYear);
//if (status ==false)return false;
//alert('here ' + dMonth +' <' + pMonth);
if (pMilli >= dMilli)
{
    
if(dMonth < pMonth)
{
dMonthObject.selectedIndex = pMonthObject.selectedIndex ;
dYearObject.selectedIndex = pYearObject.selectedIndex;
}
//if (dDay < pDay)dDaysObject.selectedIndex = pDaysObject.selectedIndex;
//if (dTime < pTime)dTimeObject.selectedIndex = pTimeObject.selectedIndex
return false;
}


return true;
}


function quotePageCheck(documentname)
{

//Checks
// 36 hours in the future from GMT time
// Drop Off > Pick Up
// Location not closed on pick up / drop off day
//Pick Up location not blank

LocationObject = document.thrifty_search.pick_up_dateLocation;
Location = LocationObject[LocationObject.selectedIndex].value;
if (Location == "0")
{
alert("Please choose a pick up location");
return false;
}

LocationObject = document.thrifty_search.drop_off_dateLocation;
Location = LocationObject[LocationObject.selectedIndex].value;
if (Location == "0")
{
alert("Please choose a drop off location");
return false;
}
var status;
/*
 
status= CheckClosedDates('document.thrifty_search.pick_up_date','message_pick_up_date', 'Pick Up Date: ');
if (status ==false)
{
span_pick_up_date= 1;
return false;
}
status= CheckClosedDates('document.thrifty_search.drop_off_date','message_drop_off_date', 'Drop Off Date: ');
if (status ==false)
{
span_drop_off_date= 1;
return false;
}
*/

//status = Controller('document.thrifty_search');
if(document.getElementById("pick_up_dateMonth"))
{
DaysObject = eval("document.thrifty_search.pick_up_date" + "Day");
MonthObject = eval("document.thrifty_search.pick_up_date" + "Month");
YearObject = eval("document.thrifty_search.pick_up_date" + "Year");
TimeObject = eval("document.thrifty_search.pick_up_date" + "Time");
pMonth = MonthObject[MonthObject.selectedIndex].value * 1;
ptextMonth = MonthObject[MonthObject.selectedIndex].text;
pYear = YearObject[YearObject.selectedIndex].value * 1;
pDay = DaysObject[DaysObject.selectedIndex].value * 1;
pTime = TimeObject[TimeObject.selectedIndex].value;
c = new Date(pYear,pMonth-1,pDay);
//alert();
var equivSplit = pTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
pMilli = c.getTime();
DaysObject = eval("document.thrifty_search.drop_off_date" + "Day");
MonthObject = eval("document.thrifty_search.drop_off_date" + "Month");
YearObject = eval("document.thrifty_search.drop_off_date" + "Year");
TimeObject = eval("document.thrifty_search.drop_off_date" + "Time");
dMonth = MonthObject[MonthObject.selectedIndex].value * 1;
dtextMonth = MonthObject[MonthObject.selectedIndex].value;
dYear = YearObject[YearObject.selectedIndex].value * 1;
dDay = DaysObject[DaysObject.selectedIndex].value * 1;
dTime = TimeObject[TimeObject.selectedIndex].value;
c = new Date(dYear,dMonth-1,dDay);
//alert();
equivSplit = dTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
dMilli = c.getTime();


}
else{
    var pDO = document.getElementById("pick_up_dateDay");
var pDay = pDO[pDO.selectedIndex].value;
var pT = document.getElementById("pick_up_dateTime");
var pTime = pT[pT.selectedIndex].value;
var pY_M = document.getElementById("pick_up_dateYear_Month");
var pYear_Month = pY_M[pY_M.selectedIndex].value;
var pYear_Month_Text = pY_M[pY_M.selectedIndex].text;
var arrY_M = pYear_Month.split("-");
var arrY_M_T = pYear_Month_Text.split(" ");
pYear = arrY_M[0];
pMonth = arrY_M[1];
ptextMonth = arrY_M_T[0];
ptextYear = arrY_M_T[1];



c = new Date(pYear,pMonth-1,pDay);
//alert();
var equivSplit = pTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
pMilli = c.getTime();

var dDO = document.getElementById("drop_off_dateDay");
var dDay = dDO[dDO.selectedIndex].value;

var dT = document.getElementById("drop_off_dateTime");
var dTime = dT[dT.selectedIndex].value;

var dY_M = document.getElementById("drop_off_dateYear_Month");
var dYear_Month = dY_M[dY_M.selectedIndex].value;
var dYear_Month_Text = dY_M[dY_M.selectedIndex].text;
arrY_M = dYear_Month.split("-");
arrY_M_T = dYear_Month_Text.split(" ");

dYear = arrY_M[0];
dMonth = arrY_M[1];
dtextMonth = arrY_M_T[0];
dtextYear = arrY_M_T[1];

c = new Date(dYear,dMonth-1,dDay);
//alert();
equivSplit = dTime.split(":")
c.setHours(equivSplit[0]);
c.setMinutes(equivSplit[1]);
dMilli = c.getTime();
}
//alert(pYear);
//return false;



////////////////////////////////
status = checkDaysinMonth("Your Pick Up Date",pDay,ptextMonth,pYear);
if (status ==false)return false;

status = checkDaysinMonth("Your Drop Off Date",dDay,dtextMonth,dYear);
if (status ==false)return false;
if (pMilli > dMilli)
{
alert("Your Pick up time is after your drop off time, please correct.");
return false;
}
if (pMilli == dMilli)
{
alert("Your Pick up time is the same as your drop off time, please correct.");
return false;
}
if (pMilli < millimin)
{
alert("Your Pick up time is not " + booking_hours_forward + " hours ahead of today's date, please correct " );//+ datemin + ' ' + pMilli + ' ' + millimin + '/' +pMonth+ '/' +pYear+ '/' +pDay +'/'+ pTime);
//alert(pTime+'/'+pDay+'/'+pMonth+'/'+pYear);
return false;
}
status= CheckOpenTimes('document.thrifty_search.pick_up_date','message_pick_up_date', 'Your Pick Up Time:');
if (status ==false)
{
span_pick_up_date= 1;
return false;
}
status= CheckOpenTimes('document.thrifty_search.drop_off_date','message_drop_off_date', 'Your Drop Off Time:');
if (status ==false){
span_drop_off_date= 1;
return false;

}
//alert('here;');
if (left_view =="yes")
{
return true; //We are showing a mini browser in left hand panel  
}
if(SITE_TYPE == "VAN")
{
var total_van_time  = dMilli - pMilli ;
var num_days = total_van_time/(1000*60*60*24);
if (num_days >VAN_MAX_RENTAL_DAYS_WITH_INS_INC)
{
//if (document.thrifty_search.cdwexc.checked ==false)
if (document.thrifty_search.cdwexc[document.thrifty_search.cdwexc.selectedIndex].value=="")
{
alert(VAN_MAX_RENTAL_DAYS_JS_ALERT);
if(VAN_DISPLAY_POPUP_SCREEN =="yes")
{
NewWindow('/booking/generic_popup.php?type=van_display_popup_text','cdw',500,450,'yes','center');
}
return false;
}

}

    if (VAN_SHOW_POPUP_ON_FORM_SUBMIT =="yes")
    {
//if (document.thrifty_search.cdwexc.checked ==false)
    if (document.thrifty_search.cdwexc[document.thrifty_search.cdwexc.selectedIndex].value!="")
    {
    var answer = confirm (VAN_SHOW_POPUP_ON_FORM_SUBMIT_TEXT);
    if (answer)
    {
    }
    else
    {
    return false;
    }
  


}

}

}

return true;


}

function searchPageCheck(documentname)
{

//status = Controller('document.booking_search');
DaysObject = eval("document.booking_search.start_date" + "Day");
MonthObject = eval("document.booking_search.start_date" + "Month");
YearObject = eval("document.booking_search.start_date" + "Year");
TimeObject = eval("document.booking_search.start_date" + "Time");
pMonth = MonthObject[MonthObject.selectedIndex].value;
ptextMonth = MonthObject[MonthObject.selectedIndex].value;
pYear = YearObject[YearObject.selectedIndex].value;
pDay = DaysObject[DaysObject.selectedIndex].value;
pTime = TimeObject[TimeObject.selectedIndex].value;



c = new Date(pYear,pMonth-1,pDay);
//alert();
var equivSplit = pTime.split(":")
//c.setHours(equivSplit[0]);
//c.setMinutes(equivSplit[1]);
c.setHours(0);
c.setMinutes(0);
pMilli = c.getTime();


DaysObject = eval("document.booking_search.end_date" + "Day");
MonthObject = eval("document.booking_search.end_date" + "Month");
YearObject = eval("document.booking_search.end_date" + "Year");
TimeObject = eval("document.booking_search.end_date" + "Time");
dMonth = MonthObject[MonthObject.selectedIndex].value;
dtextMonth = MonthObject[MonthObject.selectedIndex].text;
dYear = YearObject[YearObject.selectedIndex].value;
dDay = DaysObject[DaysObject.selectedIndex].value;
dTime = TimeObject[TimeObject.selectedIndex].value;
c = new Date(dYear,dMonth-1,dDay);
//alert();
equivSplit = dTime.split(":")
//c.setHours(equivSplit[0]);
//c.setMinutes(equivSplit[1]);
c.setHours(0);
c.setMinutes(0);
dMilli = c.getTime();

status = checkDaysinMonth("Your Start Date",pDay,ptextMonth,pYear);
if (status ==false)return false;

status = checkDaysinMonth("Your End Date",dDay,dtextMonth,dYear);
if (status ==false)return false;
if (pMilli > dMilli)
{
alert("Your Start Date is after your End Date, please correct");
return false;
}
if (pMilli == dMilli)
{
alert("Your Start Date is the same as your End Date, please correct");
return false;
}





if (status ==false)return false;



else
{
//alert("Clean Form");return false;
return true;
}

}
