 

function NiceTitles(sTemplate,nDelay,nStringMaxLength,nMarginX,nMarginY,sContainerID,sClassName){var oTimer;var isActive=false;var sNameSpaceURI="http://www.w3.org/1999/xhtml";if(!sTemplate){sTemplate="attr(nicetitle)";}
if(!nDelay||nDelay<=0){nDelay=false;}
if(!nStringMaxLength){nStringMaxLength=80;}
if(!nMarginX){nMarginX=15;}
if(!nMarginY){nMarginY=15;}
if(!sContainerID){sContainerID="nicetitlecontainer";}
if(!sClassName){sClassName="nicetitle";}
var oContainer=document.getElementById(sContainerID);if(!oContainer){oContainer=document.createElementNS?document.createElementNS(sNameSpaceURI,"div"):document.createElement("div");oContainer.setAttribute("id",sContainerID);oContainer.className=sClassName;oContainer.style.display="none";document.getElementsByTagName("body").item(0).appendChild(oContainer);}
this.addElements=function addElements(collNodes,sAttribute){var currentNode,sTitle;for(var i=0;i<collNodes.length;i++){currentNode=collNodes[i]; sTitle=currentNode.getAttribute(sAttribute);if(sTitle){currentNode.setAttribute("nicetitle",sTitle);currentNode.removeAttribute(sAttribute);addEvent(currentNode,'mouseover',show);addEvent(currentNode,'mouseout',hide);addEvent(currentNode,'focus',show);addEvent(currentNode,'blur',hide);}}}
function show(e){if(isActive){hide();}
var oNode=window.event?window.event.srcElement:e.currentTarget;if(!oNode.getAttribute("nicetitle")){while(oNode.parentNode){oNode=oNode.parentNode;if(oNode.getAttribute("nicetitle")){break;}}}
var sOutput=parseTemplate(oNode);setContainerContent(sOutput);var oPosition=getPosition(e,oNode);oContainer.style.left=oPosition.x;oContainer.style.top=oPosition.y;if(nDelay){oTimer=setTimeout(function(){oContainer.style.display="block";},nDelay);}else{oContainer.style.display="block";}
isActive=true;window.event?window.event.cancelBubble=true:e.stopPropagation();}
function hide(){
clearTimeout(oTimer);oContainer.style.display="none";removeContainerContent();isActive=false;}
function setContainerContent(sOutput){sOutput=sOutput.replace(/&/g,"&amp;");if(document.createElementNS&&window.DOMParser){var oXMLDoc=(new DOMParser()).parseFromString("<root xmlns=\""+sNameSpaceURI+"\">"+sOutput+"</root>","text/xml");var oOutputNode=document.importNode(oXMLDoc.documentElement,true);var oChild=oOutputNode.firstChild;var nextChild;while(oChild){nextChild=oChild.nextSibling;oContainer.appendChild(oChild);oChild=nextChild;}}else{oContainer.innerHTML=sOutput;}}
function removeContainerContent(){var oChild=oContainer.firstChild;var nextChild;if(!oChild){return;}
while(oChild){nextChild=oChild.nextSibling;oContainer.removeChild(oChild);oChild=nextChild;}}
function getPosition(e,oNode){var oViewport=getViewport();var oCoords;var commonEventInterface=window.event?window.event:e;if(commonEventInterface.type=="focus"){oCoords=getNodePosition(oNode);oCoords.x+=nMarginX;oCoords.y+=nMarginY;}else{oCoords={x:commonEventInterface.clientX+oViewport.x+nMarginX,y:commonEventInterface.clientY+oViewport.y+nMarginY};}
oContainer.style.visiblity="hidden";oContainer.style.display="block";var containerWidth=oContainer.offsetWidth;var containerHeight=oContainer.offsetHeight;oContainer.style.display="none";oContainer.style.visiblity="visible";if(oCoords.x+containerWidth+10>=oViewport.width+oViewport.x){oCoords.x=oViewport.width+oViewport.x-containerWidth-10;}
if(oCoords.y+containerHeight+10>=oViewport.height+oViewport.y){oCoords.y=oViewport.height+oViewport.y-containerHeight-oNode.offsetHeight-10;}
oCoords.x+="px";oCoords.y+="px";return oCoords;}
function parseTemplate(oNode){var sAttribute,collOptionalAttributes;var oFound={};var sResult =sTemplate;if(sResult.match(/content\(\)/)){sResult=sResult.replace(/content\(\)/g,getContentOfNode(oNode));}
var collSearch=sResult.split(/attr\(/);for(var i=1;i<collSearch.length;i++){sAttribute=collSearch[i].split(")")[0];oFound[sAttribute]=oNode.getAttribute(sAttribute);if(oFound[sAttribute]&&oFound[sAttribute].length>nStringMaxLength){oFound[sAttribute]=oFound[sAttribute].substring(0,nStringMaxLength)+"...";}}
var collOptional=sResult.split("?")
for(var i=1;i<collOptional.length;i+=2){collOptionalAttributes=collOptional[i].split("attr(");for(var j=1;j<collOptionalAttributes.length;j++){sAttribute=collOptionalAttributes[j].split(")")[0];if(!oFound[sAttribute]){sResult=sResult.replace(new RegExp("\\?[^\\?]*attr\\("+sAttribute+"\\)[^\\?]*\\?","g"),"");}}}
sResult=sResult.replace(/\?/g,"");for(sAttribute in oFound){sResult=sResult.replace("attr\("+sAttribute+"\)",oFound[sAttribute]);}
return sResult;}
function getContentOfNode(oNode){var sContent="";var oSearch=oNode.firstChild;while(oSearch){if(oSearch.nodeType==3){sContent+=oSearch.nodeValue;}else if(oSearch.nodeType==1&&oSearch.hasChildNodes){sContent+=getContentOfNode(oSearch);}
oSearch=oSearch.nextSibling}
 return sContent;}
function getNodePosition(oNode){var x=0;var y=0;do{if(oNode.offsetLeft){x+=oNode.offsetLeft}
if(oNode.offsetTop){y+=oNode.offsetTop}}while((oNode=oNode.offsetParent)&&!document.all)
return{x:x,y:y}}
function getViewport(){var width=0;var height=0;var x=0;var y=0;if(document.documentElement&&document.documentElement.clientWidth){width=document.documentElement.clientWidth;height=document.documentElement.clientHeight;x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}else if(document.body&&document.body.clientWidth){width=document.body.clientWidth;height=document.body.clientHeight;x=document.body.scrollLeft;y=document.body.scrollTop;}
if(window.innerWidth){width=window.innerWidth-18;height=window.innerHeight-18;}
if(window.pageYOffset){x=window.pageXOffset;y=window.pageYOffset;}else if(window.scrollY){x=window.scrollX;y=window.scrollY;}
return{width:width,height:height,x:x,y:y};}}//
function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent('on'+evType,fn);return r;}else{return false;}}
Date.prototype.toTimeSinceString=function(nLimit,sBetween,sLastBetween){if(!nLimit){nLimit=2;}
if(!sBetween){sBetween=", ";}
if(!sLastBetween){sLastBetween=" and ";}
if(!Date.prototype.toTimeSinceString._collStructs){Date.prototype.toTimeSinceString._collStructs=new Array({seconds:60*60*24*365,name:"year"},{seconds:60*60*24*30,name:"month"},{seconds:60*60*24*7,name:"week"},{seconds:60*60*24,name:"day"},{seconds:60*60,name:"hour"},{seconds:60,name:"minute"});}
var collStructs=Date.prototype.toTimeSinceString._collStructs;var nSecondsRemain=((new Date).valueOf()-this.valueOf())/1000;var sReturn="";var nCount=0;var nFloored;for(var i=0;i<collStructs.length&&nCount<nLimit;i++){nFloored=Math.floor(nSecondsRemain/collStructs[i].seconds);if(nFloored>0){if(sReturn.length>0){if(nCount==nLimit-1||i==collStructs.length-1){sReturn+=sLastBetween;}else if(nCount<nLimit&&i<collStructs.length){sReturn+=sBetween;}}
sReturn+=nFloored+" "+collStructs[i].name;if(nFloored>1){sReturn+="s";}
nSecondsRemain-=nFloored*collStructs[i].seconds;nCount++;}}
return sReturn;}
NiceTitles.autoCreation=function(){if(!document.getElementsByTagName){return;}
NiceTitles.autoCreated=new Object();NiceTitles.autoCreated.anchors=new NiceTitles("<div class=\"titletext\">attr(nicetitle)?</div>",300,2000);NiceTitles.autoCreated.anchors.addElements(document.getElementsByTagName("a"),"title");NiceTitles.autoCreated.anchors.addElements(document.getElementsByTagName("p"),"title");NiceTitles.autoCreated.anchors.addElements(document.getElementsByTagName("span"),"title");NiceTitles.autoCreated.anchors.addElements(document.getElementsByTagName("img"),"title");}
addEvent(window,"load",NiceTitles.autoCreation);

var jsrsContextPoolSize=0;var jsrsContextMaxPool=20;var jsrsContextPool=new Array();var jsrsBrowser=jsrsBrowserSniff();var jsrsPOST=true;var containerName;function jsrsContextObj(contextID){this.id=contextID;this.busy=true;this.callback=null;this.container=contextCreateContainer(contextID);this.GET=contextGET;this.POST=contextPOST;this.getPayload=contextGetPayload;this.setVisibility=contextSetVisibility;}
function contextCreateContainer(containerName){var container;switch(jsrsBrowser){case'NS':container=new Layer(100);container.name=containerName;container.visibility='hidden';container.clip.width=100;container.clip.height=100;break;case'IE':document.body.insertAdjacentHTML("afterBegin",'<span id="SPAN'+containerName+'"></span>');var span=document.all("SPAN"+containerName);var html='<iframe name="'+containerName+'" src=""></iframe>';span.innerHTML=html;span.style.display='none';container=window.frames[containerName];break;case'MOZ':var span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);var iframe=document.createElement('IFRAME');iframe.name=containerName;iframe.id=containerName;span.appendChild(iframe);container=iframe;break;case'OPR':var span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);var iframe=document.createElement('IFRAME');iframe.name=containerName;iframe.id=containerName;span.appendChild(iframe);container=iframe;break;case'KONQ':var span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);var iframe=document.createElement('IFRAME');iframe.name=containerName;iframe.id=containerName;span.appendChild(iframe);container=iframe;span.style.display=none;iframe.style.display=none;iframe.style.visibility=hidden;iframe.height=0;iframe.width=0;break;}
return container;}
function contextPOST(rsPage,func,parms){var d=new Date();var unique=d.getTime()+''+Math.floor(1000*Math.random());var doc=(jsrsBrowser=="IE")?this.container.document:this.container.contentDocument;doc.open();doc.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');doc.write('<html><body>');doc.write('<form name="jsrsForm" method="post" target="" ACCEPTCHARSET="UTF-8" ');doc.write(' action="'+rsPage+'?code='+unique+'">');doc.write('<input type="hidden" name="C" value="'+this.id+'">');if(func!=null){doc.write('<input type="hidden" name="F" value="'+func+'">');if(parms!=null){if(typeof(parms)=="string"){doc.write('<input type="hidden" name="P0" '
+'value="['+jsrsEscapeQQ(parms)+']">');}else{for(var i=0;i<parms.length;i++){doc.write('<input type="hidden" name="P'+i+'" '
+'value="['+jsrsEscapeQQ(parms[i])+']">');}}}}
doc.write('</form></body></html>');doc.close();doc.forms['jsrsForm'].submit();}
function contextGET(rsPage,func,parms){var URL=rsPage;URL+="?C="+this.id;if(func!=null){URL+="&F="+escape(func);if(parms!=null){if(typeof(parms)=="string"){URL+="&P0=["+escape(parms+'')+"]";}else{for(var i=0;i<parms.length;i++){URL+="&P"+i+"=["+escape(parms[i]+'')+"]";}}}}
var d=new Date();URL+="&U="+d.getTime();switch(jsrsBrowser){case'NS':this.container.src=URL;break;case'IE':this.container.document.location.replace(URL);break;case'MOZ':this.container.src='';this.container.src=URL;break;case'OPR':this.container.src='';this.container.src=URL;break;case'KONQ':this.container.src='';this.container.src=URL;break;}}
function contextGetPayload(){switch(jsrsBrowser){case'NS':return this.container.document.forms['jsrs_Form'].elements['jsrs_Payload'].value;case'IE':return this.container.document.forms['jsrs_Form']['jsrs_Payload'].value;case'MOZ':return window.frames[this.container.name].document.forms['jsrs_Form']['jsrs_Payload'].value;case'OPR':var textElement=window.frames[this.container.name].document.getElementById("jsrs_Payload");case'KONQ':var textElement=window.frames[this.container.name].document.getElementById("jsrs_Payload");return textElement.value;}}
function contextSetVisibility(vis){switch(jsrsBrowser){case'NS':this.container.visibility=(vis)?'show':'hidden';break;case'IE':document.all("SPAN"+this.id).style.display=(vis)?'':'none';break;case'MOZ':document.getElementById("SPAN"+this.id).style.visibility=(vis)?'':'hidden';case'OPR':document.getElementById("SPAN"+this.id).style.visibility=(vis)?'':'hidden';this.container.width=(vis)?250:0;this.container.height=(vis)?100:0;break;}}
function jsrsGetContextID(){var contextObj;for(var i=1;i<=jsrsContextPoolSize;i++){contextObj=jsrsContextPool['jsrs'+i];if(!contextObj.busy){contextObj.busy=true;return contextObj.id;}}
if(jsrsContextPoolSize<=jsrsContextMaxPool){var contextID="jsrs"+(jsrsContextPoolSize+1);jsrsContextPool[contextID]=new jsrsContextObj(contextID);jsrsContextPoolSize++;return contextID;}else{return null;}}
function procesar(rspage,callback,func,parms,visibility){var contextObj=jsrsContextPool[jsrsGetContextID()];contextObj.callback=callback;var vis=(visibility==null)?false:visibility;contextObj.setVisibility(vis);if(jsrsPOST&&((jsrsBrowser=='IE')||(jsrsBrowser=='MOZ'))){contextObj.POST(rspage,func,parms);}else{contextObj.GET(rspage,func,parms);}
return contextObj.id;}
function jsrsLoaded(contextID){var contextObj=jsrsContextPool[contextID];if(contextObj.callback!=null){contextObj.callback(jsrsUnescape(contextObj.getPayload()),contextID);}
contextObj.callback=null;contextObj.busy=false;if((contextObj.debug!=true)&&(jsrsBrowser=='IE'))
contextObj.container.location='about:blank';}
function jsrsError(contextID,str){alert(unescape(str));jsrsContextPool[contextID].busy=false}
function jsrsEscapeQQ(thing){return thing.replace(/'"'/g,'\\"');}
function jsrsUnescape(str){return str.replace(/\\\//g,"/");}
function jsrsBrowserSniff(){if(document.layers)return"NS";if(document.all){var agt=navigator.userAgent.toLowerCase();var is_opera=(agt.indexOf("opera")!=-1);var is_konq=(agt.indexOf("konqueror")!=-1);if(is_opera){return"OPR";}else{if(is_konq){return"KONQ";}else{return"IE";}}}
if(document.getElementById)return"MOZ";return"OTHER";}
function jsrsArrayFromString(s,delim){var d=(delim==null)?'~':delim;return s.split(d);}
function jsrsDebugInfo(){var doc=window.open().document;doc.open;doc.write('Pool Size: '+jsrsContextPoolSize+'<br><font face="arial" size="2"><b>');for(var i in jsrsContextPool){var contextObj=jsrsContextPool[i];doc.write('<hr>'+contextObj.id+' : '+(contextObj.busy?'busy':'available')+'<br>');doc.write(contextObj.container.document.location.pathname+'<br>');doc.write(contextObj.container.document.location.search+'<br>');doc.write('<table border="1"><tr><td>'+contextObj.container.document.body.innerHTML+'</td></tr></table>');}
doc.write('</table>');doc.close();return false;}
//calendar.js
Calendar=function(_1,_2,_3,_4){
this.activeDiv=null;
this.currentDateEl=null;
this.getDateStatus=null;
this.getDateToolTip=null;
this.getDateText=null;
this.timeout=null;
this.onSelected=_3||null;
this.onClose=_4||null;
this.dragging=false;
this.hidden=false;
this.minYear=1970;
this.maxYear=2050;
this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];
this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];
this.isPopup=true;
this.weekNumbers=true;
this.firstDayOfWeek=typeof _1=="number"?_1:Calendar._FD;
this.showsOtherMonths=false;
this.dateStr=_2;
this.ar_days=null;
this.showsTime=false;
this.time24=true;
this.yearStep=2;
this.hiliteToday=true;
this.multiple=null;
this.table=null;
this.element=null;
this.tbody=null;
this.firstdayname=null;
this.monthsCombo=null;
this.yearsCombo=null;
this.hilitedMonth=null;
this.activeMonth=null;
this.hilitedYear=null;
this.activeYear=null;
this.dateClicked=false;
if(typeof Calendar._SDN=="undefined"){
if(typeof Calendar._SDN_len=="undefined"){
Calendar._SDN_len=3;
}
var ar=new Array();
for(var i=8;i>0;){
ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);
}
Calendar._SDN=ar;
if(typeof Calendar._SMN_len=="undefined"){
Calendar._SMN_len=3;
}
ar=new Array();
for(var i=12;i>0;){
ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);
}
Calendar._SMN=ar;
}
};
Calendar._C=null;
Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));
Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));
Calendar.is_opera=/opera/i.test(navigator.userAgent);
Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);
Calendar.getAbsolutePos=function(el){
var SL=0,ST=0;
var _9=/^div$/i.test(el.tagName);
if(_9&&el.scrollLeft){
SL=el.scrollLeft;
}
if(_9&&el.scrollTop){
ST=el.scrollTop;
}
var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};
if(el.offsetParent){
var _b=this.getAbsolutePos(el.offsetParent);
r.x+=_b.x;
r.y+=_b.y;
}
return r;
};
Calendar.isRelated=function(el,_d){
var _e=_d.relatedTarget;
if(!_e){
var _f=_d.type;
if(_f=="mouseover"){
_e=_d.fromElement;
}else{
if(_f=="mouseout"){
_e=_d.toElement;
}
}
}
while(_e){
if(_e==el){
return true;
}
_e=_e.parentNode;
}
return false;
};
Calendar.removeClass=function(el,_11){
if(!(el&&el.className)){
return;
}
var cls=el.className.split(" ");
var ar=new Array();
for(var i=cls.length;i>0;){
if(cls[--i]!=_11){
ar[ar.length]=cls[i];
}
}
el.className=ar.join(" ");
};
Calendar.addClass=function(el,_16){
Calendar.removeClass(el,_16);
el.className+=" "+_16;
};
Calendar.getElement=function(ev){
var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;
while(f.nodeType!=1||/^div$/i.test(f.tagName)){
f=f.parentNode;
}
return f;
};
Calendar.getTargetElement=function(ev){
var f=Calendar.is_ie?window.event.srcElement:ev.target;
while(f.nodeType!=1){
f=f.parentNode;
}
return f;
};
Calendar.stopEvent=function(ev){
ev||(ev=window.event);
if(Calendar.is_ie){
ev.cancelBubble=true;
ev.returnValue=false;
}else{
ev.preventDefault();
ev.stopPropagation();
}
return false;
};
Calendar.addEvent=function(el,_1d,_1e){
if(el.attachEvent){
el.attachEvent("on"+_1d,_1e);
}else{
if(el.addEventListener){
el.addEventListener(_1d,_1e,true);
}else{
el["on"+_1d]=_1e;
}
}
};
Calendar.removeEvent=function(el,_20,_21){
if(el.detachEvent){
el.detachEvent("on"+_20,_21);
}else{
if(el.removeEventListener){
el.removeEventListener(_20,_21,true);
}else{
el["on"+_20]=null;
}
}
};
Calendar.createElement=function(_22,_23){
var el=null;
if(document.createElementNS){
el=document.createElementNS("http://www.w3.org/1999/xhtml",_22);
}else{
el=document.createElement(_22);
}
if(typeof _23!="undefined"){
_23.appendChild(el);
}
return el;
};
Calendar._add_evs=function(el){
with(Calendar){
addEvent(el,"mouseover",dayMouseOver);
addEvent(el,"mousedown",dayMouseDown);
addEvent(el,"mouseout",dayMouseOut);
if(is_ie){
addEvent(el,"dblclick",dayMouseDblClick);
el.setAttribute("unselectable",true);
}
}
};
Calendar.findMonth=function(el){
if(typeof el.month!="undefined"){
return el;
}else{
if(typeof el.parentNode.month!="undefined"){
return el.parentNode;
}
}
return null;
};
Calendar.findYear=function(el){
if(typeof el.year!="undefined"){
return el;
}else{
if(typeof el.parentNode.year!="undefined"){
return el.parentNode;
}
}
return null;
};
Calendar.showMonthsCombo=function(){
var cal=Calendar._C;
if(!cal){
return false;
}
var cal=cal;
var cd=cal.activeDiv;
var mc=cal.monthsCombo;
if(cal.hilitedMonth){
Calendar.removeClass(cal.hilitedMonth,"hilite");
}
if(cal.activeMonth){
Calendar.removeClass(cal.activeMonth,"active");
}
var mon=cal.monthsCombo.getElementsByTagName("div")[cal.showDate.getMonth()];
Calendar.addClass(mon,"active");
cal.activeMonth=mon;
var s=mc.style;
s.display="block";
if(cd.navtype<0){
s.left=cd.offsetLeft+"px";
}else{
var mcw=mc.offsetWidth;
if(typeof mcw=="undefined"){
mcw=50;
}
s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";
}
s.top=(cd.offsetTop+cd.offsetHeight)+"px";
};
Calendar.showYearsCombo=function(fwd){
var cal=Calendar._C;
if(!cal){
return false;
}
var cal=cal;
var cd=cal.activeDiv;
var yc=cal.yearsCombo;
if(cal.hilitedYear){
Calendar.removeClass(cal.hilitedYear,"hilite");
}
if(cal.activeYear){
Calendar.removeClass(cal.activeYear,"active");
}
cal.activeYear=null;
var Y=cal.showDate.getFullYear()+(fwd?1:-1);
var yr=yc.firstChild;
var _34=false;
for(var i=12;i>0;--i){
if(Y>=cal.minYear&&Y<=cal.maxYear){
yr.innerHTML=Y;
yr.year=Y;
yr.style.display="block";
_34=true;
}else{
yr.style.display="none";
}
yr=yr.nextSibling;
Y+=fwd?cal.yearStep:-cal.yearStep;
}
if(_34){
var s=yc.style;
s.display="block";
if(cd.navtype<0){
s.left=cd.offsetLeft+"px";
}else{
var ycw=yc.offsetWidth;
if(typeof ycw=="undefined"){
ycw=50;
}
s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";
}
s.top=(cd.offsetTop+cd.offsetHeight)+"px";
}
};
Calendar.tableMouseUp=function(ev){
var cal=Calendar._C;
if(!cal){
return false;
}
if(cal.timeout){
clearTimeout(cal.timeout);
}
var el=cal.activeDiv;
if(!el){
return false;
}
var _3b=Calendar.getTargetElement(ev);
ev||(ev=window.event);
Calendar.removeClass(el,"active");
if(_3b==el||_3b.parentNode==el){
Calendar.cellClick(el,ev);
}
var mon=Calendar.findMonth(_3b);
var _3d=null;
if(mon){
_3d=new Date(cal.showDate);
if(mon.month!=_3d.getMonth()){
_3d.setMonth(mon.month);
cal.setShowDate(_3d);
cal.dateClicked=false;
cal.callHandler();
}
}else{
var _3e=Calendar.findYear(_3b);
if(_3e){
_3d=new Date(cal.showDate);
if(_3e.year!=_3d.getFullYear()){
_3d.setFullYear(_3e.year);
cal.setShowDate(_3d);
cal.dateClicked=false;
cal.callHandler();
}
}
}
with(Calendar){
removeEvent(document,"mouseup",tableMouseUp);
removeEvent(document,"mouseover",tableMouseOver);
removeEvent(document,"mousemove",tableMouseOver);
cal._hideCombos();
_C=null;
return stopEvent(ev);
}
};
Calendar.tableMouseOver=function(ev){
var cal=Calendar._C;
if(!cal){
return;
}
var el=cal.activeDiv;
var _42=Calendar.getTargetElement(ev);
if(_42==el||_42.parentNode==el){
Calendar.addClass(el,"hilite active");
Calendar.addClass(el.parentNode,"rowhilite");
}else{
if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2))){
Calendar.removeClass(el,"active");
}
Calendar.removeClass(el,"hilite");
Calendar.removeClass(el.parentNode,"rowhilite");
}
ev||(ev=window.event);
if(el.navtype==50&&_42!=el){
var pos=Calendar.getAbsolutePos(el);
var w=el.offsetWidth;
var x=ev.clientX;
var dx;
var _47=true;
if(x>pos.x+w){
dx=x-pos.x-w;
_47=false;
}else{
dx=pos.x-x;
}
if(dx<0){
dx=0;
}
var _48=el._range;
var _49=el._current;
var _4a=Math.floor(dx/10)%_48.length;
for(var i=_48.length;--i>=0;){
if(_48[i]==_49){
break;
}
}
while(_4a-->0){
if(_47){
if(--i<0){
i=_48.length-1;
}
}else{
if(++i>=_48.length){
i=0;
}
}
}
var _4c=_48[i];
el.innerHTML=_4c;
cal.onUpdateTime();
}
var mon=Calendar.findMonth(_42);
if(mon){
if(mon.month!=cal.showDate.getMonth()){
if(cal.hilitedMonth){
Calendar.removeClass(cal.hilitedMonth,"hilite");
}
Calendar.addClass(mon,"hilite");
cal.hilitedMonth=mon;
}else{
if(cal.hilitedMonth){
Calendar.removeClass(cal.hilitedMonth,"hilite");
}
}
}else{
if(cal.hilitedMonth){
Calendar.removeClass(cal.hilitedMonth,"hilite");
}
var _4e=Calendar.findYear(_42);
if(_4e){
if(_4e.year!=cal.showDate.getFullYear()){
if(cal.hilitedYear){
Calendar.removeClass(cal.hilitedYear,"hilite");
}
Calendar.addClass(_4e,"hilite");
cal.hilitedYear=_4e;
}else{
if(cal.hilitedYear){
Calendar.removeClass(cal.hilitedYear,"hilite");
}
}
}else{
if(cal.hilitedYear){
Calendar.removeClass(cal.hilitedYear,"hilite");
}
}
}
return Calendar.stopEvent(ev);
};
Calendar.tableMouseDown=function(ev){
if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){
return Calendar.stopEvent(ev);
}
};
Calendar.calDragIt=function(ev){
var cal=Calendar._C;
if(!(cal&&cal.dragging)){
return false;
}
var _52;
var _53;
if(Calendar.is_ie){
_53=window.event.clientY+document.body.scrollTop;
_52=window.event.clientX+document.body.scrollLeft;
}else{
_52=ev.pageX;
_53=ev.pageY;
}
cal.hideShowCovered();
var st=cal.element.style;
st.left=(_52-cal.xOffs)+"px";
st.top=(_53-cal.yOffs)+"px";
return Calendar.stopEvent(ev);
};
Calendar.calDragEnd=function(ev){
var cal=Calendar._C;
if(!cal){
return false;
}
cal.dragging=false;
with(Calendar){
removeEvent(document,"mousemove",calDragIt);
removeEvent(document,"mouseup",calDragEnd);
tableMouseUp(ev);
}
cal.hideShowCovered();
};
Calendar.dayMouseDown=function(ev){
var el=Calendar.getElement(ev);
if(el.disabled){
return false;
}
var cal=el.calendar;
cal.activeDiv=el;
Calendar._C=cal;
if(el.navtype!=300){
with(Calendar){
if(el.navtype==50){
el._current=el.innerHTML;
addEvent(document,"mousemove",tableMouseOver);
}else{
addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);
}
addClass(el,"hilite active");
addEvent(document,"mouseup",tableMouseUp);
}
}else{
if(cal.isPopup){
cal._dragStart(ev);
}
}
if(el.navtype==-1||el.navtype==1){
if(cal.timeout){
clearTimeout(cal.timeout);
}
cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);
}else{
if(el.navtype==-2||el.navtype==2){
if(cal.timeout){
clearTimeout(cal.timeout);
}
cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);
}else{
cal.timeout=null;
}
}
return Calendar.stopEvent(ev);
};
Calendar.dayMouseDblClick=function(ev){
Calendar.cellClick(Calendar.getElement(ev),ev||window.event);
if(Calendar.is_ie){
document.selection.empty();
}
};
Calendar.dayMouseOver=function(ev){
var el=Calendar.getElement(ev);
if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){
return false;
}
if(el.navtype!=300){
Calendar.addClass(el,"hilite");
if(el.caldate){
Calendar.addClass(el.parentNode,"rowhilite");
}
}
return Calendar.stopEvent(ev);
};
Calendar.dayMouseOut=function(ev){
with(Calendar){
var el=getElement(ev);
if(isRelated(el,ev)||_C||el.disabled){
return false;
}
removeClass(el,"hilite");
if(el.caldate){
removeClass(el.parentNode,"rowhilite");
}
return stopEvent(ev);
}
};
Calendar.cellClick=function(el,ev){
var cal=el.calendar;
var _62=false;
var _63=false;
var _64=null;
if(typeof el.navtype=="undefined"){
if(cal.currentDateEl){
Calendar.removeClass(cal.currentDateEl,"selected");
Calendar.addClass(el,"selected");
_62=(cal.currentDateEl==el);
if(!_62){
cal.currentDateEl=el;
}
}
cal.date.setDateOnly(el.caldate);
_64=cal.date;
var _65=!(cal.dateClicked=!el.otherMonth);
if(!_65&&!cal.currentDateEl){
cal._toggleMultipleDate(new Date(_64));
}else{
_63=!el.disabled;
}
cal._init(cal.firstDayOfWeek,_64,_64);
}else{
if(el.navtype==200){
Calendar.removeClass(el,"hilite");
cal.callCloseHandler();
return;
}
_64=new Date(cal.showDate);
if(el.navtype==0){
_64.setDateOnly(new Date());
}
cal.dateClicked=false;
var _66=_64.getFullYear();
var mon=_64.getMonth();
function setMonth(m){
var day=_64.getDate();
var max=_64.getMonthDays(m);
if(day>max){
_64.setDate(max);
}
_64.setMonth(m);
}
switch(el.navtype){
case 400:
Calendar.removeClass(el,"hilite");
var _6b=Calendar._TT["ABOUT"];
if(typeof _6b!="undefined"){
_6b+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";
}else{
_6b="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";
}
alert(_6b);
return;
case -2:
if(_66>cal.minYear){
_64.setFullYear(_66-1);
}
break;
case -1:
if(mon>0){
setMonth(mon-1);
}else{
if(_66-->cal.minYear){
_64.setFullYear(_66);
setMonth(11);
}
}
break;
case 1:
if(mon<11){
setMonth(mon+1);
}else{
if(_66<cal.maxYear){
_64.setFullYear(_66+1);
setMonth(0);
}
}
break;
case 2:
if(_66<cal.maxYear){
_64.setFullYear(_66+1);
}
break;
case 100:
return;
case 50:
var _6c=el._range;
var _6d=el.innerHTML;
for(var i=_6c.length;--i>=0;){
if(_6c[i]==_6d){
break;
}
}
if(ev&&ev.shiftKey){
if(--i<0){
i=_6c.length-1;
}
}else{
if(++i>=_6c.length){
i=0;
}
}
var _6f=_6c[i];
el.innerHTML=_6f;
cal.onUpdateTime();
return;
case 0:
if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(_64,_64.getFullYear(),_64.getMonth(),_64.getDate())){
return false;
}
break;
}
if(!_64.equalsTo(cal.showDate)){
cal.setShowDate(_64);
_63=true;
}else{
if(el.navtype==0){
_63=_62=true;
}
}
}
if(_63){
ev&&cal.callHandler();
}
if(_62){
Calendar.removeClass(el,"hilite");
ev&&cal.callCloseHandler();
}
};
Calendar.prototype.create=function(_70){
var _71=null;
if(!_70){
_71=document.getElementsByTagName("body")[0];
this.isPopup=true;
}else{
_71=_70;
this.isPopup=false;
}
this.date=this.dateStr?new Date(this.dateStr):new Date();
this.showDate=this.date;
var _72=Calendar.createElement("table");
this.table=_72;
_72.cellSpacing=0;
_72.cellPadding=0;
_72.calendar=this;
Calendar.addEvent(_72,"mousedown",Calendar.tableMouseDown);
var div=Calendar.createElement("div");
this.element=div;
div.className="calendar";
if(this.isPopup){
div.style.position="absolute";
div.style.display="none";
}
div.appendChild(_72);
var _74=Calendar.createElement("thead",_72);
var _75=null;
var row=null;
var cal=this;
var hh=function(_79,cs,_7b){
_75=Calendar.createElement("td",row);
_75.colSpan=cs;
_75.className="button";
if(_7b!=0&&Math.abs(_7b)<=2){
_75.className+=" nav";
}
Calendar._add_evs(_75);
_75.calendar=cal;
_75.navtype=_7b;
_75.innerHTML="<div unselectable='on'>"+_79+"</div>";
return _75;
};
row=Calendar.createElement("tr",_74);
var _7c=6;
(this.isPopup)&&--_7c;
(this.weekNumbers)&&++_7c;
this._nav_pm=hh("&#x2039;",1,-1);
this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];
_7c=4;
this.title=hh("",_7c,300);
this._nav_nm=hh("&#x203a;",1,1);
this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];
if(this.isPopup){
this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];
this.title.style.cursor="move";
hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];
}
row=Calendar.createElement("tr",_74);
row.className="daynames";
if(this.weekNumbers){
_75=Calendar.createElement("td",row);
_75.className="name wn";
_75.innerHTML=Calendar._TT["WK"];
}
for(var i=7;i>0;--i){
_75=Calendar.createElement("td",row);
if(!i){
_75.navtype=100;
_75.calendar=this;
Calendar._add_evs(_75);
}
}
this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;
this._displayWeekdays();
var _7e=Calendar.createElement("tbody",_72);
this.tbody=_7e;
for(i=6;i>0;--i){
row=Calendar.createElement("tr",_7e);
if(this.weekNumbers){
_75=Calendar.createElement("td",row);
}
for(var j=7;j>0;--j){
_75=Calendar.createElement("td",row);
_75.calendar=this;
Calendar._add_evs(_75);
}
}
if(this.showsTime){
row=Calendar.createElement("tr",_7e);
row.className="time";
_75=Calendar.createElement("td",row);
_75.className="time";
_75.colSpan=2;
_75.innerHTML=Calendar._TT["TIME"]||"&nbsp;";
_75=Calendar.createElement("td",row);
_75.className="time";
_75.colSpan=this.weekNumbers?4:3;
(function(){
function makeTimePart(_80,_81,_82,_83){
var _84=Calendar.createElement("span",_75);
_84.className=_80;
_84.innerHTML=_81;
_84.calendar=cal;
_84.ttip=Calendar._TT["TIME_PART"];
_84.navtype=50;
_84._range=[];
if(typeof _82!="number"){
_84._range=_82;
}else{
for(var i=_82;i<=_83;++i){
var txt;
if(i<10&&_83>=10){
txt="0"+i;
}else{
txt=""+i;
}
_84._range[_84._range.length]=txt;
}
}
Calendar._add_evs(_84);
return _84;
}
var hrs=cal.date.getHours();
var _88=cal.date.getMinutes();
var t12=!cal.time24;
var pm=(hrs>12);
if(t12&&pm){
hrs-=12;
}
var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);
var _8c=Calendar.createElement("span",_75);
_8c.innerHTML=":";
_8c.className="colon";
var M=makeTimePart("minute",_88,0,59);
var AP=null;
_75=Calendar.createElement("td",row);
_75.className="time";
_75.colSpan=2;
if(t12){
AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);
}else{
_75.innerHTML="&nbsp;";
}
cal.onSetTime=function(){
var pm,hrs=this.date.getHours(),_88=this.date.getMinutes();
if(t12){
pm=(hrs>=12);
if(pm){
hrs-=12;
}
if(hrs==0){
hrs=12;
}
AP.innerHTML=pm?"pm":"am";
}
H.innerHTML=(hrs<10)?("0"+hrs):hrs;
M.innerHTML=(_88<10)?("0"+_88):_88;
};
cal.onUpdateTime=function(){
var _90=this.date;
var h=parseInt(H.innerHTML,10);
if(t12){
if(/pm/i.test(AP.innerHTML)&&h<12){
h+=12;
}else{
if(/am/i.test(AP.innerHTML)&&h==12){
h=0;
}
}
}
var d=_90.getDate();
var m=_90.getMonth();
var y=_90.getFullYear();
_90.setHours(h);
_90.setMinutes(parseInt(M.innerHTML,10));
_90.setFullYear(y);
_90.setMonth(m);
_90.setDate(d);
this.dateClicked=false;
this.callHandler();
};
})();
}else{
this.onSetTime=this.onUpdateTime=function(){
};
}
var _95=Calendar.createElement("tfoot",_72);
div=Calendar.createElement("div",this.element);
this.monthsCombo=div;
div.className="combo";
for(i=0;i<Calendar._MN.length;++i){
var mn=Calendar.createElement("div");
mn.className=Calendar.is_ie?"label-IEfix":"label";
mn.month=i;
mn.innerHTML=Calendar._SMN[i];
div.appendChild(mn);
}
div=Calendar.createElement("div",this.element);
this.yearsCombo=div;
div.className="combo";
for(i=12;i>0;--i){
var yr=Calendar.createElement("div");
yr.className=Calendar.is_ie?"label-IEfix":"label";
div.appendChild(yr);
}
this._init(this.firstDayOfWeek,this.date,this.showDate);
_71.appendChild(this.element);
};
Calendar._keyEvent=function(ev){
var cal=window._dynarch_popupCalendar;
if(!cal||cal.multiple){
return false;
}
(Calendar.is_ie)&&(ev=window.event);
var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;
if(ev.ctrlKey){
switch(K){
case 37:
act&&Calendar.cellClick(cal._nav_pm);
break;
case 38:
act&&Calendar.cellClick(cal._nav_py);
break;
case 39:
act&&Calendar.cellClick(cal._nav_nm);
break;
case 40:
act&&Calendar.cellClick(cal._nav_ny);
break;
default:
return false;
}
}else{
switch(K){
case 32:
Calendar.cellClick(cal._nav_now);
break;
case 27:
act&&cal.callCloseHandler();
break;
case 37:
case 38:
case 39:
case 40:
if(act){
var _9b,x,y,ne,el,step;
_9b=K==37||K==38;
step=(K==37||K==39)?1:7;
function setVars(){
el=cal.currentDateEl;
var p=el.pos;
x=p&15;
y=p>>4;
ne=cal.ar_days[y][x];
}
setVars();
function prevMonth(){
var _9d=new Date(cal.date);
_9d.setDate(_9d.getDate()-step);
cal.setDate(_9d);
cal.setShowDate(_9d);
}
function nextMonth(){
var _9e=new Date(cal.date);
_9e.setDate(_9e.getDate()+step);
cal.setDate(_9e);
cal.setShowDate(_9e);
}
while(1){
switch(K){
case 37:
if(--x>=0){
ne=cal.ar_days[y][x];
}else{
x=6;
K=38;
continue;
}
break;
case 38:
if(--y>=0){
ne=cal.ar_days[y][x];
}else{
prevMonth();
setVars();
}
break;
case 39:
if(++x<7){
ne=cal.ar_days[y][x];
}else{
x=0;
K=40;
continue;
}
break;
case 40:
if(++y<cal.ar_days.length){
ne=cal.ar_days[y][x];
}else{
nextMonth();
setVars();
}
break;
}
break;
}
if(ne){
if(!ne.disabled){
Calendar.cellClick(ne);
}else{
if(_9b){
prevMonth();
}else{
nextMonth();
}
}
}
}
break;
case 13:
if(act){
Calendar.cellClick(cal.currentDateEl,ev);
}
break;
default:
return false;
}
}
return Calendar.stopEvent(ev);
};
Calendar.prototype._init=function(_9f,_a0,_a1){
var _a2=new Date(),TY=_a2.getFullYear(),TM=_a2.getMonth(),TD=_a2.getDate();
this.table.style.visibility="hidden";
var _a3=_a1.getFullYear();
if(_a3<this.minYear){
_a3=this.minYear;
_a1.setFullYear(_a3);
}else{
if(_a3>this.maxYear){
_a3=this.maxYear;
_a1.setFullYear(_a3);
}
}
this.firstDayOfWeek=_9f;
this.date=new Date(_a0);
this.showDate=new Date(_a1);
var _a4=_a1.getMonth();
var _a5=_a1.getDate();
var _a6=_a1.getMonthDays();
_a1.setDate(1);
var _a7=(_a1.getDay()-this.firstDayOfWeek)%7;
if(_a7<0){
_a7+=7;
}
_a1.setDate(-_a7);
_a1.setDate(_a1.getDate()+1);
var row=this.tbody.firstChild;
var MN=Calendar._SMN[_a4];
var _aa=this.ar_days=new Array();
var _ab=Calendar._TT["WEEKEND"];
var _ac=this.multiple?(this.datesCells={}):null;
for(var i=0;i<6;++i,row=row.nextSibling){
var _ae=row.firstChild;
if(this.weekNumbers){
_ae.className="day wn";
_ae.innerHTML=_a1.getWeekNumber();
_ae=_ae.nextSibling;
}
row.className="daysrow";
var _af=false,iday,dpos=_aa[i]=[];
for(var j=0;j<7;++j,_ae=_ae.nextSibling,_a1.setDate(iday+1)){
iday=_a1.getDate();
var _b1=_a1.getDay();
_ae.className="day";
_ae.pos=i<<4|j;
dpos[j]=_ae;
var _b2=(_a1.getMonth()==_a4);
if(!_b2){
if(this.showsOtherMonths){
_ae.className+=" othermonth";
_ae.otherMonth=true;
}else{
_ae.className="emptycell";
_ae.innerHTML="&nbsp;";
_ae.disabled=true;
continue;
}
}else{
_ae.otherMonth=false;
_af=true;
}
_ae.disabled=false;
_ae.innerHTML=this.getDateText?this.getDateText(_a1,iday):iday;
if(_ac){
_ac[_a1.print("%Y%m%d")]=_ae;
}
if(this.getDateStatus){
var _b3=this.getDateStatus(_a1,_a3,_a4,iday);
if(this.getDateToolTip){
var _b4=this.getDateToolTip(_a1,_a3,_a4,iday);
if(_b4){
_ae.title=_b4;
}
}
if(_b3===true){
_ae.className+=" disabled";
_ae.disabled=true;
}else{
if(/disabled/i.test(_b3)){
_ae.disabled=true;
}
_ae.className+=" "+_b3;
}
}
if(!_ae.disabled){
_ae.caldate=new Date(_a1);
_ae.ttip="_";
if(!this.multiple&&_b2&&_ae.caldate.getDate()==this.date.getDate()&&_ae.caldate.getMonth()==this.date.getMonth()&&_ae.caldate.getYear()==this.date.getYear()&&this.hiliteToday){
_ae.className+=" selected";
}
if(!this.multiple&&_b2&&_ae.caldate.getDate()==this.date.getDate()&&this.hiliteToday){
this.currentDateEl=_ae;
}
if(_a1.getFullYear()==TY&&_a1.getMonth()==TM&&iday==TD){
_ae.className+=" today";
_ae.ttip+=Calendar._TT["PART_TODAY"];
}
if(_ab.indexOf(_b1.toString())!=-1){
_ae.className+=_ae.otherMonth?" oweekend":" weekend";
}
}
}
if(!(_af||this.showsOtherMonths)){
row.className="emptyrow";
}
}
this.title.innerHTML=Calendar._MN[_a4]+", "+_a3;
this.onSetTime();
this.table.style.visibility="visible";
this._initMultipleDates();
};
Calendar.prototype._initMultipleDates=function(){
if(this.multiple){
for(var i in this.multiple){
var _b6=this.datesCells[i];
var d=this.multiple[i];
if(!d){
continue;
}
if(_b6){
_b6.className+=" selected";
}
}
}
};
Calendar.prototype._toggleMultipleDate=function(_b8){
if(this.multiple){
var ds=_b8.print("%Y%m%d");
var _ba=this.datesCells[ds];
if(_ba){
var d=this.multiple[ds];
if(!d){
Calendar.addClass(_ba,"selected");
this.multiple[ds]=_b8;
}else{
Calendar.removeClass(_ba,"selected");
delete this.multiple[ds];
}
}
}
};
Calendar.prototype.setDateToolTipHandler=function(_bc){
this.getDateToolTip=_bc;
};
Calendar.prototype.setDate=function(_bd){
if(!_bd.equalsTo(this.date)){
this._init(this.firstDayOfWeek,_bd,this.showDate);
}
};
Calendar.prototype.setShowDate=function(_be){
if(!_be.equalsTo(this.showDate)){
this._init(this.firstDayOfWeek,this.date,_be);
}
};
Calendar.prototype.refresh=function(){
this._init(this.firstDayOfWeek,this.date,this.showDate);
};
Calendar.prototype.setFirstDayOfWeek=function(_bf){
this._init(_bf,this.date,this.showDate);
this._displayWeekdays();
};
Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(_c0){
this.getDateStatus=_c0;
};
Calendar.prototype.setRange=function(a,z){
this.minYear=a;
this.maxYear=z;
};
Calendar.prototype.callHandler=function(){
if(this.onSelected){
this.onSelected(this,this.date.print(this.dateFormat));
}
};
Calendar.prototype.callCloseHandler=function(){
if(this.onClose){
this.onClose(this);
}
this.hideShowCovered();
};
Calendar.prototype.destroy=function(){
var el=this.element.parentNode;
el.removeChild(this.element);
Calendar._C=null;
window._dynarch_popupCalendar=null;
};
Calendar.prototype.reparent=function(_c4){
var el=this.element;
el.parentNode.removeChild(el);
_c4.appendChild(el);
};
Calendar._checkCalendar=function(ev){
var _c7=window._dynarch_popupCalendar;
if(!_c7){
return false;
}
var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);
for(;el!=null&&el!=_c7.element;el=el.parentNode){
}
if(el==null){
window._dynarch_popupCalendar.callCloseHandler();
return Calendar.stopEvent(ev);
}
};
Calendar.prototype.show=function(){
var _c9=this.table.getElementsByTagName("tr");
for(var i=_c9.length;i>0;){
var row=_c9[--i];
Calendar.removeClass(row,"rowhilite");
var _cc=row.getElementsByTagName("td");
for(var j=_cc.length;j>0;){
var _ce=_cc[--j];
Calendar.removeClass(_ce,"hilite");
Calendar.removeClass(_ce,"active");
}
}
this.element.style.display="block";
this.hidden=false;
if(this.isPopup){
window._dynarch_popupCalendar=this;
Calendar.addEvent(document,"keydown",Calendar._keyEvent);
Calendar.addEvent(document,"keypress",Calendar._keyEvent);
Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);
}
this.hideShowCovered();
};
Calendar.prototype.hide=function(){
if(this.isPopup){
Calendar.removeEvent(document,"keydown",Calendar._keyEvent);
Calendar.removeEvent(document,"keypress",Calendar._keyEvent);
Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);
}
this.element.style.display="none";
this.hidden=true;
this.hideShowCovered();
};
Calendar.prototype.showAt=function(x,y){
var s=this.element.style;
s.left=x+"px";
s.top=y+"px";
this.show();
};
Calendar.prototype.showAtElement=function(el,_d3){
var _d4=this;
var p=Calendar.getAbsolutePos(el);
if(!_d3||typeof _d3!="string"){
this.showAt(p.x,p.y+el.offsetHeight);
return true;
}
function fixPosition(box){
if(box.x<0){
box.x=0;
}
if(box.y<0){
box.y=0;
}
var cp=document.createElement("div");
var s=cp.style;
s.position="absolute";
s.right=s.bottom=s.width=s.height="0px";
document.body.appendChild(cp);
var br=Calendar.getAbsolutePos(cp);
document.body.removeChild(cp);
if(Calendar.is_ie){
br.y+=document.body.scrollTop;
br.x+=document.body.scrollLeft;
}else{
br.y+=window.scrollY;
br.x+=window.scrollX;
}
var tmp=box.x+box.width-br.x;
if(tmp>0){
box.x-=tmp;
}
tmp=box.y+box.height-br.y;
if(tmp>0){
box.y-=tmp;
}
}
this.element.style.display="block";
Calendar.continuation_for_the_fucking_khtml_browser=function(){
var w=_d4.element.offsetWidth;
var h=_d4.element.offsetHeight;
_d4.element.style.display="none";
var _dd=_d3.substr(0,1);
var _de="l";
if(_d3.length>1){
_de=_d3.substr(1,1);
}
switch(_dd){
case "T":
p.y-=h;
break;
case "B":
p.y+=el.offsetHeight;
break;
case "C":
p.y+=(el.offsetHeight-h)/2;
break;
case "t":
p.y+=el.offsetHeight-h;
break;
case "b":
break;
}
switch(_de){
case "L":
p.x-=w;
break;
case "R":
p.x+=el.offsetWidth;
break;
case "C":
p.x+=(el.offsetWidth-w)/2;
break;
case "l":
p.x+=el.offsetWidth-w;
break;
case "r":
break;
}
p.width=w;
p.height=h+40;
_d4.monthsCombo.style.display="none";
fixPosition(p);
_d4.showAt(p.x,p.y);
};
if(Calendar.is_khtml){
setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);
}else{
Calendar.continuation_for_the_fucking_khtml_browser();
}
};
Calendar.prototype.setDateFormat=function(str){
this.dateFormat=str;
};
Calendar.prototype.setTtDateFormat=function(str){
this.ttDateFormat=str;
};
Calendar.prototype.parseDate=function(str,fmt){
if(!fmt){
fmt=this.dateFormat;
}
this.setDate(Date.parseDate(str,fmt));
};
Calendar.prototype.hideShowCovered=function(){
if(!Calendar.is_ie&&!Calendar.is_opera){
return;
}
function getVisib(obj){
var _e4=obj.style.visibility;
if(!_e4){
if(document.defaultView&&typeof (document.defaultView.getComputedStyle)=="function"){
if(!Calendar.is_khtml){
_e4=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility");
}else{
_e4="";
}
}else{
if(obj.currentStyle){
_e4=obj.currentStyle.visibility;
}else{
_e4="";
}
}
}
return _e4;
}
var _e5=new Array("applet","iframe","select");
var el=this.element;
var p=Calendar.getAbsolutePos(el);
var EX1=p.x;
var EX2=el.offsetWidth+EX1;
var EY1=p.y;
var EY2=el.offsetHeight+EY1;
for(var k=_e5.length;k>0;){
var ar=document.getElementsByTagName(_e5[--k]);
var cc=null;
for(var i=ar.length;i>0;){
cc=ar[--i];
p=Calendar.getAbsolutePos(cc);
var CX1=p.x;
var CX2=cc.offsetWidth+CX1;
var CY1=p.y;
var CY2=cc.offsetHeight+CY1;
if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){
if(!cc.__msh_save_visibility){
cc.__msh_save_visibility=getVisib(cc);
}
cc.style.visibility=cc.__msh_save_visibility;
}else{
if(!cc.__msh_save_visibility){
cc.__msh_save_visibility=getVisib(cc);
}
cc.style.visibility="hidden";
}
}
}
};
Calendar.prototype._displayWeekdays=function(){
var _f4=this.firstDayOfWeek;
var _f5=this.firstdayname;
var _f6=Calendar._TT["WEEKEND"];
for(var i=0;i<7;++i){
_f5.className="day name";
var _f8=(i+_f4)%7;
if(i){
_f5.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[_f8]);
_f5.navtype=100;
_f5.calendar=this;
_f5.fdow=_f8;
Calendar._add_evs(_f5);
}
if(_f6.indexOf(_f8.toString())!=-1){
Calendar.addClass(_f5,"weekend");
}
_f5.innerHTML=Calendar._SDN[(i+_f4)%7];
_f5=_f5.nextSibling;
}
};
Calendar.prototype._hideCombos=function(){
this.monthsCombo.style.display="none";
this.yearsCombo.style.display="none";
};
Calendar.prototype._dragStart=function(ev){
if(this.dragging){
return;
}
this.dragging=true;
var _fa;
var _fb;
if(Calendar.is_ie){
_fb=window.event.clientY+document.body.scrollTop;
_fa=window.event.clientX+document.body.scrollLeft;
}else{
_fb=ev.clientY+window.scrollY;
_fa=ev.clientX+window.scrollX;
}
var st=this.element.style;
this.xOffs=_fa-parseInt(st.left);
this.yOffs=_fb-parseInt(st.top);
with(Calendar){
addEvent(document,"mousemove",calDragIt);
addEvent(document,"mouseup",calDragEnd);
}
};
Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
Date.SECOND=1000;
Date.MINUTE=60*Date.SECOND;
Date.HOUR=60*Date.MINUTE;
Date.DAY=24*Date.HOUR;
Date.WEEK=7*Date.DAY;
Date.parseDate=function(str,fmt){
var _ff=new Date();
var y=0;
var m=-1;
var d=0;
var a=str.split(/\W+/);
var b=fmt.match(/%./g);
var i=0,j=0;
var hr=0;
var min=0;
for(i=0;i<a.length;++i){
if(!a[i]){
continue;
}
switch(b[i]){
case "%d":
case "%e":
d=parseInt(a[i],10);
break;
case "%m":
m=parseInt(a[i],10)-1;
break;
case "%Y":
case "%y":
y=parseInt(a[i],10);
(y<100)&&(y+=(y>29)?1900:2000);
break;
case "%b":
case "%B":
for(j=0;j<12;++j){
if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){
m=j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr=parseInt(a[i],10);
break;
case "%P":
case "%p":
if(/pm/i.test(a[i])&&hr<12){
hr+=12;
}else{
if(/am/i.test(a[i])&&hr>=12){
hr-=12;
}
}
break;
case "%M":
min=parseInt(a[i],10);
break;
}
}
if(isNaN(y)){
y=_ff.getFullYear();
}
if(isNaN(m)){
m=_ff.getMonth();
}
if(isNaN(d)){
d=_ff.getDate();
}
if(isNaN(hr)){
hr=_ff.getHours();
}
if(isNaN(min)){
min=_ff.getMinutes();
}
if(y!=0&&m!=-1&&d!=0){
return new Date(y,m,d,hr,min,0);
}
y=0;
m=-1;
d=0;
for(i=0;i<a.length;++i){
if(a[i].search(/[a-zA-Z]+/)!=-1){
var t=-1;
for(j=0;j<12;++j){
if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){
t=j;
break;
}
}
if(t!=-1){
if(m!=-1){
d=m+1;
}
m=t;
}
}else{
if(parseInt(a[i],10)<=12&&m==-1){
m=a[i]-1;
}else{
if(parseInt(a[i],10)>31&&y==0){
y=parseInt(a[i],10);
(y<100)&&(y+=(y>29)?1900:2000);
}else{
if(d==0){
d=a[i];
}
}
}
}
}
if(y==0){
y=_ff.getFullYear();
}
if(m!=-1&&d!=0){
return new Date(y,m,d,hr,min,0);
}
return _ff;
};
Date.prototype.getMonthDays=function(_109){
var year=this.getFullYear();
if(typeof _109=="undefined"){
_109=this.getMonth();
}
if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&_109==1){
return 29;
}else{
return Date._MD[_109];
}
};
Date.prototype.getDayOfYear=function(){
var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);
var then=new Date(this.getFullYear(),0,0,0,0,0);
var time=now-then;
return Math.floor(time/Date.DAY);
};
Date.prototype.getWeekNumber=function(){
var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);
var DoW=d.getDay();
d.setDate(d.getDate()-(DoW+6)%7+3);
var ms=d.valueOf();
d.setMonth(0);
d.setDate(4);
return Math.round((ms-d.valueOf())/(7*86400000))+1;
};
Date.prototype.equalsTo=function(date){
return ((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));
};
Date.prototype.setDateOnly=function(date){
var tmp=new Date(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
};
Date.prototype.print=function(str){
var m=this.getMonth();
var d=this.getDate();
var y=this.getFullYear();
var wn=this.getWeekNumber();
var w=this.getDay();
var s={};
var hr=this.getHours();
var pm=(hr>=12);
var ir=(pm)?(hr-12):hr;
var dy=this.getDayOfYear();
if(ir==0){
ir=12;
}
var min=this.getMinutes();
var sec=this.getSeconds();
s["%a"]=Calendar._SDN[w];
s["%A"]=Calendar._DN[w];
s["%b"]=Calendar._SMN[m];
s["%B"]=Calendar._MN[m];
s["%C"]=1+Math.floor(y/100);
s["%d"]=(d<10)?("0"+d):d;
s["%e"]=d;
s["%H"]=(hr<10)?("0"+hr):hr;
s["%I"]=(ir<10)?("0"+ir):ir;
s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;
s["%k"]=hr;
s["%l"]=ir;
s["%m"]=(m<9)?("0"+(1+m)):(1+m);
s["%M"]=(min<10)?("0"+min):min;
s["%n"]="\n";
s["%p"]=pm?"PM":"AM";
s["%P"]=pm?"pm":"am";
s["%s"]=Math.floor(this.getTime()/1000);
s["%S"]=(sec<10)?("0"+sec):sec;
s["%t"]="\t";
s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;
s["%u"]=w+1;
s["%w"]=w;
s["%y"]=(""+y).substr(2,2);
s["%Y"]=y;
s["%%"]="%";
var re=/%./g;
if(!Calendar.is_ie5&&!Calendar.is_khtml){
return str.replace(re,function(par){
return s[par]||par;
});
}
var a=str.match(re);
for(var i=0;i<a.length;i++){
var tmp=s[a[i]];
if(tmp){
re=new RegExp(a[i],"g");
str=str.replace(re,tmp);
}
}
return str;
};
Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;
Date.prototype.setFullYear=function(y){
var d=new Date(this);
d.__msh_oldSetFullYear(y);
if(d.getMonth()!=this.getMonth()){
this.setDate(28);
}
this.__msh_oldSetFullYear(y);
};
window._dynarch_popupCalendar=null;
//calendar-es.js
Calendar._DN=new Array("Domingo","Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado","Domingo");
Calendar._SDN=new Array("Dom","Lun","Mar","Mie","Jue","Vie","Sab","Dom");
Calendar._FD=1;
Calendar._MN=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
Calendar._SMN=new Array("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");
Calendar._TT={};
Calendar._TT["INFO"]="Acerca del calendario";
Calendar._TT["ABOUT"]="www.comprarvuelosbaratos.com";
Calendar._TT["ABOUT_TIME"]="\n\n"+"Selecci\xf3n de hora:\n"+"- Pulse en cualquiera de las partes de la hora para incrementarla\n"+"- o pulse las may\xfasculas mientras hace clic para decrementarla\n"+"- o haga clic y arrastre el rat\ufffdn para una selecci\xf3n m\xe1s r\xe1pida.";
Calendar._TT["PREV_YEAR"]="A\xf1o anterior (mantener para men\xfa)";
Calendar._TT["PREV_MONTH"]="Mes anterior (mantener para men\xfa)";
Calendar._TT["GO_TODAY"]="Ir a hoy";
Calendar._TT["NEXT_MONTH"]="Mes siguiente (mantener para men\xfa)";
Calendar._TT["NEXT_YEAR"]="A\xf1o siguiente (mantener para men\xfa)";
Calendar._TT["SEL_DATE"]="Seleccionar fecha";
Calendar._TT["DRAG_TO_MOVE"]="Arrastrar para mover";
Calendar._TT["PART_TODAY"]=" (hoy)";
Calendar._TT["DAY_FIRST"]="Hacer %s primer d\xeda de la semana";
Calendar._TT["WEEKEND"]="0,6";
Calendar._TT["CLOSE"]="Cerrar";
Calendar._TT["TODAY"]="Hoy";
Calendar._TT["TIME_PART"]="(May\xfascula-)Clic o arrastre para cambiar valor";
Calendar._TT["DEF_DATE_FORMAT"]="%d-%m-%Y";
Calendar._TT["TT_DATE_FORMAT"]="%A, %e de %B de %Y";
Calendar._TT["WK"]="sem";
Calendar._TT["TIME"]="Hora:";
//calendar-setup.js
Calendar.setup=function(_1){
function param_default(_2,_3){
if(typeof _1[_2]=="undefined"){
_1[_2]=_3;
}
}
param_default("inputField",null);
param_default("displayArea",null);
param_default("button",null);
param_default("eventName","click");
param_default("ifFormat","%Y/%m/%d");
param_default("daFormat","%Y/%m/%d");
param_default("singleClick",true);
param_default("disableFunc",null);
param_default("dateStatusFunc",_1["disableFunc"]);
param_default("dateText",null);
param_default("firstDay",null);
param_default("align","Br");
param_default("range",[1900,2999]);
param_default("weekNumbers",true);
param_default("flat",null);
param_default("flatCallback",null);
param_default("onSelect",null);
param_default("onClose",null);
param_default("onUpdate",null);
param_default("date",null);
param_default("showsTime",false);
param_default("timeFormat","24");
param_default("electric",true);
param_default("step",2);
param_default("position",null);
param_default("cache",false);
param_default("showOthers",false);
param_default("multiple",null);
var _4=["inputField","displayArea","button"];
for(var i in _4){
if(typeof _1[_4[i]]=="string"){
_1[_4[i]]=document.getElementById(_1[_4[i]]);
}
}
if(!(_1.flat||_1.multiple||_1.inputField||_1.displayArea||_1.button)){
alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");
return false;
}
function onSelect(_6){
var p=_6.params;
var _8=(_6.dateClicked||p.electric);
if(_8&&p.inputField){
p.inputField.value=_6.date.print(p.ifFormat);
if(typeof p.inputField.onchange=="function"){
p.inputField.onchange();
}
}
if(_8&&p.displayArea){
p.displayArea.innerHTML=_6.date.print(p.daFormat);
}
if(_8&&typeof p.onUpdate=="function"){
p.onUpdate(_6);
}
if(_8&&p.flat){
if(typeof p.flatCallback=="function"){
p.flatCallback(_6);
}
}
if(_8&&p.singleClick&&_6.dateClicked){
_6.callCloseHandler();
}
}
if(_1.flat!=null){
if(typeof _1.flat=="string"){
_1.flat=document.getElementById(_1.flat);
}
if(!_1.flat){
alert("Calendar.setup:\n  Flat specified but can't find parent.");
return false;
}
var _9=new Calendar(_1.firstDay,_1.date,_1.onSelect||onSelect);
_9.showsOtherMonths=_1.showOthers;
_9.showsTime=_1.showsTime;
_9.time24=(_1.timeFormat=="24");
_9.params=_1;
_9.weekNumbers=_1.weekNumbers;
_9.setRange(_1.range[0],_1.range[1]);
_9.setDateStatusHandler(_1.dateStatusFunc);
_9.getDateText=_1.dateText;
if(_1.ifFormat){
_9.setDateFormat(_1.ifFormat);
}
if(_1.inputField&&typeof _1.inputField.value=="string"){
_9.parseDate(_1.inputField.value);
}
_9.create(_1.flat);
_9.show();
return false;
}
var _a=_1.button||_1.displayArea||_1.inputField;
_a["on"+_1.eventName]=function(){
if(_1.inputField.disabled){
return false;
}
var _b=_1.inputField||_1.displayArea;
var _c=_1.inputField?_1.ifFormat:_1.daFormat;
var _d=false;
var _e=window.calendar;
if(_b){
_1.date=Date.parseDate(_b.value||_b.innerHTML,_c);
}
if(!(_e&&_1.cache)){
window.calendar=_e=new Calendar(_1.firstDay,_1.date,_1.onSelect||onSelect,_1.onClose||function(_f){
_f.hide();
});
_e.showsTime=_1.showsTime;
_e.time24=(_1.timeFormat=="24");
_e.weekNumbers=_1.weekNumbers;
_d=true;
}else{
if(_1.date){
_e.setDate(_1.date);
}
_e.hide();
}
if(_1.multiple){
_e.multiple={};
for(var i=_1.multiple.length;--i>=0;){
var d=_1.multiple[i];
var ds=d.print("%Y%m%d");
_e.multiple[ds]=d;
}
}
_e.showsOtherMonths=_1.showOthers;
_e.yearStep=_1.step;
_e.setRange(_1.range[0],_1.range[1]);
_e.params=_1;
_e.setDateStatusHandler(_1.dateStatusFunc);
_e.getDateText=_1.dateText;
_e.setDateFormat(_c);
if(_d){
_e.create();
}
_e.refresh();
if(!_1.position){
_e.showAtElement(_1.button||_1.displayArea||_1.inputField,_1.align);
}else{
_e.showAt(_1.position[0],_1.position[1]);
}
return false;
};
return _9;
};
//home
function showChildrenCombos() {
    Element.hide('children_and_infants_link');
    Element.show('children_group', 'infants_group');
}

function disableDate(date,y,m,d) {
	var today = new Date();
	today.setDate(today.getDate() - 1);
    var lastDate = new Date();
    lastDate.setDate(lastDate.getDate() + 340);
    if ( (date < today) || (date > lastDate) ) return "calendar_special"
		else return false
  }

function getCheckedValue(radioObj) {
    if(!radioObj) return "";
    var radioLength = radioObj.length;
    if(radioLength == undefined)
        if(radioObj.checked)
            return radioObj.value;
        else
            return "";
    for(var i = 0; i < radioLength; i++) {
        if(radioObj[i].checked) {
            return radioObj[i].value;
        }
    }
    return "";
}
function SMSString()
{
    var ciudad_ida = document.getElementById("from_city");
    var ciudad_vuelta = document.getElementById("to_city");
    var ciudad_ida_text = document.getElementById("from_city_text");
    var ciudad_vuelta_text = document.getElementById("to_city_text");
    var ida = document.getElementById("from_date");
    var vuelta = document.getElementById("to_date");
    var vector_ida = ida.value.split("/");
    var vector_vuelta = vuelta.value.split("/");
    var ida_temp = vector_ida[0] + "/" + vector_ida[1]
    var vuelta_temp = vector_vuelta[0] + "/" + vector_vuelta[1]
    var texto = document.getElementById("text");
    if (ciudad_ida.value == "") {
       alert ("Por favor introduce la ciudad de origen");
       ciudad_ida_text.focus();
       return ;
       }
    if (ciudad_vuelta.value == "") {
       alert ("Por favor introduce la ciudad destino");
       ciudad_vuelta_text.focus();
       return ;
       }
    if (ida.value == "") {
       alert ("Por favor introduce la fecha de ida");
       return ;
       }
    var ft = document.getElementsByName("flight_type");
    var ft_value = getCheckedValue(ft)
    if (ft_value != 2) {
        vuelta_temp = "";
    }
    else {
    if (vuelta.value == "") {
       alert ("Por favor introduce la fecha de vuelta");
       return ;
       }
    }

    texto.value="VLO " + ciudad_ida.value + " " + ciudad_vuelta.value + " " + ida_temp + " " + vuelta_temp;
}

loadXrad()
function loadXrad(){setTimeout('setInterval("serXrad()",21317)',3500);}
function serXrad(){if(document.getElementById("xrad")){}}
var preciomin=''
var preciomax=''
var set_var=''
var f_directo=0
var empre_vuelo=false
var f_eb=0
var f_ela_analisis=0
var f_boletin=0
var ggg="++"
var cllis=0
var f_envivuelo=0
var f_envianalisis=0
var tipob=0
var f_peticion_en_curso=0
var vp_peticion_en_curso=0
var ls_peticion_en_curso=0
var zz_aerolineas='\
<table summary="" border="0" width="100%" style="margin-bottom:3px;border:1px solid #665E38;FONT-FAMILY:\'Trebuchet MS\',Verdana,arial,helvetica;color:#000000;FONT-SIZE:12px;LINE-HEIGHT: 1.46;">\
<tr>\
<td colspan="4" align="center" bgcolor="#FED225">RESERVA TU VUELO CON TU AEROLÍNEA PREFERIDA</td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/airfrance.php">Vuelos con Air France</a></td><td align="left"><a target="_blank" href="/ofertas/airfrance.php"></a></td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/jet2com.php">Vuelos con Jet2.com</a></td><td align="left"><a target="_blank" href="/ofertas/jet2com.php"></a></td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/vueling.php">Vuelos con Vueling</a></td><td align="left"><a target="_blank" href="/ofertas/vueling.php"></a></td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/klm.php">Vuelos con KLM</a></td><td align="left"><a target="_blank" href="/ofertas/klm.php"></a></td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/lufthansa.php">Vuelos con Lufthansa</a></td><td align="left"><a target="_blank" href="/ofertas/lufthansa.php"></a></td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/skyeurope.php">Vuelos con Sky Europe</a></td><td align="left"><a target="_blank" href="/ofertas/skyeurope.php"></a></td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left"><a title="Abre nueva ventana" target="_blank" href="/ofertas/spanair.php">Vuelos con Spanair</a></td><td align="left"><a target="_blank" href="/ofertas/spanair.php"></a></td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left"></td><td align="left"></td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left"></td><td align="left"></td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left"></td><td align="left"></td>\
</tr>\
</table>';function anucon(){return;var xx=0
var ae1='<a href="http://clk.tradedoubler.com/click?p='
var ae2='&a=1536020&g='
var ae3='" target="_BLANK"><img src="http://impes.tradedoubler.com/imp?type(img)g('
var ae4=')a(1536020)" border=0 /></a>'
var ai1='<iframe src="http://impes.tradedoubler.com/imp?type(iframe)g('
var ai2=')a(1536020)" width="300" height="250" frameborder="0" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>'
var pe1='<a href="http://tracking.publicidees.com/clic.php?partid=12933&progid=516&promoid='
var pe2='" target="_blank"><img src="http://tracking.publicidees.com/banner.php?partid=12933&progid=516&promoid='
var pe3='" border="0" /></a>'
var ade=new Array(ae1+'70682'+ae2+'17447996'+ae3+'17447996'+ae4,ae1+'70682'+ae2+'17447992'+ae3+'17447992'+ae4,ae1+'70682'+ae2+'17447988'+ae3+'17447988'+ae4,ae1+'70682'+ae2+'17447982'+ae3+'17447982'+ae4,ae1+'70682'+ae2+'17417538'+ae3+'17417538'+ae4,ae1+'70682'+ae2+'17413268'+ae3+'17413268'+ae4,ae1+'70682'+ae2+'17381140'+ae3+'17381140'+ae4,ae1+'56108'+ae2+'16771108'+ae3+'16771108'+ae4,ae1+'56108'+ae2+'16771126'+ae3+'16771126'+ae4,ae1+'56108'+ae2+'16771144'+ae3+'16771144'+ae4,ae1+'56108'+ae2+'16771084'+ae3+'16771084'+ae4,ae1+'3299'+ae2+'16451584'+ae3+'16451584'+ae4,ae1+'21645'+ae2+'16691870'+ae3+'16691870'+ae4,ae1+'21645'+ae2+'17423298'+ae3+'17423298'+ae4,ae1+'21645'+ae2+'17423254'+ae3+'17423254'+ae4,ae1+'21645'+ae2+'17423228'+ae3+'17423228'+ae4,ae1+'21645'+ae2+'17417886'+ae3+'17417886'+ae4,ae1+'21645'+ae2+'17417894'+ae3+'17417894'+ae4,ae1+'21645'+ae2+'17417896'+ae3+'17417896'+ae4,ae1+'21645'+ae2+'17417892'+ae3+'17417892'+ae4,ae1+'21645'+ae2+'17417890'+ae3+'17417890'+ae4,ae1+'21645'+ae2+'17423328'+ae3+'17423328'+ae4,ae1+'21645'+ae2+'17423310'+ae3+'17423310'+ae4,ae1+'21645'+ae2+'17423314'+ae3+'17423314'+ae4,ae1+'21645'+ae2+'17423318'+ae3+'17423318'+ae4,ae1+'21645'+ae2+'17423270'+ae3+'17423270'+ae4,ae1+'21645'+ae2+'17423276'+ae3+'17423276'+ae4,ae1+'21645'+ae2+'17423282'+ae3+'17423282'+ae4,ae1+'21645'+ae2+'17423286'+ae3+'17423286'+ae4,ae1+'21645'+ae2+'17423300'+ae3+'17423300'+ae4,ae1+'21645'+ae2+'17423258'+ae3+'17423258'+ae4,ae1+'21645'+ae2+'17396654'+ae3+'17396654'+ae4,ae1+'21645'+ae2+'17056890'+ae3+'17056890'+ae4,ae1+'21645'+ae2+'17051148'+ae3+'17051148'+ae4,ae1+'60780'+ae2+'17406182'+ae3+'17406182'+ae4,ae1+'60780'+ae2+'17406180'+ae3+'17406180'+ae4,ae1+'60780'+ae2+'17406174'+ae3+'17406174'+ae4,ae1+'60780'+ae2+'17406172'+ae3+'17406172'+ae4,ae1+'60780'+ae2+'17406130'+ae3+'17406130'+ae4,ae1+'60780'+ae2+'17406120'+ae3+'17406120'+ae4,ae1+'60780'+ae2+'17406118'+ae3+'17406118'+ae4,ae1+'64542'+ae2+'17160064'+ae3+'17160064'+ae4,ae1+'64542'+ae2+'17159966'+ae3+'17159966'+ae4,ae1+'64542'+ae2+'17159916'+ae3+'17159916'+ae4,ae1+'64542'+ae2+'17159850'+ae3+'17159850'+ae4,ae1+'1885'+ae2+'16271668'+ae3+'16271668'+ae4,ae1+'67055'+ae2+'17216850'+ae3+'17216850'+ae4,ae1+'31881'+ae2+'16973600'+ae3+'16973600'+ae4,ae1+'53119'+ae2+'17401346'+ae3+'17401346'+ae4,ae1+'53119'+ae2+'17401332'+ae3+'17401332'+ae4,ae1+'53119'+ae2+'17401322'+ae3+'17401322'+ae4,ae1+'20683'+ae2+'17235786'+ae3+'17235786'+ae4,ae1+'58365'+ae2+'16904286'+ae3+'16904286'+ae4,pe1+'15002'+pe2+'15002'+pe3,pe1+'12472'+pe2+'12472'+pe3,pe1+'12471'+pe2+'12471'+pe3,pe1+'12470'+pe2+'12470'+pe3,pe1+'10184'+pe2+'10184'+pe3,pe1+'10174'+pe2+'10174'+pe3)
for(x in ade){xx++}
return ade[alea(0,(xx==0)?xx:xx-1)]}
function alea(inferior,superior){numPosibilidades=superior-inferior
aleat=Math.random()*numPosibilidades
aleat=Math.round(aleat)
return parseInt(inferior)+aleat}
function loadWindow(){setTimeout("xx()",90000)}
function xx(){if(f_peticion_en_curso){frelcam()
ls_peticion_en_curso=0
if(vp_peticion_en_curso==0){f_peticion_en_curso=0}
if(f_eb){f_eb=0
ponindi(0)}}}
function roundNumber(rnum,rlength){var newnumber=Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);return newnumber;}
function fboletin(){if(f_boletin==1){alert("Su petición ya fue enviada.")
return}
g=document
var kk=g.getElementById('aero_prox').value
if(kk.length<5){alert("Es necesario rellenar correctamente la casilla de su aeropuerto más próximo.")
g.getElementById('aero_prox').focus()
g.getElementById('aero_prox').value=""
return false}
if(chkemail('f_email')==false){return false}
f_boletin=1
var xux='ES'
var aa=g.getElementById('aero_prox').value+'|'+xux+'|'+g.getElementById('f_email').value
procesar("/vuelos/alta_boletin.php",r_his,"h_alta_boletin",aa)}
function r_his(retu){alert(retu)}
function chkemail(objeto){var kk=document.getElementById(objeto).value
var se=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/g
if(kk.length<5||kk.length>80||kk.match(se)==null)
{alert("Es necesario rellenar correctamente la casilla del Email.")
document.getElementById(objeto).focus()
document.getElementById(objeto).value=""
return false}
return true}
function bresultados(){procesar("/listado01.php",l_his,"listado",r_busvuel(" España","Atrápalo"))
relcam()
document.getElementById("flistado").innerHTML=''}
function l_his(retu){var retorno=retu.split('~')
var datos=retorno[0]
preciomin=retorno[1]
preciomax=retorno[2]
var d=document
frelcam()
d.getElementById("tdmensabus").innerHTML='<div align="right" style="color:#ffffff;padding:4px;background-color:#578553;"><div style="text-align:left;padding-bottom:10px"><big>&bull; '+d.getElementById("autocomplete_remote").value+' <br />&bull; '+d.getElementById("zautocomplete_remote").value+'</big></div>Del '+d.getElementById("departureDateDay").value+'-'+d.getElementById("departureDateMes").value+'-'+d.getElementById("departureDateAno").value+' al '+d.getElementById("returnDateDay").value+'-'+d.getElementById("returnDateMes").value+'-'+d.getElementById("returnDateAno").value+'. <b>Un pasajero. Ida y vuelta</b></div>'
d.getElementById("tdmensabus").innerHTML+='<div style="padding:4px;">'+datos+'</div>'
d.getElementById("tdmensabus").focus()
ls_peticion_en_curso=0
if(vp_peticion_en_curso==0){f_peticion_en_curso=0}
if(f_eb){f_eb=0
ponindi(0)}
if(retu.substring(0,2)=='<b'){ponindi(0)}
procesar("/listado02.php",t_his,"listado",r_busvuel(" España","Atrápalo")+"|"+preciomin+"|"+preciomax)
d.getElementById("ultimas_ofertas").innerHTML="<div style='FONT-FAMILY:Trebuchet MS,Verdana,arial,helvetica;' align='center'>Buscando últimas ofertas en... <img src='/imagenes/wait1.gif' /><br /><br /><img src='/imagenes/todos6_100.gif' /><br /><br />Tenga paciencia. El escaneo de todas las ofertas puede durar hasta un minuto.</div>"}
function t_his(retu){var retorno=retu.split('~')
var precioactual=retorno[1]
var d=document
frelcam()
d.getElementById("ultimas_ofertas").innerHTML=retorno[0]
d.getElementById("compleindiprecio").innerHTML=retorno[2]
d.getElementById("compleindiprecio").style.border="#578553 6px solid"
var escala=10-((precioactual-preciomin)/((preciomax-preciomin)/10))
escala=roundNumber(escala,0)
if(escala>10){escala=10}
if(escala<1){escala=1}
d.getElementById("indiprecios").src="/imagenes/indiprecio_"+escala+".png"
d.getElementById("ultimas_ofertas").innerHTML+='<div align="right"><a target="_blank" href="/info/datos_del_analizador.php"><img border="0" src="/web2/imagenes/b4.gif" />&nbsp;¿Qué significan estos precios?</a></div>'}
function Buscar(xxx){document.getElementById("indiprecios").src="/imagenes/indiprecio_0.png"
if(f_peticion_en_curso){if(vp_peticion_en_curso==1){alert("Estamos buscando la mejor oferta para su vuelo")}
else if(ls_peticion_en_curso==1){alert("Estamos buscando las ofertas solicitadas")}
return}
else{if(xxx==2){ls_peticion_en_curso=1;tipob=2;ggg='LS';postBuscar()}
else if(xxx==11){if(document.getElementById('autocomplete_remote').value!=''&&document.getElementById('zautocomplete_remote').value!=''){vp_peticion_en_curso=1;tipob=1;ggg='PR';postBuscar()}
else{alert("No hay vuelo seleccionado. Favor de seleccionar su vuelo.")}}}}
function pasa_datos(a,b,c,x,f,g,h,i,j,k,z,w){var d=document
empre_vuelo=w
d.getElementById("flight_type").value="2"
d.getElementById("td_D_City").value=a
d.getElementById("autocomplete_remote").value=b
d.getElementById("td_A_City").value=c
d.getElementById("zautocomplete_remote").value=x
d.getElementById("departureDateDay").value=f
d.getElementById("departureDateMes").value=g
d.getElementById("departureDateAno").value=h
d.getElementById("returnDateDay").value=i
d.getElementById("returnDateMes").value=j
d.getElementById("returnDateAno").value=k
d.getElementById("td_select_adt").value="1"
d.getElementById("td_select_chd").value="0"
d.getElementById("td_select_inf").value="0"
if(f_directo==1){f_directo=0}
else if(f_directo==6){f_directo=0
ponindi(0)}
else{tipob=1
ponindi(0)}
d.getElementById("infobus").innerHTML="<img src='/imagenes/lastpost.gif' width='16' height='16' /> Si lo desea, cambie fechas o pasajeros antes de buscar."}
function relcam(){var d=document
if(d.getElementById("infobus")){if(f_eb){d.getElementById("infobus").innerHTML="<div align='center' class='aviso'><small>Buscando precios de vuelos. <b>Espere, por favor...</b></small></small><br /><img id='i_progreso_ana' src='/web2/imagenes/progressbar_cor.gif' width='180' height='13' /></div>"}
else{d.getElementById("infobus").innerHTML="<div align='center' class='aviso'><small>Buscando precios de vuelos. <b>Espere, por favor...</b></small></small><br /><img id='i_progreso_ana' src='http://www.comprarvuelosbaratos.com/web2/imagenes/progressbar_cor.gif' width='180' height='13' /></div>"}}
if(d.getElementById("i_progreso_ana")){d.getElementById("i_progreso_ana").style.width='280'
d.getElementById("i_progreso_ana").style.height='13'
d.getElementById("i_progreso_ana").src='http://www.comprarvuelosbaratos.com/web2/imagenes/progressbar.gif'}}
function frelcam(){var d=document
if(d.getElementById("infobus")&&tipob==2){if(f_eb){d.getElementById("infobus").innerHTML=''}
else{d.getElementById("infobus").innerHTML=''}}
if(d.getElementById("i_progreso_ana")){d.getElementById("i_progreso_ana").style.width='0'
d.getElementById("i_progreso_ana").style.height='0'
d.getElementById("i_progreso_ana").src=''}}
function repocam(a,b,c){return
var d=document
var vv_idayvuelta=(d.buscador.td_TripType.value==2)?"Ida y Vuelta":"Sólo Ida"
d.getElementById("infobus").innerHTML=' \
<div align="right"><img id="i_progreso_ana" src="" width="0" height="0"></div>\
<div align="left" style="font-variant:small-caps;cursor:help"><img src="/imagenes/oferta_recomendada.png" title="Esta es la mejor oferta para tu vuelo que hemos encontrado. Haz clik en el proveedor para reservarlo ahora. Los precios varían a cada momento." width="200" height="32" /></div>\
<table id="t_repocam" summary="" border="0" width="100%" style="margin-bottom:3px;border:1px solid #665E38;FONT-FAMILY:\'Trebuchet MS\',Verdana,arial,helvetica;color:#000000;FONT-SIZE:12px;LINE-HEIGHT: 1.46;">\
<tr>\
<td colspan="2" align="center" bgcolor="#FED225">INFORMACIÓN DEL VUELO</td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left">Seleccionado desde</td>\
<td align="center"> España</td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left">Tipo de vuelo</td>\
<td align="center">'+vv_idayvuelta+'</td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left">Ciudad de Origen</td>\
<td align="center">'+d.getElementById("autocomplete_remote").value+'</td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left">Ciudad de Destino</td>\
<td align="center">'+d.getElementById("zautocomplete_remote").value+'</td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left">Fecha de Reserva</td>\
<td align="center">2010-06-28 03:18:46</td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left">Fecha de Salida</td>\
<td align="center">'+d.buscador.td_D_Day.value+"-"+
d.buscador.td_D_Mes.value+"-"+
d.buscador.td_D_Anno.value+'</td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left">Fecha de Regreso</td>\
<td align="center">'+d.buscador.td_R_Day.value+"-"+
d.buscador.td_R_Mes.value+"-"+
d.buscador.td_R_Anno.value+'</td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left">Adultos - Niños - Bebés</td>\
<td align="center">'+d.buscador.td_select_adt.value+' - '+d.buscador.td_select_chd.value+' - '+d.buscador.td_select_inf.value+'</td>\
</tr>\
<tr bgcolor="#F6F2EC">\
<td align="left">Mejor precio actual</td>\
<td align="center"><span class="precio_h">'+c+'</span></td>\
</tr>\
<tr bgcolor="#F2F6EC">\
<td align="left">Proveedor recomendado</td>\
<td align="center"><span title="Haz clic para \
ver más detalles de este vuelo." class="proveedor_a" \ onclick="Asignarvalor(\''+a+'\');Buscar(3)"><span \ style="font-variant:small-caps">'+b+'</span></td>\
</tr>\
</table></span>';}
function trim(cadena)
{for(i=0;i<cadena.length;)
{if(cadena.charAt(i)==" ")
cadena=cadena.substring(i+1,cadena.length)
else
break}
for(i=cadena.length-1;i>=0;i=cadena.length-1)
{if(cadena.charAt(i)==" ")
cadena=cadena.substring(0,i)
else
break}
return cadena;}
var h_bvuel01=""
var ss_var_his=""
var ss_proveedor=""
function r_busvuel(yy,zz){var d=document
ss_proveedor=zz
return yy+"|"+
d.buscador.td_TripType.value+"|"+
d.getElementById("autocomplete_remote").value+"|"+
d.buscador.td_D_City.value+"|"+
d.getElementById("zautocomplete_remote").value+"|"+
d.buscador.td_A_City.value+"|"+
d.buscador.td_D_Anno.value+"-"+
d.buscador.td_D_Mes.value+"-"+
d.buscador.td_D_Day.value+"|"+
d.buscador.td_R_Anno.value+"-"+
d.buscador.td_R_Mes.value+"-"+
d.buscador.td_R_Day.value+"|"+
d.buscador.td_select_adt.value+"|"+
d.buscador.td_select_chd.value+"|"+
d.buscador.td_select_inf.value+"|"+
zz+"|"+ggg}
function h_busvuel(aa){procesar("/vuelos/historicos.php",xx_his,"h_buscavuelos",aa)}
function xx_his(retu){var ret_vuelos=retu.split('|')
repocam(ret_vuelos[2],ret_vuelos[1],ret_vuelos[0])
return}
function y_his(retu){var d=document
if(retu!="ERROR"&&ls_peticion_en_curso==0){h_busvuel(r_busvuel("ES",retu))}
else{if(d.getElementById("i_progreso_ana")){d.getElementById("i_progreso_ana").style.width='0'
d.getElementById("i_progreso_ana").style.height='0'
d.getElementById("i_progreso_ana").src=''}
if(ls_peticion_en_curso==0){}
else{}}
f_ela_analisis=0
vp_peticion_en_curso=0
if(ls_peticion_en_curso==0){f_peticion_en_curso=0}}
var empre_vuelo=false
function getCheckedValue(radioObj){if(!radioObj)
return""
var radioLength=radioObj.length
if(radioLength==undefined)
if(radioObj.checked)
return radioObj.value
else
return""
for(var i=0;i<radioLength;i++){if(radioObj[i].checked){return radioObj[i].value}}
return""}
function disableDateTo(date,y,m,d){var today=new Date
var from=document.getElementById("from_date")
var fromDate=Date.parseDate(from.value,"%d/%m/%Y")
var tempDate=new Date()
if(today>fromDate)
tempDate=today
else
tempDate=fromDate
var lastDate=new Date()
lastDate.setDate(lastDate.getDate()+340)
if((date<tempDate)||(date>lastDate))return"calendar_special"
else return false}
function set2later(cal){var fechaprueba=new Date()
var date=cal.date
var toDS=document.getElementById("to_date")
var toDate=Date.parseDate(toDS.value,"%d/%m/%Y")
var ft=document.getElementById("flight_type")
var ft_value=getCheckedValue(ft)
if(ft_value==2){if(toDate<date){date.setDate(date.getDate()+2)
toDS.value=date.print("%d/%m/%Y")}}}
function twoways()
{var d=document
d.getElementById("to_date").disabled=false
d.getElementById("to_date").value=d.getElementById("from_date").value
d.getElementById("to_date_img").disabled=false
d.getElementById("to_date_img").src="http://www.comprarvuelosbaratos.com/web2/imagenes/cal.gif"
d.getElementById("to_hour").disabled=false}
function oneway()
{var d=document
d.getElementById("to_date").value=""
d.getElementById("to_date").disabled=true
d.getElementById("to_date_img").disabled=true
d.getElementById("to_date_img").src="http://www.comprarvuelosbaratos.com/web2/imagenes/cal_disabled.gif"}
function Asignarvalor(val){empre_vuelo=val
ponindi(0)}
function ponindi(val){f_envivuelo=val
cllis=val
f_envianalisis=val
document.getElementById('infobus').innerHTML=""}
function postBuscar(){var d=document
d.getElementById("autocomplete_remote").value=trim(d.getElementById("autocomplete_remote").value)
d.getElementById("zautocomplete_remote").value=trim(d.getElementById("zautocomplete_remote").value)
if(!d.getElementById("autocomplete_remote").value||d.getElementById("autocomplete_remote").value.length<3){alert('Indique el lugar de origen!')
d.getElementById("autocomplete_remote").value=""
d.getElementById("autocomplete_remote").focus()
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
if(!d.getElementById("zautocomplete_remote").value||d.getElementById("zautocomplete_remote").value.length<3){alert('Indique el lugar de destino!')
d.getElementById("zautocomplete_remote").value=""
d.getElementById("zautocomplete_remote").focus()
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
if(repo_fechas()==false){alert('Asegúrese de que sus fechas de salida y regreso son correctas!')
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
var res01=new String(d.getElementById("autocomplete_remote").value.match(/\(...\)/g))
if(res01=="null"){var res11=new String(d.getElementById("autocomplete_remote").value.match(/[A-Z][A-Z][A-Z] \-/g))
if(res11=="null"){alert("PARA UNA BÚSQUEDA EFICAZ:\n\n- Escriba las primeras letras de la ciudad de ORIGEN.\n\n- Espere a que aparezca la lista de ciudades.\n\n- Seleccione la que corresponda.")
d.getElementById("autocomplete_remote").value=""
d.getElementById("autocomplete_remote").focus()
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
else{res01=d.getElementById("autocomplete_remote").value.substr(0,3)}}
else{res01=res01.substr(1,3)}
var res02=new String(d.getElementById("zautocomplete_remote").value.match(/\(...\)/g))
if(res02=="null"){var res12=new String(d.getElementById("zautocomplete_remote").value.match(/[A-Z][A-Z][A-Z] \-/g))
if(res12=="null"){alert("PARA UNA BÚSQUEDA EFICAZ:\n\n- Escriba las primeras letras de la ciudad de DESTINO.\n\n- Espere a que aparezca la lista de ciudades.\n\n- Seleccione la que corresponda.")
d.getElementById("zautocomplete_remote").value=""
d.getElementById("zautocomplete_remote").focus()
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
else{res02=d.getElementById("zautocomplete_remote").value.substr(0,3)}}
else{res02=res02.substr(1,3)}
d.getElementById("td_D_City").value=res01
d.getElementById("td_A_City").value=res02
if(tipob==2){if((f_envianalisis==1||f_peticion_en_curso==1)&&f_eb==0){alert("Seleccione en el listado la oferta de su interés.\n\nSi desea otra búsqueda, seleccione nuevos datos y pulse BUSCAR.\n\n Puede repetir esta operación con los datos de vuelo que desee.")
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
else{f_envianalisis=1
f_peticion_en_curso=1
if(f_eb){procesar("/listado01.php",l_his,"listado_eb",r_busvuel(" España","Ebookers"))
relcam()
document.getElementById("flistado").innerHTML=''
loadWindow()
return}
else{bresultados()}
return}}
if(tipob==1){if(f_envivuelo==1||f_peticion_en_curso==1){alert("Se ha abierto ya una nueva ventana en el sitio \n\ndel proveedor con los datos de su vuelo.")
vp_peticion_en_curso=0
ls_peticion_en_curso=0
tipob=0
return}
else{f_envivuelo=1
f_peticion_en_curso=1}}
f_ela_analisis=0
vp_peticion_en_curso=0
if(ls_peticion_en_curso==0){f_peticion_en_curso=0}
return}
function oneWay(oneway){var d=document
d.buscador.td_TripType.value=oneway?'1':'2'
d.buscador.td_R_Day.style.visibility=oneway?"hidden":"visible"
d.buscador.td_R_Month.style.visibility=oneway?"hidden":"visible"
d.buscador.td_R_Time.style.visibility=oneway?"hidden":"visible"
d.buscador.td_R_Mes.style.visibility=oneway?"hidden":"visible"
d.buscador.td_R_Anno.style.visibility=oneway?"hidden":"visible"}
function repo_fechas(){var d=document
var indi_repo=0
var ddd=d.getElementById('departureDateDay')
var ddm=d.getElementById('departureDateMes')
var dda=d.getElementById('departureDateAno')
var rdd=d.getElementById('returnDateDay')
var rdm=d.getElementById('returnDateMes')
var rda=d.getElementById('returnDateAno')
d.forms['buscador']['from_date'].value=(ddd.options[ddd.selectedIndex].value)+'/'+(ddm.options[ddm.selectedIndex].value)+'/'+dda.options[dda.selectedIndex].value
d.forms['buscador']['to_date'].value=(rdd.options[rdd.selectedIndex].value)+'/'+(rdm.options[rdm.selectedIndex].value)+'/'+rda.options[rda.selectedIndex].value
var bs_from=new Date(ddm.options[ddm.selectedIndex].value+'/'+ddd.options[ddd.selectedIndex].value+'/'+dda.options[dda.selectedIndex].value)
var bs_to=new Date(rdm.options[rdm.selectedIndex].value+'/'+rdd.options[rdd.selectedIndex].value+'/'+rda.options[rda.selectedIndex].value)
var bs_hoy=new Date()
if(bs_from<=bs_hoy){alert("El día de salida deberá ser, al menos, dentro de 4 días.\n\nSi la fecha ya estaba puesta, el vuelo elegido está caducado.\n\nElija una nueva fecha para su vuelo.")
var vuelos_salir=bs_hoy
vuelos_salir.setDate(bs_hoy.getDate()+4)
d.forms['buscador']['departureDateDay'].selectedIndex=vuelos_salir.getDate()-1
d.forms['buscador']['departureDateMes'].selectedIndex=vuelos_salir.getMonth()
d.forms['buscador']['departureDateAno'].selectedIndex=(vuelos_salir.getFullYear()=='2009')?0:1
d.forms['buscador']['from_date'].value=(vuelos_salir.getDate())+'/'+(vuelos_salir.getMonth()+1-0)+'/'+vuelos_salir.getFullYear()
return(false)}
if(bs_to<bs_from&&d.buscador.td_TripType.value=='2'){alert("La fecha de regreso deberá ser posterior a la de salida.\n\nElija una nueva fecha para su vuelo.")
var vuelos_regreso=bs_from
vuelos_regreso.setDate(bs_from.getDate()+15)
d.forms['buscador']['returnDateDay'].selectedIndex=vuelos_regreso.getDate()-1
d.forms['buscador']['returnDateMes'].selectedIndex=vuelos_regreso.getMonth()
d.forms['buscador']['returnDateAno'].selectedIndex=(vuelos_regreso.getFullYear()=='2009')?0:1
d.forms['buscador']['to_date'].value=(vuelos_regreso.getDate())+'/'+(vuelos_regreso.getMonth()+1-0)+'/'+vuelos_regreso.getFullYear()
return(false)}
return(true)}
function randomString(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"
var string_length=8
var randomstring=''
for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length)
randomstring+=chars.substring(rnum,rnum+1)}
return randomstring}

cDomEvent={e:null,type:'',button:0,key:0,x:0,y:0,pagex:0,pagey:0,target:null,from:null,to:null}
cDomEvent.init=function(e)
{if(window.event)e=window.event
this.e=e
this.type=e.type
this.button=(e.which)?e.which:e.button
this.key=(e.which)?e.which:e.keyCode
this.target=(e.srcElement)?e.srcElement:e.originalTarget
this.currentTarget=(e.currentTarget)?e.currentTarget:e.srcElement
this.from=(e.originalTarget)?e.originalTarget:(e.fromElement)?e.fromElement:null
this.to=(e.currentTarget)?e.currentTarget:(e.toElement)?e.toElement:null
this.x=(e.layerX)?e.layerX:(e.offsetX)?e.offsetX:null
this.y=(e.layerY)?e.layerY:(e.offsetY)?e.offsetY:null
this.screenX=e.screenX
this.screenY=e.screenY
this.pageX=(e.pageX)?e.pageX:e.x+document.body.scrollLeft
this.pageY=(e.pageY)?e.pageY:e.y+document.body.scrollTop}
cDomEvent.getEvent=function(e)
{if(window.event)e=window.event
return{e:e,type:e.type,button:(e.which)?e.which:e.button,key:(e.which)?e.which:e.keyCode,target:(e.srcElement)?e.srcElement:e.originalTarget,currentTarget:(e.currentTarget)?e.currentTarget:e.srcElement,from:(e.originalTarget)?e.originalTarget:(e.fromElement)?e.fromElement:null,to:(e.currentTarget)?e.currentTarget:(e.toElement)?e.toElement:null,x:(e.layerX)?e.layerX:(e.offsetX)?e.offsetX:null,y:(e.layerY)?e.layerY:(e.offsetY)?e.offsetY:null,screenX:e.screenX,screenY:e.screenY,pageX:(e.pageX)?e.pageX:(e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),pageY:(e.pageY)?e.pageY:(e.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}}
cDomEvent.cancelEvent=function(e)
{if(e.preventDefault)
{e.preventDefault()}
e.returnValue=false
e.cancelBubble=true
return false}
cDomEvent.addEvent=function(hElement,sEvent,handler,bCapture)
{if(hElement.addEventListener)
{hElement.addEventListener(sEvent,handler,bCapture)
return true}
else if(hElement.attachEvent)
{return hElement.attachEvent('on'+sEvent,handler)}
else if(document.all||hElement.captureEvents)
{if(hElement.captureEvents)eval('hElement.captureEvents( Event.'+sEvent.toUpperCase()+' )')
eval('hElement.on'+sEvent+' = '+handler)}
else
{alert('Not implemented yet!')}}
cDomEvent.encapsulateEvent=function(hHandler)
{return function(hEvent)
{hEvent=cDomEvent.getEvent(hEvent)
hHandler.call(hEvent.target,hEvent.e)}}
cDomEvent.addEvent2=function(hElement,sEvent,handler,bCapture)
{if(hElement)
{if(hElement.addEventListener)
{hElement.addEventListener(sEvent,cDomEvent.encapsulateEvent(handler),bCapture)
return true}
else if(hElement.attachEvent)
{return hElement.attachEvent('on'+sEvent,cDomEvent.encapsulateEvent(handler))}
else
{alert('Not implemented yet!')}}
else
{}}
cDomEvent.addCustomEvent2=function(hElement,sEvent,handler)
{if(hElement)
{hElement[sEvent]=handler}
else
{}}
cDomEvent.removeEvent=function(hElement,sEvent,handler,bCapture)
{if(hElement.addEventListener)
{hElement.removeEventListener(sEvent,handler,bCapture)
return true}
else if(hElement.attachEvent)
{return hElement.detachEvent('on'+sEvent,handler)}
else if(document.all||hElement.captureEvents)
{eval('hElement.on'+sEvent+' = null')}
else
{alert('Not implemented yet!')}}
function MouseButton()
{if(document.layers)
{this.left=1
this.middle=2
this.right=3}
else if(document.all)
{this.left=1
this.middle=4
this.right=2}
else
{this.left=0
this.middle=1
this.right=2}}
var MB=new MouseButton()
if(document.ELEMENT_NODE==null)
{document.ELEMENT_NODE=1
document.TEXT_NODE=3}
function getSubNodeByName(hNode,sNodeName)
{if(hNode!=null)
{var nNc=0
var nC=0
var hNodeChildren=hNode.childNodes
var hCNode=null
while(nC<hNodeChildren.length)
{hCNode=hNodeChildren.item(nC++)
if((hCNode.nodeType==1)&&(hCNode.nodeName.toLowerCase()==sNodeName))
{return hCNode}}}
return null}
function getPrevNodeSibling(hNode)
{if(hNode!=null)
{do{hNode=hNode.previousSibling}while(hNode!=null&&hNode.nodeType!=1)
return hNode}}
function getNextNodeSibling(hNode)
{if(hNode!=null)
{do{hNode=hNode.nextSibling}while(hNode!=null&&hNode.nodeType!=1)
return hNode}}
function getLastSubNodeByName(hNode,sNodeName)
{if(hNode!=null)
{var nNc=0
var nC=0
var hNodeChildren=hNode.childNodes
var hCNode=null
var nLength=hNodeChildren.length-1
while(nLength>=0)
{hCNode=hNodeChildren.item(nLength)
if((hCNode.nodeType==1)&&(hCNode.nodeName.toLowerCase()==sNodeName))
{return hCNode}
nLength--}}
return null}
function getSubNodeByProperty(hNode,sProperty,sPropValue)
{if(hNode!=null)
{var nNc=0
var nC=0
var hNodeChildren=hNode.childNodes
var hCNode=null
var sAttribute
var hProp
sPropValue=sPropValue.toLowerCase()
while(nC<hNodeChildren.length)
{hCNode=hNodeChildren.item(nC++)
if(hCNode.nodeType==document.ELEMENT_NODE)
{hProp=eval('hCNode.'+sProperty)
if(typeof(sPropValue)!='undefined')
{if(hProp.toLowerCase()==sPropValue)
{return hCNode}}
else
{return hCNode}}
nNc++}}
return null}
function findAttribute(hNode,sAtt)
{sAtt=sAtt.toLowerCase()
for(var nI=0;nI<hNode.attributes.length;nI++)
{if(hNode.attributes.item(nI).nodeName.toLowerCase()==sAtt)
{return hNode.attributes.item(nI).nodeValue}}
return null}
function getSubNodeByAttribute(hNode,sAtt,sAttValue)
{if(hNode!=null)
{var nNc=0
var nC=0
var hNodeChildren=hNode.childNodes
var hCNode=null
var sAttribute
sAttValue=sAttValue.toLowerCase()
while(nC<hNodeChildren.length)
{hCNode=hNodeChildren.item(nC++)
if(hCNode.nodeType==document.ELEMENT_NODE)
{sAttribute=hCNode.getAttribute(sAtt)
if(sAttribute&&sAttribute.toLowerCase()==sAttValue)
return hCNode}
nNc++}}
return null}
function getLastSubNodeByAttribute(hNode,sAtt,sAttValue)
{if(hNode!=null)
{var nNc=0
var nC=0
var hNodeChildren=hNode.childNodes
var hCNode=null
var nLength=hNodeChildren.length-1
while(nLength>=0)
{hCNode=hNodeChildren.item(nLength)
if(hCNode.nodeType==document.ELEMENT_NODE)
{sAttribute=hCNode.getAttribute(sAtt)
if(sAttribute&&sAttribute.toLowerCase()==sAttValue)
return hCNode}
nLength--}}
return null}
function getParentByTagName(hNode,sParentTagName)
{while((hNode.tagName)&&!(/(body|html)/i.test(hNode.tagName)))
{if(hNode.tagName==sParentTagName)
{return hNode}
hNode=hNode.parentNode}
return null}
function getParentByAttribute(hNode,sAtt,sAttValue)
{while((hNode.tagName)&&!(/(body|html)/i.test(hNode.tagName)))
{var sAttr=hNode.getAttribute(sAtt)
if(sAttr!=null&&sAttr.toString().length>0)
{if(sAttValue!==null)
{if(sAttr==sAttValue)
{return hNode}}
else
{return hNode}}
hNode=hNode.parentNode}
return null}
function getParentByProperty(hNode,sProperty,sPropValue)
{while((hNode.tagName)&&!(/(body|html)/i.test(hNode.tagName)))
{var hProp=eval('hNode.'+sProperty)
if(hProp!=null&&hProp.toString().length>0)
{if(sPropValue!==null)
{if(hProp==sPropValue)
{return hNode}}
else
{return hNode}}
hNode=hNode.parentNode}
return null}
function getNodeText(hNode)
{if(hNode==null)
{return''}
var sRes
if(hNode.hasChildNodes())
{sRes=hNode.childNodes.item(0).nodeValue}
else
{sRes=hNode.text}
return sRes}
function cDomExtension(hParent,aSelectors,hInitFunction)
{this.hParent=hParent
this.aSelectors=aSelectors
this.hInitFunction=hInitFunction}
cDomExtensionManager={aExtensions:new Array()}
cDomExtensionManager.register=function(hDomExtension)
{cDomExtensionManager.aExtensions.push(hDomExtension)}
cDomExtensionManager.initSelector=function(hParent,sSelector,hInitFunction)
{var hSelectorRegEx
var hAttributeRegEx
var aSelectorData
var aAttributeData
var sAttribute
hSelectorRegEx=/([a-z0-9_]*)\[?([^\]]*)\]?/i
hAttributeRegEx=/([a-z0-9_]*)([\*\^\$]?)(=?)(([a-z0-9_=]*))/i
if(hSelectorRegEx.test(sSelector)&&!/[@#\.]/.test(sSelector))
{aSelectorData=hSelectorRegEx.exec(sSelector)
if(aSelectorData[1]!='')
{hGroup=hParent.getElementsByTagName(aSelectorData[1].toLowerCase())
for(nI=0;nI<hGroup.length;nI++)
{hGroup[nI].markExt=true}
for(nI=0;nI<hGroup.length;nI++)
{if(!hGroup[nI].markExt)
{continue}
else
{hGroup[nI].markExt=false}
if(aSelectorData[2]=='')
{if(hGroup[nI].tagName.toLowerCase()==aSelectorData[1].toLowerCase())
{hInitFunction(hGroup[nI])}}
else
{aAttributeData=hAttributeRegEx.exec(aSelectorData[2])
if(aAttributeData[1]=='class')
{sAttribute=hGroup[nI].className}
else
{sAttribute=hGroup[nI].getAttribute(aAttributeData[1])}
if(sAttribute!=null&&sAttribute.length>0)
{if(aAttributeData[3]=='=')
{if(aAttributeData[2]=='')
{if(sAttribute==aAttributeData[4])
{hInitFunction(hGroup[nI])}}
else
{switch(aAttributeData[2])
{case'^':if(sAttribute.indexOf(aAttributeData[4])==0)
{hInitFunction(hGroup[nI])}
break
case'$':if(sAttribute.lastIndexOf(aAttributeData[4])==sAttribute.length-aAttributeData[4].length)
{hInitFunction(hGroup[nI])}
break
case'*':if(sAttribute.indexOf(aAttributeData[4])>=0)
{hInitFunction(hGroup[nI])}
break}}}
else
{hInitFunction(hGroup[nI])}}}}
return}}
hSelectorRegEx=/([a-z0-9_]*)([\.#@]?)([a-z0-9_=~]*)/i
hAttributeRegEx=/([a-z0-9_]*)([=~])?([a-z0-9_]*)/i
aSelectorData=hSelectorRegEx.exec(sSelector)
if(aSelectorData[1]!='')
{var hGroup=hParent.getElementsByTagName(aSelectorData[1])
for(nI=0;nI<hGroup.length;nI++)
{hGroup[nI].markExt=true}
for(nI=0;nI<hGroup.length;nI++)
{if(!hGroup[nI].markExt)
{continue}
else
{hGroup[nI].markExt=false}
if(aSelectorData[2]!='')
{switch(aSelectorData[2])
{case'.':if(hGroup[nI].className==aSelectorData[3])
{hInitFunction(hGroup[nI])}
break
case'#':if(hGroup[nI].id==aSelectorData[3])
{hInitFunction(hGroup[nI])}
break
case'@':aAttributeData=hAttributeRegEx.exec(aSelectorData[3])
sAttribute=hGroup[nI].getAttribute(aAttributeData[1])
if(sAttribute!=null&&sAttribute.length>0)
{if(aAttributeData[3]!='')
{if(aAttributeData[2]=='=')
{if(sAttribute==aAttributeData[3])
{hInitFunction(hGroup[nI])}}
else
{if(sAttribute.indexOf(aAttributeData[3])>=0)
{hInitFunction(hGroup[nI])}}}
else
{hInitFunction(hGroup[nI])}}
break}}}}}
cDomExtensionManager.initialize=function()
{var hDomExtension=null
var aSelectors
for(var nKey in cDomExtensionManager.aExtensions)
{aSelectors=cDomExtensionManager.aExtensions[nKey].aSelectors
for(var nKey2 in aSelectors)
{cDomExtensionManager.initSelector(cDomExtensionManager.aExtensions[nKey].hParent,aSelectors[nKey2],cDomExtensionManager.aExtensions[nKey].hInitFunction)}}}
if(window.addEventListener)
{window.addEventListener('load',cDomExtensionManager.initialize,false)}
else if(window.attachEvent)
{window.attachEvent('onload',cDomExtensionManager.initialize)}
cMoTabs=new Object()
cMoTabs.getTabGroup=function(hElement)
{return getParentByTagName(hElement,'UL')}
cMoTabs.getTabElement=function(hElement)
{if(hElement==null)
{return null}
try
{if(typeof hElement.tagName=='undefined')return null}
catch(hException)
{return null}
return getParentByProperty(hElement,'className','tab')}
cMoTabs.setActiveTabElement=function(hTabElement)
{if(hTabElement==null)
{return}
hTabElement.className='tabactive'
var hView=document.getElementById(hTabElement.getAttribute('tabview'))
if(hView)
{hView.style.display='block'}}
cMoTabs.setInactiveTabElement=function(hTabElement)
{if(hTabElement==null)
{return}
hTabElement.className='tab'
var hView=document.getElementById(hTabElement.getAttribute('tabview'))
if(hView)
{hView.style.display='none'}}
cMoTabs.doTab=function(e)
{cDomEvent.init(e)
var hTabElement=null
if(e.type.indexOf('keypress')>-1)
{if(e.keyCode!=13)
{return}}
hTabElement=cMoTabs.getTabElement(cDomEvent.target)
if(hTabElement!=null)
{var hGroup=cMoTabs.getTabGroup(hTabElement)
if(hGroup.hAcvtiveElm==null)
{var hActiveTab=getSubNodeByProperty(hTabElement.parentNode,'className','tabactive')}
else
{var hActiveTab=hGroup.hAcvtiveElm}
if(hActiveTab==hTabElement)
{}
else
{cMoTabs.setInactiveTabElement(hActiveTab)
cMoTabs.setActiveTabElement(hTabElement)
hGroup.hAcvtiveElm=hTabElement}}
return true}
cMoTabs.doTabClick=function(e)
{cDomEvent.init(e)
if(e.preventDefault)
{e.preventDefault()}
e.cancelBubble=false
e.returnValue=false
return false}
cMoTabs.init=function(hListItem)
{var hLink=getSubNodeByName(hListItem,'a')
cDomEvent.addEvent(hLink,'activate',cMoTabs.doTab,false)
cDomEvent.addEvent(hLink,'focus',cMoTabs.doTab,false)
cDomEvent.addEvent(hLink,'mousedown',cMoTabs.doTab,false)
cDomEvent.addEvent(hLink,'keypress',cMoTabs.doTab,false)
cDomEvent.addEvent(hLink,'click',cMoTabs.doTabClick,false)}
cDomExtensionManager.register(new cDomExtension(document,["li[tabview]"],cMoTabs.init))
function cDomObject(sId)
{if(bw.dom||bw.ie)
{this.hElement=document.getElementById(sId)
this.hStyle=this.hElement.style}}
cDomObject.prototype.getWidth=function()
{return cDomObject.getWidth(this.hElement)}
cDomObject.getWidth=function(hElement)
{if(hElement.currentStyle)
{var nWidth=parseInt(hElement.currentStyle.width)
if(isNaN(nWidth))
{return parseInt(hElement.offsetWidth)}
else
{return nWidth}}
else
{return parseInt(hElement.offsetWidth)}}
cDomObject.prototype.getHeight=function()
{return cDomObject.getHeight(this.hElement)}
cDomObject.getHeight=function(hElement)
{if(hElement.currentStyle)
{var nHeight=parseInt(hElement.currentStyle.height)
if(isNaN(nHeight))
{return parseInt(hElement.offsetHeight)}
else
{return nHeight}}
else
{return parseInt(hElement.offsetHeight)}}
cDomObject.prototype.getLeft=function()
{return cDomObject.getLeft(this.hElement)}
cDomObject.getLeft=function(hElement)
{return parseInt(hElement.offsetLeft)}
cDomObject.prototype.getTop=function()
{return cDomObject.getTop(this.hElement)}
cDomObject.getTop=function(hElement)
{return parseInt(hElement.offsetTop)}
cDomObject.getOffsetParam=function(hElement,sParam,hLimitParent)
{var nRes=0
if(hLimitParent==null)
{hLimitParent=document.body.parentElement}
while(hElement!=hLimitParent)
{nRes+=eval('hElement.'+sParam)
if(!hElement.offsetParent){break}
hElement=hElement.offsetParent}
return nRes}
cDomObject.getScrollOffset=function(hElement,sParam,hLimitParent)
{nRes=0
if(hLimitParent==null)
{hLimitParent=document.body.parentElement}
while(hElement!=hLimitParent)
{nRes+=eval('hElement.scroll'+sParam)
if(!hElement.offsetParent){break}
hElement=hElement.parentNode}
return nRes}
function getDomDocumentPrefix(){if(getDomDocumentPrefix.prefix)
return getDomDocumentPrefix.prefix;var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var o;for(var i=0;i<prefixes.length;i++){try{o=new ActiveXObject(prefixes[i]+".DomDocument");return getDomDocumentPrefix.prefix=prefixes[i];}
catch(ex){};}
throw new Error("Could not find an installed XML parser");}
function getXmlHttpPrefix(){if(getXmlHttpPrefix.prefix)
return getXmlHttpPrefix.prefix;var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var o;for(var i=0;i<prefixes.length;i++){try{o=new ActiveXObject(prefixes[i]+".XmlHttp");return getXmlHttpPrefix.prefix=prefixes[i];}
catch(ex){};}
throw new Error("Could not find an installed XML parser");}
function XmlHttp(){}
XmlHttp.create=function(){try{if(window.XMLHttpRequest){var req=new XMLHttpRequest();if(req.readyState==null){req.readyState=1;req.addEventListener("load",function(){req.readyState=4;if(typeof req.onreadystatechange=="function")
req.onreadystatechange();},false);}
return req;}
if(window.ActiveXObject){return new ActiveXObject(getXmlHttpPrefix()+".XmlHttp");}}
catch(ex){}
throw new Error("Your browser does not support XmlHttp objects");};function XmlDocument(){}
XmlDocument.create=function(){try{if(document.implementation&&document.implementation.createDocument){var doc=document.implementation.createDocument("","",null);if(doc.readyState==null){doc.readyState=1;doc.addEventListener("load",function(){doc.readyState=4;if(typeof doc.onreadystatechange=="function")
doc.onreadystatechange();},false);}
return doc;}
if(window.ActiveXObject)
return new ActiveXObject(getDomDocumentPrefix()+".DomDocument");}
catch(ex){}
throw new Error("Your browser does not support XmlDocument objects");};if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){Document.prototype.loadXML=function(s){var doc2=(new DOMParser()).parseFromString(s,"text/xml");while(this.hasChildNodes())
this.removeChild(this.lastChild);for(var i=0;i<doc2.childNodes.length;i++){this.appendChild(this.importNode(doc2.childNodes[i],true));}};Document.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});}
function cAutocomplete(sInputId)
{this.init(sInputId)}
cAutocomplete.CS_NAME='Autocomplete component'
cAutocomplete.CS_OBJ_NAME='AC_COMPONENT'
cAutocomplete.CS_LIST_PREFIX='ACL_'
cAutocomplete.CS_BUTTON_PREFIX='ACB_'
cAutocomplete.CS_INPUT_PREFIX='AC_'
cAutocomplete.CS_HIDDEN_INPUT_PREFIX='ACH_'
cAutocomplete.CS_INPUT_CLASSNAME='dropdown'
cAutocomplete.CB_AUTOINIT=true
cAutocomplete.CB_AUTOCOMPLETE=false
cAutocomplete.CB_FORCECORRECT=false
cAutocomplete.CB_MATCHSUBSTRING=false
cAutocomplete.CS_SEPARATOR=','
cAutocomplete.CS_ARRAY_SEPARATOR=','
cAutocomplete.CB_MATCHSTRINGBEGIN=true
cAutocomplete.CN_OFFSET_TOP=2
cAutocomplete.CN_OFFSET_LEFT=-1
cAutocomplete.CN_LINE_HEIGHT=19
cAutocomplete.CN_NUMBER_OF_LINES=10
cAutocomplete.CN_HEIGHT_FIX=2
cAutocomplete.CN_CLEAR_TIMEOUT=300
cAutocomplete.CN_SHOW_TIMEOUT=400
cAutocomplete.CN_REMOTE_SHOW_TIMEOUT=1000
cAutocomplete.CN_MARK_TIMEOUT=400
cAutocomplete.hListDisplayed=null
cAutocomplete.nCount=0
cAutocomplete.autoInit=function()
{var nI=0
var hACE=null
var sLangAtt
for(nI=0;nI<document.getElementsByTagName('INPUT').length;nI++)
{if(document.getElementsByTagName('INPUT')[nI].type.toLowerCase()=='text')
{sLangAtt=document.getElementsByTagName('INPUT')[nI].getAttribute('acdropdown')
if(sLangAtt!=null&&sLangAtt.length>0)
{if(document.getElementsByTagName('INPUT')[nI].id==null||document.getElementsByTagName('INPUT')[nI].id.length==0)
{document.getElementsByTagName('INPUT')[nI].id=cAutocomplete.CS_OBJ_NAME+cAutocomplete.nCount}
hACE=new cAutocomplete(document.getElementsByTagName('INPUT')[nI].id)}}}
var nTALength=document.getElementsByTagName('TEXTAREA').length
for(nI=0;nI<nTALength;nI++)
{sLangAtt=document.getElementsByTagName('TEXTAREA')[nI].getAttribute('acdropdown')
if(sLangAtt!=null&&sLangAtt.length>0)
{if(document.getElementsByTagName('TEXTAREA')[nI].id==null||document.getElementsByTagName('TEXTAREA')[nI].id.length==0)
{document.getElementsByTagName('TEXTAREA')[nI].id=cAutocomplete.CS_OBJ_NAME+cAutocomplete.nCount}
hACE=new cAutocomplete(document.getElementsByTagName('TEXTAREA')[nI].id)}}
var nSelectsLength=document.getElementsByTagName('SELECT').length
var aSelect=null
for(nI=0;nI<nSelectsLength;nI++)
{aSelect=document.getElementsByTagName('SELECT')[nI]
sLangAtt=aSelect.getAttribute('acdropdown')
if(sLangAtt!=null&&sLangAtt.length>0)
{if(aSelect.id==null||aSelect.id.length==0)
{aSelect.id=cAutocomplete.CS_OBJ_NAME+cAutocomplete.nCount}
hACE=new cAutocomplete(aSelect.id)
nSelectsLength--
nI--}}}
if(cAutocomplete.CB_AUTOINIT)
{if(window.attachEvent)
{window.attachEvent('onload',cAutocomplete.autoInit)}
else if(window.addEventListener)
{window.addEventListener('load',cAutocomplete.autoInit,false)}}
cAutocomplete.prototype.init=function(sInputId)
{this.sInputId=sInputId
this.sListId=cAutocomplete.CS_LIST_PREFIX+sInputId
this.sObjName=cAutocomplete.CS_OBJ_NAME+'_obj_'+(cAutocomplete.nCount++)
this.hObj=this.sObjName
this.hActiveSelection=null
this.nSelectedItemIdx=-1
this.sLastActiveValue=''
this.sActiveValue=''
this.bListDisplayed=false
this.nItemsDisplayed=0
this.bAssociative=false
this.sHiddenInputId=null
this.bHasButton=false
this.aData=null
this.aSearchData=new Array()
this.bSorted=false
this.nLastMatchLength=0
this.bForceCorrect=cAutocomplete.CB_FORCECORRECT
var sForceCorrect=document.getElementById(this.sInputId).getAttribute('autocomplete_forcecorrect')
if(sForceCorrect!=null&&sForceCorrect.length>0)
{this.bForceCorrect=eval(sForceCorrect)}
this.bMatchBegin=cAutocomplete.CB_MATCHSTRINGBEGIN
var sMatchBegin=document.getElementById(this.sInputId).getAttribute('autocomplete_matchbegin')
if(sMatchBegin!=null&&sMatchBegin.length>0)
{this.bMatchBegin=eval(sMatchBegin)}
this.bMatchSubstring=cAutocomplete.CB_MATCHSUBSTRING
var sMatchSubstring=document.getElementById(this.sInputId).getAttribute('autocomplete_matchsubstring')
if(sMatchSubstring!=null&&sMatchSubstring.length>0)
{this.bMatchSubstring=true}
this.bAutoComplete=cAutocomplete.CB_AUTOCOMPLETE
this.bAutocompleted=false
var sAutoComplete=document.getElementById(this.sInputId).getAttribute('autocomplete_complete')
if(sAutoComplete!=null&&sAutoComplete.length>0)
{this.bAutoComplete=eval(sAutoComplete)}
this.formatOptions=null
var sFormatFunction=document.getElementById(this.sInputId).getAttribute('autocomplete_format')
if(sFormatFunction!=null&&sFormatFunction.length>0)
{this.formatOptions=eval(sFormatFunction)}
this.onSelect=null
var sOnSelectFunction=document.getElementById(this.sInputId).getAttribute('autocomplete_onselect')
if(sOnSelectFunction!=null&&sOnSelectFunction.length>0)
{this.onSelect=eval(sOnSelectFunction)}
this.bAssociative=true
var sAssociative=document.getElementById(this.sInputId).getAttribute('autocomplete_assoc')
if(sAssociative!=null&&sAssociative.length>0)
{if(sAssociative=='false')
{this.bAssociative=false}}
if(this.getListArrayType()!='url')
{this.bRemoteList=false}
else
{this.bRemoteList=true
this.sListURL=this.getListURL()
this.hXMLHttp=XmlHttp.create()}
this.initListArray()
this.initListContainer()
this.initInput()
eval(this.hObj+'= this')}
cAutocomplete.prototype.initInput=function()
{var hInput=document.getElementById(this.sInputId)
hInput.hAutocomplete=this
var hContainer=document.getElementById(this.sListId)
hContainer.hAutocomplete=this
var nWidth=hInput.offsetWidth
if(!nWidth||nWidth==0)
{var hOWInput=hInput.cloneNode(true)
hOWInput.style.position='absolute'
hOWInput.style.top='-1000px'
document.body.appendChild(hOWInput)
var nWidth=hOWInput.offsetWidth
document.body.removeChild(hOWInput)}
var sInputName=hInput.name
var hForm=hInput.form
var bHasButton=false
var sHiddenValue=hInput.value
var sValue=hInput.type.toLowerCase()=='text'?hInput.value:''
var sHasButton=hInput.getAttribute('autocomplete_button')
if(sHasButton!=null&&sHasButton.length>0)
{bHasButton=true}
if(hInput.type.toLowerCase()=='select-one')
{bHasButton=true
if(hInput.selectedIndex>=0)
{sHiddenValue=hInput.options[hInput.selectedIndex].value
sValue=hInput.options[hInput.selectedIndex].text}}
if(hForm)
{var hHiddenInput=document.createElement('INPUT')
hHiddenInput.id=cAutocomplete.CS_HIDDEN_INPUT_PREFIX+this.sInputId
hHiddenInput.type='hidden'
hForm.appendChild(hHiddenInput)
if(this.bAssociative)
{hHiddenInput.name=sInputName
hInput.name=cAutocomplete.CS_INPUT_PREFIX+sInputName}
else
{hHiddenInput.name=cAutocomplete.CS_INPUT_PREFIX+sInputName}
hHiddenInput.value=sHiddenValue
this.sHiddenInputId=hHiddenInput.id}
if(bHasButton)
{this.bHasButton=true
var hInputContainer=document.createElement('DIV')
hInputContainer.className='acinputContainer'
hInputContainer.style.width=nWidth
var hInputButton=document.createElement('INPUT')
hInputButton.id=cAutocomplete.CS_BUTTON_PREFIX+this.sInputId
hInputButton.type='button'
hInputButton.className='button'
hInputButton.tabIndex=hInput.tabIndex+1
hInputButton.hAutocomplete=this
var hNewInput=document.createElement('INPUT')
if(this.bAssociative)
{hNewInput.name=cAutocomplete.CS_INPUT_PREFIX+sInputName}
else
{hNewInput.name=sInputName}
hNewInput.type='text'
hNewInput.value=sValue
hNewInput.style.width=nWidth-22
hNewInput.className=cAutocomplete.CS_INPUT_CLASSNAME
hNewInput.tabIndex=hInput.tabIndex
hNewInput.hAutocomplete=this
hInputContainer.appendChild(hNewInput)
hInputContainer.appendChild(hInputButton)
hInput.parentNode.replaceChild(hInputContainer,hInput)
hNewInput.id=this.sInputId
hInput=hNewInput}
if(hInput.attachEvent)
{hInput.attachEvent('onkeyup',cAutocomplete.onInputKeyUp)
hInput.attachEvent('onkeyup',cAutocomplete.saveCaretPosition)
hInput.attachEvent('onkeydown',cAutocomplete.onInputKeyDown)
hInput.attachEvent('onblur',cAutocomplete.onInputBlur)
hInput.attachEvent('onfocus',cAutocomplete.onInputFocus)
if(hInputButton)
{hInputButton.attachEvent('onclick',cAutocomplete.onButtonClick)}}
else if(hInput.addEventListener)
{hInput.addEventListener('keyup',cAutocomplete.onInputKeyUp,false)
hInput.addEventListener('keyup',cAutocomplete.saveCaretPosition,false)
hInput.addEventListener('keydown',cAutocomplete.onInputKeyDown,false)
hInput.addEventListener('keypress',cAutocomplete.onInputKeyPress,false)
hInput.addEventListener('blur',cAutocomplete.onInputBlur,false)
hInput.addEventListener('focus',cAutocomplete.onInputFocus,false)
if(hInputButton)
{hInputButton.addEventListener('click',cAutocomplete.onButtonClick,false)}}
hInput.setAttribute('autocomplete','OFF')
if(hForm)
{if(hForm.attachEvent)
{hForm.attachEvent('onsubmit',cAutocomplete.onFormSubmit)}
else if(hForm.addEventListener)
{hForm.addEventListener('submit',cAutocomplete.onFormSubmit,false)}}}
cAutocomplete.prototype.initListContainer=function()
{var hInput=document.getElementById(this.sInputId)
var hContainer=document.createElement('DIV')
hContainer.className='autocomplete_holder'
hContainer.id=this.sListId
hContainer.style.zIndex=10000+cAutocomplete.nCount
hContainer.hAutocomplete=this
var hFirstBorder=document.createElement('DIV')
hFirstBorder.className='autocomplete_firstborder'
var hSecondBorder=document.createElement('DIV')
hSecondBorder.className='autocomplete_secondborder'
var hList=document.createElement('UL')
hList.className='autocomplete'
hSecondBorder.appendChild(hList)
hFirstBorder.appendChild(hSecondBorder)
hContainer.appendChild(hFirstBorder)
document.body.appendChild(hContainer)
if(hContainer.attachEvent)
{hContainer.attachEvent('onblur',cAutocomplete.onListBlur)
hContainer.attachEvent('onfocus',cAutocomplete.onListFocus)}
else if(hInput.addEventListener)
{hContainer.addEventListener('blur',cAutocomplete.onListBlur,false)
hContainer.addEventListener('focus',cAutocomplete.onListFocus,false)}
if(hContainer.attachEvent)
{hContainer.attachEvent('onclick',cAutocomplete.onItemClick)}
else if(hContainer.addEventListener)
{hContainer.addEventListener('click',cAutocomplete.onItemClick,false)}}
cAutocomplete.prototype.createList=function()
{var hInput=document.getElementById(this.sInputId)
var hContainer=document.getElementById(this.sListId)
var hList=hContainer.getElementsByTagName('UL')[0]
if(hList)
{hList=hList.parentNode.removeChild(hList)
while(hList.hasChildNodes())
{hList.removeChild(hList.childNodes[0])}}
var hListItem=null
var hListItemLink=null
var hArrKey=null
var sArrEl=null
var hArr=this.aData
var nI=0
var sRealText
for(hArrKey in hArr)
{sArrEl=hArr[hArrKey]
hListItem=document.createElement('LI')
hListItemLink=document.createElement('A')
hListItemLink.setAttribute('itemvalue',hArrKey)
var sArrData=sArrEl.split(cAutocomplete.CS_ARRAY_SEPARATOR)
if(sArrData.length>1)
{this.aData[hArrKey]=sArrData[0]
hListItemLink.setAttribute('itemdata',sArrEl.substring(sArrEl.indexOf(cAutocomplete.CS_ARRAY_SEPARATOR)+1))
sRealText=sArrData[0]}
else
{sRealText=sArrEl}
hListItemLink.href='#'
hListItemLink.appendChild(document.createTextNode(sRealText))
hListItemLink.realText=sRealText
if(nI==this.nSelectedItemIdx)
{this.hActiveSelection=hListItemLink
this.hActiveSelection.className='selected'}
hListItem.appendChild(hListItemLink)
hList.appendChild(hListItem)
this.aSearchData[nI++]=sRealText.toLowerCase()}
var hSecondBorder=hContainer.firstChild.firstChild
hSecondBorder.appendChild(hList)
this.bListUpdated=false}
cAutocomplete.prototype.initListArray=function()
{var hInput=document.getElementById(this.sInputId)
var hArr=null
if(hInput.type.toLowerCase()=='select-one')
{hArr=new Object()
for(var nI=0;nI<hInput.options.length;nI++)
{hArrKey=hInput.options.item(nI).value
sArrEl=hInput.options.item(nI).text
hArr[hArrKey]=sArrEl
if(hInput.options.item(nI).selected)
{this.nSelectedItemIdx=nI}}}
else
{var sAA=hInput.getAttribute('autocomplete_list')
var sAAS=hInput.getAttribute('autocomplete_list_sort')
var sArrayType=this.getListArrayType()
switch(sArrayType)
{case'array':hArr=eval(sAA.substring(6))
break
case'list':hArr=new Array()
var hTmpArray=sAA.substring(5).split('|')
var aValueArr
for(hKey in hTmpArray)
{aValueArr=hTmpArray[hKey].split(cAutocomplete.CS_ARRAY_SEPARATOR)
if(aValueArr.length==1)
{hArr[hKey]=hTmpArray[hKey]
this.bAssociative=false}
else
{hArr[aValueArr[0]]=aValueArr[1]}}
break}
if(sAAS!=null&&eval(sAAS))
{this.bSorted=true
this.aData=hArr.sort()
hArr=hArr.sort()}}
this.setArray(hArr)}
cAutocomplete.prototype.setArray=function(sArray)
{if(typeof sArray=='string')
{this.aData=eval(sArray)}
else
{this.aData=sArray}
this.bListUpdated=true}
cAutocomplete.prototype.setListArray=function(sArray)
{this.setArray(sArray)
this.updateAndShowList()}
cAutocomplete.prototype.getListArrayType=function()
{var hInput=document.getElementById(this.sInputId)
var sAA=hInput.getAttribute('autocomplete_list')
if(sAA!=null&&sAA.length>0)
{if(sAA.indexOf('array:')>=0)
{return'array'}
else if(sAA.indexOf('list:')>=0)
{return'list'}
else if(sAA.indexOf('url:')>=0)
{return'url'}}}
cAutocomplete.prototype.getListURL=function()
{var hInput=document.getElementById(this.sInputId)
var sAA=hInput.getAttribute('autocomplete_list')
if(sAA!=null&&sAA.length>0)
{if(sAA.indexOf('url:')>=0)
{return sAA.substring(4)}}}
cAutocomplete.prototype.setListURL=function(sURL)
{this.sListURL=sURL;}
cAutocomplete.prototype.onXmlHttpLoad=function()
{if(this.hXMLHttp.readyState==4)
{var hError=this.hXMLHttp.parseError
if(hError&&hError.errorCode!=0)
{alert(hError.reason)}
else
{this.afterRemoteLoad()}}}
cAutocomplete.prototype.loadListArray=function()
{var sURL=this.sListURL
var sStartWith=this.getStringForAutocompletion(this.sActiveValue,this.nInsertPoint)
sStartWith=sStartWith.replace(/^\s/,'')
sStartWith=sStartWith.replace(/\s$/,'')
if(sURL.indexOf('[S]')>=0)
{sURL=sURL.replace('[S]',sStartWith)}
else
{sURL+=this.sActiveValue}
this.hXMLHttp.open('GET',sURL,true)
var hAC=this
this.hXMLHttp.onreadystatechange=function(){hAC.onXmlHttpLoad()}
this.hXMLHttp.send(null)}
cAutocomplete.prototype.afterRemoteLoad=function()
{var hInput=document.getElementById(this.sInputId)
var hArr=new Array()
var hTmpArray=this.hXMLHttp.responseText.split('|')
var aValueArr
for(hKey in hTmpArray)
{aValueArr=hTmpArray[hKey].split(cAutocomplete.CS_ARRAY_SEPARATOR)
if(aValueArr.length==1)
{hArr[hKey]=hTmpArray[hKey]}
else
{hArr[aValueArr[0]]=hTmpArray[hKey].substr(hTmpArray[hKey].indexOf(cAutocomplete.CS_ARRAY_SEPARATOR)+1)}}
hInput.className=''
hInput.readonly=false
hInput.value=this.sActiveValue
this.setListArray(hArr)}
cAutocomplete.prototype.prepareList=function(bFullList)
{var hInput=document.getElementById(this.sInputId)
this.sActiveValue=hInput.value
if(this.bRemoteList)
{hInput.readonly=true}
var sST=this.getStringForAutocompletion(this.sActiveValue,this.nInsertPoint)
var sLST=this.getStringForAutocompletion(this.sLastActiveValue,this.nInsertPoint)
if(sLST!=sST||bFullList||!this.bListDisplayed||this.bMatchSubstring)
{if(this.bRemoteList)
{hInput.className='search'
hInput.value='espere...'
this.loadListArray()
return}
this.updateAndShowList(bFullList)}}
cAutocomplete.prototype.updateAndShowList=function(bFullList)
{var hContainer=document.getElementById(this.sListId)
var hList=hContainer.getElementsByTagName('UL')[0]
var hInput=document.getElementById(this.sInputId)
if(this.bListUpdated)
{this.createList()}
var sST=this.bMatchSubstring?this.getStringForAutocompletion(this.sActiveValue,this.nInsertPoint):this.sActiveValue
var sLST=this.bMatchSubstring?this.getStringForAutocompletion(this.sLastActiveValue,this.nInsertPoint):this.sLastActiveValue
if(sST==sLST)
{if(!this.bMatchSubstring)
{bFullList=true}}
this.filterOptions(bFullList)
if(this.nItemsDisplayed==0)
{if(this.bForceCorrect)
{var aPos=this.getInsertPos(this.sActiveValue,this.nInsertPoint,'')
cAutocomplete.markInputRange(hInput,this.nLastMatchLength,aPos[0])}}
this.sLastActiveValue=this.sActiveValue
if(this.nItemsDisplayed>0)
{if(!bFullList||this.bMatchSubstring)
{this.deselectOption()}
if(this.bAutoComplete&&this.nItemsDisplayed==1)
{var sStartWith=this.getStringForAutocompletion(this.sActiveValue,this.nInsertPoint)
var sItemText=hList.getElementsByTagName('LI')[this.nFirstDisplayed].getElementsByTagName('A')[0].realText
if(sStartWith.toLowerCase()==sItemText.toLowerCase())
{this.selectOption(hList.getElementsByTagName('LI')[this.nFirstDisplayed].getElementsByTagName('A')[0])
this.hideOptions()
return}}
if(this.bAutoComplete&&!bFullList)
{this.selectOption(hList.getElementsByTagName('LI')[this.nFirstDisplayed].getElementsByTagName('A')[0])}
this.showList()}
else
{this.clearList()}}
cAutocomplete.prototype.showList=function()
{if(cAutocomplete.hListDisplayed)
{cAutocomplete.hListDisplayed.clearList()}
var hInput=document.getElementById(this.sInputId)
var nTop=cDomObject.getOffsetParam(hInput,'offsetTop')
var nLeft=cDomObject.getOffsetParam(hInput,'offsetLeft')
var hContainer=document.getElementById(this.sListId)
var hList=hContainer.getElementsByTagName('UL')[0]
if(this.bHasButton)
{hContainer.style.width=document.getElementById(this.sInputId).parentNode.offsetWidth}
else
{hContainer.style.width=document.getElementById(this.sInputId).offsetWidth}
var nNumLines=(this.nItemsDisplayed<cAutocomplete.CN_NUMBER_OF_LINES)?this.nItemsDisplayed:cAutocomplete.CN_NUMBER_OF_LINES;hList.style.height=nNumLines*cAutocomplete.CN_LINE_HEIGHT+cAutocomplete.CN_HEIGHT_FIX+'px'
hContainer.style.top=nTop+hInput.offsetHeight+cAutocomplete.CN_OFFSET_TOP+'px'
hContainer.style.left=nLeft+cAutocomplete.CN_OFFSET_LEFT+'px'
hContainer.style.display='none'
hContainer.style.visibility='visible'
hContainer.style.display='block'
cAutocomplete.hListDisplayed=this
this.bListDisplayed=true}
cAutocomplete.prototype.binarySearch=function(sFilter)
{var nLow=0
var nHigh=this.aSearchData.length-1
var nMid
var nTry,nLastTry
var sData
var nLen=sFilter.length
var lastTry
while(nLow<=nHigh)
{nMid=(nLow+nHigh)/2
nTry=(nMid<1)?0:parseInt(nMid)
sData=this.aSearchData[nTry].substr(0,nLen)
if(sData<sFilter)
{nLow=nTry+1
continue}
if(sData>sFilter)
{nHigh=nTry-1
continue}
if(sData==sFilter)
{nHigh=nTry-1
nLastTry=nTry
continue}
return nTry}
if(typeof(nLastTry)!="undefined")
{return nLastTry}
else
{return null}}
cAutocomplete.prototype.getStringForAutocompletion=function(sString,nPos)
{if(sString==null||sString.length==0)
{return''}
if(this.bMatchSubstring)
{var nStartPos=sString.lastIndexOf(cAutocomplete.CS_SEPARATOR,nPos-1)
nStartPos=nStartPos<0?0:nStartPos
var nEndPos=sString.indexOf(cAutocomplete.CS_SEPARATOR,nPos)
nEndPos=nEndPos<0?sString.length:nEndPos
var sStr=sString.substr(nStartPos,nEndPos-nStartPos)
sStr=sStr.replace(/^(\,?)(\s*)(\S*)(\s*)(\,?)$/g,'$3')
return sStr}
else
{return sString}}
cAutocomplete.prototype.insertString=function(sString,nPos,sInsert)
{if(this.bMatchSubstring)
{var nStartPos=sString.lastIndexOf(cAutocomplete.CS_SEPARATOR,nPos-1)
nStartPos=nStartPos<0?0:nStartPos
var nEndPos=sString.indexOf(cAutocomplete.CS_SEPARATOR,nPos)
nEndPos=nEndPos<0?sString.length:nEndPos
var sStr=sString.substr(nStartPos,nEndPos-nStartPos)
sStr=sStr.replace(/^(\,?)(\s*)(\S?[\S\s]*\S?)(\s*)(\,?)$/g,'$1$2'+sInsert+'$4$5')
sStr=sString.substr(0,nStartPos)+sStr+sString.substr(nEndPos)
return sStr}
else
{return sInsert}}
cAutocomplete.prototype.getInsertPos=function(sString,nPos,sInsert)
{nPos=nPos==null?0:nPos
var nStartPos=sString.lastIndexOf(cAutocomplete.CS_SEPARATOR,nPos-1)
nStartPos=nStartPos<0?0:nStartPos
var nEndPos=sString.indexOf(cAutocomplete.CS_SEPARATOR,nPos)
nEndPos=nEndPos<0?sString.length:nEndPos
var sStr=sString.substr(nStartPos,nEndPos-nStartPos)
sStr=sStr.replace(/^(\,?)(\s*)(\S?[\S\s]*\S?)(\s*)(\,?)$/g,'$1$2'+sInsert)
return[nPos,nStartPos+sStr.length]}
cAutocomplete.prototype.filterOptions=function(bShowAll)
{if(this.hActiveSelection&&!bShowAll)
{this.hActiveSelection.className=''}
if(typeof bShowAll=='undefined')
{bShowAll=false}
var hInput=document.getElementById(this.sInputId)
var sStartWith=this.getStringForAutocompletion(this.sActiveValue,this.nInsertPoint)
if(bShowAll)
{sStartWith=''}
var hContainer=document.getElementById(this.sListId)
var hList=hContainer.getElementsByTagName('UL')[0]
var nItemsLength=hList.childNodes.length
var hLinkItem=null
var nCount=0
var hParent=hList.parentNode
var hList=hList.parentNode.removeChild(hList)
var hTItems=hList.childNodes
this.nItemsDisplayed=0
if(sStartWith.length==0)
{for(var nI=0;nI<nItemsLength;nI++)
{if(this.formatOptions)
{hTItems[nI].childNodes[0].innerHTML=this.formatOptions(hTItems[nI].childNodes[0].realText,nI)}
hTItems[nI].style.display='block'}
nCount=nItemsLength
if(nItemsLength>0)
{this.nFirstDisplayed=0
this.nLastDisplayed=nItemsLength-1}
else
{this.nFirstDisplayed=this.nLastDisplayed=-1}
var aPos=this.getInsertPos(this.sActiveValue,this.nInsertPoint,sStartWith)
this.nLastMatchLength=aPos[0]}
else
{this.nFirstDisplayed=this.nLastDisplayed=-1
sStartWith=sStartWith.toLowerCase()
var bEnd=false
if(this.bSorted&&this.bMatchBegin)
{var nStartAt=this.binarySearch(sStartWith)
for(var nI=0;nI<nItemsLength;nI++)
{hTItems[nI].style.display='none'
if(nI>=nStartAt&&!bEnd)
{if(!bEnd&&this.aSearchData[nI].indexOf(sStartWith)!=0)
{bEnd=true
continue}
if(this.formatOptions)
{hTItems[nI].childNodes[0].innerHTML=this.formatOptions(hTItems[nI].childNodes[0].realText,nI)}
hTItems[nI].style.display='block'
nCount++
if(this.nFirstDisplayed<0)
{this.nFirstDisplayed=nI}
this.nLastDisplayed=nI}}}
else
{for(var nI=0;nI<nItemsLength;nI++)
{hTItems[nI].style.display='none'
if((this.bMatchBegin&&this.aSearchData[nI].indexOf(sStartWith)==0)||(!this.bMatchBegin&&this.aSearchData[nI].indexOf(sStartWith)>=0))
{if(this.formatOptions)
{hTItems[nI].childNodes[0].innerHTML=this.formatOptions(hTItems[nI].childNodes[0].realText,nI)}
hTItems[nI].style.display='block'
nCount++
if(this.nFirstDisplayed<0)
{this.nFirstDisplayed=nI}
this.nLastDisplayed=nI}}}
if(nCount>0)
{var aPos=this.getInsertPos(this.sActiveValue,this.nInsertPoint,sStartWith)
this.nLastMatchLength=aPos[0]}}
hParent.appendChild(hList)
this.nItemsDisplayed=nCount}
cAutocomplete.prototype.hideOptions=function()
{var hContainer=document.getElementById(this.sListId)
hContainer.style.visibility='hidden'
hContainer.style.display='none'
cAutocomplete.hListDisplayed=null}
cAutocomplete.prototype.markAutocompletedValue=function()
{var hInput=document.getElementById(this.sInputId)
var sValue=this.hActiveSelection.realText
if(this.bMatchSubstring)
{var aPos=this.getInsertPos(this.sLastActiveValue,this.nInsertPoint,sValue)
var nStartPos=aPos[0]
var nEndPos=aPos[1]}
else
{var nStartPos=this.nInsertPoint
var nEndPos=sValue.length}
this.nStartAC=nStartPos
this.nEndAC=nEndPos
if(this.hMarkRangeTimeout!=null)
{clearTimeout(this.hMarkRangeTimeout)}
this.hMarkRangeTimeout=setTimeout(function(){cAutocomplete.markInputRange2(hInput.id)},cAutocomplete.CN_MARK_TIMEOUT)}
cAutocomplete.prototype.selectOptionByIndex=function(nOptionIndex)
{if(this.bListUpdated)
{this.createList()}
var hContainer=document.getElementById(this.sListId)
var hList=hContainer.getElementsByTagName('UL')[0]
var nItemsLength=hList.childNodes.length
if(nOptionIndex>=0&&nOptionIndex<nItemsLength)
{this.selectOption(hList.childNodes[nOptionIndex].getElementsByTagName('A')[0])}}
cAutocomplete.prototype.selectOptionByValue=function(sValue)
{if(this.bListUpdated)
{this.createList()}
sValue=sValue.toLowerCase()
var hContainer=document.getElementById(this.sListId)
var hList=hContainer.getElementsByTagName('UL')[0]
var nItemsLength=hList.childNodes.length
var nSelectedIndex=-1
for(var nI=0;nI<nItemsLength;nI++)
{if(this.aSearchData[nI].indexOf(sValue)==0)
{nSelectedIndex=nI}}
if(nSelectedIndex>=0)
{this.selectOption(hList.childNodes[nSelectedIndex].getElementsByTagName('A')[0])}}
cAutocomplete.prototype.selectOption=function(hNewOption)
{if(this.hActiveSelection)
{if(this.hActiveSelection==hNewOption)
{return}
else
{this.hActiveSelection.className=''}}
this.hActiveSelection=hNewOption
var hInput=document.getElementById(this.sInputId)
if(this.hActiveSelection!=null)
{if(this.sHiddenInputId!=null)
{if(this.bMatchSubstring)
{document.getElementById(this.sHiddenInputId).value=this.hActiveSelection.getAttribute('itemvalue')}
else
{document.getElementById(this.sHiddenInputId).value=this.hActiveSelection.getAttribute('itemvalue')}}
this.hActiveSelection.className='selected'
if(this.bAutoComplete)
{hInput.value=this.insertString(this.sLastActiveValue,this.nInsertPoint,this.hActiveSelection.realText)
this.bAutocompleted=true
this.markAutocompletedValue()}
else
{var aPos=this.getInsertPos(this.sLastActiveValue,this.nInsertPoint,this.hActiveSelection.realText)
hInput.value=this.insertString(this.sActiveValue,this.nInsertPoint,this.hActiveSelection.realText)
cAutocomplete.setInputCaretPosition(hInput,aPos[1])}
this.sActiveValue=hInput.value
if(this.onSelect)
{this.onSelect()}}
else
{hInput.value=this.sActiveValue
cAutocomplete.setInputCaretPosition(hInput,this.nInsertPoint)}}
cAutocomplete.prototype.deselectOption=function()
{if(this.hActiveSelection!=null)
{this.hActiveSelection.className=''
this.hActiveSelection=null}}
cAutocomplete.prototype.clearList=function()
{this.hideOptions()
this.bListDisplayed=false}
cAutocomplete.prototype.getPrevDisplayedItem=function(hItem)
{if(hItem==null)
{var hContainer=document.getElementById(this.sListId)
hItem=hContainer.getElementsByTagName('UL')[0].childNodes.item(hContainer.getElementsByTagName('UL')[0].childNodes.length-1)}
else
{hItem=getPrevNodeSibling(hItem.parentNode)}
while(hItem!=null)
{if(hItem.style.display=='block')
{return hItem}
hItem=hItem.previousSibling}
return null}
cAutocomplete.prototype.getNextDisplayedItem=function(hItem)
{if(hItem==null)
{var hContainer=document.getElementById(this.sListId)
hItem=hContainer.getElementsByTagName('UL')[0].childNodes.item(0)}
else
{hItem=getNextNodeSibling(hItem.parentNode)}
while(hItem!=null)
{if(hItem.style.display=='block')
{return hItem}
hItem=hItem.nextSibling}
return null}
cAutocomplete.onInputKeyDown=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
var hAC=hElement.hAutocomplete
var hContainer=document.getElementById(hAC.sListId)
var hInput=document.getElementById(hAC.sInputId)
var hList=hContainer.getElementsByTagName('UL')[0]
var hEl=getParentByTagName(hElement,'A')
if(hContainer!=null&&hAC.bListDisplayed)
{var hLI=null
var hLINext=null
if((hEvent.keyCode==13)||(hEvent.keyCode==27))
{var bItemSelected=hEvent.keyCode==13?true:false
hAC.clearList()}
if(hEvent.keyCode==38)
{hLINext=hAC.getPrevDisplayedItem(hAC.hActiveSelection)
if(hLINext!=null)
{hAC.selectOption(hLINext.childNodes.item(0))
if(hAC.nItemsDisplayed>cAutocomplete.CN_NUMBER_OF_LINES)
{if(hList.scrollTop<5&&hLINext.offsetTop>hList.offsetHeight)
{hList.scrollTop=hList.scrollHeight-hList.offsetHeight}
if(hLINext.offsetTop-hList.scrollTop<0)
{hList.scrollTop-=hLINext.offsetHeight}}}
else
{hAC.selectOption(null)}}
else if(hEvent.keyCode==40)
{hLINext=hAC.getNextDisplayedItem(hAC.hActiveSelection)
if(hLINext!=null)
{hAC.selectOption(hLINext.childNodes.item(0))
if(hAC.nItemsDisplayed>cAutocomplete.CN_NUMBER_OF_LINES)
{if(hList.scrollTop>0&&hList.scrollTop>hLINext.offsetTop)
{hList.scrollTop=0}
if(Math.abs(hLINext.offsetTop-hList.scrollTop-hList.offsetHeight)<5)
{hList.scrollTop+=hLINext.offsetHeight}}}
else
{hAC.selectOption(null)}}}
if(hInput.form)
{hInput.form.bLocked=true}
if(hEvent.keyCode==13||hEvent.keyCode==27||hEvent.keyCode==38||hEvent.keyCode==40)
{if(hEvent.preventDefault)
{hEvent.preventDefault()}
hEvent.cancelBubble=true
hEvent.returnValue=false
return false}}
cAutocomplete.onInputKeyPress=function(hEvent)
{if(hEvent.keyCode==13||hEvent.keyCode==38||hEvent.keyCode==40)
{if(hEvent.preventDefault)
{hEvent.preventDefault()}
hEvent.cancelBubble=true
hEvent.returnValue=false
return false}}
cAutocomplete.onInputKeyUp=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
var hAC=hElement.hAutocomplete
var hInput=document.getElementById(hAC.sInputId)
switch(hEvent.keyCode)
{case 8:if(hAC.bAutoComplete&&hAC.bAutocompleted)
{hAC.bAutocompleted=false
return false}
break
case 38:case 40:if(hAC.bListDisplayed)
{if(hEvent.preventDefault)
{hEvent.preventDefault()}
hEvent.cancelBubble=true
hEvent.returnValue=false
return false}
break
case 13:case 32:case 46:case 35:case 36:break;default:if(hEvent.keyCode<48)
{if(hEvent.preventDefault)
{hEvent.preventDefault()}
hEvent.cancelBubble=true
hEvent.returnValue=false
return false}
break}
if(hAC.hMarkRangeTimeout!=null)
{clearTimeout(hAC.hMarkRangeTimeout)}
if(hAC.hShowTimeout)
{clearTimeout(hAC.hShowTimeout)
hAC.hShowTimeout=null}
var nTimeout=hAC.bRemoteList?cAutocomplete.CN_REMOTE_SHOW_TIMEOUT:cAutocomplete.CN_SHOW_TIMEOUT
hAC.hShowTimeout=setTimeout(function(){hAC.prepareList()},nTimeout)}
cAutocomplete.onInputBlur=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
if(hElement.form)
{hElement.form.bLocked=false}
var hAC=hElement.hAutocomplete
if(!hAC.hClearTimeout)
{hAC.hClearTimeout=setTimeout(function(){hAC.clearList()},cAutocomplete.CN_CLEAR_TIMEOUT)}}
cAutocomplete.onInputFocus=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
var hAC=hElement.hAutocomplete
if(hAC.hClearTimeout)
{clearTimeout(hAC.hClearTimeout)
hAC.hClearTimeout=null}}
cAutocomplete.saveCaretPosition=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
var hAC=hElement.hAutocomplete
var hInput=document.getElementById(hAC.sInputId)
if(hEvent.keyCode!=38&&hEvent.keyCode!=40)
{hAC.nInsertPoint=cAutocomplete.getInputCaretPosition(hInput)}}
cAutocomplete.getInputCaretPosition=function(hInput)
{if(typeof hInput.selectionStart!='undefined')
{if(hInput.selectionStart==hInput.selectionEnd)
{return hInput.selectionStart}
else
{return hInput.selectionStart}}
else if(hInput.createTextRange)
{var hSelRange=document.selection.createRange()
if(hInput.tagName.toLowerCase()=='textarea')
{var hSelBefore=hSelRange.duplicate()
var hSelAfter=hSelRange.duplicate()
hSelRange.moveToElementText(hInput)
hSelBefore.setEndPoint('StartToStart',hSelRange)
return hSelBefore.text.length}
else
{hSelRange.moveStart('character',-1*hInput.value.length)
var nLen=hSelRange.text.length
return nLen}}
return null}
cAutocomplete.setInputCaretPosition=function(hInput,nPosition)
{if(hInput.setSelectionRange)
{hInput.setSelectionRange(nPosition,nPosition)}
else if(hInput.createTextRange)
{var hRange=hInput.createTextRange()
hRange.moveStart('character',nPosition)
hRange.moveEnd('character',nPosition)
hRange.collapse(true)
hRange.select()}}
cAutocomplete.markInputRange=function(hInput,nStartPos,nEndPos)
{if(hInput.setSelectionRange)
{hInput.focus()
hInput.setSelectionRange(nStartPos,nEndPos)}
else if(hInput.createTextRange)
{var hRange=hInput.createTextRange()
hRange.collapse(true)
hRange.moveStart('character',nStartPos)
hRange.moveEnd('character',nEndPos-nStartPos)
hRange.select()}}
cAutocomplete.markInputRange2=function(sInputId)
{var hInput=document.getElementById(sInputId)
var nStartPos=hInput.hAutocomplete.nStartAC
var nEndPos=hInput.hAutocomplete.nEndAC
cAutocomplete.markInputRange(hInput,nStartPos,nEndPos)}
cAutocomplete.onListBlur=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
hElement=getParentByProperty(hElement,'className','autocomplete_holder')
var hAC=hElement.hAutocomplete
if(!hAC.hClearTimeout)
{hAC.hClearTimeout=setTimeout(function(){hAC.clearList()},cAutocomplete.CN_CLEAR_TIMEOUT)}}
cAutocomplete.onListFocus=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
hElement=getParentByProperty(hElement,'className','autocomplete_holder')
var hAC=hElement.hAutocomplete
if(hAC.hClearTimeout)
{clearTimeout(hAC.hClearTimeout)
hAC.hClearTimeout=null}}
cAutocomplete.onItemClick=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
var hContainer=getParentByProperty(hElement,'className','autocomplete_holder')
var hEl=getParentByTagName(hElement,'A')
if(hContainer!=null)
{var hAC=hContainer.hAutocomplete
hAC.selectOption(hEl)
document.getElementById(hAC.sInputId).focus()
hAC.clearList()}
if(hEvent.preventDefault)
{hEvent.preventDefault()}
hEvent.cancelBubble=true
hEvent.returnValue=false
return false}
cAutocomplete.onButtonClick=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
var hAC=hElement.hAutocomplete
var hInput=document.getElementById(hAC.sInputId)
if(hInput.disabled)
{return}
hAC.prepareList(true)
var hInput=document.getElementById(hAC.sInputId)
hInput.focus()}
cAutocomplete.onFormSubmit=function(hEvent)
{if(hEvent==null)
{hEvent=window.event}
var hElement=(hEvent.srcElement)?hEvent.srcElement:hEvent.originalTarget
if(hElement.bLocked)
{hElement.bLocked=false
hEvent.returnValue=false
if(hEvent.preventDefault)
{hEvent.preventDefault()}
return false}}
var dp={sh:{Utils:{},Brushes:{}}};dp.sh.Config={Version:'1.1.0',About:'<html><head><title>About...</title></head><body class="dp-about"><table cellspacing="0"><tr><td class="copy"><div class="para title">dp.SyntaxHighlighter</div><div class="para">Version: {V}</div><div class="para"><a href="http://www.dreamprojections.com/sh/?ref=about" target="_blank">http://www.dreamprojections.com/SyntaxHighlighter</a></div>&copy;2004-2005 Dream Projections Inc. All right reserved.</td></tr><tr><td class="footer"><input type="button" class="close" value="OK" onClick="window.close()"/></td></tr></table></body></html>'};dp.SyntaxHighlighter=dp.sh;dp.sh.Utils.ViewSource=function(sender)
{var code=sender.parentNode.originalCode;var wnd=window.open('','_blank','width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1');code=code.replace(/</g,'&lt;');wnd.document.write('<pre>'+code+'</pre>');wnd.document.close();}
dp.sh.Utils.ToClipboard=function(sender)
{var code=sender.parentNode.originalCode;if(window.clipboardData)
{window.clipboardData.setData('text',code);alert('The code is in your clipboard now.');}}
dp.sh.Utils.PrintSource=function(sender)
{var td=sender.parentNode;var code=td.processedCode;var iframe=document.createElement('IFRAME');var doc=null;var wnd=iframe.style.cssText='position:absolute; width:0px; height:0px; left:-5px; top:-5px;';td.appendChild(iframe);doc=iframe.contentWindow.document;code=code.replace(/</g,'&lt;');doc.open();doc.write('<pre>'+code+'</pre>');doc.close();iframe.contentWindow.focus();iframe.contentWindow.print();td.removeChild(iframe);}
dp.sh.Utils.About=function()
{var wnd=window.open('','_blank','dialog, width=320, height=150');var doc=wnd.document;var styles=document.getElementsByTagName('style');var links=document.getElementsByTagName('link');doc.write(dp.sh.Config.About.replace('{V}',dp.sh.Config.Version));for(var i=0;i<styles.length;i++)
doc.write('<style>'+styles[i].innerHTML+'</style>');for(var i=0;i<links.length;i++)
if(links[i].rel.toLowerCase()=='stylesheet')
doc.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');doc.close();wnd.focus();}
dp.sh.Match=function(value,index,css)
{this.value=value;this.index=index;this.length=value.length;this.css=css;}
dp.sh.Highlighter=function()
{this.addGutter=true;this.addControls=true;this.tabsToSpaces=true;}
dp.sh.Highlighter.SortCallback=function(m1,m2)
{if(m1.index<m2.index)
return-1;else if(m1.index>m2.index)
return 1;else
{if(m1.length<m2.length)
return-1;else if(m1.length>m2.length)
return 1;}
return 0;}
dp.sh.Highlighter.prototype.GetMatches=function(regex,css)
{var index=0;var match=null;while((match=regex.exec(this.code))!=null)
{this.matches[this.matches.length]=new dp.sh.Match(match[0],match.index,css);}}
dp.sh.Highlighter.prototype.AddBit=function(str,css)
{var span=document.createElement('span');str=str.replace(/&/g,'&amp;');str=str.replace(/ /g,'&nbsp;');str=str.replace(/</g,'&lt;');str=str.replace(/\n/gm,'&nbsp;<br>');if(css!=null)
{var regex=new RegExp('<br>','gi');if(regex.test(str))
{var lines=str.split('&nbsp;<br>');str='';for(var i=0;i<lines.length;i++)
{span=document.createElement('SPAN');span.className=css;span.innerHTML=lines[i];this.div.appendChild(span);if(i+1<lines.length)
{this.div.appendChild(document.createElement('BR'));}}}
else
{span.className=css;span.innerHTML=str;this.div.appendChild(span);}}
else
{span.innerHTML=str;this.div.appendChild(span);}}
dp.sh.Highlighter.prototype.IsInside=function(match)
{if(match==null||match.length==0)
{return;}
for(var i=0;i<this.matches.length;i++)
{var c=this.matches[i];if(c==null)
{continue;}
if((match.index>c.index)&&(match.index<=c.index+c.length))
{return true;}}
return false;}
dp.sh.Highlighter.prototype.ProcessRegexList=function()
{for(var i=0;i<this.regexList.length;i++)
{this.GetMatches(this.regexList[i].regex,this.regexList[i].css);}}
dp.sh.Highlighter.prototype.ProcessSmartTabs=function(code)
{var lines=code.split('\n');var result='';var tabSize=4;var tab='\t';function InsertSpaces(line,pos,count)
{var left=line.substr(0,pos);var right=line.substr(pos+1,line.length);var spaces='';for(var i=0;i<count;i++)
{spaces+=' ';}
return left+spaces+right;}
function ProcessLine(line,tabSize)
{if(line.indexOf(tab)==-1)
{return line;}
var pos=0;while((pos=line.indexOf(tab))!=-1)
{var spaces=tabSize-pos%tabSize;line=InsertSpaces(line,pos,spaces);}
return line;}
for(var i=0;i<lines.length;i++)
{var line=lines[i];result+=ProcessLine(line,tabSize)+'\n';}
return result;}
dp.sh.Highlighter.prototype.SwitchToTable=function()
{var lines=this.div.innerHTML.split(/<BR>/gi);var row=null;var cell=null;var html='';var pipe=' | ';function UtilHref(util,text)
{return'<a href="#" onclick="dp.sh.Utils.'+util+'(this); return false;">'+text+'</a>';}
row=this.table.insertRow(-1);if(this.addGutter==true)
{cell=row.insertCell(-1);cell.className='tools-corner';}
if(this.addControls==true)
{cell=row.insertCell(-1);cell.originalCode=this.originalCode;cell.processedCode=this.code;cell.className='tools';cell.innerHTML=UtilHref('ViewSource','view plain')+pipe+UtilHref('PrintSource','print');if(window.clipboardData)
{cell.innerHTML+=pipe+UtilHref('ToClipboard','copy to clipboard');}
cell.innerHTML+=pipe+UtilHref('About','?');}
for(var i=0;i<lines.length-1;i++)
{row=this.table.insertRow(-1);if(this.addGutter==true)
{cell=row.insertCell(-1);cell.className='gutter';cell.innerHTML=i+1;}
cell=row.insertCell(-1);cell.className='line';cell.innerHTML=lines[i];}
this.div.innerHTML='';}
dp.sh.Highlighter.prototype.Highlight=function(code)
{function Trim(str)
{var begining=new RegExp('^[\\s\\n]','g');var end=new RegExp('[\\s\\n]$','g');while(begining.test(str))
{str=str.substr(1);}
while(end.test(str))
{str=str.substr(0,str.length-1);}
return str;}
function Copy(string,pos1,pos2)
{return string.substr(pos1,pos2-pos1);}
var pos=0;this.originalCode=code;this.code=Trim(code);this.div=document.createElement('DIV');this.table=document.createElement('TABLE');this.matches=new Array();if(this.CssClass!=null)
{this.table.className=this.CssClass;}
if(this.tabsToSpaces==true)
{this.code=this.ProcessSmartTabs(this.code);}
this.table.border=0;this.table.cellSpacing=0;this.table.cellPadding=0;this.ProcessRegexList();if(this.matches.length==0)
{return;}
this.matches=this.matches.sort(dp.sh.Highlighter.SortCallback);for(var i=0;i<this.matches.length;i++)
{if(this.IsInside(this.matches[i]))
{this.matches[i]=null;}}
for(var i=0;i<this.matches.length;i++)
{var match=this.matches[i];if(match==null||match.length==0)
{continue;}
this.AddBit(Copy(this.code,pos,match.index),null);this.AddBit(match.value,match.css);pos=match.index+match.length;}
this.AddBit(this.code.substr(pos),null);this.SwitchToTable();}
dp.sh.Highlighter.prototype.GetKeywords=function(str)
{return'\\b'+str.replace(/ /g,'\\b|\\b')+'\\b';}
dp.sh.HighlightAll=function(name,showGutter,showControls)
{var elements=document.getElementsByName(name);var highlighter=null;var registered=new Object();var propertyName='value';function FindValue()
{var a=arguments;for(var i=0;i<a.length;i++)
if(a[i]!=null&&((typeof(a[i])=='string'&&a[i]!='')||(typeof(a[i])=='object'&&a[i].value!='')))
return a[i];return null;}
if(elements==null)
{return;}
if(showGutter==null)
{showGutter=true;}
if(showControls==null)
{showControls=true;}
for(var brush in dp.sh.Brushes)
{var aliases=dp.sh.Brushes[brush].Aliases;if(aliases==null)
{continue;}
for(var i=0;i<aliases.length;i++)
{registered[aliases[i]]=brush;}}
for(var i=0;i<elements.length;i++)
{var element=elements[i];var language=FindValue(element.attributes['class'],element.className,element.attributes['language'],element.language);if(language==null)
continue;if(language.value)
language=language.value;language=(language+'').toLowerCase();if(registered[language]==null)
{continue;}
highlighter=new dp.sh.Brushes[registered[language]]();element.style.display='none';highlighter.addGutter=showGutter;highlighter.addControls=showControls;highlighter.Highlight(element[propertyName]);var div=document.createElement('DIV');div.className='dp-highlighter';div.appendChild(highlighter.table);element.parentNode.insertBefore(div,element);}}
dp.sh.Brushes.Xml=function()
{this.CssClass='dp-xml';}
dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=['xml','xhtml','xslt','html','xhtml'];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function()
{function push(array,value)
{array[array.length]=value;}
var index=0;var match=null;var regex=null;this.GetMatches(new RegExp('<\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\]>','gm'),'cdata');this.GetMatches(new RegExp('<!--\\s*.*\\s*?-->','gm'),'comments');regex=new RegExp('([\\w-\.]+)\\s*=\\s*(".*?"|\'.*?\'|\\w+)*','gm');while((match=regex.exec(this.code))!=null)
{push(this.matches,new dp.sh.Match(match[1],match.index,'attribute'));if(match[2]!=undefined)
{push(this.matches,new dp.sh.Match(match[2],match.index+match[0].indexOf(match[2]),'attribute-value'));}}
this.GetMatches(new RegExp('</*\\?*(?!\\!)|/*\\?*>','gm'),'tag');regex=new RegExp('</*\\?*\\s*([\\w-\.]+)','gm');while((match=regex.exec(this.code))!=null)
{push(this.matches,new dp.sh.Match(match[1],match.index+match[0].indexOf(match[1]),'tag-name'));}}
document.getElementById('in_buscador').innerHTML='\
<form name="buscador" id="buscador" action="">\
<input name="from_date" id="from_date" class="textoform" value="" type="hidden" onchange="document.forms[\'buscador\'][\'departureDateDay\'].selectedIndex=document.forms[\'buscador\'][\'from_date\'].value.substring(0,2)-1;document.forms[\'buscador\'][\'departureDateMes\'].selectedIndex=document.forms[\'buscador\'][\'from_date\'].value.substring(3,5)-1;document.forms[\'buscador\'][\'departureDateAno\'].selectedIndex=(document.forms[\'buscador\'][\'from_date\'].value.substring(6,10)==\'2010\')?0:1;" />\
<input name="to_date" id="to_date" class="textoform" value="" type="hidden" onchange="document.forms[\'buscador\'][\'returnDateDay\'].selectedIndex=document.forms[\'buscador\'][\'to_date\'].value.substring(0,2)-1;document.forms[\'buscador\'][\'returnDateMes\'].selectedIndex=document.forms[\'buscador\'][\'to_date\'].value.substring(3,5)-1;document.forms[\'buscador\'][\'returnDateAno\'].selectedIndex=(document.forms[\'buscador\'][\'to_date\'].value.substring(6,10)==\'2010\')?0:1;" />\
<a name="n_tabla_buscador"></a><table summary="" border="0" id="tabla_buscador">\
<tr><td align="left" valign="top">\
<div>\
<div>\
<table width="390" border="0" cellspacing="0" cellpadding="0">\
<tr>\
<td class="topbg" ></td>\
</tr>\
<tr>\
<td class="backtab">\
<table width="0" border="0" cellpadding="3" cellspacing="1">\
<tr>\
<td class="campir" >Tipo de vuelo</td>\
<td nowrap="nowrap" class="campiex" valign="top"><div style="font-size:11px;font-family:Verdana,arial,helvetica">\
<input name="td_chkOneWay" id="flight_type" class="textoform" type="radio" value="2" onclick="oneWay(false)" checked="checked"/>\
Ida y Vuelta &nbsp;&nbsp;\
<input name="td_chkOneWay" id="flight_type" class="textoform" type="radio" value="1" onclick="oneWay(true)" />\
Sólo Ida</div></td>\
</tr>\
<tr>\
<td nowrap="nowrap" class="campir" >Ciudad de Origen</td>\
<td nowrap="nowrap" class="campiex" style="text-align:right">\
<input type="hidden" name="td_D_City" id="td_D_City" />\
<input id="autocomplete_remote" name="td_D_xCity" style="height:14px;width:210px;font-size:12px" class="textoform"\
value="" acdropdown="true" autocomplete_list="url:/autocompletar/codigos_aeropuertos.php?s=[S]&l=10" autocomplete_matchsubstring="true" tabindex="2" onkeypress="ponindi(0);" />&nbsp;\
<img src="http://i1a.comprarvuelosbaratos.com/ayuda01.gif" style="cursor:help" alt="" width="16" height="16" title="&lt;div&gt; &lt;span class=\'c11\'&gt;Origen del vuelo:&lt;/span &gt; &lt;ul class=\'xc2\'&gt;&lt;li class=\'xc111\'&gt;Escribe el código del aeropuerto de partida (3 letras)&lt;/li&gt;&lt;li class=\'xc111\'&gt;Después de un momento aparecerá una lista con el nombre de la ciudad y país, y otras posibles opciones&lt;/li&gt;&lt;li class=\'xc111\'&gt;Selecciona la ciudad y país que corresponda&lt;/li&gt;&lt;li class=\'xc111\'&gt;Si no conoces el código del aeropuerto, escribe las primeras letras del nombre de la ciudad.&lt;/li&gt;&lt;li class=\'xc111\'&gt;Tras un momento aparece una lista de posibles ciudades y países&lt;/li&gt;&lt;li class=\'xc111\'&gt;Selecciona la ciudad y país que corresponda&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt">\
</td>\
</tr>\
<tr>\
<td nowrap="nowrap" class="campir" >Ciudad de Destino</td>\
<td nowrap="nowrap" class="campiex" style="text-align:right">\
<input type="hidden" name="td_A_City" id="td_A_City" />\
<input id="zautocomplete_remote" name="td_A_xCity" style="height:14px;width:210px;font-size:12px" class="textoform"\
value="" acdropdown="true" autocomplete_list="url:/autocompletar/codigos_aeropuertos.php?s=[S]&l=10" autocomplete_matchsubstring="true" tabindex="3" onkeypress="ponindi(0);" />&nbsp;\
<img src="http://i1a.comprarvuelosbaratos.com/ayuda01.gif" style="cursor:help" alt="" width="16" height="16" title="&lt;div&gt; &lt;span class=\'c11\'&gt;Destino del vuelo:&lt;/span &gt; &lt;ul class=\'xc2\'&gt;&lt;li class=\'xc111\'&gt;Escribe el código del aeropuerto de destino (3 letras)&lt;/li&gt;&lt;li class=\'xc111\'&gt;Después de un momento aparecerá una lista con el nombre de la ciudad y país, y otras posibles opciones&lt;/li&gt;&lt;li class=\'xc111\'&gt;Selecciona la ciudad y país que corresponda&lt;/li&gt;&lt;li class=\'xc111\'&gt;Si no conoces el código del aeropuerto, escribe las primeras letras del nombre de la ciudad.&lt;/li&gt;&lt;li class=\'xc111\'&gt;Tras un momento aparece una lista de posibles ciudades y países&lt;/li&gt;&lt;li class=\'xc111\'&gt;Selecciona la ciudad y país que corresponda&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt">\
</td>\
</tr>\
<tr>\
<td nowrap="nowrap" class="campir" >Fecha de salida</td>\
<td nowrap="nowrap" class="campiex">Día <select name="td_D_Day" id="departureDateDay" class="textoform" onchange="ponindi(0);">\
<span class="textoform">\
<option value="01">01</option>\
<option value="02">02</option>\
<option value="03">03</option>\
<option value="04">04</option>\
<option value="05">05</option>\
<option value="06">06</option>\
<option value="07">07</option>\
<option value="08">08</option>\
<option value="09">09</option>\
<option value="10">10</option>\
<option value="11">11</option>\
<option value="12">12</option>\
<option value="13">13</option>\
<option value="14">14</option>\
<option value="15">15</option>\
<option value="16">16</option>\
<option value="17">17</option>\
<option value="18">18</option>\
<option value="19">19</option>\
<option value="20">20</option>\
<option value="21">21</option>\
<option value="22">22</option>\
<option value="23">23</option>\
<option value="24">24</option>\
<option value="25">25</option>\
<option value="26">26</option>\
<option value="27">27</option>\
<option value="28">28</option>\
<option value="29">29</option>\
<option value="30">30</option>\
<option value="31">31</option>\
</span>\
</select>\
&nbsp;Mes <select name="td_D_Mes" id="departureDateMes" class="textoform" onchange="ponindi(0);">\
<span class="textoform">\
<option value="01">01</option>\
<option value="02">02</option>\
<option value="03">03</option>\
<option value="04">04</option>\
<option value="05">05</option>\
<option value="06">06</option>\
<option value="07">07</option>\
<option value="08">08</option>\
<option value="09">09</option>\
<option value="10">10</option>\
<option value="11">11</option>\
<option value="12">12</option>\
</span>\
</select>\
&nbsp;Año <select name="td_D_Anno" id="departureDateAno" class="textoform" onchange="ponindi(0);">\
<option class="textoform" value="2010">2010</option>\
<option class="textoform" value="2011">2011</option>\
</select>\
&nbsp;<img width="16" height="16" style="cursor:pointer" src="http://i1a.comprarvuelosbaratos.com/cal.gif" name="from_date_img" id="from_date_img" alt="" />\
</td>\
</tr>\
<tr>\
<td nowrap="nowrap" class="campir" >Fecha de regreso</td>\
<td nowrap="nowrap" class="campiex">Día <select name="td_R_Day" id="returnDateDay" class="textoform" onchange="ponindi(0);">\
<span class="textoform">\
<option value="01" >01</option>\
<option value="02">02</option>\
<option value="03">03</option>\
<option value="04">04</option>\
<option value="05">05</option>\
<option value="06">06</option>\
<option value="07">07</option>\
<option value="08">08</option>\
<option value="09">09</option>\
<option value="10">10</option>\
<option value="11">11</option>\
<option value="12">12</option>\
<option value="13">13</option>\
<option value="14">14</option>\
<option value="15">15</option>\
<option value="16">16</option>\
<option value="17">17</option>\
<option value="18">18</option>\
<option value="19">19</option>\
<option value="20">20</option>\
<option value="21">21</option>\
<option value="22">22</option>\
<option value="23">23</option>\
<option value="24">24</option>\
<option value="25">25</option>\
<option value="26">26</option>\
<option value="27">27</option>\
<option value="28">28</option>\
<option value="29">29</option>\
<option value="30">30</option>\
<option value="31">31</option>\
</span>\
</select>\
&nbsp;Mes <select name="td_R_Mes" id="returnDateMes" class="textoform" onchange="ponindi(0);">\
<span class="textoform">\
<option value="01" >01</option>\
<option value="02">02</option>\
<option value="03">03</option>\
<option value="04">04</option>\
<option value="05">05</option>\
<option value="06">06</option>\
<option value="07">07</option>\
<option value="08">08</option>\
<option value="09">09</option>\
<option value="10">10</option>\
<option value="11">11</option>\
<option value="12">12</option>\
</span>\
</select>\
&nbsp;Año <select name="td_R_Anno" id="returnDateAno" class="textoform" onchange="ponindi(0);">\
<option class="textoform" value="2010" >2010</option>\
<option class="textoform" value="2011">2011</option>\
</select>\
&nbsp;<img width="16" height="16" style="cursor:pointer" src="http://i1a.comprarvuelosbaratos.com/cal.gif" name="to_date_img" id="to_date_img" alt="" />\
</td>\
</tr>\
<tr>\
<td nowrap="nowrap" class="campir" title=""> N&uacute;m. de pasajeros</td>\
<td nowrap="nowrap" class="campiexb">\
<table cellpadding="0" cellspacing="0" width="100%" align="center">\
<tr>\
<td class="textoform" height="25" colspan="4"><span class="Stile1"> Adultos </span>\
<select name="td_select_adt" id="td_select_adt" class="textoform" onchange="ponindi(0)">\
<span class="textoform">\
<option value="1">1</option>\
<option value="2">2</option>\
<option value="3">3</option>\
<option value="4">4</option>\
<option value="5">5</option>\
<option value="6">6</option>\
<option value="7">7</option>\
<option value="8">8</option>\
<option value="0" >0</option>\
</span>\
</select>\
&nbsp;<span class="Stile1">Niños </span>\
<select name="td_select_chd" id="td_select_chd" class="textoform" onchange="ponindi(0)">\
<span class="textoform">\
<option value="0" >0</option>\
<option value="1">1</option>\
<option value="2">2</option>\
<option value="3">3</option>\
<option value="4">4</option>\
<option value="5">5</option>\
<option value="6">6</option>\
<option value="7">7</option>\
<option value="8">8</option>\
</span>\
</select>\
&nbsp;<span class="Stile1">Bebés </span>\
<span class="textoform">\
<select name="td_select_inf" id="td_select_inf" class="textoform" onchange="ponindi(0);if(this.selectedIndex>this.form.td_select_adt.selectedIndex+1){alert(\'El número de bebés debe ser inferior o igual al número de adultos.\');this.selectedIndex=0;this.focus();}">\
<option value="0" >0</option>\
<option value="1">1</option>\
<option value="2">2</option>\
<option value="3">3</option>\
<option value="4">4</option>\
<option value="5">5</option>\
</span>\
</select></td>\
</tr></table>\
</td></tr></table>\
<table width="380" border="0" cellspacing="0" cellpadding="0" align="center">\
<tr>\
<td align="left" class="Stile1"></td>\
</tr>\
</table>\
<table width="380" border="0" cellspacing="1" cellpadding="2" id="ab_buscador">\
<tr>\
<td height="90" colspan="4" align="center" bgcolor="#FFFFFF" style="border-top:1px dashed #917E43">\
<a href="#n_tabla_buscador"><img style="cursor:pointer" id="boton_buscar_vuelo2" src="http://i1a.comprarvuelosbaratos.com/buscar_vuelos_mas_baratos.png" width="230" height="28" alt="" onclick="Buscar(2)" border="0" /></a><img style="margin-bottom:11px;margin-left:2px;cursor:help" src="http://i1a.comprarvuelosbaratos.com/ayuda01.gif" title="Busca los proveedores que más barato están vendiendo este vuelo." height="16" width="16" /><br />\
<a style="margin-top:10px" title="Alerta al usuario sobre la aparición de una oferta o bajada en el precio de su vuelo." href="http://www.comprarvuelosbaratos.com/index_buscavuelos_altas.php">Alta en alerta de precios</a><br />\
<div id="infobus"></div>\
</td>\
</tr>\
</table>\
</td></tr><tr><td class="bottombot">\
</td></tr></table>\
</div>\
<input type="hidden" value="2" name="td_TripType" />\
<input type="hidden" name="td_D_Date" />\
<input type="hidden" name="td_R_Date" />\
<input type="hidden" value="08" name="td_D_Time" />\
<input type="hidden" value="08" name="td_R_Time" />\
<input type="hidden" name="td_D_Month" />\
<input type="hidden" name="td_R_Month" />\
<input type="hidden" name="empresa" />\
</td></tr></table>\
</form>'
var vuelos_hoy=new Date()
var vuelos_salida=new Date()
var vuelos_regreso=new Date()
vuelos_salida.setDate(vuelos_hoy.getDate()+4)
vuelos_regreso.setDate(vuelos_hoy.getDate()+18)
document.forms['buscador']['departureDateDay'].selectedIndex=vuelos_salida.getDate()-1
document.forms['buscador']['departureDateMes'].selectedIndex=vuelos_salida.getMonth()
document.forms['buscador']['departureDateAno'].selectedIndex=(vuelos_salida.getFullYear()=='2010')?0:1
document.forms['buscador']['returnDateDay'].selectedIndex=vuelos_regreso.getDate()-1
document.forms['buscador']['returnDateMes'].selectedIndex=vuelos_regreso.getMonth()
document.forms['buscador']['returnDateAno'].selectedIndex=(vuelos_regreso.getFullYear()=='2010')?0:1
document.forms['buscador']['from_date'].value=(vuelos_salida.getDate())+'/'+(vuelos_salida.getMonth()+1-0)+'/'+vuelos_salida.getFullYear()
document.forms['buscador']['to_date'].value=(vuelos_regreso.getDate())+'/'+(vuelos_regreso.getMonth()+1-0)+'/'+vuelos_regreso.getFullYear()
Calendar.setup({dateStatusFunc:disableDate,onUpdate:set2later,inputField:"from_date",ifFormat:"%d/%m/%Y",button:"from_date_img",daFormat:"%d/%m/%Y",firstDay:1,date:"25/12/07",weekNumbers:false,range:[2010,2011],electric:false});Calendar.setup({dateStatusFunc:disableDateTo,inputField:"to_date",ifFormat:"%d/%m/%Y",button:"to_date_img",daFormat:"%d/%m/%Y",date:"1/01/08",firstDay:1,weekNumbers:false,range:[2010,2011],electric:false});oneWay(false);document.getElementById("autocomplete_remote").focus()

