function disableDateTextBoxWithCalender(endDate,endCal){
	//alert(endDate);
	document.getElementById(endDate).disabled=true;
	document.getElementById(endCal).disabled=true;
	document.getElementById(endDate).value="mm/dd/yyyy";	
}
function enableDateTextBoxWithCalender(endDate,endCal){
	//alert(endDate);
	document.getElementById(endDate).disabled=false;
	document.getElementById(endCal).disabled=false;
	var toDay=new Date();
	var strToDay=toDay.getMonth()+1+"/"+toDay.getDate()+"/"+toDay.getFullYear();
	document.getElementById(endDate).value=strToDay;
}
 function dateChanged(calendar) {
	// Beware that this function is called even if the end-user only
	// changed the month/year. In order to determine if a date was
	// clicked you can use the dateClicked property of the calendar:
	if (calendar.dateClicked) {
	// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
	var y = calendar.date.getFullYear();
	var m = calendar.date.getMonth(); // integer, 0..11
	var d = calendar.date.getDate(); // integer, 1..31
	// redirect...
	}
}
	
 function ourDateStatusFunc(date) {
	  	var toDay= new Date();
	  	var dummyDate=date;
	  	dummyDate.setHours(0,0,0,0);
	  	toDay.setHours(0,0,0,0);
			var diff=((dummyDate-toDay)/1000/60/60/24);
		  	if (diff<0){
  	 				return true;
  	 		}
		return "special" 
 
	}
		


 function calendarDateCheck(startDateId,endDateId,startRadioId,endRadioId){
	  	var strStartDate= document.getElementById(startDateId).value;
	 	var strEndDate= document.getElementById(endDateId).value;
	  	var toDay= new Date();
		var startDateStatus=true;
		if (document.getElementById(startRadioId).checked) {
		  	if (isDate(strStartDate)){
				var regEx = new RegExp('-','gi') ;
			  	strStartDate=strStartDate.replace(regEx,'/');
			  	var startDate = new Date(strStartDate);
			  	startDate.setHours(0,0,0,0);
			  	toDay.setHours(0,0,0,0);
				var diff=((startDate-toDay)/1000/60/60/24);
			  	if (diff<0){
						alert("Start Date must not be less than Today's Date");
	  	 				return false;
	  	 		}
			}else{
			 	return false;
			}
		}
		
	  	if (document.getElementById(endRadioId).checked) {
		  	if (isDate(strEndDate)){ 
				var regEx = new RegExp('-','gi') ;
			  	strEndDate=strEndDate.replace(regEx,'/');
			  	var endDate = new Date(strEndDate);
			  	endDate.setHours(0,0,0,0);
			  	toDay.setHours(0,0,0,0);
			  	//alert(endDate+"    "+toDay);
			  	var diff=((endDate-toDay)/1000/60/60/24);
			  	//alert(new Date("12/11/2005")-new Date("12/12/2005")/1000/60/60/24);
			  	if (diff<0){
						alert("End Date must not be less than Today's Date");
	  	 				return false;
	  	 		}
			}else{ 
				 	return false;
			}	
  	 	}
  	 	
 		return true;
   }
    
  			
