/**
 * @author 
 */
/**
 * Revision History ---------------- Date Version Author Activity 23-Mar-2005
 * 1.0 Mithun P R Modification done 17-May-2005 1.1 Mithun P R Modification done
 * for Virgin Blue 24-May-2005 1.2 Mithun P R Previous dates should be disabled
 * 29-Jun-2006 1.3 John Varghese Made the component XHTML compliant Added px to
 * dimensions in style 29-Jun-2006 1.4 Jomon George Solved the rendering issue
 * in Opera by not producing the iframe 10-09-2006 1.5 Mithun P R Modified to
 * correct error while selecting last item in combo 14-09-2006 1.6 Mithun P R
 * Modified to set focus to calendar
 * 
 * 
 */


var vWinCal;
var weekend = [0,6];
var weekendColor = "#FFFFFF";
var fontface = "Verdana";
var fontsize = 1;

var calendar_bgcolor = '#ffffff';
var calendar_head_font = '#ffffff';

var gNow = new Date();
var ggWinCal;
isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;

Calendar.Months = ["JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE",
                   "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"];

//Non-Leap year Month days..
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
//Leap year Month days..
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

function Calendar(p_item, p_WinCal, p_month, p_year, p_format) {
	if ((p_month == null) && (p_year == null)){
		return;
	}
	if (p_WinCal == null){
		this.gWinCal = ggWinCal;
	}
	else{
		this.gWinCal = p_WinCal;
	}

	if (p_month == null) {
		this.gMonthName = null;
		this.gMonth = null;
		this.gYearly = true;
	} else {
		this.gMonthName = Calendar.get_month(p_month);
		this.gMonth = new Number(p_month);
		this.gYearly = false;
	}

	this.gYear = p_year;
	this.gFormat = p_format;
	this.gBGColor = "#FFFFFF";
	this.gFGColor = "black";
	this.gTextColor = "#CCCC99";
	this.gHeaderColor = "#A2A251";
	this.gReturnItem = p_item;
}

Calendar.get_month = Calendar_get_month;
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
Calendar.calc_month_year = Calendar_calc_month_year;
Calendar.print = Calendar_print;

function Calendar_get_month(monthNo) {
	return Calendar.Months[monthNo];
}

function Calendar_get_daysofmonth(monthNo, p_year) {
	/*
	 * Check for leap year .. 1.Years evenly divisible by four are normally leap
	 * years, except for... 2.Years also evenly divisible by 100 are not leap
	 * years, except for... 3.Years also evenly divisible by 400 are leap years.
	 */
	if ((p_year % 4) == 0) {
		if ((p_year % 100) == 0 && (p_year % 400) != 0){
			return Calendar.DOMonth[monthNo];
		}
		return Calendar.lDOMonth[monthNo];
	} else{
		return Calendar.DOMonth[monthNo];
	}
}

function Calendar_calc_month_year(p_Month, p_Year, incr) {
	/*
	 * Will return an 1-D array with 1st element being the calculated month and
	 * second being the calculated year after applying the month
	 * increment/decrement as specified by 'incr' parameter. 'incr' will
	 * normally have 1/-1 to navigate thru the months.
	 */
	var ret_arr = new Array();

	if (incr == -1) {
		// B A C K W A R D
		if (p_Month == 0) {
			ret_arr[0] = 11;
			ret_arr[1] = parseInt(p_Year) - 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) - 1;
			ret_arr[1] = parseInt(p_Year);
		}
	} else if (incr == 1) {
		// F O R W A R D
		if (p_Month == 11) {
			ret_arr[0] = 0;
			ret_arr[1] = parseInt(p_Year) + 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) + 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}

	return ret_arr;
}

function Calendar_print() {
	ggWinCal.print();
}

function Calendar_calc_month_year(p_Month, p_Year, incr) {
	/*
	 * Will return an 1-D array with 1st element being the calculated month and
	 * second being the calculated year after applying the month
	 * increment/decrement as specified by 'incr' parameter. 'incr' will
	 * normally have 1/-1 to navigate thru the months.
	 */
	var ret_arr = new Array();

	if (incr == -1) {
		// B A C K W A R D
		if (p_Month == 0) {
			ret_arr[0] = 11;
			ret_arr[1] = parseInt(p_Year) - 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) - 1;
			ret_arr[1] = parseInt(p_Year);
		}
	} else if (incr == 1) {
		// F O R W A R D
		if (p_Month == 11) {
			ret_arr[0] = 0;
			ret_arr[1] = parseInt(p_Year) + 1;
		}
		else {
			ret_arr[0] = parseInt(p_Month) + 1;
			ret_arr[1] = parseInt(p_Year);
		}
	}

	return ret_arr;
}

//This is for compatibility with Navigator 3, we have to create and discard one
//object before the prototype object exists.
new Calendar();

Calendar.prototype.getMonthlyCalendarCode = function(p_state) {
	var vCode = "";
	var vHeader_Code = "";
	var vData_Code = "";

	// Begin Table Drawing code here..
	vCode = vCode + "<TABLE id='table1' CELLSPACING=0 HEIGHT='109px;' width='100%;' CELLPADDING=0 BORDER=0 BGCOLOR=\"" + this.gBGColor + "\">";

	vHeader_Code = this.cal_header();
	// vData_Code = this.cal_data();

	if(p_state=="false")
	{
		vData_Code = this.cal_data();
	}
	else
	{
		vData_Code = this.cal_date_comp();
	}


	vCode = vCode + vHeader_Code + vData_Code;

	vCode = vCode + "</TABLE>";

	return vCode;
}

Calendar.prototype.color_day_comp = function(vday) {
	var vNowDay = gNow.getDate();
	var vNowMonth = gNow.getMonth();
	var vNowYear = gNow.getFullYear();

	if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
	{
		return (" BGCOLOR='#CCCCCC' ");        
	}
	else {
		return ("");
	}
}

Calendar.prototype.cal_date_comp = function() {    	
	var vDate = new Date();
	vDate.setDate(1);
	vDate.setMonth(this.gMonth);
	vDate.setFullYear(this.gYear);

	var vFirstDay=vDate.getDay();
	var vDay=1;
	var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
	var vOnLastDay=0;
	var vCode = "";

	/*
	 * Get day for the 1st of the requested month/year.. Place as many blank
	 * cells before the 1st day of the month as necessary.
	 */

	vCode = vCode + "<TR>";
	for (i=0; i<vFirstDay; i++) {
		vCode = vCode + "<TD  class='dateCol' WIDTH='14%' HEIGHT=15 ALIGN=CENTER " + this.write_weekend_string(i) + "><FONT SIZE='1' FACE='" + fontface + "'>&nbsp;</FONT></TD>";
	}
	
	var enabledDisabledDayFlag=false;
	// Write rest of the 1st week
	for (j=vFirstDay; j<7; j++) {    
		
		var sampDate = vDay+"-"+this.gMonth+"-"+this.gYear;            
		var state = chkDates(expectedStartDte,sampDate); // 1 <=2
		
		enabledDisabledDayFlag=enabledDisabledDay(j,vDay,this.gMonth,this.gYear);
		
		vCode = vCode + "<TD class=\"dateCol\" onmouseover='{hover(this)}'"+	 
		" onmouseout='mouseout(this)' ";
		
		
		
		if(state=="failure"  || enabledDisabledDayFlag)
		{
			vCode = vCode + " onclick='return false;' " ;
		}	
		else
		{
			vCode = vCode + " onclick=\" if(correctElement(this)) {return setDateValues('" +this.format_data(vDay) +"','"+this.gReturnItem+"')}\"";  
		}            
		
		vCode = vCode + " class='dateCol' WIDTH='14%'"+this.color_day_comp(vDay)+" HEIGHT=15 ALIGN=CENTER "  + this.write_weekend_string(j) + ">";

		

		if(state=="failure"  || enabledDisabledDayFlag)
		{
			vCode = vCode + "<span style='color: #999999;'>"+this.format_day(vDay)+"</span>"; 
		}	
		else
		{
			vCode = vCode + this.format_day(vDay)
		}            

		vCode = vCode + "</TD>";           
		vDay=vDay + 1;
	}
	vCode = vCode + "</TR>";

	var kval = 2;
	if((vFirstDay >=5 && vLastDay == 31) ||(vFirstDay >= 6 && vLastDay == 30)){
	} else {
		kval=1;
	}
	var kvalfeb = 1;
	if(vFirstDay == 0 && vLastDay ==  28){
		kvalfeb = 10;
	}
	var enabledDisabledDayFlag=false;
	// Write the rest of the weeks
	for (k=2; k<7; k++) { 
		vCode = vCode + "<TR>";

		for (j=0; j<7; j++) {
			
			var sampDate = vDay+"-"+this.gMonth+"-"+this.gYear;     			       
			var state = chkDates(expectedStartDte,sampDate); // 1 <=2
			enabledDisabledDayFlag=enabledDisabledDay(j,vDay,this.gMonth,this.gYear)
			
			vCode = vCode + "<TD class='dateCol' onmouseover='hover(this)'" +
			" onmouseout='mouseout(this)' ";
			
			if(state=="failure"  || enabledDisabledDayFlag)
			{
				vCode = vCode + " onclick='return false;' " ;
			}	
			else
			{
				vCode = vCode + " onclick=\" if(correctElement(this)){ return setDateValues('" + this.format_data(vDay) + "','"+this.gReturnItem+"')}\"";
			}
			
			vCode = vCode +  " WIDTH='14%'"+this.color_day_comp(vDay)+" HEIGHT=15 ALIGN=CENTER "  + this.write_weekend_string(j) + ">";

			
//kandarp
			//if(state=="failure" ||(vDay<=28&&this.gMonth>=3&&vDay>=5&&this.gMonth>=9&&j!=1))
			if(state=="failure"  || enabledDisabledDayFlag)
			{
				
				vCode = vCode + "<span style='color: #999999;'>"+this.format_day(vDay)+"</span>"; 
				//vCode = vCode + "<span style='color: #999999;'>"+this.format_day(vDay)+"</span>"; 
			}
			else
			{
				vCode = vCode +  this.format_day(vDay); 

			}

			vCode = vCode + "</TD>";
			vDay=vDay + 1;

			if (vDay > vLastDay) {
				vOnLastDay = 1;
				break;
			}
		}

		if (j == 6)
			vCode = vCode + "</TR>";
		if (vOnLastDay == 1)
			break;
	}

	// Fill up the rest of last week with proper blanks, so that we get proper
	// square blocks
	for (m=1; m<(7-j); m++) {
		if (this.gYearly)
			vCode = vCode + "<TD class='dateCol' style='background-color:#ffffff' HEIGHT=15 ALIGN=CENTER WIDTH='14%'" + this.write_weekend_string(j+m) +
			"></TD>";
		else
			vCode = vCode + "<TD class='dateCol' style='background-color:#ffffff' WIDTH='14%' HEIGHT=15 ALIGN=CENTER  " +
			this.write_weekend_string(j+m) +
			">&nbsp;" // + m
			+ "</TD>";
	}
	vCode = vCode + "<TR>";
	if(kval == 1){

		for (m=0; m<7; m++) {
			if (this.gYearly)
				vCode = vCode + "<TD class='dateCol' style='background-color:#ffffff' HEIGHT=15 ALIGN=CENTER WIDTH='14%'" + this.write_weekend_string(j+m) +
				"></TD>";
			else
				vCode = vCode + "<TD class='dateCol' style='background-color:#ffffff' WIDTH='14%' HEIGHT=15 ALIGN=CENTER  " +
				this.write_weekend_string(j+m) +
				">&nbsp;"// + m
				+ "</TD>";
		}

	}

	if(kvalfeb == 10){
		vCode = vCode + "</TR>";
		vCode = vCode + "<TR>";
		for (m=0; m<7; m++) {
			if (this.gYearly)
				vCode = vCode + "<TD class='dateCol' HEIGHT=15 ALIGN=CENTER WIDTH='14%'" + this.write_weekend_string(j+m) +
				"></TD>";
			else
				vCode = vCode + "<TD class='dateCol' WIDTH='14%' HEIGHT=15 ALIGN=CENTER  " +
				this.write_weekend_string(j+m) +
				">&nbsp;"// + m
				+ "</TD>";
		}
	}



	return vCode;
}
Calendar.prototype.show = function(p_state) {
	var vCode = "";

	this.gWinCal.document.open();

	// Setup the page...
	this.wwrite("<html>");
	this.wwrite("<head><title></title>");
	this.wwrite("<style type='text/css' HREF='MoM_style.html'></style></head>");

	this.wwrite("<body  TOPMARGIN='0' LEFTMARGIN=0' RIGHTMARGIN='0' bgcolor='#FFFFFF'>" );

	// Show navigation buttons
	var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
	var prevMM = prevMMYYYY[0];
	var prevYYYY = prevMMYYYY[1];

	var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
	var nextMM = nextMMYYYY[0];
	var nextYYYY = nextMMYYYY[1];

	this.wwrite("<TABLE id='table2' WIDTH='100%' BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#CECFCE'><TR><TD COLSPAN='2' ALIGN=left><B><FONT COLOR='#990033' FACE='Verdana' SIZE='1'> " + "<A HREF=\"" +
			"javascript:Build(" +
			"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "','" + p_state + "'" +
			");" +
			"\"><FONT COLOR='#990033' FACE=Verdana SIZE=1><</FONT><\/A>&nbsp;"  +this.gMonthName + "&nbsp;<A HREF=\"" +
			"javascript:Build(" +
			"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "','" + p_state + "'" +
			");" +
			"\"><FONT COLOR='#990033' FACE=Verdana SIZE=1>></FONT><\/A>" + " </FONT></B></TD> <TD  COLSPAN='2' ALIGN=right><B><FONT FACE='Verdana' COLOR='#990033' SIZE='1'> "+ "<A HREF=\"" +
			"javascript:Build(" +
			"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "','" + p_state + "'" +
			");" +
			"\"><FONT COLOR='#990033' FACE=Verdana SIZE=1><</FONT><\/A>&nbsp;" + this.gYear + "&nbsp;<A HREF=\"" +
			"javascript:Build(" +
			"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "','" + p_state + "'" +
			");" +
			"\"><FONT COLOR='#990033' FACE=Verdana SIZE=1>></FONT><\/A>" + "  </FONT></B></TD></TR><TR><TD WIDTH='25%' ALIGN=center><FONT FACE='Verdana' SIZE='1'>");

	this.wwrite("</FONT></TD></TR></TABLE>");

	// Get the complete calendar code for the month..
	vCode = this.getMonthlyCalendarCode(p_state);
	this.wwrite(vCode);

	this.wwrite("</font></body></html>");
	this.gWinCal.document.close();
}

Calendar.prototype.showY = function(p_state) {
	var vCode = "";
	var i;
	var vr, vc, vx, vy;     // Row, Column, X-coord, Y-coord
	var vxf = 285;          // X-Factor
	var vyf = 200;          // Y-Factor
	var vxm = 0;            // X-margin
	var vym = 0;                // Y-margin
	if (isIE)   vym = 0;
	else if (isNav) vym = 0;

	this.gWinCal.document.open();

	this.wwrite("<html>");
	this.wwrite("<head><title>Calendar</title>");
	this.wwrite("<style type='text/css' HREF='MoM_style.html'>\n<!--");
	for (i=0; i<12; i++) {
		vc = i % 3;
		if (i>=0 && i<= 2)  vr = 0;
		if (i>=3 && i<= 5)  vr = 1;
		if (i>=6 && i<= 8)  vr = 2;
		if (i>=9 && i<= 11) vr = 3;

		vx = parseInt(vxf * vc) + vxm;
		vy = parseInt(vyf * vr) + vym;

		this.wwrite(".lclass" + i + " {position:absolute;top:" + vy + ";left:" + vx + ";}");
	}
	this.wwrite("-->\n</style>");
	this.wwrite("</head>");

	this.wwrite("<body TOPMARGIN='0' LEFTMARGIN=0' RIGHTMARGIN='0' bgcolor='#FFFFFF'>" );
	this.wwrite("<FONT FACE='" + fontface + "' SIZE=1><B>");
	this.wwrite("Year : " + this.gYear);
	this.wwrite("</B> </FONT>");

	// Show navigation buttons
	var prevYYYY = parseInt(this.gYear) - 1;
	var nextYYYY = parseInt(this.gYear) + 1;

	this.wwrite("<TABLE id='table3' WIDTH='100%' BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#FFFFFF'><TR><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"" +
			"javascript:Build(" +
			"'" + this.gReturnItem + "', null, '" + prevYYYY + "', '" + this.gFormat + "','" + p_state + "'" +
			");" +
	"\" alt='Prev Year'>Prev<\/A>]</TD><TD ALIGN=center>");
	this.wwrite("</TD><TD ALIGN=center>");
	this.wwrite("[<A HREF=\"" +
			"javascript:Build(" +
			"'" + this.gReturnItem + "', null, '" + nextYYYY + "', '" + this.gFormat + "','" + p_state + "'" +
			");" +
	"\">Next<\/A>]</TD></TR></TABLE>");

	// Get the complete calendar code for each month..
	var j;
	for (i=11; i>=0; i--) {
		if (isIE)
			this.wwrite("<DIV ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");
		else if (isNav)
			this.wwrite("<LAYER ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");

		this.gMonth = i;
		this.gMonthName = Calendar.get_month(this.gMonth);
		vCode = this.getMonthlyCalendarCode(p_state);
		this.wwrite(this.gMonthName + "/" + this.gYear + "");
		this.wwrite(vCode);

		if (isIE)
			this.wwrite("</DIV>");
		else if (isNav)
			this.wwrite("</LAYER>");
	}

	this.wwrite("</font></body></html>");
	this.gWinCal.document.close();
}

Calendar.prototype.wwrite = function(wtext) {
	// this.gWinCal.document.writeln(wtext);
	this.gWinCal.innerHTML = this.gWinCal.innerHTML+wtext;    
}

Calendar.prototype.wwriteA = function(wtext) {
	this.gWinCal.document.write(wtext);
}

Calendar.prototype.cal_header = function() {
	var vCode = "";

	vCode = vCode + "<TR BGCOLOR='#ffffff' COLOR='#336699' height='16px;'>";
	vCode = vCode + "<TD WIDTH='14%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Sun</B></FONT></TD>";
	vCode = vCode + "<TD WIDTH='14%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Mon</B></FONT></TD>";
	vCode = vCode + "<TD WIDTH='14%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Tue</B></FONT></TD>";
	vCode = vCode + "<TD WIDTH='14%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Wed</B></FONT></TD>";
	vCode = vCode + "<TD WIDTH='14%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Thu</B></FONT></TD>";
	vCode = vCode + "<TD WIDTH='14%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Fri</B></FONT></TD>";
	vCode = vCode + "<TD WIDTH='16%' ALIGN=CENTER><FONT SIZE='1' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Sat</B></FONT></TD>";
	vCode = vCode + "</TR>";

	return vCode;
}

Calendar.prototype.cal_data = function() {    
	var vDate = new Date();
	vDate.setDate(1);
	vDate.setMonth(this.gMonth);
	vDate.setFullYear(this.gYear);

	var vFirstDay=vDate.getDay();
	var vDay=1;
	var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
	var vOnLastDay=0;
	var vCode = "";

	/*
	 * Get day for the 1st of the requested month/year.. Place as many blank
	 * cells before the 1st day of the month as necessary.
	 */

	vCode = vCode + "<TR>";
	for (i=0; i<vFirstDay; i++) {
		vCode = vCode + "<TD WIDTH='14%' HEIGHT=15 ALIGN=CENTER " + this.write_weekend_string(i) + "><FONT SIZE='1' FACE='" + fontface + "'> </FONT></TD>";
	}

	// Write rest of the 1st week
	for (j=vFirstDay; j<7; j++) {
		vCode = vCode + "<TD WIDTH='14%' HEIGHT=15 ALIGN=CENTER "  + this.write_weekend_string(j) + "><FONT SIZE='1' FACE='" + fontface + "'>" +
		"<A style='text-decoration:underline' " +
		"onClick=\"document." + this.gReturnItem + ".value='" +
		this.format_data(vDay) +
		"';document." + this.gReturnItem + ".focus();closeLayer();\" onmouseover=setPointerType(this) >" +
		this.format_day(vDay) +
		"</A>" +
		"</FONT></TD>";
		vDay=vDay + 1;
	}
	vCode = vCode + "</TR>";

	// Write the rest of the weeks
	for (k=2; k<7; k++) {
		vCode = vCode + "<TR>";

		for (j=0; j<7; j++) {
			vCode = vCode + "<TD WIDTH='14%' HEIGHT=15 ALIGN=CENTER "  + this.write_weekend_string(j) + "><FONT SIZE='1' FACE='" + fontface + "'>" +
			"<A style='text-decoration:underline' " +
			"onClick=\"document." + this.gReturnItem + ".value='" +
			this.format_data(vDay) +
			"';"+ "document." + this.gReturnItem + ".focus();closeLayer();\" onmouseover=setPointerType(this) >" +
			this.format_day(vDay) +
			"</A>" +
			"</FONT></TD>";
			vDay=vDay + 1;

			if (vDay > vLastDay) {
				vOnLastDay = 1;
				break;
			}
		}

		if (j == 6)
			vCode = vCode + "</TR>";
		if (vOnLastDay == 1)
			break;
	}

	// Fill up the rest of last week with proper blanks, so that we get proper
	// square blocks
	for (m=1; m<(7-j); m++) {
		if (this.gYearly)
			vCode = vCode + "<TD  HEIGHT=15 ALIGN=CENTER WIDTH='14%'" + this.write_weekend_string(j+m) +
			"><FONT SIZE='1' FACE='" + fontface + "' COLOR='#FFFFFF'> </FONT></TD>";
		else
			vCode = vCode + "<TD WIDTH='14%' HEIGHT=15 ALIGN=CENTER  " + this.write_weekend_string(j+m) +
			"><FONT SIZE='1' FACE='" + fontface + "' COLOR='#FFFFFF'>" + m + "</FONT></TD>";
	}

	return vCode;
}

Calendar.prototype.format_day = function(vday) {
	var vNowDay = gNow.getDate();
	var vNowMonth = gNow.getMonth();
	var vNowYear = gNow.getFullYear();
//	Today's date
	if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
		return ("<FONT COLOR=\"#FF0000\"><B>" + vday + "</B></FONT>");
	else
		return (vday );
}

Calendar.prototype.write_weekend_string = function(vday) {
	var i;

	// Return special formatting for the weekend day.
	for (i=0; i<weekend.length; i++) {
		if (vday == weekend[i])
			return (" BGCOLOR=\"" + weekendColor + "\"");
	}

	return "";
}

Calendar.prototype.format_data = function(p_day) {
	var vData;
	var vMonth = 1 + this.gMonth;
	vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
	var vMon = Calendar.get_month(this.gMonth).substr(0,3);
	var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
	var vY4 = new String(this.gYear);    
	var vY2 = new String(this.gYear.substr(2,2));    
	var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day;

	switch (this.gFormat) {
	case "MM\/DD\/YYYY" :
		vData = vMonth + "\/" + vDD + "\/" + vY4;
		break;
	case "MM\/DD\/YY" :
		vData = vMonth + "\/" + vDD + "\/" + vY2;
		break;
	case "MM-DD-YYYY" :
		vData = vMonth + "-" + vDD + "-" + vY4;
		break;
	case "MM-DD-YY" :
		vData = vMonth + "-" + vDD + "-" + vY2;
		break;

	case "DD\/MON\/YYYY" :
		vData = vDD + "\/" + vMon + "\/" + vY4;
		break;
	case "DD\/MON\/YY" :
		vData = vDD + "\/" + vMon + "\/" + vY2;
		break;
	case "DD-MON-YYYY" :
		vData = vDD + "-" + vMon + "-" + vY4;
		break;
	case "DD-Mon-YYYY" :
		vData = vDD + "-" + vMon + "-" + vY4;
		break;
	case "DD-MON-YY" :
		vData = vDD + "-" + vMon + "-" + vY2;
		break;

	case "DD\/MONTH\/YYYY" :
		vData = vDD + "\/" + vFMon + "\/" + vY4;
		break;
	case "DD\/MONTH\/YY" :
		vData = vDD + "\/" + vFMon + "\/" + vY2;
		break;
	case "DD-MONTH-YYYY" :
		vData = vDD + "-" + vFMon + "-" + vY4;
		break;
	case "DD-MONTH-YY" :
		vData = vDD + "-" + vFMon + "-" + vY2;
		break;

	case "DD\/MM\/YYYY" :
		vData = vDD + "\/" + vMonth + "\/" + vY4;
		break;
	case "DD\/MM\/YY" :
		vData = vDD + "\/" + vMonth + "\/" + vY2;
		break;
	case "DD-MM-YYYY" :
		vData = vDD + "-" + vMonth + "-" + vY4;
		break;
	case "DD-MM-YY" :
		vData = vDD + "-" + vMonth + "-" + vY2;
		break;

	default :
		vData = vMonth + "\/" + vDD + "\/" + vY4;
	}

	return vData;
}

function Build(p_item, p_month, p_year, p_format,p_state) {
	var p_WinCal = ggWinCal;
	gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);

	// Customize your Calendar here..
	gCal.gBGColor="#FFFFFF";
	gCal.gLinkColor="#FFFFFF";
	gCal.gTextColor="#FFFFFF";
	gCal.gHeaderColor="#000000";

	// Choose appropriate show function
	if (gCal.gYearly)   gCal.showY(p_state);
	else    gCal.show(p_state);
}

function show_cal() {
	/*
	 * p_month : 0-11 for Jan-Dec; 12 for All Months. p_year : 4-digit year
	 * p_format: Date format (mm/dd/yyyy, dd/mm/yy, ...) p_item : Return Item.
	 */
	var top = 291;
	var left = 421;
	var p_state = "false";

	p_item = arguments[0];
	if (arguments[1] == null)
		p_month = new String(gNow.getMonth());
	else
		p_month = arguments[1];
	if (arguments[2] == "" || arguments[2] == null)
		p_year = new String(gNow.getFullYear().toString());
	else
		p_year = arguments[2];
	if (arguments[3] == null)
		p_format = "DD-MON-YYYY";
	else
		p_format = arguments[3];
	if (arguments[4] == null)
		top = 291;
	else
		top = arguments[4];
	if (arguments[5] == null)
		left = 421;
	else
		left = arguments[5];

	if (arguments[6] == null || arguments[6].length==0)
		p_state = "false";
	else
		p_state = arguments[6];        

	var dtls = "width=180,height=115,status=no,resizable=no,top="+top+",left="+left;  

	if(!vWinCal || vWinCal.closed) {
		vWinCal = window.open("", "Calendar","width=180,height=115,status=no,resizable=no,top="+top+",left="+left);
		vWinCal.opener = self;
		ggWinCal = vWinCal;
	} else if(vWinCal) {
		vWinCal.focus();
	}

	Build(p_item, p_month, p_year, p_format,p_state);
}

/** ********** */
var expectedStartDte = new Date();
var expectedEndDte;

/*
 * The parameters passed to calendar component are given below
 * 
 * v1 - The calendar object or text field v2 - The position of the calendar from
 * browser top v3 - The position of the calendar from browser left v4 - To
 * specify if calendar exists as part of the component or is related to a text
 * field true --> related to component false --> individual text field v5 - The
 * selected date in the calendar v6 - The lower limit of the calendar v7 - The
 * upper limit of the calendar v8 - To specify if limit to be applied to
 * calendar navigation v9 - The value is 1 or 2 for showing 1 or 2 monthly
 * calendar respectively
 */

function show_calendar(v1,v2,v3,v4,v5,v6,v7,v8,v9) {
	var dates=document.getElementById(v1).value.split("-");
	var tmpDate=document.getElementById(v1).value;
	tmpDate=tmpDate.replace(/\d{1,2}\-[A-Za-z]{3}\-\d{4}/,''); 
	if(tmpDate!=''){
		dates=["DD","MMM","YYYY"];
	}

	var stDtStr = v6.split("-");

	if(!isNaN(dates[0])&&!isNaN(dates[2])&&getMonthId(dates[1])!=undefined){
		if((dates[2] < stDtStr[2]) || ((dates[2] == stDtStr[2]) && (getMonthId(dates[1]) < stDtStr[1])) 
				|| ((dates[2] == stDtStr[2]) && (getMonthId(dates[1]) == stDtStr[1]) && dates[0] < stDtStr[0])){
			v5 = v6;
		}else{ 
			v5=dates[0]+"-"+getMonthId(dates[1])+"-"+dates[2];
		}
	}
	if(v5!=null)
	{
		var arrLst = v5.split("-");
		gNow.setFullYear(arrLst[2],arrLst[1],arrLst[0]); 
	}
	else
	{
		gNow = new Date();
		var elemobj = eval("document."+v1);
		var elemArray = elemobj.value.split("-");       
		if(elemArray.length==3)
		{               
			gNow.setFullYear(elemArray[2],getMonthId(elemArray[1]),elemArray[0]);
		}   
	} 

	if(v8=="n" || v8=="N")
	{
		expectedStartDte = null;
		expectedEndDte = null;
	}
	else
	{
		if(v6!=null && v6.length>0)
		{
			expectedStartDte = v6;                      
		}
		else
		{
			var tmp = new Date();           
			expectedStartDte = tmp.getMonth()+"-"+tmp.getFullYear();        

		}

		if(v7!=null)
			expectedEndDte = v7;
		else
			expectedEndDte=null;        
	}   

	var field = v1;
	var mon = new String(gNow.getMonth());
	var yr = new String(gNow.getFullYear().toString());
	var frmt = p_format = "DD-MON-YYYY";
	var top = v2;
	var lft = v3;   
	var state = v4;

	if(v9!=null && v9>2)
	{
		v9=2;
	}
	else if(v9==null)
	{
		v9=2;
	}

	show_2monthly_calendar(field,mon,yr,frmt,top,lft,state,v9); 

	// Setting focus to the calendar
	if(document.getElementById('hidCalLyr'))
	{			
		var layer = document.getElementById('hidCalLyr');		
		// var focusIt = layer.getElementsByTagName('a')[0];//This is an array,
		// get the first link.
		// focusIt.focus();
	}
}



/*
 * 2 Monthly Calendar Code Starts here
 */
function show_2monthly_calendar(p_item, p_month,p_year, p_format) {   

	var top = 291;
	var left = 421;
	var p_state = "false";

	// ++++++++++++++++++++++++++++++++++++
	var browserName=navigator.appName;
	var agt=navigator.userAgent.toLowerCase();
	var is_opera =     (document.all==undefined);     
	// ++++++++++++++++++++++++++++++++++++++++++++++++++



	p_item = arguments[0];
	if (arguments[1] == null)
		p_month = new String(gNow.getMonth());
	else
		p_month = arguments[1];
	if (arguments[2] == "" || arguments[2] == null)
		p_year = new String(gNow.getFullYear().toString());
	else
		p_year = arguments[2];
	if (arguments[3] == null)
		p_format = "DD-MON-YYYY";
	else
		p_format = arguments[3];
	if (arguments[4] == null)
		top = 291;
	else
		top = arguments[4];
	if (arguments[5] == null)
		left = 421;
	else
		left = arguments[5];

	if (arguments[6] == null || arguments[6].length==0)
		p_state = "false";
	else
		p_state = arguments[6];        

	var p_showId = arguments[7];

	var elem = document.createElement("div");
	elem.id = 'hidCalLyr';
	elem.align = "left"
		if(p_showId==2)
		{
			// elem.style.width='390px';


		}
		else if(p_showId==1)
		{      
			elem.style.width='250px';
		}
	elem.style.height='150px';
	elem.style.position='absolute';
	elem.style.top=''+top+'px';
	elem.style.left=''+left+'px';  
	elem.zIndex=3453000; 
	if (!is_opera) {

		var iframeElem = document.createElement("iframe");
		iframeElem.src="javascript:false";
		iframeElem.id = 'hidCalLyrIfr';
		if(p_showId==2)
		{
			// iframeElem.style.width='390px';

		}
		else if(p_showId==1){
			iframeElem.style.width='250px';  
		}

		iframeElem.style.display='block';

		iframeElem.style.border='0px';
		// iframeElem.zIndex=2000;

	}



	if(document.getElementById("hidCalLyr")==null || !document.getElementById("hidCalLyr"))
	{          
		/*
		 * var obj = document.forms[0]; obj.appendChild(iframeElem);
		 * obj.appendChild(elem);
		 */
		var obj = document.getElementsByTagName('body')[0];         
		if (!is_opera){

			obj.appendChild(iframeElem);
		}
		obj.appendChild(elem);          
	} 
	else
	{
		document.getElementById("hidCalLyr").style.display='block';
		document.getElementById("hidCalLyr").innerHTML="";
		document.getElementById("hidCalLyr").style.left=left+'px';
		document.getElementById("hidCalLyr").style.top=(top)+'px'         

		if (!is_opera) {          
			document.getElementById("hidCalLyrIfr").style.left=(left+2)+'px';		 
			document.getElementById("hidCalLyrIfr").style.top=(top+5)+'px'; 
			document.getElementById("hidCalLyrIfr").style.display='block';
			iframeElem.style.height=document.getElementById("hidCalLyrIfr").style.height;
		}

		if(p_showId==2)  {        


		}
		else if(p_showId==1)
		{       
			document.getElementById("hidCalLyr").style.width='250px';
			if (!is_opera)
				document.getElementById("hidCalLyrIfr").style.width='250px';
		}
	}

	ggWinCal=document.getElementById("hidCalLyr");     
	Build2Monthly(p_item, p_month, p_year, p_format,p_state,p_showId);
}

function compareDates(dte1Month,dte1Year,dte2,dte3,p_showId)
{    
	var tmpDte = dte1Month+"-"+dte1Year;
	var endDte = null;
	var startDte = null;
	if(dte2!=null)
		startDte = dte2.split('-')[1]+"-"+dte2.split('-')[2];
	if(dte3!=null)
		endDte = dte3.split('-')[1]+"-"+dte3.split('-')[2];   

	var startState = checkDateSeq(startDte,tmpDte); // if tmpDte is greater than
	// startDte ..
	// tmpDte>=startDte
	var endState = checkDateSeq(tmpDte,endDte); // if tmpDte is less than endDte
	// .... tmpDte<endDte

	var returnState = "true";    

	if(startState=="failure")
	{
		returnState = "false";
	}   

	if(returnState=="true")
	{
		if(p_showId==2)
		{			
			if(endState=="failure" )
			{
				returnState = "false";
			}	
			else if(endState=="equal" ) {
				returnState = "equal";
			}
		}
		else
		{
			if(endState=="failure")
			{
				returnState = "false";
			}	
		}		
	}

	return returnState;   

}

function checkDateSeq(fromDate,toDate){

	if(fromDate!=null && toDate!=null)
	{
		var firstDateElements = fromDate.split("-");
		var secondDateElements = toDate.split("-"); 

		var firstMonth = parseFloat(firstDateElements[0]);  
		var firstYear = parseFloat(firstDateElements[1]);

		var secMonth = parseFloat(secondDateElements[0]);           
		var secYear = parseFloat(secondDateElements[1]);

		if(secYear < firstYear){        
			return "failure";
		}else if((secYear == firstYear) && (secMonth<firstMonth)){      
			return "failure";
		}else if((secYear == firstYear) && (secMonth==firstMonth)){                     
			return "equal";
		}
	}

	return "true";

} 


function Build2Monthly(p_item, p_month, p_year, p_format,p_state,p_showId) {    
	var p_WinCal = ggWinCal;                    
	if(p_showId==2 && (p_month+"-"+p_year)==expectedEndDte)
	{    		
		var tmp = Calendar.calc_month_year(p_month, p_year, -1);    		
		p_month = ""+tmp[0];
		p_year = ""+tmp[1];    		
		this.gMonth = ""+p_month;
		this.gYear = ""+p_year;
	}    

	var compareState = compareDates(p_month,p_year,expectedStartDte,expectedEndDte,p_showId);        
	if(compareState=="true")
	{

		gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);

		// Customize your Calendar here..
		gCal.gBGColor="#FFFFFF";
		gCal.gLinkColor="#FFFFFF";
		gCal.gTextColor="#FFFFFF";
		gCal.gHeaderColor="#000000";

		gCal.gWinCal.innerHTML = "";	    	    
		gCal.showMonthly(p_month,p_state,p_showId); 	    
	}
	else if(compareState=="equal")
	{
		var tmpArray = p_item.split('@@');
		var tmpMonthObj = document.getElementById(tmpArray[1]);    	
		if((tmpMonthObj.options.length)==(tmpMonthObj.selectedIndex+1))
		{
			var prevMMYYYY = Calendar.calc_month_year(p_month, p_year, -1);
			p_month = ""+prevMMYYYY[0];
			p_year = ""+prevMMYYYY[1];
			this.gMonth = p_month;
			this.gYear = p_year;

			gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);

			// Customize your Calendar here..
			gCal.gBGColor="#FFFFFF";
			gCal.gLinkColor="#FFFFFF";
			gCal.gTextColor="#FFFFFF";
			gCal.gHeaderColor="#000000";

			gCal.gWinCal.innerHTML = "";	    	    
			gCal.showMonthly(p_month,p_state,p_showId);
		}   	

	}
	else
	{
		var tmp = expectedStartDte.split("-");
		var mth = parseFloat(tmp[0]);
		var yr = tmp[1];    		

		if(mth==0)
		{
			mth = 11;	
			yr = tmp[1];
		}
		else
		{
			mth = mth-1;	
			yr = parseFloat(tmp[1])+1;
		}

	}
}

function closeLayer(){
	if(document.getElementById("hidCalLyr"))    {
		var oNodeToRemove = document.getElementById("hidCalLyr");
		// oNodeToRemove.style.display="none"
		oNodeToRemove.parentNode.removeChild(oNodeToRemove);			

	}

	if(document.getElementById("hidCalLyrIfr"))    {
		var oNodeToRemove = document.getElementById("hidCalLyrIfr");
		// oNodeToRemove.style.display="none";
		oNodeToRemove.parentNode.removeChild(oNodeToRemove);

	}

}

Calendar.prototype.showMonthly = function(p_month,p_state,p_showId) {
	var vCode = "";
	var i;

	// Show navigation buttons
	var prevYYYY = parseInt(this.gYear) - 1;
	var nextYYYY = parseInt(this.gYear) + 1;        

	// Show navigation buttons
	var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
	var prevMM = prevMMYYYY[0];
	var prevYYYY = prevMMYYYY[1];

	var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
	var nextMM = nextMMYYYY[0];
	var nextYYYY = nextMMYYYY[1];

	var tmpStartDte = null;
	var tmpEndDte = null;
	if(expectedStartDte!=null)    
		var tmpStartDte = expectedStartDte.split('-')[1]+"-"+expectedStartDte.split('-')[2];
	if(expectedEndDte!=null)    
		tmpEndDte = expectedEndDte.split('-')[1]+"-"+expectedEndDte.split('-')[2];

	var startState = checkDateSeq(tmpStartDte,prevMM+"-"+prevYYYY);
	var endState = checkDateSeq(nextMM+"-"+nextYYYY,tmpEndDte);   


	var navStr = "<table  id='table4' border='0' cellpadding='0' align=right cellspacing='0' height='150' width='100%'>";
	navStr+="<tr><td></td><td>";
	navStr+= "<table id='table5' bgcolor='"+calendar_bgcolor+"' border='0' cellpadding='0' cellspacing='0' width='350px' style='display:block; overflow:hidden' >"; 
	navStr+="<tr>";
	navStr+="<td align=left width='29' style='background-color:#000000'><b><font color='"+calendar_head_font+"' face='Verdana' size='1'>&nbsp;&nbsp; " 
	if(startState!="failure")
	{
		navStr = navStr + "<a class='calLinkleft' href=\"" + "javascript:Build2Monthly(" +
		"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "','" + p_state + "','" + p_showId + "'" +
		");" +
		"\">" ;
	}   

	var tmpPrevMonth = this.gMonthName;
	var tmpNextMonth = Calendar.get_month(parseFloat(nextMM));
	if(p_showId==1)
	{
		if(startState!="failure")
			tmpPrevMonth = Calendar.get_month(parseFloat(prevMM)); 
		else
			tmpPrevMonth = "";

		if(endState=="failure")
			tmpNextMonth = "";
	}     

	if(p_showId==2 && startState!="failure")
	{
		tmpPrevMonth = Calendar.get_month(parseFloat(prevMM));
	}

	if(startState!="failure")
	{
		navStr = navStr + "&nbsp;"+ "<\/a>";
	}
	else
	{
		navStr = navStr + "&nbsp;";
	}

	navStr = navStr + " </font></b></td>";
	// Get the complete calendar code for each month..
	var j;
	var tmp = p_month;
	var tmp1;
	var tmp2;
	this.gMonthName = Calendar.get_month(this.gMonth); 
	vCode = this.getMonthlyCalendarCode(p_state);
	tmp1 = vCode;

	navStr+="<td class='space' colspan='2' style='background-color:#000000' align=center width='146'><b><font color='"+calendar_head_font+"' face='Verdana' size='1'>"+this.gMonthName + "/" + this.gYear + "</font></b></td>";
	this.gMonth = nextMM;
	this.gYear = new String(nextYYYY);    
	this.gMonthName = Calendar.get_month(this.gMonth);
	vCode = this.getMonthlyCalendarCode(p_state);
	tmp2 = vCode;      

	if(p_showId==2)
	{
		navStr+="<td align=center width='146' style='background-color:#000000'><b><font color='"+calendar_head_font+"' face='Verdana' size='1'>"+this.gMonthName + "/" + this.gYear + "</font></b></td>";
	}
	navStr+="<td align=right width='29' style='background-color:#000000'><b><font color='"+calendar_head_font+"' face='Verdana' size='1'>";

	if(endState=="true")
	{
		navStr = navStr + "<a class='calLink' href=\"" + "javascript:Build2Monthly(" +
		"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "','" + p_state + "','" + p_showId + "'" +
		");" +
		"\"><\/a>";
	}   
	else
	{
		if(p_showId==2)
			navStr = navStr + ""+tmpNextMonth;
	}

	if(p_showId==1)
	{
		if(endState=="equal")
		{
			navStr = navStr + "<a class='calLink' href=\"" + "javascript:Build2Monthly(" +
			"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "','" + p_state + "','" + p_showId + "'" +
			");" +
			"\"><font color='"+calendar_head_font+"' face=Verdana size=1>"+"Next"+"&nbsp;>></font><\/a>";
		}   
	}

	navStr = navStr + "&nbsp;&nbsp;";       
	navStr = navStr + "</font></td>";
	navStr+="</tr><tr>";
	navStr+="<td colspan='3' align=center valign=top class='space'>"+tmp1+"</td>";
	if(p_showId==2)
	{
		navStr+="<td colspan='2' align=center valign=top>"+tmp2+"</td>";
	}
	navStr+="</tr>";
	navStr+="<tr><td class='linkclose' colspan='5' align=center valign=top><a href=\"" + "javascript:closeLayer()\">Close</a></td>";
	navStr+="</tr></table>";
	navStr+="</td></tr></table>";
	this.wwrite(navStr);    
}

function chkDates(fromDate,toDate){

	if(fromDate!=null && toDate!=null)
	{
		var firstDateElements = fromDate.split("-");
		var secondDateElements = toDate.split("-");

		var firstDate = parseFloat(firstDateElements[0]);
		var firstMonth = parseFloat(firstDateElements[1]);  
		var firstYear = parseFloat(firstDateElements[2]);

		var secDate = parseFloat(secondDateElements[0]);
		var secMonth = parseFloat(secondDateElements[1]);           
		var secYear = parseFloat(secondDateElements[2]);

		if(secYear < firstYear){        
			return "failure";
		}else if((secYear == firstYear) && (secMonth<firstMonth)){      
			return "failure";
		}else if((secYear == firstYear) && (secMonth==firstMonth) && (secDate<firstDate)){                      
			return "failure";
		}else if((secYear == firstYear) && (secMonth==firstMonth) && (secDate==firstDate)){     
			return "equal";
		}
	}

	return "true";

}
function isValidDate(givenDate){ 
	var isValid=false;
	if(givenDate.length!=0){
		givenDate=new String(givenDate);
		var tmpdate=givenDate.replace(/\d{1,2}\-[A-Za-z]{3}\-\d{4}/,'');
		if(tmpdate==''){
			var dates=givenDate.split("-");
			dates[1]=dates[1].toUpperCase().replace(/JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC/,'');
			if(dates[1]==''){
				isValid=true; 
			}

		}
	} 
	return isValid;
}
function hover(el){
	var html=new String(el.innerHTML);
	if(html.toUpperCase().indexOf("SPAN")<0){ 
		el.className="dateColhover";
	}
}
function mouseout(el){
	el.className="dateCol"
}
function correctElement(el){
	var html=new String(el.innerHTML);
	return html.indexOf("SPAN")<0; 


}

function isInsideCal(el){
	var isInside=false;
	while(el!=null){
		if(el.id=='hidCalLyr'){
			isInside=true;
			break;
		}
		el=el.offsetParent;
	}
	return isInside;

}	  

function closeCalendar(e){
	var srcElement=document.all?e.srcElement:e.target;  
	if((srcElement.onclick==null||srcElement.onclick.toString().indexOf('show_calendar(')<0)&& !isInsideCal(srcElement)){
		if(document.getElementById("hidCalLyr")) 
			closeLayer();
	}

}   

if(document.all)
	document.onclick=function (){closeCalendar(window.event)};
	else{
		document.addEventListener("click",closeCalendar,true);
	}


//kandarp	DDDDDDDDDDDDDDDDDDDDDDDDDD
function enabledDisabledDay(j,vDay,gMonth,gYear)	// index 0 for jan and 11 for dec.
{
	
	var isDisable=false;

	var fOnlyRadioObj=document.getElementById("rtTripId1");
	var fcRadioObj=document.getElementById("rtTripId4");
	var fhcObj=document.getElementById("rtTripId2");
	var fhObj=document.getElementById("rtTripId3");
	var hcObj=document.getElementById("rtTripId5");
	
	var originDataFromFormSt;
	var destinationDataFromFormSt;
	
	var originDataFromForm;
	var destinationDataFromForm;

	if(fOnlyRadioObj.checked||fcRadioObj.checked)
	{
		originDataFromFormSt=document.searchForm.originforfOnlyandfc.value;
		destinationDataFromFormSt=document.searchForm.destinationforfOnlyandfc.value;
	}
	else if(fhcObj.checked||fhObj.checked)
	{
		originDataFromFormSt=document.packagesForm.originforfhcandfh.value;
		destinationDataFromFormSt=document.packagesForm.destinationforfhcandfh.value;
	}
	else if(hcObj.checked)
	{
		isDisable=false;
		return isDisable;
	}
	
	originDataFromForm=getStringFromCode(originDataFromFormSt);
	destinationDataFromForm=getStringFromCode(destinationDataFromFormSt);
	
	
	///////////////////////Condition/////////////
	if(originDataFromForm=="VPS" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth<=9)) || (j==2 && (gMonth<=9)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth<=9)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth<=9)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=0 && gMonth<=1)) || (j==1 && (gMonth<=0)) || (j==2 && (gMonth<=0)) || (j==3 && (gMonth<=0))|| (j==4 && (gMonth>=1 && gMonth<=1)) || (j==5 && (gMonth>=0 && gMonth<=1))||(j==6 && (gMonth<=0)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
	
		
	else if(originDataFromForm=="SDF" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth<=9)) || (j==2 && (gMonth<=9)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth<=9)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth<=9)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=0 && gMonth<=1)) || (j==1 && (gMonth<=0)) || (j==2 && (gMonth<=0)) || (j==3 && (gMonth<=0))|| (j==4 && (gMonth>=1 && gMonth<=1)) || (j==5 && (gMonth>=0 && gMonth<=1))||(j==6 && (gMonth<=0)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
	
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="ATL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth<=9)) || (j==2 && (gMonth<=9)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth<=9)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth<=9)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=0 && gMonth<=1)) || (j==1 && (gMonth<=0)) || (j==2 && (gMonth<=0)) || (j==3 && (gMonth<=0))|| (j==4 && (gMonth>=1 && gMonth<=1)) || (j==5 && (gMonth>=0 && gMonth<=1))||(j==6 && (gMonth<=0)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
		
	else if(originDataFromForm=="ATL" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth<=9)) || (j==2 && (gMonth<=9)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth<=9)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth<=9)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=0 && gMonth<=1)) || (j==1 && (gMonth<=0)) || (j==2 && (gMonth<=0)) || (j==3 && (gMonth<=0))|| (j==4 && (gMonth>=1 && gMonth<=1)) || (j==5 && (gMonth>=0 && gMonth<=1))||(j==6 && (gMonth<=0)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
	else if(originDataFromForm=="SDF" && destinationDataFromForm=="ATL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=1)) || (j==1 && (gMonth<=1)) || (j==2 && (gMonth<=1)) || (j==3 && (gMonth<=1))|| (j==4 && (gMonth<=1)) ||(j==5 && (gMonth<=1))||(j==6 && (gMonth<=1)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
		
	else if(originDataFromForm=="ATL" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=1)) || (j==1 && (gMonth<=1)) || (j==2 && (gMonth<=1)) || (j==3 && (gMonth<=1))|| (j==4 && (gMonth<=1)) ||(j==5 && (gMonth<=1))||(j==6 && (gMonth<=1)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="GPT" && destinationDataFromForm=="ATL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==1 && (gMonth<=2)) || (j==2 && (gMonth<=2)) || (j==3 && (gMonth<=2))|| (j==4 && (gMonth<=2)) ||(j==5 && (gMonth<=2))||(j==6 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
		
	else if(originDataFromForm=="ATL" && destinationDataFromForm=="GPT")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==1 && (gMonth<=2)) || (j==2 && (gMonth<=2)) || (j==3 && (gMonth<=2))|| (j==4 && (gMonth<=2)) ||(j==5 && (gMonth<=2))||(j==6 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="GPT" && destinationDataFromForm=="HOU")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==1 && (gMonth<=2)) || (j==2 && (gMonth<=2)) || (j==3 && (gMonth<=2))|| (j==4 && (gMonth<=2)) ||(j==5 && (gMonth<=2))||(j==6 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
		
	else if(originDataFromForm=="HOU" && destinationDataFromForm=="GPT")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==1 && (gMonth<=2)) || (j==2 && (gMonth<=2)) || (j==3 && (gMonth<=2))|| (j==4 && (gMonth<=2)) ||(j==5 && (gMonth<=2))||(j==6 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="GPT" && destinationDataFromForm=="PIE")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==1 && (gMonth<=3)) || (j==2 && (gMonth<=3)) || (j==3 && (gMonth<=3))|| (j==4 && (gMonth<=3)) ||(j==5 && (gMonth<=3))||(j==6 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}	
	
		
	else if(originDataFromForm=="PIE" && destinationDataFromForm=="GPT")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5)) || (j==1 && (gMonth>=5)) || (j==2 && (gMonth>=5)) || (j==3 && (gMonth>=5))|| (j==4 && (gMonth>=5)) ||(j==5 && (gMonth>=5))||(j==6 && (gMonth>=5)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==1 && (gMonth<=3)) || (j==2 && (gMonth<=3)) || (j==3 && (gMonth<=3))|| (j==4 && (gMonth<=3)) ||(j==5 && (gMonth<=3))||(j==6 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FLL" && destinationDataFromForm=="FPO")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=10)) || (j==1 && (gMonth>=10)) || (j==2 && (gMonth>=10)) || (j==3 && (gMonth>=10))|| (j==4 && (gMonth>=10)) ||(j==5 && (gMonth>=10))||(j==6 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==1 && (gMonth<=3)) || (j==2 && (gMonth<=3)) || (j==3 && (gMonth<=3))|| (j==4 && (gMonth<=3)) ||(j==5 && (gMonth<=3))||(j==6 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FPO" && destinationDataFromForm=="FLL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=10)) || (j==1 && (gMonth>=10)) || (j==2 && (gMonth>=10)) || (j==3 && (gMonth>=10))|| (j==4 && (gMonth>=10)) ||(j==5 && (gMonth>=10))||(j==6 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=3 && j!=4 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==1 && (gMonth<=3)) || (j==2 && (gMonth<=3)) || (j==3 && (gMonth<=3))|| (j==4 && (gMonth<=3)) ||(j==5 && (gMonth<=3))||(j==6 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="BWI" && destinationDataFromForm=="FPO")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=10)) || (j==4 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==4 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FPO" && destinationDataFromForm=="BWI")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=10)) || (j==4 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==4 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SDF" && destinationDataFromForm=="FPO")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=10)) || (j==4 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==4 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FPO" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=10)) || (j==4 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=3)) || (j==4 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="RIC" && destinationDataFromForm=="FPO")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) ||(j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=3)) ||(j==5 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FPO" && destinationDataFromForm=="RIC")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) ||(j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=3)) || (j==5 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="RDU" && destinationDataFromForm=="FPO")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) ||(j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=3)) ||(j==5 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FPO" && destinationDataFromForm=="RDU")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) ||(j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=3)) || (j==5 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="RDF" && destinationDataFromForm=="FPO")
	{	
		if(gYear == 2011)	
		{
			if(j!=3 && j!=6)
			{
				isDisable=true;
			}else if((j==3 && (gMonth>=10)) ||(j==6 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=3 && j!=6)
			{
				isDisable=true;
			}else if((j==3 && (gMonth<=3)) ||(j==6 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FPO" && destinationDataFromForm=="RIC")
	{	
		if(gYear == 2011)	
		{
			if(j!=3 && j!=6)
			{
				isDisable=true;
			}else if((j==3 && (gMonth>=10)) ||(j==6 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=3 && j!=6)
			{
				isDisable=true;
			}else if((j==3 && (gMonth<=3)) || (j==6 && (gMonth<=3)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
else if(originDataFromForm=="CKB" && destinationDataFromForm=="SFB")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==2 && (gMonth==11))|| (j==4 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth==11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=0 && vDay<8)) || (j==6 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}

	else if(originDataFromForm=="SFB" && destinationDataFromForm=="CKB")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==2 && (gMonth==11))|| (j==4 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth==11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=0 && vDay<8)) || (j==6 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}

	else if(originDataFromForm=="SFB" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==2 && (gMonth==11))|| (j==4 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth==11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=0 && vDay<8)) || (j==6 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SDF" && destinationDataFromForm=="SFB")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==2 && (gMonth==11))|| (j==4 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth==11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=0 && vDay<8)) || (j==6 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SFB" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=3 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=8)) || (j==3 && (gMonth>=5 && gMonth<=7))|| (j==4 && (gMonth>=5 && gMonth<=8)) || (j==6 && (gMonth>=5 && gMonth<=7)))
			{
				if((j==3 && gMonth==7 && vDay>18) || (j==6 && gMonth==7 && vDay>18) || (j==0 && gMonth==8 && vDay>17) || (j==4 && gMonth==8 && vDay>17))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="SFB")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=3 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=8)) || (j==3 && (gMonth>=5 && gMonth<=7))|| (j==4 && (gMonth>=5 && gMonth<=8)) || (j==6 && (gMonth>=5 && gMonth<=7)))
			{
				if((j==3 && gMonth==7 && vDay>18) || (j==6 && gMonth==7 && vDay>18) || (j==0 && gMonth==8 && vDay>17) || (j==4 && gMonth==8 && vDay>17))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
else if(originDataFromForm=="PGD" && destinationDataFromForm=="CMI")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)) || (j==1 && (gMonth>=11)) || (j==5 && (gMonth>=11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=0 && vDay<8)) || (j==5 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}

	else if(originDataFromForm=="CMI" && destinationDataFromForm=="PGD")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)) || (j==1 && (gMonth>=11)) || (j==5 && (gMonth>=11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=0 && vDay<8)) || (j==5 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}

	else if(originDataFromForm=="SDF" && destinationDataFromForm=="PGD")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)) || (j==1 && (gMonth>=11)) || (j==5 && (gMonth>=11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=0 && vDay<8)) || (j==5 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PGD" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)) || (j==1 && (gMonth>=11)) || (j==5 && (gMonth>=11)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else if(gMonth==11 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=0 && vDay<8)) || (j==5 && (gMonth<=0 && vDay<8)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SDF" && destinationDataFromForm=="PIA")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) || (j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIA" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) || (j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PGD" && destinationDataFromForm=="PIA")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) || (j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIA" && destinationDataFromForm=="PGD")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=10)) || (j==5 && (gMonth>=10)))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PGD" && destinationDataFromForm=="UTM")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=5)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="UTM" && destinationDataFromForm=="PGD")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=5)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="PGD")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=5)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PGD" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=5)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SFB" && destinationDataFromForm=="SHV")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SHV" && destinationDataFromForm=="SFB")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="ATL" && destinationDataFromForm=="LFT")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="LFT" && destinationDataFromForm=="ATL")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FLL" && destinationDataFromForm=="STL")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="STL" && destinationDataFromForm=="FLL")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="LAS" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="LAS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIE" && destinationDataFromForm=="AVL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="AVL" && destinationDataFromForm=="PIE")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="AVL" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="AVL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="LFT" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="LFT")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="CHA" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="CHA")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SHV" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="SHV")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==4 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="ATL" && destinationDataFromForm=="TYS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=3)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==3 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="TYS" && destinationDataFromForm=="ATL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=3)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==3 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="TYS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=3 && j!=5)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==3 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="TYS" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=3 && j!=5)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==3 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5 && gMonth<=7)))
			{
				if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="PIE")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5)) || (j==3 && (gMonth>=5 && gMonth<=8)) || (j==4 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5)))
			{
				if(j==4 && (gMonth==7 && vDay>18) || (j==3 && (gMonth==8 && vDay>=17)))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIE" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5)) || (j==3 && (gMonth>=5 && gMonth<=8)) || (j==4 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5)))
			{
				if(j==4 && (gMonth==7 && vDay>18) || (j==3 && (gMonth==8 && vDay>=17)))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
		else if(originDataFromForm=="VPS" && destinationDataFromForm=="STL")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=10)) || (j==5 && (gMonth>=5 && gMonth<=10)))
			{
				if(gMonth==10 && vDay>2)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="STL" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5 && gMonth<=10)) || (j==5 && (gMonth>=5 && gMonth<=10)))
			{
				if(gMonth==10 && vDay>2)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="ATL" && destinationDataFromForm=="PIE")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5)) || (j==3 && (gMonth>=5)) || (j==4 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5)))
			{
				if(j==4 && (gMonth==7 && vDay>18))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=3 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==3 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIE" && destinationDataFromForm=="ATL")
	{	
		if(gYear == 2011)	
		{
			if(j!=1 && j!=3 && j!=4 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth>=5)) || (j==3 && (gMonth>=5)) || (j==4 && (gMonth>=5 && gMonth<=7)) || (j==5 && (gMonth>=5)))
			{
				if(j==4 && (gMonth==7 && vDay>18))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=1 && j!=3 && j!=5)
			{
				isDisable=true;
			}else if((j==1 && (gMonth<=2)) || (j==3 && (gMonth<=2)) || (j==5 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="STL" && destinationDataFromForm=="PGD")
{ 
if(gYear == 2011) 
{
if(j!=0 && j!=4)
{
isDisable=true;
}else if((j==0 && gMonth>=11) || (j==4 && gMonth>=11))
{
if(gMonth==11 && vDay<24)
{
isDisable=true;
}
else
{
isDisable=false;
}
}
else
{
isDisable=true;
}
}else if(gYear == 2012) 
{
if(j!=0 && j!=4)
{
isDisable=true;
}else if((j==0 && (gMonth<=2)) || (j==4 && (gMonth<=2)))
{
isDisable=false;
}
else
{
isDisable=true;
}
}else
{
isDisable=true; 
}
}
else if(originDataFromForm=="PGD" && destinationDataFromForm=="STL")
{ 
if(gYear == 2011) 
{
if(j!=0 && j!=4)
{
isDisable=true;
}else if((j==0 && gMonth>=11) || (j==4 && gMonth>=11))
{
if(gMonth==11 && vDay<24)
{
isDisable=true;
}
else
{
isDisable=false;
}
}
else
{
isDisable=true;
}
}else if(gYear == 2012) 
{
if(j!=0 && j!=4)
{
isDisable=true;
}else if((j==0 && (gMonth<=2)) || (j==4 && (gMonth<=2)))
{
isDisable=false;
}
else
{
isDisable=true;
}
}else
{
isDisable=true; 
}
}
	else if(originDataFromForm=="FLL" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=7 && gMonth<=10)) || (j==4 && (gMonth>=5 && gMonth<=8)) || (j==6 && (gMonth>=5 && gMonth<=10)))
			{
				if(gMonth==10 && vDay>2)
				{
					isDisable=true;
				}
				else if(j==2 && (gMonth==7 && vDay<19) || (j==4 && gMonth==8 && vDay >17))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="FLL")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=7 && gMonth<=10)) || (j==4 && (gMonth>=5 && gMonth<=8)) || (j==6 && (gMonth>=5 && gMonth<=10)))
			{
				if(gMonth==10 && vDay>2)
				{
					isDisable=true;
				}
				else if(j==2 && (gMonth==7 && vDay<19) || (j==4 && gMonth==8 && vDay >17))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SDF" && destinationDataFromForm=="FLL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && gMonth>=10) || (j==2 && gMonth>=5) || (j==4 && gMonth>=10) || (j==6 && gMonth>=5))
			{
				if(j==0 && gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else if(j==4 && gMonth==7 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=0 && vDay<8)) || (j==2 && (gMonth<=0 && vDay<18)) || (j==4 && (gMonth<=0 && vDay<8)) || (j==6 && (gMonth<=0 && vDay<18)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FLL" && destinationDataFromForm=="SDF")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && gMonth>=10) || (j==2 && gMonth>=5) || (j==4 && gMonth>=10) || (j==6 && gMonth>=5))
			{
				if(j==0 && gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else if(j==4 && gMonth==7 && vDay<19)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=0 && vDay<8)) || (j==2 && (gMonth<=0 && vDay<18)) || (j==4 && (gMonth<=0 && vDay<8)) || (j==6 && (gMonth<=0 && vDay<18)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="SFB" && destinationDataFromForm=="LIT")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=3 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && gMonth>=11) || (j==3 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth>=5 && gMonth<=7)) || (j==6 && gMonth>=11))
			{
				if(gMonth==11 && vDay<24)
				{
					isDisable=true;
				}
				else if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=2)) || (j==6 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="LIT" && destinationDataFromForm=="SFB")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=3 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && gMonth>=11) || (j==3 && (gMonth>=5 && gMonth<=7)) || (j==6 && (gMonth>=5 && gMonth<=7)) || (j==6 && gMonth>=11))
			{
				if(gMonth==11 && vDay<24)
				{
					isDisable=true;
				}
				else if(gMonth==7 && vDay>18)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=2)) || (j==6 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="LIT")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=8)) || (j==4 && (gMonth>=5 && gMonth<=8)) || (j==6 && (gMonth>=5 && gMonth<=8)))
			{
				if(gMonth==8 && vDay>17)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="LIT" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=2 && j!=4 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth>=5 && gMonth<=8)) || (j==4 && (gMonth>=5 && gMonth<=8)) || (j==6 && (gMonth>=5 && gMonth<=8)))
			{
				if(gMonth==8 && vDay>17)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="UTM")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==1 && (gMonth>=5 && gMonth<=7)) || (j==2 && gMonth<=10) || (j==5 && (gMonth>=5 && gMonth<=7)) || (j==6 && gMonth<=10))
			{
				if((j==2 && gMonth==10 && vDay>2) || (j==6 && gMonth==10 && vDay>2))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=2)) || (j==6 && (gMonth<=2)))
			{
					isDisable=true;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="UTM" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=1 && j!=2 && j!=5 && j!=6)
			{
				isDisable=true;
			}else if((j==0 && (gMonth>=5 && gMonth<=7)) || (j==1 && (gMonth>=5 && gMonth<=7)) || (j==2 && gMonth<=10) || (j==5 && (gMonth>=5 && gMonth<=7)) || (j==6 && gMonth<=10))
			{
				if((j==2 && gMonth==10 && vDay>2) || (j==6 && gMonth==10 && vDay>2))
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=2 && j!=6)
			{
				isDisable=true;
			}else if((j==2 && (gMonth<=2)) || (j==6 && (gMonth<=2)))
			{
					isDisable=true;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="VPS" && destinationDataFromForm=="PIA")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && gMonth>=10) || (j==4 && gMonth>=10))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==4 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIA" && destinationDataFromForm=="VPS")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && gMonth>=10) || (j==4 && gMonth>=10))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==4 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="FLL" && destinationDataFromForm=="PIA")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && gMonth>=10) || (j==4 && gMonth>=10))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==4 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else if(originDataFromForm=="PIA" && destinationDataFromForm=="FLL")
	{	
		if(gYear == 2011)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && gMonth>=10) || (j==4 && gMonth>=10))
			{
				if(gMonth==10 && vDay<3)
				{
					isDisable=true;
				}
				else
				{
					isDisable=false;
				}
			}
			else
			{
				isDisable=true;
			}
			
		}else if(gYear == 2012)	
		{
			if(j!=0 && j!=4)
			{
				isDisable=true;
			}else if((j==0 && (gMonth<=2)) || (j==4 && (gMonth<=2)))
			{
					isDisable=false;
			}
			else
			{
				isDisable=true;
			}
			
		}else
		{
			isDisable=true;	
		}
	}
	else
	{
		isDisable=false;	
	}
	
		
///////////////////////End Condition/////////////
	return isDisable;
}
