function move(){
if(arguments[1]){
var _1=$(arguments[1]);
if(arguments[0]){
$("toMove").value=arguments[1];
}
}else{
var _1=$($("toMove").value);
}
left=getAbsoluteLeft(_1.id);
tope=getAbsoluteTop(_1.id)+25;
if(arguments[0]){
scrolling=arguments[0];
if(scrolling>185){
tope=scrolling+250;
if($("toMove").value=="f_return_date"){
tope+=40;
}
}else{
tope=getAbsoluteTop(_1.id)+25;
}
}
if(arguments[1]){
new Effect.SlideDown("calendar");
}
$("calendar").setStyle({left:left+"px",top:tope+"px"});
};
function hideC(e){
var _3=window.event?window.event.srcElement:e?e.target:null;
if(!_3){
return;
}
if($("calendar").style.display!="none"){
var t=true;
while(_3.parentNode!=null){
oParent=_3.parentNode;
if(oParent.id=="calendar"){
t=false;
break;
}
_3=oParent;
}
if(t==true){
$("calendar").style.display="none";
}
}
};
document.onmouseup=hideC;
function myCalendar(_5,_6,_7,_8,_9,_a){
this.tag=_6;
this.which=_5;
this.makeMonth=makeMonth;
this.input1=_8;
this.input2=_9;
this.region=_7;
lang(_7);
this.salida=_a;
};
document.write("<div style=\"position: absolute; left: 8px; top: 10px; display:none; z-index:10000\" id=\"calendar\"></div>");
var cutOff=0;
var backDate=0;
var n=(document.layers)?1:0;
var ie=(document.all)?1:0;
var n6=(document.getElementById&&!document.all)?1:0;
var agt=navigator.userAgent.toLowerCase();
var is_ie4=(agt.indexOf("msie 4")!=-1);
var mac=(agt.indexOf("this.mac")!=-1);
var monthnames=new Array();
var days=new Array();
function lang(_b){
if(_b){
if(_b=="es"){
monthnames[1-1]="enero";
monthnames[2-1]="febrero";
monthnames[3-1]="marzo";
monthnames[4-1]="abril";
monthnames[5-1]="mayo";
monthnames[6-1]="junio";
monthnames[7-1]="julio";
monthnames[8-1]="agosto";
monthnames[9-1]="septiembre";
monthnames[10-1]="octubre";
monthnames[11-1]="noviembre";
monthnames[12-1]="diciembre";
days[0]="d";
days[1]="l";
days[2]="m";
days[3]="m";
days[4]="j";
days[5]="v";
days[6]="s";
}
if(_b=="en"){
monthnames[1-1]="january";
monthnames[2-1]="february";
monthnames[3-1]="march";
monthnames[4-1]="april";
monthnames[5-1]="may";
monthnames[6-1]="jun";
monthnames[7-1]="july";
monthnames[8-1]="august";
monthnames[9-1]="september";
monthnames[10-1]="october";
monthnames[11-1]="november";
monthnames[12-1]="december";
days[0]="s";
days[1]="m";
days[2]="t";
days[3]="w";
days[4]="t";
days[5]="f";
days[6]="s";
}
}
this.region=_b;
};
var linkcount=0;
var calCode1;
function addlink(_c,_d,_e){
var _f=new Array(3);
_f[0]=_c;
_f[1]=_d;
_f[2]=_e;
this[linkcount++]=_f;
};
Array.prototype.addlink=addlink;
this.linkdays=new Array();
monthdays=new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
var previousMonth="";
var nextMonth="";
var yearsFuture=1;
function makeStop(){
currentMonth=0;
backDate=0;
todayDate=new Date();
year=todayDate.getYear();
day=todayDate.getDate();
backDate=(day-1);
if(currentMonth==0){
month=todayDate.getMonth();
}else{
month=currentMonth;
}
if(month>11){
monthMultiplier=Math.floor(month/12);
month=month-(12*monthMultiplier);
year=year+monthMultiplier;
}
year=year%100;
year=((year<50)?(2000+year):(1900+year));
if(month==0){
stopMonth=11;
}else{
stopMonth=todayDate.getMonth()-1;
}
stopYear=year+1;
};
makeStop();
function makeMonth(_10){
var _11=this.which;
var _12=$(input1).value.split("/");
year1=_12[2];
if(region=="es"){
day1=_12[0];
month1=_12[1];
}
if(region=="en"){
day1=_12[1];
month1=_12[0];
}
toDo=false;
var _13=todayDate.getYear();
if($(input1).value.length<=10&&$(input1).value.length>=5){
var _14=new Date(year1+"/"+month1+"/"+day1);
if(_14&&_14!="Invalid Date"){
toDo=true;
if(month1&&this.salida||this.salida==false){
_11=month1-1;
}
if(_11<todayDate.getMonth()){
_11=_11+12;
}
}
}
todayDate=new Date();
if(_11==0){
month=todayDate.getMonth();
nextMonth=month+1;
previousMonth=month-1;
}else{
month=_11;
nextMonth=month+1;
previousMonth=month-1;
}
if(month>11){
monthMultiplier=Math.floor(month/12);
month=month-(12*monthMultiplier);
_13=_13+monthMultiplier;
}
_13=_13%100;
_13=((_13<50)?(2000+_13):(1900+_13));
if(((_13%4==0)&&!(_13%100==0))||(_13%400==0)){
monthdays[1]=29;
}else{
monthdays[1]=28;
}
var _15=new Date(_13,month,1);
var _16=_15.getDay();
calCode1="<table border='0' cellpadding='0' cellspacing='0' style='border:solid #666666 1px; vertical-align:middle'>";
calCode1=calCode1+"<tbody><tr valign='top'><td>";
if(previousMonth>=todayDate.getMonth()){
link1="<a href='#' onclick='doCalendar("+previousMonth+",\""+this.tag+"\");return false;'><img src='/images/btn_back.png' border='0' align='left'></a>";
}else{
link1="&nbsp;";
}
calCode1=calCode1+"<div class='month'>"+link1+monthnames[month]+" "+_13+"</div>";
calCode1=calCode1+"<table id='firstCalendar' align='center' border='0' cellpadding='0' cellspacing='0' width='100%'>";
calCode1=calCode1+"<thead>";
calCode1=calCode1+"<tr align='center' valign='bottom'>";
calCode1=calCode1+"<td class='day' width='15'>"+days[0]+"</td>";
calCode1=calCode1+"<td class='day' width='15'>"+days[1]+"</td>";
calCode1=calCode1+"<td class='day' width='15'>"+days[2]+"</td>";
calCode1=calCode1+"<td class='day' width='15'>"+days[3]+"</td>";
calCode1=calCode1+"<td class='day' width='15'>"+days[4]+"</td>";
calCode1=calCode1+"<td class='day' width='15'>"+days[5]+"</td>";
calCode1=calCode1+"<td class='day' width='15'>"+days[6]+"</td>";
calCode1=calCode1+"</tr></thead><tbody><tr><td colspan='7'><table class='all_border' cellpadding='0' cellspacing='0' width='100%'><tbody>";
calCode1=calCode1+"<tr class='days'>";
for(s=0;s<_16;s++){
calCode1=calCode1+"<td class='date'>&nbsp;</td>";
}
count=1;
while(count<=monthdays[month]){
for(b=_16;b<7;b++){
linktrue=false;
disabled=false;
daySelected=false;
mesActual=stopMonth+1;
if(count<=monthdays[month]){
if(toDo){
today=false;
realMonth=month+1;
actualDate=new Date(_13+"/"+realMonth+"/"+count);
if(this.salida==false){
if(_14>=actualDate){
disabled=true;
if(_14<=actualDate){
daySelected=true;
}
}
}
}
}
if(this.salida!=false&&_14){
if(month==month1-1&&count==day1&&_13<=stopYear){
daySelected=true;
}else{
daySelected=false;
}
}
if(month==mesActual&&count==todayDate.getDate()&&_13==todayDate.getFullYear()){
today=true;
}else{
today=false;
}
if(today){
calCode1=calCode1+"<td class='date today' align='right' style='color:white'>";
}else{
if(daySelected){
calCode1=calCode1+"<td class='date selected' align='right'>";
}else{
calCode1=calCode1+"<td class='date' align='right'>";
}
}
if(count<=monthdays[month]){
cutOff=cutOff+1;
if(month>=stopMonth&&_13>=stopYear){
calCode1=calCode1+count;
}else{
if(month==todayDate.getMonth()&&count<=backDate){
calCode1=calCode1+count;
}else{
if(is_ie4){
calCode1=calCode1+"";
}else{
if(!disabled){
calCode1=calCode1+"<a style='cursor:pointer' onclick='setDates("+Number(month+1)+","+count+","+_13+",\""+this.tag+"\");return false;'>";
}
calCode1=calCode1+count;
}
if(is_ie4){
calCode1=calCode1+"";
}else{
if(!disabled){
calCode1=calCode1+"</a>";
}
}
}
}
}else{
calCode1=calCode1+"&nbsp;";
}
calCode1=calCode1+"</td>";
count++;
today=false;
}
calCode1=calCode1+"</tr>";
calCode1=calCode1+"<tr>";
_16=0;
}
calCode1=calCode1+"</tr></tbody></table></td></tr></tbody></table></td>";
calCode1=calCode1+"<td bgcolor='#666666'><img src='/images/empty.png' border='0' height='118' width='1'></td>";
calCode2="<td>";
if(month==11){
month2=0;
year2=_13+1;
}else{
month2=month+1;
year2=_13;
}
var _17=new Date(year2,month2,1);
var _18=_17.getDay();
if(month2==stopMonth){
link2="&nbsp;";
}else{
link2="<a href='#' onclick='doCalendar("+nextMonth+",\""+this.tag+"\");return false;'><img src='/images/btn_next.png' alt='>>' border='0' align='right'></a>";
}
calCode2=calCode2+"<div class='month'>"+link2+monthnames[month2]+" "+year2+"</div>";
calCode2=calCode2+"<table id='secondCalendar' align='center' border='0' cellpadding='0' cellspacing='0' width='100%'><tbody>";
calCode2=calCode2+"<tr align='center' valign='bottom'>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[0]+"</td>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[1]+"</td>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[2]+"</td>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[3]+"</td>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[4]+"</td>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[5]+"</td>";
calCode2=calCode2+"<td class='day' width='15' align='center'>"+days[6]+"</td>";
calCode2=calCode2+"</tr>";
calCode2=calCode2+"<tr><td colspan='7'><table class='all_border' cellpadding='0' cellspacing='0' width='100%'><tbody><tr>";
for(s=0;s<_18;s++){
calCode2=calCode2+"<td class=\"date\">&nbsp;</td>";
}
count=1;
while(count<=monthdays[month2]){
for(b=_18;b<7;b++){
linktrue=false;
disabled=false;
daySelected=false;
if(count<=monthdays[month2]){
mesActual=stopMonth+1;
if(toDo){
today=false;
realMonth=month2+1;
actualDate=new Date(year2+"/"+realMonth+"/"+count);
if(this.salida==false){
if(_14>=actualDate){
disabled=true;
if(_14<=actualDate){
daySelected=true;
}
}
}
}
}
if(this.salida!=false&&_14){
if(month2==month1-1&&count==day1&&_13<=stopYear){
daySelected=true;
}else{
daySelected=false;
}
}
if(month2==mesActual&&count==todayDate.getDate()&&year2==todayDate.getFullYear()){
today=true;
}else{
today=false;
}
if(today){
calCode2=calCode2+"<td class='date today' align='right' style='color:white'>";
}else{
if(daySelected){
calCode2=calCode2+"<td class='date selected' align='right'>";
}else{
calCode2=calCode2+"<td class='date' align='right'>";
}
}
if(count<=monthdays[month2]){
if(is_ie4){
calCode2=calCode2+"";
}else{
if(!disabled){
calCode2=calCode2+"<a style='cursor:pointer' onclick='setDates("+Number(month2+1)+","+count+","+year2+",\""+this.tag+"\");return false;'>";
}
}
calCode2=calCode2+count;
if(is_ie4){
calCode2=calCode2+"";
}else{
if(!disabled){
calCode2=calCode2+"</a>";
}
}
}else{
calCode2=calCode2+"&nbsp;";
}
calCode2=calCode2+"</td>";
count++;
}
calCode2=calCode2+"</tr>";
calCode2=calCode2+"<tr>";
_18=0;
}
calCode2=calCode2+"</tr></tbody></table><td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>";
var _19="";
if(is_ie4){
_19="<CENTER><FONT STYLE='color:#006600;text-decoration:none;font-family:arial,helvetica,sans-serif;font-size:10px;line-height:13px;'>Some calendar features are not supported by this browser.<BR><A HREF='#' onClick='self.close();'><FONT STYLE='color:#006600;text-decoration:underline;font-family:arial,helvetica,sans-serif;font-size:10px;line-height:13px;'>Close window</FONT></A>.</FONT></CENTER>";
}
calCode3=calCode1+calCode2+_19;
if(n){
document.calendar.document.write(calCode3);
document.calendar.document.close();
}
if(ie){
if(mac){
calendarmac.innerHTML=calCode1;
calendar2mac.innerHTML=calCode2;
}else{
calendar.innerHTML=calCode3;
}
}
if(n6){
document.getElementById("calendar").innerHTML=calCode3;
}
};
function getday(_1a,_1b,_1c){
if(_1b=="es"){
var _1d=new Array(7);
var _1e=new Array(12);
_1d[0]="Domingo";
_1d[1]="Lunes";
_1d[2]="Martes";
_1d[3]="Miercoles";
_1d[4]="Jueves";
_1d[5]="Viernes";
_1d[6]="Sabado";
_1e[1]="Enero";
_1e[2]="Febrero";
_1e[3]="Marzo";
_1e[4]="Abril";
_1e[5]="Mayo";
_1e[6]="Junio";
_1e[7]="Julio";
_1e[8]="Agosto";
_1e[9]="Septiembre";
_1e[10]="Octubre";
_1e[11]="Noviembre";
_1e[12]="Diciembre";
}
if(_1b=="en"){
var _1d=new Array(7);
var _1e=new Array(12);
_1d[0]="Sunday";
_1d[1]="Monday";
_1d[2]="Tuesday";
_1d[3]="Wednesday";
_1d[4]="Thursday";
_1d[5]="Friday";
_1d[6]="Saturday";
_1e[1]="January";
_1e[2]="February";
_1e[3]="March";
_1e[4]="April";
_1e[5]="May";
_1e[6]="Jun";
_1e[7]="July";
_1e[8]="August";
_1e[9]="September";
_1e[10]="October";
_1e[11]="November";
_1e[12]="December";
}
splitD=_1a.split("/");
dateF=new Date(splitD[0]+"/"+splitD[1]+"/"+splitD[2]);
d=_1d[dateF.getDay()];
m=_1e[splitD[1]];
y=splitD[0];
dateD=splitD[2];
if(_1c){
result=d;
}else{
result=d+" "+dateD+" "+m+" "+y;
}
return result;
};
function addZero(val){
if(val<10){
val="0"+val;
}
return val;
};
function setDates(_20,_21,_22,tag){
_20=addZero(_20);
_21=addZero(_21);
format=_22+"/"+_20+"/"+_21;
result=format.split("/");
if(this.region=="es"){
result=result[2]+"/"+result[1]+"/"+result[0];
}
if(this.region=="en"){
result=result[1]+"/"+result[2]+"/"+result[0];
}
document.getElementById(tag).value=result;
dayTag=tag+"_day";
hiddenTag=tag+"_hidden";
$(hiddenTag).value=result;
$(dayTag).innerHTML=getday(format,this.region,true);
new Effect.SlideUp("calendar");
};
function parseDate(_24,_25){
parsed=new Array();
if(arguments[2]){
parsed["dateD"]=_24.substr(0,2);
parsed["slash1"]=_24.substr(2,1);
parsed["dateM"]=_24.substr(3,2);
parsed["slash2"]=_24.substr(5,1);
parsed["dateY"]=_24.substr(6,4);
parsed["date"]=parsed["dateM"]+"/"+parsed["dateD"]+"/"+parsed["dateY"];
parsed["date2"]=parsed["dateD"]+"/"+parsed["dateM"]+"/"+parsed["dateY"];
}
return parsed[_25];
};
function getmanualday(_26,_27,_28){
dateD=parseDate(_26,"dateD",_28);
dateM=parseDate(_26,"dateM",_28);
dateY=parseDate(_26,"dateY",_28);
_26=parseDate(_26,"date",_28);
var d=new Date(_26);
var _2a=new Array(7);
_2a[0]="Domingo";
_2a[1]="Lunes";
_2a[2]="Martes";
_2a[3]="Miercoles";
_2a[4]="Jueves";
_2a[5]="Viernes";
_2a[6]="Sabado";
day=_2a[d.getDay()];
tagDay=_27+"_day";
if(day&&_26.length==10){
t=document.getElementById(tagDay);
t.innerHTML=day;
}else{
t=document.getElementById(tagDay);
t.innerHTML="";
}
};
function validDate(_2b,_2c,_2d){
var _2e=false;
tagHidden=_2c+"_hidden";
dateD=parseDate(_2b,"dateD",_2d);
slash1=parseDate(_2b,"slash1",_2d);
dateM=parseDate(_2b,"dateM",_2d);
slash2=parseDate(_2b,"slash2",_2d);
dateY=parseDate(_2b,"dateY",_2d);
if(dateD<=31&&dateD.length==2&&slash1=="/"&&dateM<=12&&dateM.length==2&&slash2=="/"&&dateY.length==4){
var _2f=new Date(dateY+"/"+dateM+"/"+dateD);
if(_2f&&_2f!="Invalid Date"){
_2e=true;
}
}
if(_2e){
$(tagHidden).value=$(_2c).value;
}else{
$(_2c).value=$(tagHidden).value;
}
_2b=parseDate($(tagHidden).value,"date2",_2d);
getmanualday(_2b,_2c,_2d);
};
if(this.ie||this.n||this.n6){
if(this.mac){
document.write("<div style=\"position:absolute;left:8px;top:10px;\" id=\"calendar\">&nbsp;</div>");
document.write("<div style=\"position:absolute;left:8px;top:10px;\" id=\"calendar\">&nbsp;</div>");
document.write("<div style=\"position:absolute;left:150px;top:10px;\" id=\"calendar\">&nbsp;</div>");
}else{
}
}

