var months = new Array("Jan", "Feb", "Mar","Apr", "May", "Jun", "Jul", "Aug", "Sep","Oct", "Nov", "Dec");
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31,30, 31, 30, 31);
var days = new Array("S","M", "T", "W","T", "F", "S");
var classTemp;
var calendarHover="calendarHover";
var today=new getToday();
var year=today.year;
var month=today.month;
var newCal;
var weekday;	//add by daniel for get week 10/08/2007
/*******************************************************************************
-- Function getDays
-- Description: This will return the num of days in such month
-- Input: month,year
-- Output:the value of the array daysInMonth[monthindex]
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function getDays(month, year) 
{ if (month==1)//check whether the year is a leap year or not when the month is Feb.
     return ((0 == year % 4) && (0 != (year % 100))) ||(0 == year % 400) ? 29 : 28;
  else
     return daysInMonth[month];
}

/*******************************************************************************
-- Function getToday
-- Description: This will return what day it is today
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function getToday() 
{  this.now = new Date();
   this.year = this.now.getFullYear();
   this.month = this.now.getMonth();
   this.day = this.now.getDate();
   this.weekday=this.now.getDay();
}


/*******************************************************************************
-- Function Calendar
-- Description: Show the Calendar
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function Calendar() 
{  newCal = new Date(year,month,1);//get the first day of current month
   today = new getToday();   
   var day = -1;   
   var startDay = newCal.getDay(); 
   var endDay=getDays(newCal.getMonth(), newCal.getFullYear());
   var daily = 0;  
   if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth()))
      day = today.day;
   var caltable = document.getElementById('calendar');  //nanco get the collection of the calendar table
   var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear()); //get the num of days in such month
   //create the calendar
   for (var intWeek = 0; intWeek < caltable.rows.length;intWeek++)
     for (var intDay = 0;intDay < caltable.rows[intWeek].cells.length;intDay++)
     {
      var cell = caltable.rows[intWeek].cells[intDay];   //get the cell case
	  
     var montemp=(newCal.getMonth()+1)<10?("0"+(newCal.getMonth()+1)):(newCal.getMonth()+1);      	  
      if ((intDay == startDay) && (0 == daily)){ daily = 1;}
      var daytemp=daily<10?("0"+daily):(daily);
      var d="<"+newCal.getFullYear()+"-"+montemp+"-"+daytemp+">";
      
	  //set style
	  if (daytemp<day)
		 cell.className = "calendarPre"
      else if(day==daily)
	     cell.className="calendarNow";
      else if(intDay==6)
	     cell.className = "calendarTdDay";
      else if (intDay==0)
	     cell.className ="calendarTdDay";
      else
	     cell.className="calendarTdDay";
	 
      if ((daily > 0) && (daily <= intDaysInMonth))  
      {	 cell.innerHTML = daily;  // nanco modified 02/16/2005 change innerText to innerHTML
         daily++;
      }
      else
        cell.innerHTML = "";  //nanco modified 02/16/2005 change innerText to innerHTML
    }	
 
  //document.getElementById("year").value=year;
  document.getElementById("lblyear").innerHTML=year;
  //document.getElementById("month").value=month+1<10 ? "0"+(month+1) : month+1;
  var mon;
  switch(month+1)
  {
	case 1: 
		mon = "Jan"; break;
	case 2: 
		mon = "Feb"; break;
	case 3: 
		mon = "Mar"; break;
	case 4: 
		mon = "Apr"; break;
	case 5: 
		mon = "May"; break;
	case 6: 
		mon = "Jun"; break;
	case 7: 
		mon = "Jul"; break;
	case 8: 
		mon = "Aug"; break;
	case 9: 
		mon = "Sep"; break;
	case 10: 
		mon = "Oct"; break;
	case 11: 
		mon = "Nov"; break;
	case 12: 
		mon = "Dec"; break;
  }
  
  document.getElementById("lblmonth").innerHTML=mon;
  //document.getElementById("before").style.display='none';
 
}


/*******************************************************************************
-- Function subMonth
-- Description: This will return the PreMonth
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function subMonth()
{
  if ((month-1)<0)
  {
     month=11;
	 year=year-1;
  }
  else
  { 
    month=month-1;
  }
  
  if (year <= document.getElementById("lblyear").innerHTML)
  {
	if (month-1 < today.month)
	{
		//document.getElementById("before").style.display='none';
	}
  }
  
  NewCalendar();
}

/*******************************************************************************
-- Function addMonth
-- Description: This will return next Month
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function addMonth()
{
  if((month+1)>11)
  {
    month=0;
    year=year+1;
  }
  else
  { 
    month=month+1;
  }
  
  document.getElementById("before").style.display='';
  
  NewCalendar();
}


/*******************************************************************************
-- Function setRevDate
-- Description: This will fill the blank revDate the date selected
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
-- 01/16/05 - Modified (Nanco) - add the selDate parameter
********************************************************************************/
function setRevDate(selDate)
{
	var InputDate=document.getElementById("ddlReq_date");
	var year=document.getElementById("lblyear").innerHTML;
	var month=document.getElementById("lblmonth").innerHTML;
	
	var mont;
	switch(month)
	{
		case "Jan": 
			mont = 01; break;
		case "Feb": 
			mont = 02; break;
		case "Mar": 
			mont = 03; break;
		case "Apr": 
			mont = 04; break;
		case "May": 
			mont = 05; break;
		case "Jun": 
			mont = 06; break;
		case "Jul": 
			mont = 07; break;
		case "Aug": 
			mont = 08; break;
		case "Sep": 
			mont = 09; break;
		case "Oct": 
			mont = 10; break;
		case "Nov": 
			mont = 11; break;
		case "Dec": 
			mont = 12; break;
	}

	var day=selDate;//nanco modified 02/16/2005
	day=day < 10 ? "0"+day:day;
	
	if(day!='' && !CompareDate(mont+"/"+day+"/"+year,today.month+1+"/"+today.day+"/"+today.year))
	{
		//InputDate.value=month+"/"+day+"/"+year;
	   var wholedate=mont+"/"+day+"/"+year
	   for(i=0;i<InputDate.length;i++){
	   if(InputDate.options[i].value==wholedate)
	   {
	   ind=i;
	   }
	   }
	   try{          
			InputDate.options[ind].selected=true;
			document.getElementById("btnCanE").focus();
       }catch(e){
			InputDate.value=wholedate;
			document.getElementById("btnCanE").focus();
       }          

		CloseCalendar();
		
	}
}


function SetRevDateToText(selDate)
{    
	var InputDate=document.getElementById(document.getElementById("hdnDateName").value);
	var year=document.getElementById("lblyear").innerHTML;
	var month=document.getElementById("lblmonth").innerHTML;
	var mont;
	switch(month)
	{
		case "Jan": 
			mont = 01; break;
		case "Feb": 
			mont = 02; break;
		case "Mar": 
			mont = 03; break;
		case "Apr": 
			mont = 04; break;
		case "May": 
			mont = 05; break;
		case "Jun": 
			mont = 06; break;
		case "Jul": 
			mont = 07; break;
		case "Aug": 
			mont = 08; break;
		case "Sep": 
			mont = 09; break;
		case "Oct": 
			mont = 10; break;
		case "Nov": 
			mont = 11; break;
		case "Dec": 
			mont = 12; break;
	}

	var day=selDate;//nanco modified 02/16/2005
	day=day < 10 ? "0"+day:day;
	
	//if(day!='' && !CompareDate(mont+"/"+day+"/"+year,today.month+1+"/"+today.day+"/"+today.year))
	if(day!='')
	{
		var week;
		var date1=mont+"/"+day+"/"+year;		
		var x=new Date(date1);		
		//var selectedDate=Date.parse(x);		 
		weekday=x.getDay();
			switch(weekday){
				case 0:	
					week="Sun"; break;
				case 1:	
					week="Mon"; break;
				case 2:	
					week="Tue"; break;
				case 3:	
					week="Wed"; break;
				case 4:	
					week="Thu"; break;
				case 5:	
					week="Fri"; break;
				case 6:	
					week="Sat"; break;	
			}
		
		InputDate.value=week+", "+ month+" "+day+", "+year;		
		//document.getElementById("btnCanE").focus();
		
	   /*var wholedate=mont+"/"+day+"/"+year
	   for(i=0;i<InputDate.length;i++){
	   if(InputDate.options[i].value==wholedate)
	   {
	   ind=i;
	   }
	   }
	   try{          
			InputDate.options[ind].selected=true;
       }catch(e){
			InputDate.value=wholedate;
       }*/

		CloseCalendar();
		
	}
}

//add by william 07/19/2007

function setOrderRevDate(selDate)
{
	var InputDate=document.getElementById("ddlReq_date");
	var InputDay=document.getElementById("ddlDate");
	var year=document.getElementById("lblyear").innerHTML;
	var month=document.getElementById("lblmonth").innerHTML;
	
	var mont;
	switch(month)
	{
		case "Jan": 
			mont = 01; break;
		case "Feb": 
			mont = 02; break;
		case "Mar": 
			mont = 03; break;
		case "Apr": 
			mont = 04; break;
		case "May": 
			mont = 05; break;
		case "Jun": 
			mont = 06; break;
		case "Jul": 
			mont = 07; break;
		case "Aug": 
			mont = 08; break;
		case "Sep": 
			mont = 09; break;
		case "Oct": 
			mont = 10; break;
		case "Nov": 
			mont = 11; break;
		case "Dec": 
			mont = 12; break;
	}

	var day=selDate;//nanco modified 02/16/2005
	//day=day < 10 ? "0"+day:day;
	
	if(day!='' && !CompareDate(mont+"/"+day+"/"+year,today.month+1+"/"+today.day+"/"+today.year))
	{
		//InputDate.value=month+"/"+day+"/"+year;
	   var wholedate=mont+"/"+year
	   for(i=0;i<InputDate.length;i++){
	   if(InputDate.options[i].value==wholedate)
	   {
	   ind=i;
	   }
	   }
	   for(j=0;j<InputDay.length;j++){
	   if(InputDay.options[j].value==day)
	   {
	   jnd=j;
	   }
	   }

	try{    
	
		InputDate.options[ind].selected=true;
		InputDay.options[jnd].selected=true;
    }catch(e){
		InputDate.value=wholedate;
    }   

	if (document.getElementById('hdnReqDate').value.split("/")[0]+"/"+document.getElementById('hdnDate').value+"/"+document.getElementById('hdnReqDate').value.split("/")[1]!=mont+"/"+day+"/"+year)
	{
		document.getElementById("btnResubmit").style.display="";
		document.getElementById("lblReSubmit").style.display="";
		document.getElementById("btnNext").style.display="none";
	}
	else
	{
		document.getElementById("btnResubmit").style.display="none";
		document.getElementById("lblReSubmit").style.display="none";
		document.getElementById("btnNext").style.display="";
	}
		
		CloseCalendar();
		
	}
}

/*function setRevDate(controlname)
{   
	var ddlDate=document.getElementById(controlname);
	var year=document.getElementById("year").value;
	var month=document.getElementById("month").value;
	var day=window.event.srcElement.innerText;
	
	var i;

	
	//day=day < 10 ? "0"+day:day;
	
	if(day!='' && !CompareDate(month+"/"+day+"/"+year,today.month+1+"/"+today.day+"/"+today.year))
	{
	
	   var wholedate=month+"/"+day+"/"+year
	  
	   for(i=0;i<ddlDate.length;i++){
	     if(ddlDate.options[i].value==wholedate){
	     ind=i;
	     }
	   
	   }
	   
	   try{          
			ddlDate.options[ind].selected=true;
       }catch(e){
			ddlDate.value=wholedate;
       }   
	   
	   CloseCalendar();
		
	}
}*/

/*******************************************************************************
-- Function setHolidayDate
-- Description: This will fill the blank HolidayDate the date selected
-- Input: 
-- Output:
-- 11/02/04 - Created (Cooker)
********************************************************************************/
function setHolidayDate()
{
	var InputDate=document.getElementById("DaytimeVoucherInfo1_txtReq_date");
	var year=document.getElementById("year").value;
	var month=document.getElementById("month").value;
	var day=event.srcElement.innerText;
	
	day=day < 10 ? "0"+day:day;
	
	if(day!='')
	{
		InputDate.value=month+"/"+day+"/"+year;
		
	}
}

/*******************************************************************************
-- Function setRevDateFromCal()
-- Description: This will fill the blank revDate the date selected,
                used  when there is more than 1 inputDate
-- Input: 
-- Output:
-- 10/29/2004  modified from function setRevDate()   Nancy
-- 01/16/05 - Modified (Nanco) - add the selDate parameter
********************************************************************************/

function setRevDateFromCal(selDate)
{   var InputDate=document.getElementById(document.getElementById("hdnDateName").value);
	//var InputDate=document.getElementById(atag);
	var year=document.getElementById("year").value;
	var month=document.getElementById("month").value;
	var day=selDate;//nanco modified 02/16/2005
	
	day=day < 10 ? "0"+day:day;
	
	if(day!='' && !CompareDate(month+"/"+day+"/"+year,today.month+1+"/"+today.day+"/"+today.year))
	{
		InputDate.value=month+"/"+day+"/"+year;
		CloseCalendar();
	}
}
/*******************************************************************************
-- Function setRevDateBefore()
-- Description: This will fill the blank revDate the date(before today) selected,
                used  when there is more than 1 inputDate
-- Input: 
-- Output:
-- 10/29/2004  modified from function setRevDateFromCal()   (wan)
********************************************************************************/

function setRevDateBefore()
{   var InputDate=document.getElementById(document.all.hdnDateName.value);
	//var InputDate=document.getElementById(atag);
	var year=document.getElementById("year").value;
	var month=document.getElementById("month").value;
	var day=event.srcElement.innerText;
	
	day=day < 10 ? "0"+day:day;
	
	//if(day!='' && !CompareDate(month+"/"+day+"/"+year,today.month+1+"/"+today.day+"/"+today.year))
	//{
		InputDate.value=month+"/"+day+"/"+year;
		
		document.getElementById("DivCalendar").style.display = 'none';
	//}
}

/*******************************************************************************
-- Function clearRevDateBefore()
-- Description: This will clear the revDate box,
                when there is more than 1 inputDate,work with setRevDateBefore().
-- Input: 
-- Output:
-- 04/20/2005  create (Ming)
********************************************************************************/
function clearRevDateBefore()
{
   var InputDate=document.getElementById(document.all.hdnDateName.value);
   if (event.srcElement.innerText.length>0){
     InputDate.value="";
     document.getElementById("DivCalendar").style.display = 'none';
   }
}

function setAnyDate()
{
   var InputDate=document.getElementById(document.all.hdnDateName.value);
	//var InputDate=document.getElementById(atag);
	var year=document.getElementById("year").value;
	var month=document.getElementById("month").value;
	if (event.srcElement.innerText.length>0)
	{
		var day=event.srcElement.innerText;
			day=day < 10 ? "0"+day:day;
		InputDate.value=month+"/"+day+"/"+year;
		document.all["DivCalendar"].style.display = 'none';
	}
}

/*******************************************************************************
-- Function setDate
-- Description: This will return a new date that filled in the calendar's blanks
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function setDate() 
{
  if (document.all.month.value<1||document.all.month.value>12)
  {
    alert("please enter the month bettewn 1-12!");
	return;
  }
  year=Math.ceil(document.all.year.value);
  month=Math.ceil(document.all.month.value-1);
  Calendar();
}


/*******************************************************************************
-- Function show
-- Description: This will populate the calendar in the right position
-- Input: atag   id of div of the calendar
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function show(atag)
{
	var calendar=document.getElementById("DivCalendar");
    var	fixedX = -1			
	var	fixedY = -1			
	var	leftpos=95
	var	toppos=0
	
	if(calendar.style.display=="none")
	{
	//var rad=document.getElementById("rdReservation");
	//if(rad.checked==true)
	//{
		calendar.style.display="";
		
		 ctl = atag
				do {
					ctl = ctl.offsetParent;
					leftpos	+= ctl.offsetLeft;
					toppos += ctl.offsetTop;
				} while(ctl.tagName!="BODY");
				
			 calendar.style.left =	fixedX==-1 ? atag.offsetLeft + leftpos :	fixedX
			calendar.style.top = fixedY==-1 ? atag.offsetTop +	toppos + atag.offsetHeight + 2 : fixedY
			
			//document.getElementById("before").style.display='none';
	}
		//}
else
	calendar.style.display="none";
}

/*******************************************************************************
-- Function showC
-- Description: This will populate the calendar in the right position
-- Input: atag   id of div of the calendar
-- Output:
-- 11/02/04 - Created (Cooker)
********************************************************************************/
function showC(atag)
{
	var calendar=document.getElementById("DivCalendar");
    var	fixedX = -1			
	var	fixedY = -1			
	var	leftpos=100
	var	toppos=0
	
	if(calendar.style.display=="none")
	{
		
		calendar.style.display="";
		
		 ctl = atag
				do {
					ctl = ctl.offsetParent;
					leftpos	+= ctl.offsetLeft;
					toppos += ctl.offsetTop;
				} while(ctl.tagName!="BODY");
				
			calendar.style.left =	fixedX==-1 ? atag.offsetLeft + leftpos :	fixedX
			calendar.style.top = fixedY==-1 ? atag.offsetTop +	toppos + atag.offsetHeight + 2 : fixedY

		
		}
	else
		calendar.style.display="none";
}

/*******************************************************************************
-- Function showCan
-- Description: This will populate the calendar in the right position 
-- Input:        dateTag     name of inputDate
                 canTag      name of divCalendar  
-- Output:
-- 10/29/2004   modified from function show()   Nancy   
********************************************************************************/
function showCaL(dateTag,calTag)    //aTag  txtDate,canTag  name of divCalendar
{	
	var calendar=document.getElementById(calTag);
	var atag=document.getElementById(dateTag);
    var	fixedX = -1			
	var	fixedY = -1			
	var	leftpos=140
	var	toppos=0
	
	if(calendar.style.display=="none")
	{
		calendar.style.display="";
		
		 ctl = atag
				do {
				
					ctl = ctl.offsetParent;
					leftpos	+= ctl.offsetLeft;
					toppos += ctl.offsetTop;
				} while(ctl.tagName!="BODY" && ctl.tagName!="HTML");
				
			 /*calendar.style.left =	fixedX==-1 ? atag.offsetLeft + leftpos :	fixedX
			 calendar.style.top = fixedY==-1 ? atag.offsetTop +	toppos + atag.offsetHeight + 2 : fixedY*/
	     calendar.style.left =	(fixedX==-1 ? atag.offsetLeft + leftpos :	fixedX)+"px";
		 calendar.style.top = (fixedY==-1 ? atag.offsetTop +	toppos + atag.offsetHeight + 2 : fixedY)+"px";	
		 
       var DateName =document.getElementById("hdnDateName");
       DateName.value=dateTag

	}
	else
		calendar.style.display="none";
}

function hidCaL(dateTag,calTag)    //aTag  txtDate,canTag  name of divCalendar
{
	var calendar=document.getElementById("DivCalendar");
	calendar.style.display="none";
}

/*******************************************************************************
-- Function CloseCalendar
-- Description: This will close the calendar 
-- Input: 
-- Output:
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function CloseCalendar()
{
	var calendar=document.getElementById("DivCalendar");
	calendar.style.display="none";

}

/*******************************************************************************
-- Function CompareDate
-- Description: This will return the result of the compareDate function
-- Input: date1,date2
-- Output: true, when date1<date2 
		   false, when date1>=date2
-- 10/10/04 - Created (Cooker)
********************************************************************************/
function CompareDate(date1,date2)
{
	if(Date.parse(date1)<Date.parse(date2))
		return true;
	else
		return false;
}

//add by william 13/08/2007
function ChangeColor(obj)
{
	obj.style.backgroundColor="Red";
}

function RestorColor(obj)
{
    var month=document.getElementById("lblmonth").innerHTML;
    if (month=="Jan"){
        month="1";
    }else if(month=="Feb"){
        month="2";
    }else if(month=="Mar"){
        month="3";
    }else if(month=="Apr"){
        month="4";
    }else if(month=="May"){
        month="5";
    }else if(month=="Jun"){
        month="6";
    }else if(month=="Jul"){
        month="7";
    }else if(month=="Aug"){
        month="8";
    }else if(month=="Sep"){
        month="9";
    }else if(month=="Oct"){
        month="10";
    }else if(month=="Nov"){
        month="11";
    }else if(month=="Dec"){
        month="12";
    }    
    var strDate=month+'/'+obj.innerHTML+'/'+document.getElementById("lblyear").innerHTML;  
    //alert(strDate); 
    var a;   
    if(isNaN(Date.parse(strDate))){
        a=0;   
    }else{   
        a=(new Date(strDate)).getDay();   
        if(a==0) a=7;   
    } 
    //alert(a);
    today = new getToday();
    todayDate=today.month+1+'/'+today.day+'/'+today.year;
//    alert(today.year);
//    alert(document.getElementById("lblyear").innerHTML);
//    alert(today.month);
//    alert(month-1);
//    alert(today.day);
//    alert(obj.innerHTML);
    if ((today.year == document.getElementById("lblyear").innerHTML) &&(today.month == month-1) && (today.day==obj.innerHTML)){
        obj.style.backgroundColor="#a91313";
    }else{
        /*if (CompareDate(strDate,todayDate)==true){
            obj.style.backgroundColor="#ffffff";
        }else{
            if (a==6 || a==7){
                obj.style.backgroundColor="#c5def4";
            }else{
                obj.style.backgroundColor="#d9e6f2";
            }        
        } */
        obj.style.backgroundColor="#ffffff";   
    } 
    
}

function NewCalendar() 
{  newCal = new Date(year,month,1);//get the first day of current month
   today = new getToday();   
   var day = -1;   
   var startDay = newCal.getDay(); 
   var endDay=getDays(newCal.getMonth(), newCal.getFullYear());
   var daily = 0;  
   if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth()))
      day = today.day;
   var caltable = document.getElementById('calendar');  //nanco get the collection of the calendar table
   var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear()); //get the num of days in such month
   //create the calendar
   for (var intWeek = 0; intWeek < caltable.rows.length;intWeek++)
     for (var intDay = 0;intDay < caltable.rows[intWeek].cells.length;intDay++)
     {
      var cell = caltable.rows[intWeek].cells[intDay];   //get the cell case
	  
     var montemp=(newCal.getMonth()+1)<10?("0"+(newCal.getMonth()+1)):(newCal.getMonth()+1);      	  
      if ((intDay == startDay) && (0 == daily)){ daily = 1;}
      var daytemp=daily<10?("0"+daily):(daily);
      var d="<"+newCal.getFullYear()+"-"+montemp+"-"+daytemp+">";
      
	  //set style
	  if (daytemp<day)
		 cell.className = "calendarPre"
      else if(day==daily)
	     cell.className="calendarNow";
      else if(intDay==6)
	     cell.className = "calendarTdDay";
      else if (intDay==0)
	     cell.className ="calendarTdDay";
      else
	     cell.className="calendarTdDay";
	 
      if ((daily > 0) && (daily <= intDaysInMonth))  
      {	 cell.innerHTML = daily;  // nanco modified 02/16/2005 change innerText to innerHTML
         daily++;
      }
      else
        cell.innerHTML = "";  //nanco modified 02/16/2005 change innerText to innerHTML
    }	
 
  document.getElementById("lblyear").innerHTML=year;
  var mon;
  switch(month+1)
  {
	case 1: 
		mon = "Jan"; break;
	case 2: 
		mon = "Feb"; break;
	case 3: 
		mon = "Mar"; break;
	case 4: 
		mon = "Apr"; break;
	case 5: 
		mon = "May"; break;
	case 6: 
		mon = "Jun"; break;
	case 7: 
		mon = "Jul"; break;
	case 8: 
		mon = "Aug"; break;
	case 9: 
		mon = "Sep"; break;
	case 10: 
		mon = "Oct"; break;
	case 11: 
		mon = "Nov"; break;
	case 12: 
		mon = "Dec"; break;
  }
  
  document.getElementById("lblmonth").innerHTML=mon;
  //document.getElementById("before").style.display='none';
}

function OpenWindowAddress(){
	
	eval("window.open('addr_format.aspx','addrformat','width=375,height=400');");
}