
/////////////////////////////
function isValidDate(sdate){
		var sDate = sdate.split("/");
		var monthDays	= "31,28,31, 30, 31, 30, 31, 31, 30, 31, 30,31"
		monthDays = monthDays.split(",");
    	var year		= sDate[2]
    var _month		= sDate[0]
    var days      = sDate[1]
    
    //february
    if(sDate[0]==2){
		
		if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
						monthDays[1] = 29;
		
		if(1*sDate[1]>1*monthDays[1]){
			return false
		}else return true
	}
	var monthIndex = sDate[0]-1
	if(1*sDate[1]>1*monthDays[monthIndex])	return false
	else return true						

}
/////////////////////////////////////////////////////
//the function chang drop ogg location to be like pick off location
function changeDrop(obj){
	document.form1.drop_off_location[document.form1.pick_up_location.selectedIndex].selected = true
}
/////////////////////////////
function numOfDays(theForm){
	
	var numOfDays  = getNumOfDays(theForm.pickmonth.value+"/"+theForm.pickday.value+"/"+theForm.pickyear.value+" "+theForm.pick_up_time.value, theForm.offmonth.value+"/"+theForm.offday.value+"/"+theForm.offyear.value+" "+theForm.drop_off_time.value);
	window.num_of_days.innerHTML = numOfDays+" "+ siteDic.DAYS;
	document.form1.no_OfDays.value = numOfDays;
	
}
/////////////////////////////	
function popPC(obj){
	
	if(obj.options[obj.selectedIndex].pc>0){
		desplayDiv(obj.options[obj.selectedIndex].pc,true);
	}
}
/////////////////////////////
function desplayDiv(docId,countryPC){
	
	if(countryPC){
		
		openWindow("/site/travelAgent/reservation/campaign.asp?docId="+docId+"&countryPC=true",null,"pc",300,335);
	}else{	
		
		openWindow("/site/travelAgent/reservation/campaign.asp?docId="+docId,null,"pc",300,335);
	}	
}