//$Id: CalendarControl.js 1 2010-02-05 08:20:11Z ramesh $
function positionInfo(object) {

  var p_elm = object;

  this.getElementLeft = getElementLeft;
  function getElementLeft() {
    var x = 0;
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    while (elm != null) {
      x+= elm.offsetLeft;
      elm = elm.offsetParent;
    }
    return parseInt(x);
  }

  this.getElementWidth = getElementWidth;
  function getElementWidth(){
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    return parseInt(elm.offsetWidth);
  }

  this.getElementRight = getElementRight;
  function getElementRight(){
    return getElementLeft(p_elm) + getElementWidth(p_elm);
  }

  this.getElementTop = getElementTop;
  function getElementTop() {
    var y = 0;
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    while (elm != null) {
      y+= elm.offsetTop;
      elm = elm.offsetParent;
    }
    return parseInt(y);
  }

  this.getElementHeight = getElementHeight;
  function getElementHeight(){
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    return parseInt(elm.offsetHeight);
  }

  this.getElementBottom = getElementBottom;
  function getElementBottom(){
    return getElementTop(p_elm) + getElementHeight(p_elm);
  }
}

function CalendarControl() {

  var calendarId = 'CalendarControl';
  var currentYear = 0;
  var currentMonth = 0;
  var currentDay = 0;

  var selectedYear = 0;
  var selectedMonth = 0;
  var selectedDay = 0;

  var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
  var dateField = null;

  function getProperty(p_property){
    var p_elm = calendarId;
    var elm = null;

    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    if (elm != null){
      if(elm.style){
        elm = elm.style;
        if(elm[p_property]){
          return elm[p_property];
        } else {
          return null;
        }
      } else {
        return null;
      }
    }
  }

  function setElementProperty(p_property, p_value, p_elmId){
    var p_elm = p_elmId;
    var elm = null;

    if(typeof(p_elm) == "object"){
      elm = p_elm;
    } else {
      elm = document.getElementById(p_elm);
    }
    if((elm != null) && (elm.style != null)){
      elm = elm.style;
      elm[ p_property ] = p_value;
    }
  }

  function setProperty(p_property, p_value) {
    setElementProperty(p_property, p_value, calendarId);
  }

  function getDaysInMonth(year, month) {
    return [31,((!(year % 4 ) && ( (year % 100 ) || !( year % 400 ) ))?29:28),31,30,31,30,31,31,30,31,30,31][month-1];
  }

  function getDayOfWeek(year, month, day) {
    var date = new Date(year,month-1,day)
    return date.getDay();
  }

  this.clearDate = clearDate;
  function clearDate() {
    dateField.value = '';
    hide();
  }

  this.setDate = setDate;
  function setDate(year, month, day) {
	var dToday = new Date();
	var tDay = dToday.getDate();
	var tMonth = dToday.getMonth()+1;
	var tYear = dToday.getFullYear();
   
    var fromdate = document.getElementById("date1");
	var fromdate_value = fromdate.value;
	fromdate = fromdate_value.split("/",3);
	var fromdate_day = fromdate[0];
	var fromdate_month = fromdate[1];
	var fromdate_year = fromdate[2];

	//if(document.getElementById("returnt").style.display == "block"){
         if(document.getElementById("returnt").style.visibility == "visible"){
		var todate = document.getElementById("date2");
		var todate_value = todate.value;
		todate = todate_value.split("/",3);
		var todate_day = todate[0];
		var todate_month = todate[1];
		var todate_year = todate[2];
        }
         
       // if(document.getElementById("busReturnDate").style.display == "none"){
        if(document.getElementById("busReturnDate").style.visibility == "hidden"){
            var fromdateBus = document.getElementById("dateBus1");
            var fromdateBus_value = fromdateBus.value;
            fromdateBus = fromdateBus_value.split("/",3);
            var fromdateBus_day = fromdateBus[0];
            var fromdateBus_month = fromdateBus[1];
            var fromdateBus_year = fromdateBus[2];
        }

        var fromdateInter = document.getElementById("interDate1");
        var fromdateInter_value = fromdateInter.value;
        fromdateInter = fromdateInter_value.split("/",3);
        var fromdateInter_day = fromdateInter[0];
        var fromdateInter_month = fromdateInter[1];
        var fromdateInter_year = fromdateInter[2];
        

    if(checkDateId == "date1" || checkDateId == "dateBus1" || checkDateId == "interDate1"){
		if(day < tDay && month<=tMonth && year<=tYear){}
		else{
			if (dateField) {
			  if (month < 10) {month = "0" + month;}
			  if (day < 10) {day = "0" + day;}

			  var dateString = day+"/"+month+"/"+year;
			  dateField.value = dateString;
			  hide();
			}
			return;
		}
	}else if(checkDateId == "date2"){
                if(day < tDay && month<=tMonth && year<=tYear){ 
		}else{
                 /*else if(day < todate_day && month<=todate_month){}*/
			if (dateField) {
			  if (month < 10) {month = "0" + month;}
			  if (day < 10) {day = "0" + day;}

			  var dateString = day+"/"+month+"/"+year;
			  dateField.value = dateString;
			  hide();
			}
			return;
		}
    }else if(checkDateId == "dateBus2"){
          	if(day < fromdateBus_day && month<=fromdateBus_month){}
		else{
			if (dateField) {
			  if (month < 10) {month = "0" + month;}
			  if (day < 10) {day = "0" + day;}

			  var dateString = day+"/"+month+"/"+year;
			  dateField.value = dateString;
			  hide();
			}
			return;
		}
   }else if(checkDateId == "interDate2"){
        if(day < tDay && month<=tMonth && year<=tYear){}
		else{
			if (dateField) {
			  if (month < 10) {month = "0" + month;}
			  if (day < 10) {day = "0" + day;}

			  var dateString = day+"/"+month+"/"+year;
			  dateField.value = dateString;
			  hide();
			}
			return;
		}
   }
   else{
		if(day < fromdate_day && month<=fromdate_month){}
		else{
			if (dateField) {
			  if (month < 10) {month = "0" + month;}
			  if (day < 10) {day = "0" + day;}

			  var dateString = day+"/"+month+"/"+year;
			  dateField.value = dateString;
			  hide();
			}
			return;
		}
	}
  }

  this.changeMonth = changeMonth;
  function changeMonth(change) {
	var dToday = new Date();
	var tMonth = dToday.getMonth();
	var tYear = dToday.getFullYear();
    currentMonth += change;
	if( currentMonth<=tMonth && currentYear<=tYear){
		if(change == -1){
			currentMonth = currentMonth + 1;
		}else{
			currentMonth = currentMonth - 1;
		}
	}
	else{
		currentDay = 0;
		if(currentMonth > 12) {          
		  currentMonth = 1;
		  currentYear++;
		} else if(currentMonth < 1) {
		  currentMonth = 12;
		  currentYear--;
		}

		calendar = document.getElementById(calendarId);
		calendar.innerHTML = calendarDrawTable();
	}
  }

  this.changeYear = changeYear;
  function changeYear(change) {
    currentYear += change;
    currentDay = 0;
    calendar = document.getElementById(calendarId);
    calendar.innerHTML = calendarDrawTable();
  }

  function getCurrentYear() {
    var year = new Date().getYear();
    if(year < 1900) year += 1900;
    return year;
  }

  function getCurrentMonth() {
    return new Date().getMonth() + 1;
  } 

  function getCurrentDay() {
    return new Date().getDate();
  }

  function calendarDrawTable() {

    var dayOfMonth = 1;
    var validDay = 0;
    var startDayOfWeek = getDayOfWeek(currentYear, currentMonth, dayOfMonth - 1);
    var daysInMonth = getDaysInMonth(currentYear, currentMonth);
    var css_class = null; //CSS class for each day
    var dToday = new Date();
    var tDay = dToday.getDate();
    var tMonth = dToday.getMonth()+1;
    var tYear = dToday.getFullYear();
    
    var fromdate = document.getElementById("date1");
    var fromdate_value = fromdate.value;
    fromdate = fromdate_value.split("/",3);
    var fromdate_day = fromdate[0];
    var fromdate_month = fromdate[1];
    var fromdate_year = fromdate[2];
    
    //if(document.getElementById("busReturnDate").style.display == "block"){
    if(document.getElementById("busReturnDate").style.visibility == "visible"){
        var fromdateBus = document.getElementById("dateBus1");
        var fromdateBus_value = fromdateBus.value;
        fromdateBus = fromdateBus_value.split("/",3);
        var fromdateBus_day = fromdateBus[0];
        var fromdateBus_month = fromdateBus[1];
        var fromdateBus_year = fromdateBus[2];
    }

    //if(document.getElementById("internationalreturnt").style.visibility == "visible"){
        var fromdateInter = document.getElementById("interDate1");
        var fromdateInter_value = fromdateInter.value;
        fromdateInter = fromdateInter_value.split("/",3);
        var fromdateInter_day = fromdateInter[0];
        var fromdateInter_month = fromdateInter[1];
        var fromdateInter_year = fromdateInter[2];
    //}
    
    var nextMonthResult = calculateResult();
    function calculateResult(){
         var result = months[currentMonth];
         if(result == "undefined" || result == null){
                 result = "Jan";
                 return result;
         }else{
                result = months[currentMonth].substring(0,3);
                return result;
         }
    }
    var table = "<table cellspacing='0' cellpadding='0' border='0'>";
    table = table + "<tr class='header'>";
    table = table + "  <td colspan='1' class='previous'><a href='javascript:changeCalendarControlMonth(-1);'>&lt;</a> <a href='javascript:changeCalendarControlYear(-1);'></a></td>";
    table = table + "  <td colspan='5' class='title'>" + months[currentMonth-1] + " - " + currentYear + "</td>";
    table = table + "  <td colspan='1' class='previous'><a href='javascript:changeCalendarControlYear(1);'></a> <a href='javascript:changeCalendarControlMonth(1);'>&gt;</a></td>";
    table = table + "</tr>";
    table = table + "<tr><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th></tr>";

    if((startDayOfWeek == 5 && daysInMonth == 31) || (startDayOfWeek == 6 && daysInMonth>=30)){
		for(var week=0; week < 6; week++) {
		  table = table + "<tr>";
		  for(var dayOfWeek=0; dayOfWeek < 7; dayOfWeek++) {
			if(week == 0 && startDayOfWeek == dayOfWeek) {
			  validDay = 1;
			} else if (validDay == 1 && dayOfMonth > daysInMonth) {
			  validDay = 0;
			}
            
			if(validDay) {
			  if (dayOfMonth == selectedDay && currentYear == selectedYear && currentMonth == selectedMonth) {
				css_class = 'current';
			  } else if(checkDateId == "date1" || checkDateId == "dateBus1" || checkDateId == "interDate1"){
				  if(dayOfMonth < tDay && currentMonth <= tMonth && currentYear <= tYear){
					css_class = 'previousday';
				  }else{
					  css_class = 'weekday';
				  }
			  }else if(checkDateId == "date2" ){ 				  
				   if(dayOfMonth < tDay && currentMonth <= tMonth && currentYear <= tYear){
						  css_class = 'previousday';
                                   }else if(dayOfMonth < fromdate_day && currentMonth <= fromdate_month && currentYear <= fromdate_year){
                                                    css_class = 'previousday';
                                   }else{
                                            css_class = 'weekday';
                                   }
			  }else if(checkDateId == "dateBus2"){
				  if(dayOfMonth < fromdateBus_day && currentMonth <= fromdateBus_month && currentYear <= fromdateBus_year){
					css_class = 'previousday';
				  }else{
					  css_class = 'weekday';
				  }
			  }else if(checkDateId == "interDate2"){
                  if(dayOfMonth < tDay && currentMonth <= tMonth && currentYear <= tYear){
						  css_class = 'previousday';
                  }else if(dayOfMonth < fromdateInter_day && currentMonth <= fromdateInter_month && currentYear <= fromdateInter_year){
					css_class = 'previousday';
				  }else{
					  css_class = 'weekday';
				  }
			  }
              else {
				css_class = 'weekday';
			  }

			  table = table + "<td><a class='"+css_class+"' href=\"javascript:setCalendarControlDate("+currentYear+","+currentMonth+","+dayOfMonth+")\">"+dayOfMonth+"</a></td>";
			  dayOfMonth++;
			} else {
			  table = table + "<td class='empty'>&nbsp;</td>";
			}
		  }
		  table = table + "</tr>";
		}//
	}else{
		for(var week=0; week < 5; week++) {
		  table = table + "<tr>";
		  for(var dayOfWeek=0; dayOfWeek < 7; dayOfWeek++) {
			if(week == 0 && startDayOfWeek == dayOfWeek) {
			  validDay = 1;
			} else if (validDay == 1 && dayOfMonth > daysInMonth) {
			  validDay = 0;
			}

			if(validDay) {
			  if (dayOfMonth == selectedDay && currentYear == selectedYear && currentMonth == selectedMonth) {
				css_class = 'current';
			  } else if(checkDateId == "date1" || checkDateId == "dateBus1" || checkDateId == "interDate1"){
				  if(dayOfMonth < tDay && currentMonth <= tMonth && currentYear <= tYear){
					css_class = 'previousday';
				  }else{
					  css_class = 'weekday';
				  }
			  }else if(checkDateId == "date2" ){ 
				   if(dayOfMonth < tDay && currentMonth <= tMonth && currentYear <= tYear){
						  css_class = 'previousday';
					}else if(dayOfMonth < fromdate_day && currentMonth <= fromdate_month && currentYear <= fromdate_year){
							css_class = 'previousday';
					}else{
						css_class = 'weekday';
					}
			  }else if(checkDateId == "dateBus2"){
				  if(dayOfMonth < fromdateBus_day && currentMonth <= fromdateBus_month && currentYear <= fromdateBus_year){
					css_class = 'previousday';
				  }else{
					  css_class = 'weekday';
				  }
			  }else if(checkDateId == "interDate2"){
                  if(dayOfMonth < tDay && currentMonth <= tMonth && currentYear <= tYear){
						  css_class = 'previousday';
                  }else if(dayOfMonth < fromdateInter_day && currentMonth <= fromdateInter_month && currentYear <= fromdateInter_year){
					css_class = 'previousday';
				  }else{
					  css_class = 'weekday';
				  }
			  }
              else {
				css_class = 'weekday';
			  }
			  table = table + "<td><a class='"+css_class+"' href=\"javascript:setCalendarControlDate("+currentYear+","+currentMonth+","+dayOfMonth+")\">"+dayOfMonth+"</a></td>";
			  dayOfMonth++;
			} else {
			  table = table + "<td class='empty'>&nbsp;</td>";
			}
		  }
		  table = table + "</tr>";
		}//
	}

    table = table + "<tr class='header'><th colspan='7' style='padding: 3px;'><a href='javascript:hideCalendarControl();'><b>Close</b></a></td></tr>";
    table = table + "</table>";

    return table;
  }

  this.show = show;
  function show(field) {
    can_hide = 0;
  
    // If the calendar is visible and associated with
    // this field do not do anything.
    if (dateField == field) {
      return;
    } else {
      dateField = field;
    }

    if(dateField) {
      try {
        var dateString = new String(dateField.value);
        var dateParts = dateString.split("/");
        
        selectedDay = parseInt(dateParts[0],10);
        selectedMonth = parseInt(dateParts[1],10);
        selectedYear = parseInt(dateParts[2],10);
      } catch(e) {}
    }

    if (!(selectedYear && selectedMonth && selectedDay)) {
      selectedMonth = getCurrentMonth();
      selectedDay = getCurrentDay();
      selectedYear = getCurrentYear();
    }

    currentMonth = selectedMonth;
    currentDay = selectedDay;
    currentYear = selectedYear;

    if(document.getElementById){

      calendar = document.getElementById(calendarId);
      calendar.innerHTML = calendarDrawTable(currentYear, currentMonth);

      setProperty('display', 'block');

      var fieldPos = new positionInfo(dateField);
      var calendarPos = new positionInfo(calendarId);

      var x = fieldPos.getElementLeft();
      var y = fieldPos.getElementBottom();

      setProperty('left', x + "px");
      setProperty('top', y + "px");
 
      if (document.all) {
        setElementProperty('display', 'block', 'CalendarControlIFrame');
        setElementProperty('left', x + "px", 'CalendarControlIFrame');
        setElementProperty('top', y + "px", 'CalendarControlIFrame');
        setElementProperty('width', calendarPos.getElementWidth() + "px", 'CalendarControlIFrame');
        setElementProperty('height', calendarPos.getElementHeight() + "px", 'CalendarControlIFrame');
      }
    }
  }

  this.hide = hide;
  function hide() {
    if(dateField) {
      setProperty('display', 'none');
      setElementProperty('display', 'none', 'CalendarControlIFrame');
      dateField = null;
	  if(checkDateId == 'date1'){ 
		returnDateDefault();
	  }else if(checkDateId == 'dateBus1'){
        returnDateBusDefault();
      }else if(checkDateId == 'interDate1'){
        returnDateInterDefault();
      }
      else{}
    }
  }

  this.visible = visible;
  function visible() {
    return dateField
  }

  this.can_hide = can_hide;
  var can_hide = 0;
}

var calendarControl = new CalendarControl();
var checkDateId;
function showCalendarControl(textField) {
  checkDateId = textField.id;
  calendarControl.show(textField);
  //isDate(textField);
 
}

function clearCalendarControl() {
  calendarControl.clearDate();
}

function hideCalendarControl() {
  if (calendarControl.visible()) {
    calendarControl.hide();
  }
}
function hideCalendar(){

}
function setCalendarControlDate(year, month, day) {
  calendarControl.setDate(year, month, day);
}

function changeCalendarControlYear(change) {
  calendarControl.changeYear(change);
}

function changeCalendarControlMonth(change) {
  
  calendarControl.changeMonth(change);
}

function returnDateDefault(){

    var date1_div = document.getElementById("date1");
    var date1_value = date1_div.value;
    var date1_split = date1_value.split("/",3);

    var date2_div = document.getElementById("date2");
    result_date = date1_split[0];
    result_date_ch = result_date;
    result_month = date1_split[1];
    result_year = date1_split[2];
    if(result_year%4 == 0){
            if( result_month == 02){
                            if(result_date == 29){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
                            }
       }
    }else{
            if( result_month == 02){
                            if(result_date == 28){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
                            }
            }
    }
    if(result_date == 31){
            if( result_month == 01 || result_month == 03 || result_month == 05 || result_month == 07 || result_month == 08 ){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
            }
            if(result_month == 10){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+result_month+"/"+result_year;
                               return true;
            }
            if(result_month == 12){
                       result_date =1;
                       result_month =1;
                       result_year++;
                       date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                       return true;
            }
    }
    if(result_date == 30){
            if(result_month == 04 || result_month == 06 || result_month == 09 || result_month == 11){
                       result_date = 1;
                       result_month ++;
                       if(result_month == 04 || result_month == 06){
                                    date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                                    return true;
                       }else{
                                    date2_div.value = 0+""+result_date+"/"+result_month+"/"+result_year;
                                    return true;
                       }						   
            }
    }
    if(result_date_ch < 31){
            date2_div.value = result_date+"/"+result_month+"/"+result_year;
            return true;
    }

} 
function returnDateBusDefault(){

    var date1_div = document.getElementById("dateBus1");
    var date1_value = date1_div.value;
    var date1_split = date1_value.split("/",3);

    var date2_div = document.getElementById("dateBus2");
    result_date = date1_split[0];
    result_date_ch = result_date;
    result_month = date1_split[1];
    result_year = date1_split[2];
    if(result_year%4 == 0){
            if( result_month == 02){
                            if(result_date == 29){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
                            }
       }
    }else{
            if( result_month == 02){
                            if(result_date == 28){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
                            }
            }
    }
    if(result_date == 31){
            if( result_month == 01 || result_month == 03 || result_month == 05 || result_month == 07 || result_month == 08 ){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
            }
            if(result_month == 10){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+result_month+"/"+result_year;
                               return true;
            }
            if(result_month == 12){
                       result_date =1;
                       result_month =1;
                       result_year++;
                       date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                       return true;
            }
    }
    if(result_date == 30){
            if(result_month == 04 || result_month == 06 || result_month == 09 || result_month == 11){
                       result_date = 1;
                       result_month ++;
                       if(result_month == 04 || result_month == 06){
                                    date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                                    return true;
                       }else{
                                    date2_div.value = 0+""+result_date+"/"+result_month+"/"+result_year;
                                    return true;
                       }						   
            }
    }
    if(result_date_ch < 31){
            date2_div.value = result_date+"/"+result_month+"/"+result_year;
            return true;
    }

}

function returnDateInterDefault(){
    
    var date1_div = document.getElementById("interDate1");
    var date1_value = date1_div.value;
    var date1_split = date1_value.split("/",3);

    var date2_div = document.getElementById("interDate2");
    result_date = date1_split[0];
    result_date_ch = result_date;
    result_month = date1_split[1];
    result_year = date1_split[2];
    if(result_year%4 == 0){
            if( result_month == 02){
                            if(result_date == 29){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
                            }
       }
    }else{
            if( result_month == 02){
                            if(result_date == 28){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
                            }
            }
    }
    if(result_date == 31){
            if( result_month == 01 || result_month == 03 || result_month == 05 || result_month == 07 || result_month == 08 ){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                               return true;
            }
            if(result_month == 10){
                               result_date = 1;
                               result_month ++;
                               date2_div.value = 0+""+result_date+"/"+result_month+"/"+result_year;
                               return true;
            }
            if(result_month == 12){
                       result_date =1;
                       result_month =1;
                       result_year++;
                       date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                       return true;
            }
    }
    if(result_date == 30){
            if(result_month == 04 || result_month == 06 || result_month == 09 || result_month == 11){
                       result_date = 1;
                       result_month ++;
                       if(result_month == 04 || result_month == 06){
                                    date2_div.value = 0+""+result_date+"/"+0+""+result_month+"/"+result_year;
                                    return true;
                       }else{
                                    date2_div.value = 0+""+result_date+"/"+result_month+"/"+result_year;
                                    return true;
                       }
            }
    }
    if(result_date_ch < 31){
            date2_div.value = result_date+"/"+result_month+"/"+result_year;
            return true;
    }
}

document.write("<iframe id='CalendarControlIFrame' style='z-index:2000;' src='javascript:false;' frameBorder='0' scrolling='no'></iframe>");
document.write("<div id='CalendarControl' style='z-index:2000;'></div>");
