if((scwDateTodayStr=="undefined")||(scwDateTodayStr==null)){
	scwDateTodayStr = new Date().toDateString();
}
if((scwDateDisplayFormat=="undefined")||(scwDateDisplayFormat==null))
{
	var scwDateDisplayFormat="DD/MM/YYYY";
	var scwDateOutputFormat="DD/MM/YYYY";
	var scwDateInputSequence="DMY";
}
var scwDateToday=Date.parse(scwDateTodayStr);
var scwDateYesterday = scwDateToday - (24*60*60*1000);
var scwDateTemp=new Date(scwDateToday);
var scwDateNow=new Date(scwDateToday + (4*24*60*60*1000) );
var scwBaseYear=scwDateTemp.getFullYear();
var scwDropDownYears=5;
var scwLanguage;
var frmSearch;
function scwSetDefaultLanguage(){
try{
scwSetLanguage();
}
catch(exception){
scwToday="Today:";
scwDrag="click here to drag";
scwArrMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
scwArrWeekInits=["S","M","T","W","T","F","S"];
scwInvalidDateMsg="The entered date is invalid.\n";
scwOutOfRangeMsg="The entered date is invalid.\nValid format: " + scwDateDisplayFormat;
scwDoesNotExistMsg="The entered date does not exist.";
scwInvalidAlert=["Invalid date (",") ignored.Valid format: " + scwDateDisplayFormat];
scwDateDisablingError=["Error "," is not a Date object."];
scwRangeDisablingError=["Error "," should consist of two elements."];
}
}
var scwWeekStart=1;
var scwWeekNumberDisplay=false;
var scwWeekNumberBaseDay=4;
var scwShowInvalidDateMsg=true,scwShowOutOfRangeMsg=true,scwShowDoesNotExistMsg=true,scwShowInvalidAlert=true,scwShowDateDisablingError=true,scwShowRangeDisablingError=true;
var scwArrDelimiters=["/","-",".",","," "];
var scwZindex=1;
var scwBlnStrict=true;
var scwEnabledDay=[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true];
var scwDisabledDates=new Array();

var scwActiveToday=true;
var scwOutOfMonthDisable=true;
var scwOutOfMonthHide=true;
var scwOutOfRangeDisable=true;
var scwAllowDrag=false;
var scwClickToHide=false;
document.writeln("<style type=\"text/css\">"+".scw           {padding:1px;vertical-align:middle;}"+"iframe.scw     {position:absolute;z-index:"+scwZindex+";top:0px;left:0px;visibility:hidden;"+"width:1px;height:1px;}"+"table.scw      {padding:0px;visibility:hidden;"+"position:absolute;cursor:default;"+"width:200px;top:0px;left:0px;"+"z-index:"+(scwZindex+1)+";text-align:center;}"+"</style>");
document.writeln("<style type=\"text/css\">"+"/* IMPORTANT:  The SCW calendar script requires all "+"               the classes defined here."+"*/"+"table.scw      {padding:       2px;"+"vertical-align:middle;"+"border:        solid 2px #000000;"+"font-size:     10pt;"+"font-family:   Arial,Helvetica,Sans-Serif;}"+"td.scwDrag,"+"td.scwHead                 {padding:       0px 0px;"+"text-align:    center;"+"background-color: #9C9A9C;}"+"td.scwDrag                 {font-size:     8pt;}"+"select.scwHead             {margin:        3px 1px;"+"text-align:    center;}"+"input.scwHead              {height:        22px;"+"width:         22px;"+"vertical-align:middle;"+"text-align:    center;"+"margin:        2px 1px;"+"font-weight:   bold;"+"font-size:     10pt;"+"font-family:   fixedSys;}"+"td.scwWeekNumberHead,"+"td.scwWeek                 {padding:       0px;"+"text-align:    center;"+"font-weight:   bold;}"+"td.scwFoot,"+"td.scwFootHover,"+"td.scwFoot:hover,"+"td.scwFootDisabled         {padding:       0px;"+"text-align:    center;"+"font-weight:   normal;}"+"table.scwCells             {text-align:    right;"+"font-size:     8pt;"+"width:         96%;}"+"td.scwCells,"+"td.scwCellsHover,"+"td.scwCells:hover,"+"td.scwCellsDisabled,"+"td.scwCellsExMonth,"+"td.scwCellsExMonthHover,"+"td.scwCellsExMonth:hover,"+"td.scwCellsExMonthDisabled,"+"td.scwCellsWeekend,"+"td.scwCellsWeekendHover,"+"td.scwCellsWeekend:hover,"+"td.scwCellsWeekendDisabled,"+"td.scwInputDate,"+"td.scwInputDateHover,"+"td.scwInputDate:hover,"+"td.scwInputDateDisabled,"+"td.scwWeekNo,"+"td.scwWeeks                {padding:           3px;"+"width:             16px;"+"height:            16px;"+"font-weight:       bold;"+"vertical-align:    middle;}"+"/* Blend the colours into your page here...    */"+"/* Calendar background */"+"table.scw                  {background-color:  #ffffff;}"+"/* Drag Handle */"+"td.scwDrag                 {background-color:  #9999CC;"+"color:             #CCCCFF;}"+"/* Week number heading */"+"td.scwWeekNumberHead       {color:             #000000;}"+"/* Week day headings */"+"td.scwWeek                 {color:             #000000;}"+"/* Week numbers */"+"td.scwWeekNo               {background-color:  #776677;"+"color:             #000000;}"+"/* Enabled Days */"+"/* Week Day */"+"td.scwCells                {"+"color:             #000000;}"+"/* Day matching the input date */"+"td.scwInputDate            {"+"color:             #FF0000;}"+"/* Weekend Day */"+"td.scwCellsWeekend         {"+"color:             #000000;}"+"/* Day outside the current month */"+"td.scwCellsExMonth         {"+"color:             #ffffff;}"+"/* Today selector */"+"td.scwFoot                 {"+"color:             #FF0000;}"+"/* MouseOver/Hover formatting "+"       If you want to \"turn off\" any of the formatting "+"       then just set to the same as the standard format"+"       above."+" "+"       Note: The reason that the following are"+"       implemented using both a class and a :hover"+"       pseudoclass is because Opera handles the rendering"+"       involved in the class swap very poorly and IE6 "+"       (and below) only implements pseudoclasses on the"+"       anchor tag."+"*/"+"/* Active cells */"+"td.scwCells:hover,"+"td.scwCellsHover           {background-color:  #FFFF00;"+"cursor:            pointer;"+"cursor:            hand;"+"color:             #000000;}"+"/* Day matching the input date */"+"td.scwInputDate:hover,"+"td.scwInputDateHover       {background-color:  #FFFF00;"+"cursor:            pointer;"+"cursor:            hand;"+"color:             #000000;}"+"/* Weekend cells */"+"td.scwCellsWeekend:hover,"+"td.scwCellsWeekendHover    {background-color:  #FFFF00;"+"cursor:            pointer;"+"cursor:            hand;"+"color:             #000000;}"+"/* Day outside the current month */"+"td.scwCellsExMonth:hover,"+"td.scwCellsExMonthHover    {"+""+""+"color:             #ffffff;}"+"/* Today selector */"+"td.scwFoot:hover,"+"td.scwFootHover            {color:             #FFFF00;"+"cursor:            pointer;"+"cursor:            hand;"+"font-weight:       bold;}"+"/* Disabled cells */"+"/* Week Day */"+"/* Day matching the input date */"+"td.scwInputDateDisabled    {"+"color:             #9C9A9C;}"+"td.scwCellsDisabled        {"+"color:             #9C9A9C;}"+"/* Weekend Day */"+"td.scwCellsWeekendDisabled {"+"color:             #9C9A9C;}"+"/* Day outside the current month */"+"td.scwCellsExMonthDisabled {"+"color:             #ffffff;}"+"td.scwFootDisabled         {"+"color:             #9C9A9C;}"+"</style>");
var scwTargetEle,scwTriggerEle,scwMonthSum=0,scwBlnFullInputDate=false,scwPassEnabledDay=new Array(),scwSeedDate=new Date(),scwParmActiveToday=true,scwWeekStart=scwWeekStart%7,scwToday,scwDrag,scwArrMonthNames,scwArrWeekInits,scwInvalidDateMsg,scwOutOfRangeMsg,scwDoesNotExistMsg,scwInvalidAlert,scwDateDisablingError,scwRangeDisablingError;
Date.prototype.scwFormat=function(_1){
var _2=0,codeChar="",result="";
for(var i=0;i<=_1.length;i++){
if(i<_1.length&&_1.charAt(i)==codeChar){
_2++;
}else{
switch(codeChar){
case "y":
case "Y":
result+=(this.getFullYear()%Math.pow(10,_2)).toString().scwPadLeft(_2);
break;
case "m":
case "M":
result+=(_2<3)?(this.getMonth()+1).toString().scwPadLeft(_2):scwArrMonthNames[this.getMonth()];
break;
case "d":
case "D":
result+=this.getDate().toString().scwPadLeft(_2);
break;
default:
while(_2-->0){
result+=codeChar;
}
}
if(i<_1.length){
codeChar=_1.charAt(i);
_2=1;
}
}
}
return result;
};
String.prototype.scwPadLeft=function(_4){
var _5="";
for(var i=0;i<(_4-this.length);i++){
_5+="0";
}
return (_5+this);
};
Function.prototype.runsAfterSCW=function(){
var _7=this,args=new Array(arguments.length);
for(var i=0;i<args.length;++i){
args[i]=arguments[i];
}
return function(){
for(var i=0;i<arguments.length;++i){
args[args.length]=arguments[i];
}
return (args.shift()==scwTriggerEle)?_7.apply(this,args):null;
};
};
function scwID(id){
return document.getElementById(id);
}
var scwNextActionReturn,scwNextAction;
function showCal(_b,_c){
scwShow(_b,_c);
scwShow1(_b,_c);
scwShow2(_b,_c);
}


function scwShow_group(_d,_e){
frmSearch='x';

scwTriggerEle=_e;
scwParmActiveToday=true;
for(var i=0;i<7;i++){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=true;
for(var j=2;j<arguments.length;j++){
if(arguments[j]==i){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=false;
if(scwDateNow.getDay()==i){
scwParmActiveToday=false;
}
}
}
}
scwSeedDate=scwDateNow;
if(typeof _d.value=="undefined"){
var _11=_d.childNodes;
for(var i=0;i<_11.length;i++){
if(_11[i].nodeType==3){
var _13=_11[i].nodeValue.replace(/^\s+/,"").replace(/\s+$/,"");
if(_13.length>0){
scwTriggerEle.scwTextNode=_11[i];
scwTriggerEle.scwLength=_11[i].nodeValue.length;
break;
}
}
}
}else{
var _14=_d.value.replace(/^\s+/,"").replace(/\s+$/,"");
}
scwSetDefaultLanguage();
scwID("scwDragText").innerHTML=scwDrag;
scwID("scwMonths").options.length=0;
for(var i=0;i<scwArrMonthNames.length;i++){
scwID("scwMonths").options[i]=new Option(scwArrMonthNames[i],scwArrMonthNames[i]);
}
scwID("scwYears").options.length=0;
for(var i=0;i<scwDropDownYears;i++){
scwID("scwYears").options[i]=new Option((scwBaseYear+i),(scwBaseYear+i));
}
for(var i=0;i<scwArrWeekInits.length;i++){
scwID("scwWeekInit"+i).innerHTML=scwArrWeekInits[(i+scwWeekStart)%scwArrWeekInits.length];
}
if(_14.length==0){
scwBlnFullInputDate=false;
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate||(new Date(scwBaseYear,0,1))>scwSeedDate){
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
}
}else{
function scwInputFormat(){
var _18=new Array(),scwArrInput=_14.split(new RegExp("[\\"+scwArrDelimiters.join("\\")+"]+","g"));
if(scwArrInput[0]!=null){
if(scwArrInput[0].length==0){
scwArrInput.splice(0,1);
}
if(scwArrInput[scwArrInput.length-1].length==0){
scwArrInput.splice(scwArrInput.length-1,1);
}
}
scwBlnFullInputDate=false;
switch(scwArrInput.length){
case 1:
_18[0]=parseInt(scwArrInput[0],10);
_18[1]="6";
_18[2]=1;
break;
case 2:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/M/i)];
_18[2]=1;
break;
case 3:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.search(/M/i)];
_18[2]=parseInt(scwArrInput[scwDateInputSequence.search(/D/i)],10);
scwBlnFullInputDate=true;
break;
default:
_18[0]=0;
_18[1]=0;
_18[2]=0;
}
var _19=/^(0?[1-9]|[1-2]\d|3[0-1])$/,scwExpValMonth=new RegExp("^(0?[1-9]|1[0-2]|"+scwArrMonthNames.join("|")+")$","i"),scwExpValYear=/^(\d{1,2}|\d{4})$/;
if(scwExpValYear.exec(_18[0])==null||scwExpValMonth.exec(_18[1])==null||_19.exec(_18[2])==null){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwBlnFullInputDate=false;
_18[0]=scwBaseYear+Math.floor(scwDropDownYears/2);
_18[1]="6";
_18[2]=1;
}
return _18;
}
scwArrSeedDate=scwInputFormat();
if(scwArrSeedDate[0]<100){
scwArrSeedDate[0]+=(scwArrSeedDate[0]>50)?1900:2000;
}
if(scwArrSeedDate[1].search(/\d+/)!=0){
month=scwArrMonthNames.join("|").toUpperCase().search(scwArrSeedDate[1].substr(0,3).toUpperCase());
scwArrSeedDate[1]=Math.floor(month/4)+1;
}
scwSeedDate=new Date(scwArrSeedDate[0],scwArrSeedDate[1]-1,scwArrSeedDate[2]);
}
if(isNaN(scwSeedDate)){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear,0,1))>scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear,0,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears)-1,11,1);
scwBlnFullInputDate=false;
}else{
if(scwBlnStrict&&scwBlnFullInputDate&&(scwSeedDate.getDate()!=scwArrSeedDate[2]||(scwSeedDate.getMonth()+1)!=scwArrSeedDate[1]||scwSeedDate.getFullYear()!=scwArrSeedDate[0])){
if(scwShowDoesNotExistMsg){
alert(scwDoesNotExistMsg);
}
scwSeedDate=new Date(scwSeedDate.getFullYear(),scwSeedDate.getMonth()-1,1);
scwBlnFullInputDate=false;
}
}
}
}
for(var i=0;i<scwDisabledDates.length;i++){
if(!((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Date))){
if((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Array)){
var _1b=true;
if(scwDisabledDates[i].length!=2){
if(scwShowRangeDisablingError){
alert(scwRangeDisablingError[0]+scwDisabledDates[i]+scwRangeDisablingError[1]);
}
_1b=false;
}else{
for(var j=0;j<scwDisabledDates[i].length;j++){
if(!((typeof scwDisabledDates[i][j]=="object")&&(scwDisabledDates[i][j].constructor==Date))){
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i][j]+scwDateDisablingError[1]);
}
_1b=false;
}
}
}
if(_1b&&(scwDisabledDates[i][0]>scwDisabledDates[i][1])){
scwDisabledDates[i].reverse();
}
}else{
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i]+scwDateDisablingError[1]);
}
}
}
}
scwMonthSum=12*(scwSeedDate.getFullYear()-scwBaseYear)+scwSeedDate.getMonth();
scwID("scwYears").options.selectedIndex=Math.floor(scwMonthSum/12);
scwID("scwMonths").options.selectedIndex=(scwMonthSum%12);
if(window.opera){
scwID("scwMonths").style.display="none";
scwID("scwMonths").style.display="block";
scwID("scwYears").style.display="none";
scwID("scwYears").style.display="block";
}
scwID("scwDrag").style.display=(scwAllowDrag)?((scwID("scwIFrame"))?"block":"table-row"):"none";
scwShowMonth(0);
scwTargetEle=_d;
var _1d=parseInt(_d.offsetTop,10)+parseInt(_d.offsetHeight,10),offsetLeft=parseInt(_d.offsetLeft,10);
if(!window.opera){
while(_d.tagName!="BODY"&&_d.tagName!="HTML"){
_1d-=parseInt(_d.scrollTop,10);
offsetLeft-=parseInt(_d.scrollLeft,10);
_d=_d.parentNode;
}
_d=scwTargetEle;
}
do{
_d=_d.offsetParent;
_1d+=parseInt(_d.offsetTop,10);
offsetLeft+=parseInt(_d.offsetLeft,10);
}while(_d.tagName!="BODY"&&_d.tagName!="HTML");
scwID("scw").style.top=_1d+"px";
scwID("scw").style.left=offsetLeft+"px";
if(scwID("scwIframe")){
scwID("scwIframe").style.top=_1d+"px";
scwID("scwIframe").style.left=offsetLeft+"px";
scwID("scwIframe").style.width=(scwID("scw").offsetWidth-2)+"px";
scwID("scwIframe").style.height=(scwID("scw").offsetHeight-2)+"px";
scwID("scwIframe").style.visibility="visible";
}
scwID("scw").style.visibility="visible";
scwID("scwYears").options.selectedIndex=scwID("scwYears").options.selectedIndex;
scwID("scwMonths").options.selectedIndex=scwID("scwMonths").options.selectedIndex;
var el=(_e.parentNode)?_e.parentNode:_e;
if(typeof event=="undefined"){
el.addEventListener("click",scwStopPropagation,false);
}else{
if(el.attachEvent){
el.attachEvent("onclick",scwStopPropagation);
}else{
event.cancelBubble=true;
}
}
}







function scwShow(_d,_e,_boo1){
scwDisabledDates[0]=[new Date(1800,0,1),new Date(scwDateYesterday)];
if(_boo1 == 'n'){
frmSearch='y'
}else if(_boo1 == 'x'){
frmSearch='x'
}else{
frmSearch='d'
}
/*var checkout=scwID("SearchCheckout").value;
var checkin_new=scwID("SearchCheckin").value;
var new_checkout=checkout.split("/");
var new_scw_checkin=checkin_new.split("/");
var val_chout=new_checkout[0].valueOf();
var val_chin=new_scw_checkin[0].valueOf();
//val_ch=val_ch.toString(val_ch);
val_ch=val_chout+1;
//alert(val_ch);
//new_check[1]=new_check[1]+1;
var che_ch=new_checkout[1]+"/"+new_checkout[0]+"/"+new_checkout[2];
var che_ch_in=new_scw_checkin[1]+"/"+new_scw_checkin[0]+"/"+new_scw_checkin[2];
//alert(che);
//if((checkin=="undefined")||(checkin==null)){
//	scwDateTodayStr = new Date(checkin).toDateString();
//}
scwCheckoutStr = new Date(che_ch).toDateString();
scwCheckinStr = new Date(che_ch_in).toDateString();
scwCheckoutStr=Date.parse(scwCheckoutStr);
scwCheckinStr=Date.parse(scwCheckinStr);
alert(scwCheckoutStr);
alert(scwCheckinStr);
alert("today : "+scwDateToday+" checkout : "+ scwCheckoutStr);
if(scwCheckinStr > scwCheckoutStr){
	alert("checkin date is invalid!");
	scwDateToday = scwDateTemp;
}
*/
scwTriggerEle=_e;
scwParmActiveToday=true;
for(var i=0;i<7;i++){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=true;
for(var j=2;j<arguments.length;j++){
if(arguments[j]==i){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=false;
if(scwDateNow.getDay()==i){
scwParmActiveToday=false;
}


}
}
}
//alert(scwDateNow);
scwSeedDate=scwDateNow;
if(typeof _d.value=="undefined"){
var _11=_d.childNodes;
for(var i=0;i<_11.length;i++){
if(_11[i].nodeType==3){
var _13=_11[i].nodeValue.replace(/^\s+/,"").replace(/\s+$/,"");
if(_13.length>0){
scwTriggerEle.scwTextNode=_11[i];
scwTriggerEle.scwLength=_11[i].nodeValue.length;
break;
}
}
}
}else{
var _14=_d.value.replace(/^\s+/,"").replace(/\s+$/,"");
}
scwSetDefaultLanguage();
scwID("scwDragText").innerHTML=scwDrag;
scwID("scwMonths").options.length=0;
for(var i=0;i<scwArrMonthNames.length;i++){
scwID("scwMonths").options[i]=new Option(scwArrMonthNames[i],scwArrMonthNames[i]);
}
scwID("scwYears").options.length=0;
for(var i=0;i<scwDropDownYears;i++){
scwID("scwYears").options[i]=new Option((scwBaseYear+i),(scwBaseYear+i));
}
for(var i=0;i<scwArrWeekInits.length;i++){
scwID("scwWeekInit"+i).innerHTML=scwArrWeekInits[(i+scwWeekStart)%scwArrWeekInits.length];
}
if(_14.length==0){
scwBlnFullInputDate=false;
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate||(new Date(scwBaseYear,0,1))>scwSeedDate){
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
}
}else{
function scwInputFormat(){
var _18=new Array(),scwArrInput=_14.split(new RegExp("[\\"+scwArrDelimiters.join("\\")+"]+","g"));
if(scwArrInput[0]!=null){
if(scwArrInput[0].length==0){
scwArrInput.splice(0,1);
}
if(scwArrInput[scwArrInput.length-1].length==0){
scwArrInput.splice(scwArrInput.length-1,1);
}
}
scwBlnFullInputDate=false;
switch(scwArrInput.length){
case 1:
_18[0]=parseInt(scwArrInput[0],10);
_18[1]="6";
_18[2]=1;
break;
case 2:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/M/i)];
_18[2]=1;
break;
case 3:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.search(/M/i)];
_18[2]=parseInt(scwArrInput[scwDateInputSequence.search(/D/i)],10);
scwBlnFullInputDate=true;
break;
default:
_18[0]=0;
_18[1]=0;
_18[2]=0;
}
var _19=/^(0?[1-9]|[1-2]\d|3[0-1])$/,scwExpValMonth=new RegExp("^(0?[1-9]|1[0-2]|"+scwArrMonthNames.join("|")+")$","i"),scwExpValYear=/^(\d{1,2}|\d{4})$/;
if(scwExpValYear.exec(_18[0])==null||scwExpValMonth.exec(_18[1])==null||_19.exec(_18[2])==null){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwBlnFullInputDate=false;
_18[0]=scwBaseYear+Math.floor(scwDropDownYears/2);
_18[1]="6";
_18[2]=1;
}
return _18;
}
scwArrSeedDate=scwInputFormat();
if(scwArrSeedDate[0]<100){
scwArrSeedDate[0]+=(scwArrSeedDate[0]>50)?1900:2000;
}
if(scwArrSeedDate[1].search(/\d+/)!=0){
month=scwArrMonthNames.join("|").toUpperCase().search(scwArrSeedDate[1].substr(0,3).toUpperCase());
scwArrSeedDate[1]=Math.floor(month/4)+1;
}
scwSeedDate=new Date(scwArrSeedDate[0],scwArrSeedDate[1]-1,scwArrSeedDate[2]);
}
if(isNaN(scwSeedDate)){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear,0,1))>scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear,0,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears)-1,11,1);
scwBlnFullInputDate=false;
}else{
if(scwBlnStrict&&scwBlnFullInputDate&&(scwSeedDate.getDate()!=scwArrSeedDate[2]||(scwSeedDate.getMonth()+1)!=scwArrSeedDate[1]||scwSeedDate.getFullYear()!=scwArrSeedDate[0])){
if(scwShowDoesNotExistMsg){
alert(scwDoesNotExistMsg);
}
scwSeedDate=new Date(scwSeedDate.getFullYear(),scwSeedDate.getMonth()-1,1);
scwBlnFullInputDate=false;
}
}
}
}
for(var i=0;i<scwDisabledDates.length;i++){
if(!((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Date))){
if((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Array)){
var _1b=true;
if(scwDisabledDates[i].length!=2){
if(scwShowRangeDisablingError){
alert(scwRangeDisablingError[0]+scwDisabledDates[i]+scwRangeDisablingError[1]);
}
_1b=false;
}else{
for(var j=0;j<scwDisabledDates[i].length;j++){
if(!((typeof scwDisabledDates[i][j]=="object")&&(scwDisabledDates[i][j].constructor==Date))){
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i][j]+scwDateDisablingError[1]);
}
_1b=false;
}
}
}
if(_1b&&(scwDisabledDates[i][0]>scwDisabledDates[i][1])){
scwDisabledDates[i].reverse();
}
}else{
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i]+scwDateDisablingError[1]);
}
}
}
}
scwMonthSum=12*(scwSeedDate.getFullYear()-scwBaseYear)+scwSeedDate.getMonth();
scwID("scwYears").options.selectedIndex=Math.floor(scwMonthSum/12);
scwID("scwMonths").options.selectedIndex=(scwMonthSum%12);
if(window.opera){
scwID("scwMonths").style.display="none";
scwID("scwMonths").style.display="block";
scwID("scwYears").style.display="none";
scwID("scwYears").style.display="block";
}
scwID("scwDrag").style.display=(scwAllowDrag)?((scwID("scwIFrame"))?"block":"table-row"):"none";
scwShowMonth(0);
scwTargetEle=_d;
var _1d=parseInt(_d.offsetTop,10)+parseInt(_d.offsetHeight,10),offsetLeft=parseInt(_d.offsetLeft,10);
if(!window.opera){
while(_d.tagName!="BODY"&&_d.tagName!="HTML"){
_1d-=parseInt(_d.scrollTop,10);
offsetLeft-=parseInt(_d.scrollLeft,10);
_d=_d.parentNode;
}
_d=scwTargetEle;
}
do{
_d=_d.offsetParent;
_1d+=parseInt(_d.offsetTop,10);
offsetLeft+=parseInt(_d.offsetLeft,10);
}while(_d.tagName!="BODY"&&_d.tagName!="HTML");
scwID("scw").style.top=_1d+"px";
scwID("scw").style.left=offsetLeft+"px";
if(scwID("scwIframe")){
scwID("scwIframe").style.top=_1d+"px";
scwID("scwIframe").style.left=offsetLeft+"px";
scwID("scwIframe").style.width=(scwID("scw").offsetWidth-2)+"px";
scwID("scwIframe").style.height=(scwID("scw").offsetHeight-2)+"px";
scwID("scwIframe").style.visibility="visible";
}
scwID("scw").style.visibility="visible";
scwID("scwYears").options.selectedIndex=scwID("scwYears").options.selectedIndex;
scwID("scwMonths").options.selectedIndex=scwID("scwMonths").options.selectedIndex;
var el=(_e.parentNode)?_e.parentNode:_e;
if(typeof event=="undefined"){
el.addEventListener("click",scwStopPropagation,false);
}else{
if(el.attachEvent){
el.attachEvent("onclick",scwStopPropagation);
}else{
event.cancelBubble=true;
}
}
//scwID("searchCheckout").value = 
//scwShow1(_d,_e);
}
//
function scwShow1(_d,_e,_boo){
	
frmSearch='';
scwTriggerEle=_e;
scwParmActiveToday=true;
if(_boo=='n'){
var checkin=scwID("SearchCheckin").value;
}else{
var checkin=scwID("searchCheckin").value;
}
var new_check=checkin.split("/");
var val_ch=new_check[0].valueOf();
//val_ch=val_ch.toString(val_ch);
val_ch=val_ch+1;
//alert(val_ch);
//new_check[1]=new_check[1]+1;
var local=scwID("locality").title;
var che;
if(local != 'us'){
che=new_check[1]+"/"+new_check[0]+"/"+new_check[2];
}else{
che=new_check[0]+"/"+new_check[1]+"/"+new_check[2];
}
//alert(che);
//if((checkin=="undefined")||(checkin==null)){
//	scwDateTodayStr = new Date(checkin).toDateString();
//}
scwDateTodayStr = new Date(che).toDateString();
//alert(scwDateTodayStr);
scwDateToday=Date.parse(scwDateTodayStr);
//by mubasher comments for check in date active till today date
//scwDateYesterday = scwDateToday - (24*60*60*1000);

scwDateYesterday1 = scwDateToday;
//alert(scwDateYesterday);
scwDateTemp=new Date(scwDateToday);
scwDateNow=new Date(scwDateToday + (1*24*60*60*1000) );
scwDisabledDates[0]=[new Date(1800,0,0),new Date(scwDateYesterday1)];
//alert(scwDisabledDates);
for(var i=0;i<7;i++){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=true;
for(var j=2;j<arguments.length;j++){
if(arguments[j]==i){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=false;
if(scwDateNow.getDay()==i){
scwParmActiveToday=false;
}


}
}
}
scwSeedDate=scwDateNow;
//alert(scwDateNow);
if(typeof _d.value=="undefined"){
var _11=_d.childNodes;
for(var i=0;i<_11.length;i++){
if(_11[i].nodeType==3){
var _13=_11[i].nodeValue.replace(/^\s+/,"").replace(/\s+$/,"");
if(_13.length>0){
scwTriggerEle.scwTextNode=_11[i];
scwTriggerEle.scwLength=_11[i].nodeValue.length;
break;
}
}
}
}else{
var _14=_d.value.replace(/^\s+/,"").replace(/\s+$/,"");
}
scwSetDefaultLanguage();
scwID("scwDragText").innerHTML=scwDrag;
scwID("scwMonths").options.length=0;
for(var i=0;i<scwArrMonthNames.length;i++){
scwID("scwMonths").options[i]=new Option(scwArrMonthNames[i],scwArrMonthNames[i]);
}
scwID("scwYears").options.length=0;
for(var i=0;i<scwDropDownYears;i++){
scwID("scwYears").options[i]=new Option((scwBaseYear+i),(scwBaseYear+i));
}
for(var i=0;i<scwArrWeekInits.length;i++){
scwID("scwWeekInit"+i).innerHTML=scwArrWeekInits[(i+scwWeekStart)%scwArrWeekInits.length];
}
if(_14.length==0){
scwBlnFullInputDate=false;
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate||(new Date(scwBaseYear,0,1))>scwSeedDate){
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
}
}else{
function scwInputFormat(){
var _18=new Array(),scwArrInput=_14.split(new RegExp("[\\"+scwArrDelimiters.join("\\")+"]+","g"));
if(scwArrInput[0]!=null){
if(scwArrInput[0].length==0){
scwArrInput.splice(0,1);
}
if(scwArrInput[scwArrInput.length-1].length==0){
scwArrInput.splice(scwArrInput.length-1,1);
}
}
scwBlnFullInputDate=false;
switch(scwArrInput.length){
case 1:
_18[0]=parseInt(scwArrInput[0],10);
_18[1]="6";
_18[2]=1;
break;
case 2:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/M/i)];
_18[2]=1;
break;
case 3:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.search(/M/i)];
_18[2]=parseInt(scwArrInput[scwDateInputSequence.search(/D/i)],10);
scwBlnFullInputDate=true;
break;
default:
_18[0]=0;
_18[1]=0;
_18[2]=0;
}
var _19=/^(0?[1-9]|[1-2]\d|3[0-1])$/,scwExpValMonth=new RegExp("^(0?[1-9]|1[0-2]|"+scwArrMonthNames.join("|")+")$","i"),scwExpValYear=/^(\d{1,2}|\d{4})$/;
if(scwExpValYear.exec(_18[0])==null||scwExpValMonth.exec(_18[1])==null||_19.exec(_18[2])==null){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwBlnFullInputDate=false;
_18[0]=scwBaseYear+Math.floor(scwDropDownYears/2);
_18[1]="6";
_18[2]=1;
}
return _18;
}
scwArrSeedDate=scwInputFormat();
if(scwArrSeedDate[0]<100){
scwArrSeedDate[0]+=(scwArrSeedDate[0]>50)?1900:2000;
}
if(scwArrSeedDate[1].search(/\d+/)!=0){
month=scwArrMonthNames.join("|").toUpperCase().search(scwArrSeedDate[1].substr(0,3).toUpperCase());
scwArrSeedDate[1]=Math.floor(month/4)+1;
}
scwSeedDate=new Date(scwArrSeedDate[0],scwArrSeedDate[1]-1,scwArrSeedDate[2]);
}

if(isNaN(scwSeedDate)){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear,0,1))>scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear,0,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears)-1,11,1);
scwBlnFullInputDate=false;
}else{
if(scwBlnStrict&&scwBlnFullInputDate&&(scwSeedDate.getDate()!=scwArrSeedDate[2]||(scwSeedDate.getMonth()+1)!=scwArrSeedDate[1]||scwSeedDate.getFullYear()!=scwArrSeedDate[0])){
if(scwShowDoesNotExistMsg){
alert(scwDoesNotExistMsg);
}
scwSeedDate=new Date(scwSeedDate.getFullYear(),scwSeedDate.getMonth()-1,1);
scwBlnFullInputDate=false;
}
}
}
}
//alert(scwDisabledDates);
for(var i=0;i<scwDisabledDates.length;i++){
if(!((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Date))){
if((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Array)){
var _1b=true;
if(scwDisabledDates[i].length!=2){
if(scwShowRangeDisablingError){
alert(scwRangeDisablingError[0]+scwDisabledDates[i]+scwRangeDisablingError[1]);
}
_1b=false;
}else{
for(var j=0;j<scwDisabledDates[i].length;j++){
if(!((typeof scwDisabledDates[i][j]=="object")&&(scwDisabledDates[i][j].constructor==Date))){
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i][j]+scwDateDisablingError[1]);
}
_1b=false;
}
}
}
if(_1b&&(scwDisabledDates[i][0]>scwDisabledDates[i][1])){
scwDisabledDates[i].reverse();
}
}else{
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i]+scwDateDisablingError[1]);
}
}
}
}
scwMonthSum=12*(scwSeedDate.getFullYear()-scwBaseYear)+scwSeedDate.getMonth();
scwID("scwYears").options.selectedIndex=Math.floor(scwMonthSum/12);
scwID("scwMonths").options.selectedIndex=(scwMonthSum%12);
if(window.opera){
scwID("scwMonths").style.display="none";
scwID("scwMonths").style.display="block";
scwID("scwYears").style.display="none";
scwID("scwYears").style.display="block";
}
scwID("scwDrag").style.display=(scwAllowDrag)?((scwID("scwIFrame"))?"block":"table-row"):"none";
scwShowMonth(0);
scwTargetEle=_d;
var _1d=parseInt(_d.offsetTop,10)+parseInt(_d.offsetHeight,10),offsetLeft=parseInt(_d.offsetLeft,10);
if(!window.opera){
while(_d.tagName!="BODY"&&_d.tagName!="HTML"){
_1d-=parseInt(_d.scrollTop,10);
offsetLeft-=parseInt(_d.scrollLeft,10);
_d=_d.parentNode;
}
_d=scwTargetEle;
}
do{
_d=_d.offsetParent;
_1d+=parseInt(_d.offsetTop,10);
offsetLeft+=parseInt(_d.offsetLeft,10);
}while(_d.tagName!="BODY"&&_d.tagName!="HTML");
scwID("scw").style.top=_1d+"px";
scwID("scw").style.left=offsetLeft+"px";
if(scwID("scwIframe")){
scwID("scwIframe").style.top=_1d+"px";
scwID("scwIframe").style.left=offsetLeft+"px";
scwID("scwIframe").style.width=(scwID("scw").offsetWidth-2)+"px";
scwID("scwIframe").style.height=(scwID("scw").offsetHeight-2)+"px";
scwID("scwIframe").style.visibility="visible";
}
scwID("scw").style.visibility="visible";
scwID("scwYears").options.selectedIndex=scwID("scwYears").options.selectedIndex;
scwID("scwMonths").options.selectedIndex=scwID("scwMonths").options.selectedIndex;
var el=(_e.parentNode)?_e.parentNode:_e;
if(typeof event=="undefined"){
el.addEventListener("click",scwStopPropagation,false);
}else{
if(el.attachEvent){
el.attachEvent("onclick",scwStopPropagation);
}else{
event.cancelBubble=true;
}
}
}


//
function scwHide(){
scwID("scw").style.visibility="hidden";
if(scwID("scwIframe")){
scwID("scwIframe").style.visibility="hidden";
}
if(typeof scwNextAction!="undefined"&&scwNextAction!=null){
scwNextActionReturn=scwNextAction();
scwNextAction=null;
}
}
function scwCancel(_1f){
if(scwClickToHide){
scwHide();
}
scwStopPropagation(_1f);
}
function scwStopPropagation(_20){
if(_20.stopPropagation){
_20.stopPropagation();
}else{
_20.cancelBubble=true;
}
}
function scwBeginDrag(_21){
var _22=scwID("scw");
var _23=_21.clientX,deltaY=_21.clientY,offsetEle=_22;
do{
_23-=parseInt(offsetEle.offsetLeft,10);
deltaY-=parseInt(offsetEle.offsetTop,10);
offsetEle=offsetEle.offsetParent;
}while(offsetEle.tagName!="BODY"&&offsetEle.tagName!="HTML");
if(document.addEventListener){
document.addEventListener("mousemove",moveHandler,true);
document.addEventListener("mouseup",upHandler,true);
}else{
_22.attachEvent("onmousemove",moveHandler);
_22.attachEvent("onmouseup",upHandler);
_22.setCapture();
}
scwStopPropagation(_21);
function moveHandler(_24){
if(!_24){
_24=window.event;
}
_22.style.left=(_24.clientX-_23)+"px";
_22.style.top=(_24.clientY-deltaY)+"px";
if(scwID("scwIframe")){
scwID("scwIframe").style.left=(_24.clientX-_23)+"px";
scwID("scwIframe").style.top=(_24.clientY-deltaY)+"px";
}
scwStopPropagation(_24);
}
function upHandler(_25){
if(!_25){
_25=window.event;
}
if(document.removeEventListener){
document.removeEventListener("mousemove",moveHandler,true);
document.removeEventListener("mouseup",upHandler,true);
}else{
_22.detachEvent("onmouseup",upHandler);
_22.detachEvent("onmousemove",moveHandler);
_22.releaseCapture();
}
scwStopPropagation(_25);
}
}
function scwShowMonth(_26){
var _27=new Date(scwDateToday),scwStartDate=new Date();
_27.setHours(12);
scwSelYears=scwID("scwYears");
scwSelMonths=scwID("scwMonths");
if(scwSelYears.options.selectedIndex>-1){
scwMonthSum=12*(scwSelYears.options.selectedIndex)+_26;
if(scwSelMonths.options.selectedIndex>-1){
scwMonthSum+=scwSelMonths.options.selectedIndex;
}
}else{
if(scwSelMonths.options.selectedIndex>-1){
scwMonthSum+=scwSelMonths.options.selectedIndex;
}
}
_27.setFullYear(scwBaseYear+Math.floor(scwMonthSum/12),(scwMonthSum%12),1);
scwID("scwWeek_").style.display=(scwWeekNumberDisplay)?((scwID("scwIFrame"))?"block":"table-cell"):"none";
if((12*parseInt((_27.getFullYear()-scwBaseYear),10))+parseInt(_27.getMonth(),10)<(12*scwDropDownYears)&&(12*parseInt((_27.getFullYear()-scwBaseYear),10))+parseInt(_27.getMonth(),10)>-1){
scwSelYears.options.selectedIndex=Math.floor(scwMonthSum/12);
scwSelMonths.options.selectedIndex=(scwMonthSum%12);
scwCurMonth=_27.getMonth();
_27.setDate((((_27.getDay()-scwWeekStart)<0)?-6:1)+scwWeekStart-_27.getDay());
var _28=new Date(_27.getFullYear(),_27.getMonth(),_27.getDate()).valueOf();
scwStartDate=new Date(_27);
var _29=scwID("scwFoot");
function scwFootOutput(){
scwSetOutput(scwDateNow);
}
if(scwDisabledDates.length==0){
if(scwActiveToday&&scwParmActiveToday){
_29.onclick=scwFootOutput;
_29.className="scwFoot";
if(scwID("scwIFrame")){
_29.onmouseover=scwChangeClass;
_29.onmouseout=scwChangeClass;
}
}else{
_29.onclick=null;
_29.className="scwFootDisabled";
if(scwID("scwIFrame")){
_29.onmouseover=null;
_29.onmouseout=null;
}
if(document.addEventListener){
_29.addEventListener("click",scwStopPropagation,false);
}else{
_29.attachEvent("onclick",scwStopPropagation);
}
}
}else{
for(var k=0;k<scwDisabledDates.length;k++){
if(!scwActiveToday||!scwParmActiveToday||((typeof scwDisabledDates[k]=="object")&&(((scwDisabledDates[k].constructor==Date)&&scwDateNow.valueOf()==scwDisabledDates[k].valueOf())||((scwDisabledDates[k].constructor==Array)&&scwDateNow.valueOf()>=scwDisabledDates[k][0].valueOf()&&scwDateNow.valueOf()<=scwDisabledDates[k][1].valueOf())))){
_29.onclick=null;
_29.className="scwFootDisabled";
if(scwID("scwIFrame")){
_29.onmouseover=null;
_29.onmouseout=null;
}
if(document.addEventListener){
_29.addEventListener("click",scwStopPropagation,false);
}else{
_29.attachEvent("onclick",scwStopPropagation);
}
break;
}else{
_29.onclick=scwFootOutput;
_29.className="scwFoot";
if(scwID("scwIFrame")){
_29.onmouseover=scwChangeClass;
_29.onmouseout=scwChangeClass;
}
}
}
}
function scwSetOutput(_2b){
if(typeof scwTargetEle.value=="undefined"){
scwTriggerEle.scwTextNode.replaceData(0,scwTriggerEle.scwLength,_2b.scwFormat(scwDateOutputFormat));
}else{
scwTargetEle.value=_2b.scwFormat(scwDateOutputFormat);
var date_out = Date.parse(_2b);
//alert(_2b);
date_out = date_out + (1*24*60*60*1000);
var myDate = new Date(date_out);

//_2ch= date_out.toString();
//alert(frmSearch);
if(frmSearch != '' ){
if(frmSearch == 'd'){
	if(scwID("searchCheckout1")){
		scwID("searchCheckout1").value=myDate.scwFormat(scwDateOutputFormat);
	}else{
		scwID("searchCheckout").value=myDate.scwFormat(scwDateOutputFormat);
	}
}else if(frmSearch == 'y'){
	if(scwID("SearchCheckout1")){
		scwID("SearchCheckout1").value=myDate.scwFormat(scwDateOutputFormat);
	}else{	
		scwID("SearchCheckout").value=myDate.scwFormat(scwDateOutputFormat);
	}
}
}
}
scwHide();
}
function scwCellOutput(_2c){
var _2d=scwEventTrigger(_2c),scwOutputDate=new Date(scwStartDate);
if(_2d.nodeType==3){
_2d=_2d.parentNode;
}
scwOutputDate.setDate(scwStartDate.getDate()+parseInt(_2d.id.substr(8),10));
scwSetOutput(scwOutputDate);
}
function scwChangeClass(_2e){
var _2f=scwEventTrigger(_2e);
if(_2f.nodeType==3){
_2f=_2f.parentNode;
}
switch(_2f.className){
case "scwCells":
_2f.className="scwCellsHover";
break;
case "scwCellsHover":
_2f.className="scwCells";
break;
case "scwCellsExMonth":
_2f.className="scwCellsExMonthHover";
break;
case "scwCellsExMonthHover":
_2f.className="scwCellsExMonth";
break;
case "scwCellsWeekend":
_2f.className="scwCellsWeekendHover";
break;
case "scwCellsWeekendHover":
_2f.className="scwCellsWeekend";
break;
case "scwFoot":
_2f.className="scwFootHover";
break;
case "scwFootHover":
_2f.className="scwFoot";
break;
case "scwInputDate":
_2f.className="scwInputDateHover";
break;
case "scwInputDateHover":
_2f.className="scwInputDate";
}
return true;
}
function scwEventTrigger(_30){
if(!_30){
_30=event;
}
return _30.target||_30.srcElement;
}
function scwWeekNumber(_31){
var _32=new Date(_31);
_32.setDate(_32.getDate()-_32.getDay()+scwWeekNumberBaseDay+((_31.getDay()>scwWeekNumberBaseDay)?7:0));
var _33=new Date(_32.getFullYear(),0,1);
_33.setDate(_33.getDate()-_33.getDay()+scwWeekNumberBaseDay);
if(_33<new Date(_32.getFullYear(),0,1)){
_33.setDate(_33.getDate()+7);
}
var _34=new Date(_33-scwWeekNumberBaseDay+_31.getDay());
if(_34>_33){
_34.setDate(_34.getDate()-7);
}
var _35="0"+(Math.round((_32-_33)/604800000,0)+1);
return _35.substring(_35.length-2,_35.length);
}
var _36=scwID("scwCells");
for(i=0;i<_36.childNodes.length;i++){
var _37=_36.childNodes[i];
if(_37.nodeType==1&&_37.tagName=="TR"){
if(scwWeekNumberDisplay){
_37.childNodes[0].innerHTML=scwWeekNumber(_27);
_37.childNodes[0].style.display=(scwID("scwIFrame"))?"block":"table-cell";
}else{
_37.childNodes[0].style.display="none";
}
for(j=1;j<_37.childNodes.length;j++){
var _38=_37.childNodes[j];
if(_38.nodeType==1&&_38.tagName=="TD"){
_37.childNodes[j].innerHTML=_27.getDate();
var _39=_37.childNodes[j],scwDisabled=((scwOutOfRangeDisable&&(_27<(new Date(scwBaseYear,0,1,_27.getHours()))||_27>(new Date(scwBaseYear+scwDropDownYears,0,0,_27.getHours()))))||(scwOutOfMonthDisable&&(_27<(new Date(_27.getFullYear(),scwCurMonth,1,_27.getHours()))||_27>(new Date(_27.getFullYear(),scwCurMonth+1,0,_27.getHours())))))?true:false;
_39.style.visibility=(scwOutOfMonthHide&&(_27<(new Date(_27.getFullYear(),scwCurMonth,1,_27.getHours()))||_27>(new Date(_27.getFullYear(),scwCurMonth+1,0,_27.getHours()))))?"hidden":"";
for(var k=0;k<scwDisabledDates.length;k++){
if((typeof scwDisabledDates[k]=="object")&&(scwDisabledDates[k].constructor==Date)&&_28==scwDisabledDates[k].valueOf()){
scwDisabled=true;
}else{
if((typeof scwDisabledDates[k]=="object")&&(scwDisabledDates[k].constructor==Array)&&_28>=scwDisabledDates[k][0].valueOf()&&_28<=scwDisabledDates[k][1].valueOf()){
scwDisabled=true;
}
}
}
if(scwDisabled||!scwEnabledDay[j-1+(7*((i*_36.childNodes.length)/6))]||!scwPassEnabledDay[(j-1+(7*(i*_36.childNodes.length/6)))%7]){
_37.childNodes[j].onclick=null;
if(scwID("scwIFrame")){
_37.childNodes[j].onmouseover=null;
_37.childNodes[j].onmouseout=null;
}
_39.className=(_27.getMonth()!=scwCurMonth)?"scwCellsExMonthDisabled":(scwBlnFullInputDate&&_27.toDateString()==scwSeedDate.toDateString())?"scwInputDateDisabled":(_27.getDay()%6==0)?"scwCellsWeekendDisabled":"scwCellsDisabled";
}else{
_37.childNodes[j].onclick=scwCellOutput;
if(scwID("scwIFrame")){
_37.childNodes[j].onmouseover=scwChangeClass;
_37.childNodes[j].onmouseout=scwChangeClass;
}
_39.className=(_27.getMonth()!=scwCurMonth)?"scwCellsExMonth":(scwBlnFullInputDate&&_27.toDateString()==scwSeedDate.toDateString())?"scwInputDate":(_27.getDay()%6==0)?"scwCellsWeekend":"scwCells";
}
_27.setDate(_27.getDate()+1);
_28=new Date(_27.getFullYear(),_27.getMonth(),_27.getDate()).valueOf();
}
}
}
}
}
scwID("scw").style.visibility="hidden";
scwID("scw").style.visibility="visible";
}
document.write("<!--[if IE]>"+"<iframe class='scw' src='/scwblank.html' "+"id='scwIframe' name='scwIframe' "+"frameborder='0'>"+"</iframe>"+"<![endif]-->"+"<table id='scw' class='scw'>"+"<tr class='scw'>"+"<td class='scw'>"+"<table class='scwHead' id='scwHead' width='100%' "+"cellspacing='0' cellpadding='0'>"+"<tr id='scwDrag' style='display:none;'>"+"<td colspan='4' class='scwDrag' "+"onmousedown='scwBeginDrag(event);'>"+"<div id='scwDragText'></div>"+"</td>"+"</tr>"+"<tr class='scwHead' >"+"<td class='scwHead'>"+"<img class='scwHead' id='scwHeadLeft' src='/img/prev_cal.gif' "+"onclick='scwShowMonth(-1);'  /></td>"+"<td class='scwHead'>"+"<select id='scwMonths' class='scwHead' "+"onchange='scwShowMonth(0);'>"+"</select>"+"</td>"+"<td class='scwHead'>"+"<select id='scwYears' class='scwHead' "+"onchange='scwShowMonth(0);'>"+"</select>"+"</td>"+"<td class='scwHead'>"+"<img class='scwHead' id='scwHeadRight' src='/img/next_cal.gif' "+"onclick='scwShowMonth(1);' /></td>"+"</tr>"+"</table>"+"</td>"+"</tr>"+"<tr class='scw'>"+"<td class='scw'>"+"<table class='scwCells' align='center'>"+"<thead>"+"<tr><td class='scwWeekNumberHead' id='scwWeek_' ></td>");
for(i=0;i<7;i++){
document.write("<td class='scwWeek' id='scwWeekInit"+i+"'></td>");
}
document.write("</tr>"+"</thead>"+"<tbody id='scwCells' "+"onClick='scwStopPropagation(event);'>");
for(i=0;i<6;i++){
document.write("<tr>"+"<td class='scwWeekNo' id='scwWeek_"+i+"'></td>");
for(j=0;j<7;j++){
document.write("<td class='scwCells' id='scwCell_"+(j+(i*7))+"'></td>");
}
document.write("</tr>");
}
document.write("</tbody>");
if((new Date(scwBaseYear+scwDropDownYears,11,32))>scwDateNow&&(new Date(scwBaseYear,0,0))<scwDateNow){
document.write("<tfoot class='scwFoot'>"+"<tr class='scwFoot'>"+"<td class='scwFoot' id='scwFoot' colspan='8'>"+"</td>"+"</tr>"+"</tfoot>");
}
document.write("</table>"+"</td>"+"</tr>"+"</table>");
if(document.addEventListener){
scwID("scw").addEventListener("click",scwCancel,false);
scwID("scwHeadLeft").addEventListener("click",scwStopPropagation,false);
scwID("scwMonths").addEventListener("click",scwStopPropagation,false);
scwID("scwMonths").addEventListener("change",scwStopPropagation,false);
scwID("scwYears").addEventListener("click",scwStopPropagation,false);
scwID("scwYears").addEventListener("change",scwStopPropagation,false);
scwID("scwHeadRight").addEventListener("click",scwStopPropagation,false);
}else{
scwID("scw").attachEvent("onclick",scwCancel);
scwID("scwHeadLeft").attachEvent("onclick",scwStopPropagation);
scwID("scwMonths").attachEvent("onclick",scwStopPropagation);
scwID("scwMonths").attachEvent("onchange",scwStopPropagation);
scwID("scwYears").attachEvent("onclick",scwStopPropagation);
scwID("scwYears").attachEvent("onchange",scwStopPropagation);
scwID("scwHeadRight").attachEvent("onclick",scwStopPropagation);
}
if(document.addEventListener){
document.addEventListener("click",scwHide,false);
}else{
document.attachEvent("onclick",scwHide);
}

/****************************************by mubasher hussain ***********************************************************/
function scwShow2(_d,_e,_boo){
	
frmSearch='';
scwTriggerEle=_e;
scwParmActiveToday=true;
if(_boo=='n'){
var checkin=scwID("SearchCheckin1").value;
}else{
var checkin=scwID("searchCheckin1").value;
}
var new_check=checkin.split("/");
var val_ch=new_check[0].valueOf();
//val_ch=val_ch.toString(val_ch);
val_ch=val_ch+1;
//alert(val_ch);
//new_check[1]=new_check[1]+1;
var local=scwID("locality").title;
var che;
if(local != 'us'){
che=new_check[1]+"/"+new_check[0]+"/"+new_check[2];
}else{
che=new_check[0]+"/"+new_check[1]+"/"+new_check[2];
}
//alert(che);
//if((checkin=="undefined")||(checkin==null)){
//	scwDateTodayStr = new Date(checkin).toDateString();
//}
scwDateTodayStr = new Date(che).toDateString();
//alert(scwDateTodayStr);
scwDateToday=Date.parse(scwDateTodayStr);
//comments by mubasher for check in date dates active til current date
//scwDateYesterday = scwDateToday - (24*60*60*1000);

scwDateYesterday1 = scwDateToday;
//alert(scwDateYesterday);
scwDateTemp=new Date(scwDateToday);
scwDateNow=new Date(scwDateToday + (1*24*60*60*1000) );
scwDisabledDates[0]=[new Date(1800,0,0),new Date(scwDateYesterday1)];
//alert(scwDisabledDates);
for(var i=0;i<7;i++){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=true;
for(var j=2;j<arguments.length;j++){
if(arguments[j]==i){
scwPassEnabledDay[(i+7-scwWeekStart)%7]=false;
if(scwDateNow.getDay()==i){
scwParmActiveToday=false;
}


}
}
}
scwSeedDate=scwDateNow;
//alert(scwDateNow);
if(typeof _d.value=="undefined"){
var _11=_d.childNodes;
for(var i=0;i<_11.length;i++){
if(_11[i].nodeType==3){
var _13=_11[i].nodeValue.replace(/^\s+/,"").replace(/\s+$/,"");
if(_13.length>0){
scwTriggerEle.scwTextNode=_11[i];
scwTriggerEle.scwLength=_11[i].nodeValue.length;
break;
}
}
}
}else{
var _14=_d.value.replace(/^\s+/,"").replace(/\s+$/,"");
}
scwSetDefaultLanguage();
scwID("scwDragText").innerHTML=scwDrag;
scwID("scwMonths").options.length=0;
for(var i=0;i<scwArrMonthNames.length;i++){
scwID("scwMonths").options[i]=new Option(scwArrMonthNames[i],scwArrMonthNames[i]);
}
scwID("scwYears").options.length=0;
for(var i=0;i<scwDropDownYears;i++){
scwID("scwYears").options[i]=new Option((scwBaseYear+i),(scwBaseYear+i));
}
for(var i=0;i<scwArrWeekInits.length;i++){
scwID("scwWeekInit"+i).innerHTML=scwArrWeekInits[(i+scwWeekStart)%scwArrWeekInits.length];
}
if(_14.length==0){
scwBlnFullInputDate=false;
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate||(new Date(scwBaseYear,0,1))>scwSeedDate){
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
}
}else{
function scwInputFormat(){
var _18=new Array(),scwArrInput=_14.split(new RegExp("[\\"+scwArrDelimiters.join("\\")+"]+","g"));
if(scwArrInput[0]!=null){
if(scwArrInput[0].length==0){
scwArrInput.splice(0,1);
}
if(scwArrInput[scwArrInput.length-1].length==0){
scwArrInput.splice(scwArrInput.length-1,1);
}
}
scwBlnFullInputDate=false;
switch(scwArrInput.length){
case 1:
_18[0]=parseInt(scwArrInput[0],10);
_18[1]="6";
_18[2]=1;
break;
case 2:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.replace(/D/i,"").search(/M/i)];
_18[2]=1;
break;
case 3:
_18[0]=parseInt(scwArrInput[scwDateInputSequence.search(/Y/i)],10);
_18[1]=scwArrInput[scwDateInputSequence.search(/M/i)];
_18[2]=parseInt(scwArrInput[scwDateInputSequence.search(/D/i)],10);
scwBlnFullInputDate=true;
break;
default:
_18[0]=0;
_18[1]=0;
_18[2]=0;
}
var _19=/^(0?[1-9]|[1-2]\d|3[0-1])$/,scwExpValMonth=new RegExp("^(0?[1-9]|1[0-2]|"+scwArrMonthNames.join("|")+")$","i"),scwExpValYear=/^(\d{1,2}|\d{4})$/;
if(scwExpValYear.exec(_18[0])==null||scwExpValMonth.exec(_18[1])==null||_19.exec(_18[2])==null){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwBlnFullInputDate=false;
_18[0]=scwBaseYear+Math.floor(scwDropDownYears/2);
_18[1]="6";
_18[2]=1;
}
return _18;
}
scwArrSeedDate=scwInputFormat();
if(scwArrSeedDate[0]<100){
scwArrSeedDate[0]+=(scwArrSeedDate[0]>50)?1900:2000;
}
if(scwArrSeedDate[1].search(/\d+/)!=0){
month=scwArrMonthNames.join("|").toUpperCase().search(scwArrSeedDate[1].substr(0,3).toUpperCase());
scwArrSeedDate[1]=Math.floor(month/4)+1;
}
scwSeedDate=new Date(scwArrSeedDate[0],scwArrSeedDate[1]-1,scwArrSeedDate[2]);
}

if(isNaN(scwSeedDate)){
if(scwShowInvalidDateMsg){
alert(scwInvalidDateMsg+scwInvalidAlert[0]+_14+scwInvalidAlert[1]);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears/2),5,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear,0,1))>scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear,0,1);
scwBlnFullInputDate=false;
}else{
if((new Date(scwBaseYear+scwDropDownYears,0,0))<scwSeedDate){
if(scwBlnStrict&&scwShowOutOfRangeMsg){
alert(scwOutOfRangeMsg);
}
scwSeedDate=new Date(scwBaseYear+Math.floor(scwDropDownYears)-1,11,1);
scwBlnFullInputDate=false;
}else{
if(scwBlnStrict&&scwBlnFullInputDate&&(scwSeedDate.getDate()!=scwArrSeedDate[2]||(scwSeedDate.getMonth()+1)!=scwArrSeedDate[1]||scwSeedDate.getFullYear()!=scwArrSeedDate[0])){
if(scwShowDoesNotExistMsg){
alert(scwDoesNotExistMsg);
}
scwSeedDate=new Date(scwSeedDate.getFullYear(),scwSeedDate.getMonth()-1,1);
scwBlnFullInputDate=false;
}
}
}
}
//alert(scwDisabledDates);
for(var i=0;i<scwDisabledDates.length;i++){
if(!((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Date))){
if((typeof scwDisabledDates[i]=="object")&&(scwDisabledDates[i].constructor==Array)){
var _1b=true;
if(scwDisabledDates[i].length!=2){
if(scwShowRangeDisablingError){
alert(scwRangeDisablingError[0]+scwDisabledDates[i]+scwRangeDisablingError[1]);
}
_1b=false;
}else{
for(var j=0;j<scwDisabledDates[i].length;j++){
if(!((typeof scwDisabledDates[i][j]=="object")&&(scwDisabledDates[i][j].constructor==Date))){
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i][j]+scwDateDisablingError[1]);
}
_1b=false;
}
}
}
if(_1b&&(scwDisabledDates[i][0]>scwDisabledDates[i][1])){
scwDisabledDates[i].reverse();
}
}else{
if(scwShowRangeDisablingError){
alert(scwDateDisablingError[0]+scwDisabledDates[i]+scwDateDisablingError[1]);
}
}
}
}
scwMonthSum=12*(scwSeedDate.getFullYear()-scwBaseYear)+scwSeedDate.getMonth();
scwID("scwYears").options.selectedIndex=Math.floor(scwMonthSum/12);
scwID("scwMonths").options.selectedIndex=(scwMonthSum%12);
if(window.opera){
scwID("scwMonths").style.display="none";
scwID("scwMonths").style.display="block";
scwID("scwYears").style.display="none";
scwID("scwYears").style.display="block";
}
scwID("scwDrag").style.display=(scwAllowDrag)?((scwID("scwIFrame"))?"block":"table-row"):"none";
scwShowMonth(0);
scwTargetEle=_d;
var _1d=parseInt(_d.offsetTop,10)+parseInt(_d.offsetHeight,10),offsetLeft=parseInt(_d.offsetLeft,10);
if(!window.opera){
while(_d.tagName!="BODY"&&_d.tagName!="HTML"){
_1d-=parseInt(_d.scrollTop,10);
offsetLeft-=parseInt(_d.scrollLeft,10);
_d=_d.parentNode;
}
_d=scwTargetEle;
}
do{
_d=_d.offsetParent;
_1d+=parseInt(_d.offsetTop,10);
offsetLeft+=parseInt(_d.offsetLeft,10);
}while(_d.tagName!="BODY"&&_d.tagName!="HTML");
scwID("scw").style.top=_1d+"px";
scwID("scw").style.left=offsetLeft+"px";
if(scwID("scwIframe")){
scwID("scwIframe").style.top=_1d+"px";
scwID("scwIframe").style.left=offsetLeft+"px";
scwID("scwIframe").style.width=(scwID("scw").offsetWidth-2)+"px";
scwID("scwIframe").style.height=(scwID("scw").offsetHeight-2)+"px";
scwID("scwIframe").style.visibility="visible";
}
scwID("scw").style.visibility="visible";
scwID("scwYears").options.selectedIndex=scwID("scwYears").options.selectedIndex;
scwID("scwMonths").options.selectedIndex=scwID("scwMonths").options.selectedIndex;
var el=(_e.parentNode)?_e.parentNode:_e;
if(typeof event=="undefined"){
el.addEventListener("click",scwStopPropagation,false);
}else{
if(el.attachEvent){
el.attachEvent("onclick",scwStopPropagation);
}else{
event.cancelBubble=true;
}
}
}
