var AccordianContainer={toggleItem:function(id){
var el=dojo.query("#AccordianContent_"+id)[0];
var _3=dojo.query("#AccordianMore_"+id)[0];
if(el.style.display=="block"){
el.style.display="none";
_3.style.backgroundPosition="right 0";
}else{
el.style.display="block";
_3.style.backgroundPosition="right -16px";
}
}};
function pad(_4,_5){
var _6=_4+"";
while(_6.length<_5){
_6="0"+_6;
}
return _6;
};
function gtZero(_7){
return (_7>0?_7:0);
};
function updateChristmasCountdown(){
var _8=new Date();
var _9=new Date(2008,11,25);
var _a=(_9-_8)/60000;
var _b=gtZero(Math.floor(_a/1440));
var _c=pad(gtZero(Math.floor((_a-(_b*1440))/60)),2);
var _d=pad(gtZero(Math.floor((_a-(_b*1440)-(_c*60)))),2);
document.getElementById("countdown-days-span").innerHTML=_b;
document.getElementById("countdown-hours-span").innerHTML=_c;
document.getElementById("countdown-mins-span").innerHTML=_d;
setTimeout(updateChristmasCountdown,60000);
};
function CountingTextArea(id){
this.id=id;
this.limit;
this.component=document.getElementById(this.id+"area");
};
CountingTextArea.prototype.updateCounter=function(){
if(this.component){
var _f=this.component.value.length;
}
if(_f<=this.limit){
counter=document.getElementById(this.id+"counter");
if(counter){
counter.innerHTML=this.limit-_f;
}
return;
}else{
this.component.value=this.component.value.substring(0,this.limit);
return false;
}
};
CountingTextArea.prototype.setLimit=function(_10){
this.limit=_10;
return;
};
function CountdownTimer(id){
this.id=id;
var _12=document.getElementById(this.id+"-text");
var _13=document.getElementById(this.id+"-timer");
var _14=document.getElementById(this.id+"-days");
var _15=document.getElementById(this.id+"-hours");
var _16=document.getElementById(this.id+"-mins");
var _17=document.getElementById(this.id+"-secs");
var _18=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var _19;
var _1a;
this.setCompletedText=function(_1b){
_1a=_1b;
};
function _1c(_1d,_1e,_1f,_20){
if(_13){
_13.innerHTML=_1d+":"+pad(_1e)+":"+pad(_1f)+":"+pad(_20);
}else{
if(_14){
_14.innerHTML=pad(_1d);
}
if(_15){
_15.innerHTML=pad(_1e);
}
if(_16){
_16.innerHTML=pad(_1f);
}
if(_17){
_17.innerHTML=pad(_20);
}
}
return;
};
function _22(){
_13.innerHTML="";
_12.innerHTML=_1a;
return;
};
this.startTimer=function(_23){
_19=Date.parse(_23);
_24();
var _25=setInterval(_24,1000);
return;
};
function _24(){
var _26=new Date();
var _27=_26.getYear();
if(_27<1000){
_27+=1900;
}
var _28=_26.getMonth();
var _29=_26.getDate();
var _2a=_26.getHours();
var _2b=_26.getMinutes();
var _2c=_26.getSeconds();
var _2d=_18[_28]+" "+_29+", "+_27+" "+_2a+":"+_2b+":"+_2c;
var _2e=Date.parse(_2d);
d_date=_19-_2e;
d_day=Math.floor(d_date/(60*60*1000*24)*1);
d_hour=Math.floor((d_date%(60*60*1000*24))/(60*60*1000)*1);
d_min=Math.floor(((d_date%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
d_sec=Math.floor((((d_date%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
if(d_day<=0&&d_hour<=0&&d_min<=0){
_22();
}else{
_1c(d_day,d_hour,d_min,d_sec);
}
return;
};
function pad(_2f){
return (_2f<10)?"0"+_2f:_2f;
};
};
function dartUK(){
};
dartUK.svr="http://ad.uk.doubleclick.net";
dartUK.tile=0;
dartUK.checktile=0;
dartUK.ord=0;
dartUK.dInfo=new Object();
dartUK.dInfo.ad="nodata";
dartUK.dInfo.gd="nodata";
dartUK.dInfo.cd="nodata";
dartUK.dInfo.rd="nodata";
dartUK.dInfo.td="nodata";
dartUK.init=function(){
this.generatetile();
this.generateOrd();
};
dartUK.generateOrd=function(){
if(this.ord==0){
this.ord=(""+new Date().getTime()).substring(4)+(""+Math.random(1)).substring(2,6);
}
};
dartUK.generatetile=function(){
this.tile=((typeof dartCount!="undefined"))?dartCount:1;
this.checktile=1;
};
dartUK.createStubCookie=function(){
var _30=new Date(2008,1,31);
document.cookie="dinfo=G=G1:A=A6:C=pcode:R=region:T=town; expires="+_30.toGMTString()+";domain=orange.co.uk";
};
dartUK.readCookie=function(_31){
var dc=document.cookie;
var _33=_31+"=";
var _34=dc.indexOf("; "+_33);
if(_34==-1){
_34=dc.indexOf(_33);
if(_34!=0){
return null;
}
}else{
_34+=2;
}
var end=document.cookie.indexOf(";",_34);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_34+_33.length,end));
};
dartUK.processDInfo=function(){
var _36=this.readCookie("dinfo");
if(_36!=null){
var _37=_36.split(":");
for(i=0;i<_37.length;i++){
var _38=_37[i].substring(0,1);
var _39=_37[i].split("=");
var _3a=_39[1];
switch(_38){
case "A":
var _3b="ad";
break;
case "C":
var _3b="cd";
break;
case "G":
var _3b="gd";
break;
case "R":
var _3b="rd";
break;
case "T":
var _3b="td";
break;
}
if(typeof _3b!="undefined"&&(_3a!=""||_3a.length!=-1||_3a!=null)){
this.dInfo[_3b]=_3a;
}
}
}
};
dartUK.buildDART=function(_3c,_3d){
var _3e="";
if(_3d==0){
this.processDInfo();
var _3f=_3c.lastIndexOf(";")+1;
var _40=_3c.slice(0,_3f);
var _41=_3c.slice(_3f);
var _42="";
if(this.dInfo){
_42=segQS+"ad="+this.dInfo.ad+";gd="+this.dInfo.gd+";cd="+this.dInfo.cd+";rd="+this.dInfo.rd+";td="+this.dInfo.ad+";";
}
_3e=_40+_42+_41;
return _3e;
}else{
_3e=_3c;
return _3e;
}
};
dartUK.render=function(_43,_44){
if(typeof _44=="undefined"){
var _44=0;
}
var _45=this.buildDART(_43,_44);
var _46="<scri"+"pt language=\"JavaScript\" "+" src=\""+this.svr+"/adj/"+_45+";tile="+this.tile+";ord="+this.ord+"?\" type=\"text/javascript\">"+"</scr"+"ipt>";
this.tile++;
document.write(_46);
};
dartUK.init();
function pad(_47,_48){
var str=_47+"";
while(str.length<_48){
str="0"+str;
}
return str;
};
function gtZero(_4a){
return (_4a>0?_4a:0);
};
function updateEventCountdown(_4b){
_4b=String(_4b);
var _4c=_4b.substr(0,4);
var _4d=Number(_4b.substr(4,2))-1;
var day=_4b.substr(6,2);
var _4f=new Date();
var _50=new Date(_4c,_4d,day);
var _51=(_50-_4f)/60000;
var _52=gtZero(Math.floor(_51/1440));
var _53=pad(gtZero(Math.floor((_51-(_52*1440))/60)),2);
var _54=pad(gtZero(Math.floor((_51-(_52*1440)-(_53*60)))),2);
document.getElementById("countdown-days-span").innerHTML=_52;
document.getElementById("countdown-hours-span").innerHTML=_53;
document.getElementById("countdown-mins-span").innerHTML=_54;
setTimeout("updateEventCountdown('"+_4b+"')",60000);
};
function pad(_55,_56){
var str=_55+"";
while(str.length<_56){
str="0"+str;
}
return str;
};
function gtZero(_58){
return (_58>0?_58:0);
};
function updateOWCountdown(){
var _59=new Date();
var _5a=_59.getDay();
var _5b=3;
if(_5a==_5b){
document.getElementById("countdownContainerWednesday").style.display="block";
document.getElementById("countdownContainer").style.display="none";
return false;
}else{
var _5c=(7-_5a)+_5b;
var _5d=new Date(_59.getFullYear(),_59.getMonth(),_59.getDate()+_5c);
document.getElementById("countdownContainer").style.display="block";
document.getElementById("countdownContainerWednesday").style.display="none";
}
var _5e=(_5d-_59)/60000;
var _5f=gtZero(Math.floor(_5e/1440));
var _60=pad(gtZero(Math.floor((_5e-(_5f*1440))/60)),2);
var _61=pad(gtZero(Math.floor((_5e-(_5f*1440)-(_60*60)))),2);
displayDays=pad(_5f%7,2);
document.getElementById("countdown-days-div").innerHTML=displayDays;
document.getElementById("countdown-hours-div").innerHTML=_60;
document.getElementById("countdown-mins-div").innerHTML=_61;
setTimeout(updateOWCountdown,60000);
};
var FlexCarousel={galleryArray:[],galleryMeta:[],galleryCallback:function(id){
var _63="lightbox_"+id;
var _64=dojo.query("#"+_63)[0];
if(dojo.isIE&&_64){
_64.style.display="none";
}
var _65=dojo.query("p#loading_text_"+id);
if(_65[0]){
_65[0].style.display="none";
}
return this.galleryArray[id];
},lightboxGalleryCallback:function(id){
return this.galleryArray[id];
},initLightbox:function(_67){
},imageClicked:function(_68,_69){
var _6a="lightbox_"+_69;
var _6b=dijit.byId(_6a);
if(_6b){
_6b.duration=1;
_6a="#"+_6a;
if(dojo.isIE){
dojo.query(_6a)[0].style.display="block";
}
var _6c=this.getImageObject(_68,_69);
var _6d=dojo.query(_6a+" div.image a")[0];
_6d.removeChild(dojo.query(_6a+" div.image a img")[0]);
if(typeof (document.getElementById("flexcarousel_lightbox_"+_69).selectImage)=="function"){
document.getElementById("flexcarousel_lightbox_"+_69).selectImage(_68);
}
var _6e=dojo.query(_6a+" div.caption")[0];
if(_6c.caption){
_6e.style.display="block";
_6e.innerHTML=this.html_entity_decode(_6c.caption);
}else{
_6e.style.display="none";
}
var _6f=document.createElement("img");
_6d.appendChild(_6f);
dojo.attr(_6f,"src",_6c.src);
_6b.show();
var _70=this.galleryMeta[_69];
orangeTrack("webtrends","lightbox_gallery",{galleryId:_70.id,title:_70.title,contentGroup:_70.contentGroup,imagePosition:_6c.position});
}
},lightboxImageClicked:function(_71,_72){
},getImageObject:function(_73,_74){
var _75=this.galleryArray[_74];
for(var i=0;i<_75.length;i++){
if(_75[i].id==_73){
return _75[i];
}
}
return false;
},html_entity_decode:function(str){
var ta=document.createElement("textarea");
ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
var _79=ta.value;
ta=null;
return _79;
}};
function closeLightbox(_7a){
var _7b="lightbox_"+_7a;
var _7c=dijit.byId(_7b);
_7c.hide();
};
function log(_7d){
console.log(_7d);
};
function gallerySubmitVoteForm(_7e){
var _7f=false;
var _80=document.forms["form_"+_7e].elements;
for(var i=0;i<_80.length;i++){
var el=document.forms["form_"+_7e].elements[i];
if(el.type=="radio"){
if(el.checked){
_7f=true;
}
}
}
if(!_7f){
alert("Please select an option before you click Vote");
return false;
}
return true;
};
function HeadlineFeature(id){
this.id=id;
this.component=document.getElementById(this.id);
this.currentpane=1;
};
HeadlineFeature.prototype.switchto=function(_84){
if(this.component&&_84!=this.currentpane){
var _85=document.getElementById(this.id+"-"+this.currentpane);
if(_85){
_85.className="HeadlineFeatureItem";
}
var _86=document.getElementById(this.id+"-"+_84);
if(_86){
_86.className="HeadlineFeatureItem open";
this.currentpane=_84;
}
}
return false;
};
function horseracingChangeSelectedMeeting(){
var _87=document.location.href.split("?");
var _88=_87[0]+"?meeting="+escape(document.getElementById("meeting_select").value);
document.location=_88;
};
function horseracingChangeSelectedDate(){
var _89=document.location.href.split("?");
var _8a=_89[0]+"?day="+escape(document.getElementById("date_select").value);
document.location=_8a;
};
function BuildAndVerify(f,_8c){
var _8d=document.forms[_8c]["iDepDay"];
var _8e=document.forms[_8c]["sDepMth"];
var _8f=_8d[_8d.selectedIndex].value;
var _90=_8e[_8e.selectedIndex].value;
var _91=document.forms[_8c]["iRetDay"];
var _92=document.forms[_8c]["sRetMth"];
var _93=_8d[_91.selectedIndex].value;
var _94=_8e[_92.selectedIndex].value;
if(_8f.length==1){
_8f="0"+_8f;
}
if(_93.length==1){
_93="0"+_93;
}
var _95=""+_8f+"/"+_90.substring(4)+"/"+_90.substring(2,4);
var _96=""+_93+"/"+_94.substring(4)+"/"+_94.substring(2,4);
document.forms[_8c]["d1"].value=_95;
document.forms[_8c]["d2"].value=_96;
return true;
};
function updateReturnDate(x,ret,_99){
var _9a=document.forms[_99][ret];
_9a.selectedIndex=x;
};
function greyOutFields(b,_9c){
var _9d=document.forms[_9c]["iRetDay"];
var _9e=document.forms[_9c]["sRetMth"];
if(b){
_9e.style.background="#ccc";
_9d.style.background="#ccc";
}else{
_9e.style.background="#fff";
_9d.style.background="#fff";
}
};
Calendar=function(_9f,_a0,_a1,_a2){
this.activeDiv=null;
this.currentDateEl=null;
this.getDateStatus=null;
this.getDateToolTip=null;
this.getDateText=null;
this.timeout=null;
this.onSelected=_a1||null;
this.onClose=_a2||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 _9f=="number"?_9f:Calendar._FD;
this.showsOtherMonths=false;
this.dateStr=_a0;
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;
this.startDate=null;
this.endDate=null;
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 _a8=/^div$/i.test(el.tagName);
if(_a8&&el.scrollLeft){
SL=el.scrollLeft;
}
if(_a8&&el.scrollTop){
ST=el.scrollTop;
}
var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};
if(el.offsetParent){
var tmp=this.getAbsolutePos(el.offsetParent);
r.x+=tmp.x;
r.y+=tmp.y;
}
return r;
};
Calendar.isRelated=function(el,evt){
var _ad=evt.relatedTarget;
if(!_ad){
var _ae=evt.type;
if(_ae=="mouseover"){
_ad=evt.fromElement;
}else{
if(_ae=="mouseout"){
_ad=evt.toElement;
}
}
}
while(_ad){
if(_ad==el){
return true;
}
_ad=_ad.parentNode;
}
return false;
};
Calendar.removeClass=function(el,_b0){
if(!(el&&el.className)){
return;
}
var cls=el.className.split(" ");
var ar=new Array();
for(var i=cls.length;i>0;){
if(cls[--i]!=_b0){
ar[ar.length]=cls[i];
}
}
el.className=ar.join(" ");
};
Calendar.addClass=function(el,_b5){
Calendar.removeClass(el,_b5);
el.className+=" "+_b5;
};
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,_bc,_bd){
if(el.attachEvent){
el.attachEvent("on"+_bc,_bd);
}else{
if(el.addEventListener){
el.addEventListener(_bc,_bd,true);
}else{
el["on"+_bc]=_bd;
}
}
};
Calendar.removeEvent=function(el,_bf,_c0){
if(el.detachEvent){
el.detachEvent("on"+_bf,_c0);
}else{
if(el.removeEventListener){
el.removeEventListener(_bf,_c0,true);
}else{
el["on"+_bf]=null;
}
}
};
Calendar.createElement=function(_c1,_c2){
var el=null;
if(document.createElementNS){
el=document.createElementNS("http://www.w3.org/1999/xhtml",_c1);
}else{
el=document.createElement(_c1);
}
if(typeof _c2!="undefined"){
_c2.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.date.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.date.getFullYear()+(fwd?1:-1);
var yr=yc.firstChild;
var _d3=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";
_d3=true;
}else{
yr.style.display="none";
}
yr=yr.nextSibling;
Y+=fwd?cal.yearStep:-cal.yearStep;
}
if(_d3){
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 _da=Calendar.getTargetElement(ev);
ev||(ev=window.event);
Calendar.removeClass(el,"active");
if(_da==el||_da.parentNode==el){
Calendar.cellClick(el,ev);
}
var mon=Calendar.findMonth(_da);
var _dc=null;
if(mon){
_dc=new Date(cal.date);
if(mon.month!=_dc.getMonth()){
_dc.setMonth(mon.month);
cal.setDate(_dc);
cal.dateClicked=false;
cal.callHandler();
}
}else{
var _dd=Calendar.findYear(_da);
if(_dd){
_dc=new Date(cal.date);
if(_dd.year!=_dc.getFullYear()){
_dc.setFullYear(_dd.year);
cal.setDate(_dc);
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 _e1=Calendar.getTargetElement(ev);
if(_e1==el||_e1.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&&_e1!=el){
var pos=Calendar.getAbsolutePos(el);
var w=el.offsetWidth;
var x=ev.clientX;
var dx;
var _e6=true;
if(x>pos.x+w){
dx=x-pos.x-w;
_e6=false;
}else{
dx=pos.x-x;
}
if(dx<0){
dx=0;
}
var _e7=el._range;
var _e8=el._current;
var _e9=Math.floor(dx/10)%_e7.length;
for(var i=_e7.length;--i>=0;){
if(_e7[i]==_e8){
break;
}
}
while(_e9-->0){
if(_e6){
if(--i<0){
i=_e7.length-1;
}
}else{
if(++i>=_e7.length){
i=0;
}
}
}
var _eb=_e7[i];
el.innerHTML=_eb;
cal.onUpdateTime();
}
var mon=Calendar.findMonth(_e1);
if(mon){
if(mon.month!=cal.date.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 _ed=Calendar.findYear(_e1);
if(_ed){
if(_ed.year!=cal.date.getFullYear()){
if(cal.hilitedYear){
Calendar.removeClass(cal.hilitedYear,"hilite");
}
Calendar.addClass(_ed,"hilite");
cal.hilitedYear=_ed;
}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 _f1;
var _f2;
if(Calendar.is_ie){
_f2=window.event.clientY+document.body.scrollTop;
_f1=window.event.clientX+document.body.scrollLeft;
}else{
_f1=ev.pageX;
_f2=ev.pageY;
}
cal.hideShowCovered();
var st=cal.element.style;
st.left=(_f1-cal.xOffs)+"px";
st.top=(_f2-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.ttip){
if(el.ttip.substr(0,1)=="_"){
el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);
}
el.calendar.tooltips.innerHTML=el.ttip;
}
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");
}
if(el.calendar){
el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];
}
return stopEvent(ev);
}
};
Calendar.cellClick=function(el,ev){
var cal=el.calendar;
var _101=false;
var _102=false;
var date=null;
if(typeof el.navtype=="undefined"){
if(cal.currentDateEl){
Calendar.removeClass(cal.currentDateEl,"selected");
Calendar.addClass(el,"selected");
_101=(cal.currentDateEl==el);
if(!_101){
cal.currentDateEl=el;
}
}
cal.date.setDateOnly(el.caldate);
date=cal.date;
var _104=!(cal.dateClicked=!el.otherMonth);
if(!_104&&!cal.currentDateEl){
cal._toggleMultipleDate(new Date(date));
}else{
_102=!el.disabled;
}
if(_104){
cal._init(cal.firstDayOfWeek,date);
}
}else{
if(el.navtype==200){
Calendar.removeClass(el,"hilite");
cal.callCloseHandler();
return;
}
date=new Date(cal.date);
if(el.navtype==0){
date.setDateOnly(new Date());
}
cal.dateClicked=false;
var year=date.getFullYear();
var mon=date.getMonth();
function _107(m){
var day=date.getDate();
var max=date.getMonthDays(m);
if(day>max){
date.setDate(max);
}
date.setMonth(m);
};
switch(el.navtype){
case 400:
Calendar.removeClass(el,"hilite");
var text=Calendar._TT["ABOUT"];
if(typeof text!="undefined"){
text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";
}else{
text="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(text);
return;
case -2:
if(year>cal.minYear){
date.setFullYear(year-1);
}
break;
case -1:
if(mon>0){
_107(mon-1);
}else{
if(year-->cal.minYear){
date.setFullYear(year);
_107(11);
}
}
break;
case 1:
if(mon<11){
_107(mon+1);
}else{
if(year<cal.maxYear){
date.setFullYear(year+1);
_107(0);
}
}
break;
case 2:
if(year<cal.maxYear){
date.setFullYear(year+1);
}
break;
case 100:
cal.setFirstDayOfWeek(el.fdow);
return;
case 50:
var _10c=el._range;
var _10d=el.innerHTML;
for(var i=_10c.length;--i>=0;){
if(_10c[i]==_10d){
break;
}
}
if(ev&&ev.shiftKey){
if(--i<0){
i=_10c.length-1;
}
}else{
if(++i>=_10c.length){
i=0;
}
}
var _10f=_10c[i];
el.innerHTML=_10f;
cal.onUpdateTime();
return;
case 0:
if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){
return false;
}
break;
}
if(!date.equalsTo(cal.date)){
cal.setDate(date);
_102=true;
}else{
if(el.navtype==0){
_102=_101=true;
}
}
}
if(_102){
ev&&cal.callHandler();
}
if(_101){
Calendar.removeClass(el,"hilite");
ev&&cal.callCloseHandler();
}
};
Calendar.prototype.create=function(_par){
var _111=null;
if(!_par){
_111=document.getElementsByTagName("body")[0];
this.isPopup=true;
}else{
_111=_par;
this.isPopup=false;
}
this.date=this.dateStr?new Date(this.dateStr):new Date();
var _112=Calendar.createElement("table");
this.table=_112;
_112.cellSpacing=0;
_112.cellPadding=0;
_112.calendar=this;
Calendar.addEvent(_112,"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(_112);
var _114=Calendar.createElement("thead",_112);
var cell=null;
var row=null;
var cal=this;
var hh=function(text,cs,_11b){
cell=Calendar.createElement("td",row);
cell.colSpan=cs;
cell.className="button";
if(_11b!=0&&Math.abs(_11b)<=2){
cell.className+=" nav";
}
Calendar._add_evs(cell);
cell.calendar=cal;
cell.navtype=_11b;
cell.innerHTML="<div unselectable='on'>"+text+"</div>";
return cell;
};
var _11c=function(text,cs){
cell=Calendar.createElement("td",row);
cell.colSpan=cs;
cell.className="button";
cell.calendar=cal;
cell.innerHTML=" ";
return cell;
};
var hhi=function(_120,cs,_122,id){
cell=Calendar.createElement("td",row);
cell.colSpan=cs;
cell.className="button";
if(_122!=0&&Math.abs(_122)<=2){
cell.className+=" nav";
}
Calendar._add_evs(cell);
cell.calendar=cal;
cell.navtype=_122;
cell.innerHTML="<div unselectable='on' id='"+id+"'></div>";
return cell;
};
row=Calendar.createElement("tr",_114);
var _124=6;
(this.isPopup)&&--_124;
(this.weekNumbers)&&++_124;
hh("?",1,400).ttip=Calendar._TT["INFO"];
this.title=hh("",_124,300);
this.title.className="caltitle";
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",_114);
row.className="headrow";
this._nav_pm=hhi("",2,-1,"back_btn");
this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];
this._nav_now=_11c("",this.weekNumbers?4:3);
this._nav_now.ttip="";
this._nav_nm=hhi("",2,1,"next_btn");
this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];
row=Calendar.createElement("tr",_114);
row.className="daynames";
if(this.weekNumbers){
cell=Calendar.createElement("td",row);
cell.className="name wn";
cell.innerHTML=Calendar._TT["WK"];
}
for(var i=7;i>0;--i){
cell=Calendar.createElement("td",row);
if(!i){
cell.navtype=100;
cell.calendar=this;
Calendar._add_evs(cell);
}
}
this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;
this._displayWeekdays();
var _126=Calendar.createElement("tbody",_112);
this.tbody=_126;
for(i=6;i>0;--i){
row=Calendar.createElement("tr",_126);
if(this.weekNumbers){
cell=Calendar.createElement("td",row);
}
for(var j=7;j>0;--j){
cell=Calendar.createElement("td",row);
cell.calendar=this;
Calendar._add_evs(cell);
}
}
if(this.showsTime){
row=Calendar.createElement("tr",_126);
row.className="time";
cell=Calendar.createElement("td",row);
cell.className="time";
cell.colSpan=2;
cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";
cell=Calendar.createElement("td",row);
cell.className="time";
cell.colSpan=this.weekNumbers?4:3;
(function(){
function _128(_129,init,_12b,_12c){
var part=Calendar.createElement("span",cell);
part.className=_129;
part.innerHTML=init;
part.calendar=cal;
part.ttip=Calendar._TT["TIME_PART"];
part.navtype=50;
part._range=[];
if(typeof _12b!="number"){
part._range=_12b;
}else{
for(var i=_12b;i<=_12c;++i){
var txt;
if(i<10&&_12c>=10){
txt="0"+i;
}else{
txt=""+i;
}
part._range[part._range.length]=txt;
}
}
Calendar._add_evs(part);
return part;
};
var hrs=cal.date.getHours();
var mins=cal.date.getMinutes();
var t12=!cal.time24;
var pm=(hrs>12);
if(t12&&pm){
hrs-=12;
}
var H=_128("hour",hrs,t12?1:0,t12?12:23);
var span=Calendar.createElement("span",cell);
span.innerHTML=":";
span.className="colon";
var M=_128("minute",mins,0,59);
var AP=null;
cell=Calendar.createElement("td",row);
cell.className="time";
cell.colSpan=2;
if(t12){
AP=_128("ampm",pm?"pm":"am",["am","pm"]);
}else{
cell.innerHTML="&nbsp;";
}
cal.onSetTime=function(){
var pm,hrs=this.date.getHours(),mins=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=(mins<10)?("0"+mins):mins;
};
cal.onUpdateTime=function(){
var date=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=date.getDate();
var m=date.getMonth();
var y=date.getFullYear();
date.setHours(h);
date.setMinutes(parseInt(M.innerHTML,10));
date.setFullYear(y);
date.setMonth(m);
date.setDate(d);
this.dateClicked=false;
this.callHandler();
};
})();
}else{
this.onSetTime=this.onUpdateTime=function(){
};
}
var _13e=Calendar.createElement("tfoot",_112);
row=Calendar.createElement("tr",_13e);
row.className="footrow";
cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);
cell.className="ttip";
if(this.isPopup){
cell.ttip=Calendar._TT["DRAG_TO_MOVE"];
cell.style.cursor="move";
}
this.tooltips=cell;
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);
_111.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 prev,x,y,ne,el,step;
prev=K==37||K==38;
step=(K==37||K==39)?1:7;
function _14b(){
el=cal.currentDateEl;
var p=el.pos;
x=p&15;
y=p>>4;
ne=cal.ar_days[y][x];
};
_14b();
function _14d(){
var date=new Date(cal.date);
date.setDate(date.getDate()-step);
cal.setDate(date);
};
function _14f(){
var date=new Date(cal.date);
date.setDate(date.getDate()+step);
cal.setDate(date);
};
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{
_14d();
_14b();
}
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{
_14f();
_14b();
}
break;
}
break;
}
if(ne){
if(!ne.disabled){
Calendar.cellClick(ne);
}else{
if(prev){
_14d();
}else{
_14f();
}
}
}
}
break;
case 13:
if(act){
Calendar.cellClick(cal.currentDateEl,ev);
}
break;
default:
return false;
}
}
return Calendar.stopEvent(ev);
};
Calendar.prototype._init=function(_151,date){
var _153=new Date(),TY=_153.getFullYear(),TM=_153.getMonth(),TD=_153.getDate();
this.table.style.visibility="hidden";
var year=date.getFullYear();
if(year<this.minYear){
year=this.minYear;
date.setFullYear(year);
}else{
if(year>this.maxYear){
year=this.maxYear;
date.setFullYear(year);
}
}
this.firstDayOfWeek=_151;
this.date=new Date(date);
var _158=date.getMonth();
var mday=date.getDate();
var _15a=date.getMonthDays();
date.setDate(1);
var day1=(date.getDay()-this.firstDayOfWeek)%7;
if(day1<0){
day1+=7;
}
date.setDate(-day1);
date.setDate(date.getDate()+1);
var row=this.tbody.firstChild;
var MN=Calendar._SMN[_158];
var _15e=this.ar_days=new Array();
var _15f=Calendar._TT["WEEKEND"];
var _160=this.multiple?(this.datesCells={}):null;
for(var i=0;i<6;++i,row=row.nextSibling){
var cell=row.firstChild;
if(this.weekNumbers){
cell.className="day wn";
cell.innerHTML=date.getWeekNumber();
cell=cell.nextSibling;
}
row.className="daysrow";
var _163=false,iday,dpos=_15e[i]=[];
for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){
iday=date.getDate();
var wday=date.getDay();
cell.className="day";
cell.pos=i<<4|j;
dpos[j]=cell;
var _168=(date.getMonth()==_158);
if(!_168){
if(this.showsOtherMonths){
cell.className+=" othermonth";
cell.otherMonth=true;
}else{
cell.className="emptycell";
cell.innerHTML="&nbsp;";
cell.disabled=true;
continue;
}
}else{
cell.otherMonth=false;
_163=true;
}
cell.disabled=false;
cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;
if(this.startDate!=null&&this.endDate!=null){
if(date<this.startDate||date>this.endDate){
cell.className="day outofrange";
}
}
if(_160){
_160[date.print("%Y%m%d")]=cell;
}
if(this.getDateStatus){
var _169=this.getDateStatus(date,year,_158,iday);
if(this.getDateToolTip){
var _16a=this.getDateToolTip(date,year,_158,iday);
if(_16a){
cell.title=_16a;
}
}
if(_169===true){
cell.className+=" disabled";
cell.disabled=true;
}else{
if(/disabled/i.test(_169)){
cell.disabled=true;
}
cell.className+=" "+_169;
}
}
if(!cell.disabled){
cell.caldate=new Date(date);
cell.ttip="_";
if(!this.multiple&&_168&&iday==mday&&this.hiliteToday){
cell.className+=" selected";
this.currentDateEl=cell;
}
if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){
cell.className+=" today";
cell.ttip+=Calendar._TT["PART_TODAY"];
}
if(_15f.indexOf(wday.toString())!=-1){
cell.className+=cell.otherMonth?" oweekend":" weekend";
}
}
}
if(!(_163||this.showsOtherMonths)){
row.className="emptyrow";
}
}
this.title.innerHTML=Calendar._MN[_158]+", "+year;
this.onSetTime();
this.table.style.visibility="visible";
this._initMultipleDates();
};
Calendar.prototype._initMultipleDates=function(){
if(this.multiple){
for(var i in this.multiple){
var cell=this.datesCells[i];
var d=this.multiple[i];
if(!d){
continue;
}
if(cell){
cell.className+=" selected";
}
}
}
};
Calendar.prototype._toggleMultipleDate=function(date){
if(this.multiple){
var ds=date.print("%Y%m%d");
var cell=this.datesCells[ds];
if(cell){
var d=this.multiple[ds];
if(!d){
Calendar.addClass(cell,"selected");
this.multiple[ds]=date;
}else{
Calendar.removeClass(cell,"selected");
delete this.multiple[ds];
}
}
}
};
Calendar.prototype.setDateToolTipHandler=function(_172){
this.getDateToolTip=_172;
};
Calendar.prototype.setDate=function(date){
if(!date.equalsTo(this.date)){
this._init(this.firstDayOfWeek,date);
}
};
Calendar.prototype.refresh=function(){
this._init(this.firstDayOfWeek,this.date);
};
Calendar.prototype.setFirstDayOfWeek=function(_174){
this._init(_174,this.date);
this._displayWeekdays();
};
Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(_175){
this.getDateStatus=_175;
};
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(_179){
var el=this.element;
el.parentNode.removeChild(el);
_179.appendChild(el);
};
Calendar._checkCalendar=function(ev){
var _17c=window._dynarch_popupCalendar;
if(!_17c){
return false;
}
var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);
for(;el!=null&&el!=_17c.element;el=el.parentNode){
}
if(el==null){
window._dynarch_popupCalendar.callCloseHandler();
return Calendar.stopEvent(ev);
}
};
Calendar.prototype.show=function(){
var rows=this.table.getElementsByTagName("tr");
for(var i=rows.length;i>0;){
var row=rows[--i];
Calendar.removeClass(row,"rowhilite");
var _181=row.getElementsByTagName("td");
for(var j=_181.length;j>0;){
var cell=_181[--j];
Calendar.removeClass(cell,"hilite");
Calendar.removeClass(cell,"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,opts){
var self=this;
var p=Calendar.getAbsolutePos(el);
if(!opts||typeof opts!="string"){
this.showAt(p.x,p.y+el.offsetHeight);
return true;
}
function _18b(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_khtml_browser=function(){
var w=self.element.offsetWidth;
var h=self.element.offsetHeight;
self.element.style.display="none";
var _193=opts.substr(0,1);
var _194="l";
if(opts.length>1){
_194=opts.substr(1,1);
}
switch(_193){
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(_194){
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;
self.monthsCombo.style.display="none";
_18b(p);
self.showAt(p.x,p.y);
};
if(Calendar.is_khtml){
setTimeout("Calendar.continuation_for_the_khtml_browser()",10);
}else{
Calendar.continuation_for_the_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 _199(obj){
var _19b=obj.style.visibility;
if(!_19b){
if(document.defaultView&&typeof (document.defaultView.getComputedStyle)=="function"){
if(!Calendar.is_khtml){
_19b=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility");
}else{
_19b="";
}
}else{
if(obj.currentStyle){
_19b=obj.currentStyle.visibility;
}else{
_19b="";
}
}
}
return _19b;
};
var tags=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=tags.length;k>0;){
var ar=document.getElementsByTagName(tags[--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=_199(cc);
}
cc.style.visibility=cc.__msh_save_visibility;
}else{
if(!cc.__msh_save_visibility){
cc.__msh_save_visibility=_199(cc);
}
cc.style.visibility="hidden";
}
}
}
};
Calendar.prototype._displayWeekdays=function(){
var fdow=this.firstDayOfWeek;
var cell=this.firstdayname;
var _1ad=Calendar._TT["WEEKEND"];
for(var i=0;i<7;++i){
cell.className="day name";
var _1af=(i+fdow)%7;
if(i){
cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[_1af]);
cell.navtype=100;
cell.calendar=this;
cell.fdow=_1af;
Calendar._add_evs(cell);
}
if(_1ad.indexOf(_1af.toString())!=-1){
Calendar.addClass(cell,"weekend");
}
cell.innerHTML=Calendar._SDN[(i+fdow)%7];
cell=cell.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 posX;
var posY;
if(Calendar.is_ie){
posY=window.event.clientY+document.body.scrollTop;
posX=window.event.clientX+document.body.scrollLeft;
}else{
posY=ev.clientY+window.scrollY;
posX=ev.clientX+window.scrollX;
}
var st=this.element.style;
this.xOffs=posX-parseInt(st.left);
this.yOffs=posY-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 _1b6=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=_1b6.getFullYear();
}
if(isNaN(m)){
m=_1b6.getMonth();
}
if(isNaN(d)){
d=_1b6.getDate();
}
if(isNaN(hr)){
hr=_1b6.getHours();
}
if(isNaN(min)){
min=_1b6.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=_1b6.getFullYear();
}
if(m!=-1&&d!=0){
return new Date(y,m,d,hr,min,0);
}
return _1b6;
};
Date.prototype.getMonthDays=function(_1c1){
var year=this.getFullYear();
if(typeof _1c1=="undefined"){
_1c1=this.getMonth();
}
if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&_1c1==1){
return 29;
}else{
return Date._MD[_1c1];
}
};
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._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");
Calendar._FD=0;
Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
Calendar._TT={};
Calendar._TT["INFO"]="About the calendar";
Calendar._TT["ABOUT"]="DHTML Date/Time Selector\n"+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n"+"For latest version visit: http://www.dynarch.com/projects/calendar/\n"+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details."+"\n\n"+"Date selection:\n"+"- Use the ?, ? buttons to select year\n"+"- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n"+"- Hold mouse button on any of the above buttons for faster selection.";
Calendar._TT["ABOUT_TIME"]="\n\n"+"Time selection:\n"+"- Click on any of the time parts to increase it\n"+"- or Shift-click to decrease it\n"+"- or click and drag for faster selection.";
Calendar._TT["PREV_YEAR"]="Prev. year (hold for menu)";
Calendar._TT["PREV_MONTH"]="Prev. month (hold for menu)";
Calendar._TT["GO_TODAY"]="Go Today";
Calendar._TT["NEXT_MONTH"]="Next month (hold for menu)";
Calendar._TT["NEXT_YEAR"]="Next year (hold for menu)";
Calendar._TT["SEL_DATE"]="Select date";
Calendar._TT["DRAG_TO_MOVE"]="Drag to move";
Calendar._TT["PART_TODAY"]=" (today)";
Calendar._TT["DAY_FIRST"]="Display %s first";
Calendar._TT["WEEKEND"]="0,6";
Calendar._TT["CLOSE"]="Close";
Calendar._TT["TODAY"]="Today";
Calendar._TT["TIME_PART"]="(Shift-)Click or drag to change value";
Calendar._TT["DEF_DATE_FORMAT"]="%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"]="%a, %b %e";
Calendar._TT["WK"]="wk";
Calendar._TT["TIME"]="Time:";
Calendar.setup=function(_1e0){
function _1e1(_1e2,def){
if(typeof _1e0[_1e2]=="undefined"){
_1e0[_1e2]=def;
}
};
_1e1("inputField",null);
_1e1("inputFields",null);
_1e1("displayArea",null);
_1e1("button",null);
_1e1("eventName","click");
_1e1("ifFormat","%Y/%m/%d");
_1e1("daFormat","%Y/%m/%d");
_1e1("singleClick",true);
_1e1("disableFunc",null);
_1e1("dateStatusFunc",_1e0["disableFunc"]);
_1e1("dateText",null);
_1e1("firstDay",null);
_1e1("align","Br");
_1e1("range",[1900,2999]);
_1e1("weekNumbers",false);
_1e1("flat",null);
_1e1("flatCallback",null);
_1e1("onSelect",null);
_1e1("onClose",null);
_1e1("onUpdate",null);
_1e1("date",null);
_1e1("showsTime",false);
_1e1("timeFormat","24");
_1e1("electric",true);
_1e1("step",1);
_1e1("position",null);
_1e1("cache",false);
_1e1("showOthers",false);
_1e1("multiple",null);
_1e1("startDate",null);
_1e1("endDate",null);
var tmp=["inputField","displayArea","button"];
for(var i in tmp){
if(typeof _1e0[tmp[i]]=="string"){
_1e0[tmp[i]]=document.getElementById(_1e0[tmp[i]]);
}
}
function _1e6(cal){
var p=cal.params;
var _1e9=false;
var _1ea=(cal.dateClicked||p.electric);
if(_1ea&&p.inputField){
p.inputField.value=cal.date.print(p.ifFormat);
if(typeof p.inputField.onchange=="function"){
p.inputField.onchange();
}
}
if(_1ea&&p.displayArea){
p.displayArea.innerHTML=cal.date.print(p.daFormat);
}
if(_1ea&&typeof p.onUpdate=="function"&&cal.dateClicked){
_1e9=true;
}
if(_1e9){
p.onUpdate(cal);
}else{
return false;
}
if(_1ea&&p.flat){
if(typeof p.flatCallback=="function"){
p.flatCallback(cal);
}
}
if(_1ea&&p.singleClick&&cal.dateClicked){
cal.callCloseHandler();
}
};
if(_1e0.flat!=null){
if(typeof _1e0.flat=="string"){
_1e0.flat=document.getElementById(_1e0.flat);
}
if(!_1e0.flat){
alert("Calendar.setup:\n  Flat specified but can't find parent.");
return false;
}
var cal=new Calendar(_1e0.firstDay,_1e0.date,_1e0.onSelect||_1e6);
cal.showsOtherMonths=_1e0.showOthers;
cal.showsTime=_1e0.showsTime;
cal.time24=(_1e0.timeFormat=="24");
cal.params=_1e0;
cal.weekNumbers=_1e0.weekNumbers;
cal.setRange(_1e0.range[0],_1e0.range[1]);
cal.setDateStatusHandler(_1e0.dateStatusFunc);
cal.getDateText=_1e0.dateText;
if(_1e0.ifFormat){
cal.setDateFormat(_1e0.ifFormat);
}
if(_1e0.inputField&&typeof _1e0.inputField.value=="string"){
cal.parseDate(_1e0.inputField.value);
}
cal.create(_1e0.flat);
cal.show();
return false;
}
var _1ec=_1e0.button;
_1ec["on"+_1e0.eventName]=function(){
var _1ed=_1e0.inputField||_1e0.displayArea;
var _1ee=_1e0.inputField?_1e0.ifFormat:_1e0.daFormat;
var _1ef=false;
var cal=window.calendar;
if(_1ed){
_1e0.date=Date.parseDate(_1ed.value||_1ed.innerHTML,_1ee);
}
if(!(cal&&_1e0.cache)){
window.calendar=cal=new Calendar(_1e0.firstDay,_1e0.date,_1e0.onSelect||_1e6,_1e0.onClose||function(cal){
cal.hide();
});
cal.showsTime=_1e0.showsTime;
cal.time24=(_1e0.timeFormat=="24");
cal.weekNumbers=_1e0.weekNumbers;
_1ef=true;
}else{
if(_1e0.date){
cal.setDate(_1e0.date);
}
cal.hide();
}
if(_1e0.multiple){
cal.multiple={};
for(var i=_1e0.multiple.length;--i>=0;){
var d=_1e0.multiple[i];
var ds=d.print("%Y%m%d");
cal.multiple[ds]=d;
}
}
if(typeof _1e0.custom=="object"){
cal.custom=_1e0.custom;
}
cal.startDate=_1e0.startDate;
cal.endDate=_1e0.endDate;
cal.showsOtherMonths=_1e0.showOthers;
cal.yearStep=_1e0.step;
cal.setRange(_1e0.range[0],_1e0.range[1]);
cal.params=_1e0;
cal.setDateStatusHandler(_1e0.dateStatusFunc);
cal.getDateText=_1e0.dateText;
cal.setDateFormat(_1ee);
if(_1ef){
cal.create();
}
cal.refresh();
if(!_1e0.position){
cal.showAtElement(_1e0.button||_1e0.displayArea||_1e0.inputField,_1e0.align);
}else{
cal.showAt(_1e0.position[0],_1e0.position[1]);
}
return false;
};
return cal;
};
function validateComboFlightForm(fm){
var _1f6=new Date(now.getFullYear(),now.getMonth(),now.getDate());
var _1f7=fm.iDepDay.options[fm.iDepDay.selectedIndex].value;
var _1f8=fm.iRetDay.options[fm.iRetDay.selectedIndex].value;
var _1f9=fm.sDepMth.options[fm.sDepMth.selectedIndex].value;
var _1fa=fm.sRetMth.options[fm.sRetMth.selectedIndex].value;
var _1fb=_1f9.substring(0,4);
var _1fc=_1f9.substring((_1f9.length-2));
var _1fd=_1f9.substring((_1f9.length-2))-1;
var _1fe=_1fa.substring(0,4);
var _1ff=_1fa.substring((_1fa.length-2));
var _200=_1fa.substring((_1fa.length-2))-1;
if(_1fc<10){
_1fc=_1fc.substring((_1fc.length-1));
}
if(_1ff<10){
_1ff=_1ff.substring((_1ff.length-1));
}
if(fm.sDepart.selectedIndex==-1){
alert("Please select a departure airport.");
fm.sDepart.focus();
return false;
}
if(fm.sArrival.value==""){
alert("Please enter a destination city or airport code.");
fm.sArrival.focus();
return false;
}
if(fm.iDepDay.selectedIndex==-1){
alert("Please select a departure day.");
fm.iDepDay.focus();
return false;
}
if(fm.iRetDay.selectedIndex==-1){
alert("Please select a return day.");
fm.iRetDay.focus();
return false;
}
if(!DateOK(_1fb,_1fc,_1f7)){
alert("Please enter a valid departure date.");
fm.iDepDay.focus();
return false;
}
if(!DateOK(_1fe,_1ff,_1f8)){
alert("Please enter a valid return date.");
fm.iDepDay.focus();
return false;
}
var _201=new Date(_1fb,_1fd,_1f7);
var _202=timeDifference(_201,_1f6,"d");
if(_202<1){
alert("Your departure date must be after today.");
fm.iDepDay.focus();
return false;
}
var _203=new Date(_1fe,_200,_1f8);
var _204=timeDifference(_203,_201,"d");
if(_204<0){
alert("Your return date must be the same or a later date than your departure date.");
fm.iDepDay.focus();
return false;
}
processComboFlightForm(fm);
};
function processComboFlightForm(fm){
var _206="";
var _207=0;
if(typeof document.flightComboForm.partner!="undefined"){
if(typeof document.flightComboForm.partner.type=="hidden"){
_206=document.flightComboForm.partner.value;
_207=1;
}
}
if(_207==0){
for(i=0;i<fm.partner.length;i++){
if(fm.partner[i].checked){
_206=fm.partner[i].value;
break;
}
}
}
if(_206=="ebookers"){
fm.DEP.value=fm.sDepart.options[fm.sDepart.selectedIndex].value;
fm.LARR.value=fm.sArrival.value;
fm.DAY_DATE.value=fm.iDepDay.value;
fm.MONTH_DATE.value=fm.sDepMth.value;
fm.DAY_RDATE.value=fm.iRetDay.value;
fm.MONTH_RDATE.value=fm.sRetMth.value;
fm.PAX0.value=fm.iNoAdult.options[fm.iNoAdult.selectedIndex].value;
fm.PAX1.value=fm.iNoChild.options[fm.iNoChild.selectedIndex].value;
fm.PAX2.value=fm.iNoInfant.options[fm.iNoInfant.selectedIndex].value;
if(fm.bDirect.checked){
fm.DIRECT.value=1;
}
fm.method="POST";
fm.action="http://www.ebookers.com/afo/flights/wait1.html";
}else{
var _208=fm.iDepDay.options[fm.iDepDay.selectedIndex].value;
var _209=fm.iRetDay.options[fm.iRetDay.selectedIndex].value;
var _20a=fm.sDepMth.options[fm.sDepMth.selectedIndex].value;
var _20b=fm.sRetMth.options[fm.sRetMth.selectedIndex].value;
var _20c=_20a.substring(0,4);
var _20d=_20a.substring((_20a.length-2));
var _20e=_20b.substring(0,4);
var _20f=_20b.substring((_20b.length-2));
if(_20d<10){
_20d=_20d.substring((_20d.length-1));
}
if(_20f<10){
_20f=_20f.substring((_20f.length-1));
}
fm.TYPE.value="Round/Trip";
fm.departure.value=fm.sDepart.options[fm.sDepart.selectedIndex].value;
fm.partner.value="wanadoo";
fm.arrival.value=fm.sArrival.value;
fm.dday.value=_208;
fm.dmonth.value=_20d;
fm.dyear.value=_20c;
fm.rday.value=_209;
fm.rmonth.value=_20f;
fm.ryear.value=_20e;
fm.nbadults.value=fm.iNoAdult.options[fm.iNoAdult.selectedIndex].value;
fm.nbchilds.value=fm.iNoChild.options[fm.iNoChild.selectedIndex].value;
fm.nbbabies.value=fm.iNoInfant.options[fm.iNoInfant.selectedIndex].value;
fm.method="GET";
fm.action="http://wanadoo.kelkoo.co.uk/ctl/do/checkFlight";
}
return true;
};
monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
shortMonthNames=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
daysInMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
now=new Date();
dayInMS=24*60*60*1000;
weekInMS=7*24*60*60*1000;
yearInMS=365*24*60*60*1000;
startDate=new Date(Date.parse(now)+dayInMS);
endDate=new Date(Date.parse(startDate)+weekInMS);
finalDate=new Date(Date.parse(startDate)+yearInMS);
var Today=new Date();
function DateOK(Y,M,D){
var L=daysInMonth[M-1];
return D>0&&!!L&&(D<=L||D==29&&Y%4==0&&(Y%100!=0||Y%400==0));
};
function to2digits(no){
thestrNo=""+no;
return ((thestrNo.length==1)?"0":"")+thestrNo;
};
function generateMonthOptions(_215,_216){
for(monthNo=_215.getMonth();monthNo<12;monthNo++){
document.write("<OPTION value=\""+(_215.getFullYear())+to2digits(monthNo+1)+"\"");
if(monthNo==_215.getMonth()){
document.write(" SELECTED");
}
if(typeof _216!="undefined"&&_216=="short"){
document.write(">"+shortMonthNames[monthNo]+"&nbsp;"+to2digits((now.getFullYear())-2000)+"</OPTION>");
}else{
document.write(">"+monthNames[monthNo]+"&nbsp;"+to2digits((now.getFullYear())-2000)+"</OPTION>");
}
}
for(monthNo=0;monthNo<_215.getMonth();monthNo++){
document.write("<OPTION value=\""+(_215.getFullYear()+1)+to2digits(monthNo+1)+"\"");
if(monthNo==_215.getMonth()){
document.write(" SELECTED");
}
if(typeof _216!="undefined"&&_216=="short"){
document.write(">"+shortMonthNames[monthNo]+"&nbsp;"+to2digits((now.getFullYear()+1)-2000)+"</OPTION>");
}else{
document.write(">"+monthNames[monthNo]+"&nbsp;"+to2digits((now.getFullYear()+1)-2000)+"</OPTION>");
}
}
};
function generateDaysOptions(){
for(i=0;i<31;i++){
iVal=i+1;
document.write("<option value=\""+iVal+"\">"+to2digits(iVal)+"</option>");
}
};
function timeDifference(_217,_218,_219){
var _21a=_217.getTime()-_218.getTime();
var _21b=Math.floor(_21a/1000/60/60/24);
_21a-=_21b*1000*60*60*24;
var _21c=Math.floor(_21a/1000/60/60);
_21a-=_21c*1000*60*60;
var _21d=Math.floor(_21a/1000/60);
_21a-=_21d*1000*60;
var _21e=Math.floor(_21a/1000);
if(_219=="d"){
return _21b;
}
if(_219=="h"){
return _21c;
}
if(_219=="m"){
return _21d;
}
if(_219=="s"){
return _21e;
}
};
function initValues(_21f){
try{
document.forms[_21f].iDepDay.selectedIndex=startDate.getDate()-1;
document.forms[_21f].iRetDay.selectedIndex=endDate.getDate()-1;
var _220=endDate.getMonth()-startDate.getMonth();
if(_220<0&&endDate.getFullYear()>startDate.getFullYear()){
_220=_220+12;
}
document.forms[_21f].sRetMth.selectedIndex=_220;
}
catch(e){
}
};
function callbackCalendar(){
if(startDate<=calendar.date&&calendar.date<=finalDate){
var _221=calendar.date.getDate()-1;
var _222=startDate.getMonth();
var _223=calendar.date.getMonth();
var _224=_223-_222;
if(_224<0&&calendar.date.getFullYear()>startDate.getFullYear()){
_224=_224+12;
}
var _225=eval(calendar.custom.dayFld);
var _226=eval(calendar.custom.monFld);
_225.selectedIndex=_221;
_226.selectedIndex=_224;
}else{
alert("Please select a date between "+displayCalendarDate(startDate)+" and "+displayCalendarDate(finalDate));
}
};
function callbackTPCalendar(){
if(startDate<=calendar.date&&calendar.date<=finalDate){
var _227=calendar.date.getDate()-1;
var _228=startDate.getMonth();
var _229=calendar.date.getMonth();
var _22a=new String(calendar.date.getFullYear());
var _22b=_229-_228;
if(_22b<0&&calendar.date.getFullYear()>startDate.getFullYear()){
_22b=_22b+12;
}
var _22c=eval(calendar.custom.dayFld);
var _22d=eval(calendar.custom.monFld);
var _22e=eval(calendar.custom.yrFld);
_22c.value=_227+1;
_22d.value=_229+1;
_22e.value=_22a.substring(2,4);
updateFlightDates();
}else{
alert("Please select a date between "+displayCalendarDate(startDate)+" and "+displayCalendarDate(finalDate));
}
};
function updateFlightDates(){
var _22f=document.forms["tp_flighttool"]["iDepDay"];
var _230=document.forms["tp_flighttool"]["sDepMth"];
var _231=document.forms["tp_flighttool"]["sDepYr"];
if(_22f.value!=""){
var _232=_22f.value;
var _233=_230.value;
var _234=_231.value;
if(_232.length==1){
_232="0"+_232;
}
if(_233.length==1){
_233="0"+_233;
}
var _235=_232+"/"+_233+"/"+_234;
document.forms["tp_flighttool"]["ddate"].value=_235;
}
var _236=document.forms["tp_flighttool"]["iRetDay"];
var _237=document.forms["tp_flighttool"]["sRetMth"];
var _238=document.forms["tp_flighttool"]["sRetYr"];
if(_236.value!=""){
var _239=_236.value;
var _23a=_237.value;
var _23b=_238.value;
if(_239.length==1){
_239="0"+_239;
}
if(_23a.length==1){
_23a="0"+_23a;
}
var _23c=_239+"/"+_23a+"/"+_23b;
document.forms["tp_flighttool"]["rdate"].value=_23c;
}
};
function displayCalendarDate(_23d){
var str=padZeros(_23d.getDate())+"/"+padZeros(_23d.getMonth()+1)+"/"+_23d.getFullYear();
return str;
};
function padZeros(num){
if(num<10){
return "0"+num;
}else{
return num;
}
};
if(typeof Hos=="undefined"){
Hos={};
}
if(typeof Hos.Banner=="undefined"){
Hos.Banner={};
}
Hos.Banner={loadDates:function(){
var _240=new Date();
var _241=_240.getMonth();
var _242=_240.getUTCFullYear();
var _243=[];
var _244=[];
var _245=[];
var _246=["2009"];
var _247=["2009"];
var x=0;
while(_240.getMonth()==_241){
_244[x]=_240.getDate();
_240.setDate(_240.getDate()+1);
x++;
}
_240.setMonth(_241);
_240.setYear(_242);
if(document.getElementById("dayDDL").selectedIndex>=0){
Hos.Banner.popDays(_244,_244,document.searchForm.dayDDL.options[document.getElementById("dayDDL").selectedIndex].value);
}else{
Hos.Banner.popDays(_244,_244);
}
var z=0;
do{
_243[z]=(_240.getMonth()<9)?"0"+(_240.getMonth()+1):(_240.getMonth()+1);
_245[z]=(_240.getMonth()+1);
_240.setMonth(_240.getMonth()+1);
z++;
}while(_240.getFullYear()<=2009);
Hos.Banner.popMonth(_243,_245);
Hos.Banner.popYear(_246,_247);
},monthDDL_onchange:function(year,_24b){
var _24c=new Date();
var _24d=new Date(year,parseInt(_24b)-1,1);
var _24e=[];
var x=0;
if(_24d.getMonth()!==_24c.getMonth()){
while(_24d.getMonth()==parseInt(_24b)-1){
_24e[x]=_24d.getDate();
_24d.setDate(_24d.getDate()+1);
x++;
}
}else{
Hos.Banner.loadDates();
return false;
}
Hos.Banner.popDays(_24e,_24e,document.searchForm.dayDDL.options[document.getElementById("dayDDL").selectedIndex].value);
},popDays:function(_250,_251,_252){
Hos.Banner.removeAllOptions(document.searchForm.dayDDL);
for(var i=0;i<_250.length;i++){
var _254=false;
if(parseInt(_252)==parseInt(_251[i])){
_254=true;
}
Hos.Banner.addOption(document.searchForm.dayDDL,_250[i],_251[i],_254);
}
},popMonth:function(_255,_256){
Hos.Banner.removeAllOptions(document.searchForm.monthDDL);
for(var i=0;i<_255.length;++i){
Hos.Banner.addOption(document.searchForm.monthDDL,_255[i],_256[i]);
}
},popYear:function(_258,_259){
Hos.Banner.removeAllOptions(document.searchForm.yearDDL);
for(var i=0;i<_258.length;++i){
Hos.Banner.addOption(document.searchForm.yearDDL,_258[i],_259[i]);
}
},addOption:function(_25b,text,_25d,_25e){
var optn=document.createElement("OPTION");
optn.text=text;
optn.value=_25d;
if(_25e){
optn.selected=true;
}
_25b.options.add(optn);
},removeAllOptions:function(_260){
var i;
for(i=_260.options.length-1;i>=0;i--){
_260.remove(i);
}
},validateSelections:function(){
var _262=new Array("","","");
var _263=false;
if(document.getElementById("hos_region").selectedIndex==0){
_262[0]="- Holiday area";
_263=true;
}
if(_263){
alert("Please Select the following: "+"\n"+"\n"+_262[0]+"\n"+_262[1]+"\n"+_262[2]);
return false;
}else{
return true;
}
},submitSearch:function(){
Hos.Banner.setHiddenSearchValues();
document.getElementById("hos_hiddenSearchForm").submit();
},setHiddenSearchValues:function(){
document.getElementById("hos_hiddenSearchForm_SDATE").value=document.searchForm.yearDDL.options[document.getElementById("yearDDL").selectedIndex].value+"-"+document.searchForm.monthDDL.options[document.getElementById("monthDDL").selectedIndex].value+"-"+document.searchForm.dayDDL.options[document.getElementById("dayDDL").selectedIndex].value;
document.getElementById("hos_hiddenSearchForm_RCODE").value=document.getElementById("hos_region").options[document.getElementById("hos_region").selectedIndex].value;
document.getElementById("hos_hiddenSearchForm_DURTN").value=document.getElementById("hos_nights").options[document.getElementById("hos_nights").selectedIndex].value;
}};
function LargeGalleryView(id,_265,_266){
this.current_image_order_id=parseInt(_265);
this.image_array=new Array();
this.current_image_order_id=_265;
this.id=id;
this.total_images=_266;
};
LargeGalleryView.prototype.addImageToArray=function(_267,_268,_269,_26a){
this.image_array[_267]=new Array();
this.image_array[_267]["image_description"]=_26a;
this.image_array[_267]["image_src"]=_268;
this.image_array[_267]["image_alt"]=_269;
};
LargeGalleryView.prototype.init=function(){
this.image_dom_node=document.getElementById("image_"+this.id);
this.description_dom_node=document.getElementById("description_"+this.id);
this.image_no_dom_node=document.getElementById("image_no_"+this.id);
this.prev_button_dom_node=document.getElementById("prev_button_"+this.id);
this.next_button_dom_node=document.getElementById("next_button_"+this.id);
};
LargeGalleryView.prototype.selectImage=function(diff){
if(!this.image_dom_node||!this.description_dom_node){
this.init();
}
var _26c=parseInt(this.current_image_order_id)+diff;
if(this.image_array[_26c]){
this.image_dom_node.alt=this.image_array[_26c]["image_alt"];
this.image_dom_node.src=this.image_array[_26c]["image_src"];
this.description_dom_node.innerHTML=this.image_array[_26c]["image_description"];
this.image_no_dom_node.innerHTML=_26c;
this.current_image_order_id=_26c;
if(this.current_image_order_id==this.total_images){
this.next_button_dom_node.style.display="none";
}else{
if(this.next_button_dom_node.style.display!="inline"){
this.next_button_dom_node.style.display="inline";
}
}
if(this.current_image_order_id==1){
this.prev_button_dom_node.style.display="none";
}else{
if(this.prev_button_dom_node.style.display!="inline"){
this.prev_button_dom_node.style.display="inline";
}
}
}
};
function LinkList(id){
this.id=id;
this.togglestate=0;
this.limit=5;
this.component=document.getElementById(this.id);
this.morelink=document.getElementById("morelink_"+this.id);
};
LinkList.prototype.toggle=function(){
if(this.component){
var list=this.component.getElementsByTagName("li");
if(list){
if(this.togglestate==1){
var _26f="none";
this.togglestate=0;
this.morelink.innerHTML="more";
}else{
var _26f="block";
this.togglestate=1;
this.morelink.innerHTML="less";
}
for(var i=this.limit;i<list.length;i++){
list[i].style.display=_26f;
}
}
}
return false;
};
function monkeyMusic_playMonkeyDemo(_271,_272){
console.log("Playing monkey demo");
OpenWindow=window.open("","MonkeyDemo",config="status=no, statusbar=no, menubar=no, scrollbars=no, toolbar=no, location=no, locationbar=no, directories=no, personalbar=no, titlebar=no, resizable=no, width=530, height=350");
OpenWindow.document.write("<html>");
OpenWindow.document.write("<title>Monkey Demo</title>");
OpenWindow.document.write("<body bgcolor=\"black\">");
OpenWindow.document.write("<object id=\"flashObj\" width=\"512\" height=\"334\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0\">");
OpenWindow.document.write("<param name=\"movie\" value=\"http://c.brightcove.com/services/viewer/federated_f9/"+_272+"?isVid=1&publisherID=1815805388\" />");
OpenWindow.document.write("<param name=\"bgcolor\" value=\"#FFFFFF\" />");
OpenWindow.document.write("<param name=\"flashVars\" value=\"@videoPlayer="+_271+"&playerID="+_272+"&domain=embed&\" />");
OpenWindow.document.write("<param name=\"base\" value=\"http://admin.brightcove.com\" />");
OpenWindow.document.write("<param name=\"seamlesstabbing\" value=\"false\" />");
OpenWindow.document.write("<param name=\"allowFullScreen\" value=\"true\" />");
OpenWindow.document.write("<param name=\"swLiveConnect\" value=\"true\" />");
OpenWindow.document.write("<param name=\"allowScriptAccess\" value=\"always\" />");
OpenWindow.document.write("<embed src=\"http://c.brightcove.com/services/viewer/federated_f9/"+_272+"?isVid=1&publisherID=181505388\" bgcolor=\"#FFFFFF\" flashVars=\"@videoPlayer="+_271+"&playerID="+_272+"&domain=embed&\" base=\"http://admin.brightcove.com\" name=\"flashObj\" width=\"512\" height=\"334\" seamlesstabbing=\"false\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" swLiveConnect=\"true\" allowScriptAccess=\"always\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">");
OpenWindow.document.write("</embed>");
OpenWindow.document.write("</object>");
OpenWindow.document.write("</body>");
OpenWindow.document.write("</html>");
OpenWindow.document.close();
return;
};
function monkeyMusic_playMonkeyDemoLB(id,_274,_275){
console.log("In lightbox: "+id);
var _276="lightbox_"+id;
var _277=dijit.byId(_276);
if(_277){
_277.duration=1;
_276="#"+_276;
if(dojo.isIE){
dojo.query(_276)[0].style.display="block";
}
_277.show();
console.log("showing dialog ",_277);
var _278=document.getElementById("TrackingTag");
_278.appendChild(addTrackingTag("Orange_monkey","monkey_intro","Monkey_site"));
}
};
function addTrackingTag(_279,_27a,_27b){
console.log("Adding tracking tag. Campaign: "+_279+", Creative: "+_27a+", Flight: "+_27b);
var _27c=document.createElement("img");
_27c.style.display="none";
_27c.width="0";
_27c.height="0";
_27c.src="http://adtracker.valuedopinions.co.uk/track.aspx?Campaign="+_279+"&Creative="+_27a+"&Flight="+_27b;
return _27c;
};
function MonkeyForm(id){
this.id=id;
this.component=document.getElementById(this.id);
};
MonkeyForm.prototype.addExtraField=function(name){
if(this.component){
var _27f=document.createElement("input");
if(_27f){
_27f.setAttribute("type","hidden");
_27f.setAttribute("value","1");
_27f.setAttribute("name",name);
this.component.appendChild(_27f);
}
}
return;
};
function validateMonkeyJoinForm(_280,_281){
var _282=document.getElementById(_281);
var _283=false;
var _284=[_280.firstName,_280.surname,_280.emailAddress,_280.human_confirm_em,_280.address1,_280.address2,_280.address4,_280.postcode];
for(var i=0;i<_284.length;i++){
if(!_validateNonBlankField(_284[i])){
_283=true;
}
}
if(_280.human_confirm_em.value!=_280.emailAddress.value){
_markError(_280.human_confirm_em);
_283=true;
}
if(_283){
_282.style.display="block";
return false;
}
return true;
};
function _validateNonBlankField(_286){
if(_286.value==""){
_markError(_286);
return false;
}else{
_clearError(_286);
return true;
}
};
function _markError(_287){
var n=_287.parentNode;
if(!n.className.match("error")){
n.className+=n.className?" error":"error";
}
};
function _clearError(_289){
var n=_289.parentNode;
n.className=n.className.replace(/\s?error/,"");
};
var popUpWindow=null;
function openPopup(url,name,top,left,_28f,_290,_291){
popUpWindow=window.open(url,name,"top="+top+", left="+left+", width="+_28f+", height="+_290+", "+_291);
};
function closePopupAndOpenNewWindows(x){
popUpWindow.close();
window.open(x);
};
var popUpWindow=null;
var MonkeyLaunchParams=null;
var MonkeySSO={clicked:function(id,_294){
console.log("In lightbox: "+id);
console.log("params: ",_294);
MonkeyLaunchParams=_294;
var _295="lightbox_"+id;
var _296=dijit.byId(_295);
if(_296){
_296.duration=1;
_295="#"+_295;
if(dojo.isIE){
dojo.query(_295)[0].style.display="block";
}
_296.show();
console.log("showing dialog ",_296);
}
}};
function closeLightbox(id){
var _298="lightbox_"+id;
var _299=dijit.byId(_298);
_299.hide();
};
function numbersOnly(evt){
var key;
if(window.event){
key=window.event.keyCode;
}else{
if(evt.which){
key=evt.which;
}else{
return true;
}
}
keychar=String.fromCharCode(key);
numcheck=/\d/;
return numcheck.test(keychar)||(key==8);
};
function checkMonkeyLogin(id,_29d){
var _29e=document.getElementById(id+"_msisdn").value;
var _29f=document.getElementById(id+"_password").value;
var _2a0=document.getElementById("monkey_"+id+"_errors");
var _2a1=document.getElementById("monkey_"+id+"_extrainfotitle");
var _2a2=document.getElementById("monkey_"+id+"_extrainfo");
if(!_29e||_29e==""||!_29f||_29f==""){
_2a0.innerHTML="Sorry, that's the wrong mobile number or password. Please try again.";
return false;
}
if(_29e.length<10||_29e.length>12){
_2a0.innerHTML="Sorry, that's the wrong mobile number or password. Please try again.";
return false;
}
var _2a3=null;
_2a0.innerHTML="Checking details, please wait...";
var _2a4={feedbacknode:_2a0,wn_support:browserSupportsWindowNameXhr(),url:"https://web.orange.co.uk/monkey/index.html?rm=login",content:{msisdn:_29e,password:_29f},sync:false,callbackParamName:"callback",load:function(_2a5,_2a6){
var _2a7;
var _2a8=this.feedbacknode;
if(this.wn_support){
_2a7=_2a5;
}else{
_2a7=_2a5.result;
}
console.log(_2a7);
switch(_2a7){
case "1":
if(_29d){
console.log("Launching full player: "+_29d);
monkeyMusic_launchMonkeyPlayer(id,false);
}
location.reload(true);
break;
case "-1":
console.log("Unknown error");
_2a8.innerHTML="Sorry, we're having some problems - we're fixing them right now.";
break;
case "-2":
console.log("Invalid MSISDN");
_2a8.innerHTML="Sorry, that's the wrong mobile number or password. Please try again.";
break;
case "-3":
console.log("Not PAYG");
_2a8.innerHTML="Sorry, only pay as you go customers on Monkey can log in.";
break;
case "-4":
console.log("Invalid login. Not PAYG?");
_2a8.innerHTML="Sorry, we're having some problems - we're fixing them right now.";
break;
case "-5":
console.log("Timeout");
_2a8.innerHTML="Sorry, we're having some problems. Could you try again?";
break;
case "-6":
console.log("Not eligible");
_2a8.innerHTML="Sorry, you need to top up by 10+ pounds this month before you can log in.";
break;
case "-7":
console.log("Bundle check error");
_2a8.innerHTML="Sorry, we're having some problems. Could you try again?";
break;
case "-8":
console.log("Not on Monkey bundle");
_2a8.innerHTML="If you've already signed up to Monkey you need to top up by &pound;10 to login. If you aren't, register below.";
_2a1.innerHTML="* Already topped up by &pound;10?";
_2a2.innerHTML="Please note it can take upto 24hrs for your reward to be actioned. Sorry for the delay!";
break;
default:
console.log("Unknown response");
_2a8.innerHTML="Sorry, we're having some problems - we're fixing them right now.";
break;
}
},error:function(_2a9,_2aa){
console.log("error: "+_2a9);
}};
if(browserSupportsWindowNameXhr()){
dojox.io.windowName.send("POST",_2a4);
}else{
dojo.io.script.get(_2a4);
}
return false;
};
function browserSupportsWindowNameXhr(){
if(dojo.isOpera){
return (false);
}else{
return (true);
}
};
function monkeyMusic_launchMonkeyPlayer(id,demo,_2ad,_2ae,_2af){
if(_2ad===undefined&&MonkeyLaunchParams){
_2ad=MonkeyLaunchParams.channelID;
}
if(_2ae===undefined&&MonkeyLaunchParams){
_2ae=MonkeyLaunchParams.buddyID;
}
if(_2af===undefined&&MonkeyLaunchParams){
_2af=MonkeyLaunchParams.keyWord;
}
if(!_2ad){
_2ad=0;
}
if(!_2ae){
_2ae=0;
}
if(!_2af){
var _2af=0;
}
var _2b0=g_GetCookie("monkeysignedin");
console.log("Called launching player (msisdn ["+_2b0+"]: channelID="+_2ad+", buddyID="+_2ae+", keyWord="+_2af);
if(_2b0||demo){
if(!_2b0&&demo){
_2b0=0;
_2b1=0;
}else{
var _2b1=g_GetCookie("monkeypid");
if(!_2b1){
_2b1=0;
}
}
var _2b2="channelID="+_2ad+"&buddyID="+_2ae+"&keyWord="+_2af;
var _2b3=_2b0?"/monkey/player.html":"http://ouk-web.snowite.fr/monkey/index.php";
console.log("Launching player: "+_2b3+" with channelID="+_2ad+", buddyID="+_2ae+", keyWord="+_2af);
if(popUpWindow&&!popUpWindow.closed){
popUpWindow.location=_2b3+"?"+_2b2;
}else{
openPopup(_2b3+"?"+_2b2,"monkeyPlayer",10,10,962,573,"menubar=no,scrollbars=no,statusbar=no");
}
window.setTimeout("popUpWindow.focus()",500);
if(demo){
closeLightbox(id);
}
return;
}else{
console.log("Opening lightbox: "+id);
var _2b4={channelID:_2ad,buddyID:_2ae,keyWord:_2af};
MonkeySSO.clicked(id,_2b4);
}
};
function monkeyMusic_signOut(id){
g_DeleteCookie("monkeysignedin","/");
g_DeleteCookie("monkeywelcome","/");
g_DeleteCookie("monkeypid","/");
location.reload(true);
};
function monkeyMusic_showWelcomeLB(id){
console.log("In lightbox: "+id);
var _2b7="lightbox_"+id;
var _2b8=dijit.byId(_2b7);
if(_2b8){
_2b8.duration=1;
_2b7="#"+_2b7;
if(dojo.isIE){
dojo.query(_2b7)[0].style.display="block";
}
_2b8.show();
console.log("showing dialog ",_2b8);
}
};
var MovieCommentList_visible=false;
function MovieCommentForm_toggleDisplay(){
if(document.getElementById("MovieCommentFormErrors")){
document.getElementById("MovieCommentFormErrors").style.display="none";
}
if(MovieCommentForm_visible){
document.getElementById("MovieCommentFormClose").style.display="none";
document.getElementById("MovieCommentFormLeaveComment").style.display="block";
document.getElementById("MovieCommentForm").style.display="none";
MovieCommentForm_visible=false;
}else{
document.getElementById("MovieCommentFormClose").style.display="block";
document.getElementById("MovieCommentFormLeaveComment").style.display="none";
document.getElementById("MovieCommentForm").style.display="block";
MovieCommentForm_visible=true;
}
return (false);
};
function MovieCommentForm_submitForm(){
var _2b9=document.getElementById("name");
var _2ba=document.getElementById("posterem");
if(_2b9.value=="your name"){
_2b9.value="";
}
if(_2ba.value=="your email"){
_2ba.value="";
}
return (true);
};
function MovieCommentList_showAll(){
if(!MovieCommentList_visible){
document.getElementById("MovieCommentListOpenAll").style.display="none";
document.getElementById("MovieCommentListInitiallyHidden").style.display="block";
MovieCommentList_visible=true;
}
return (false);
};
var movieInvites={recaptchaInitialized:false,number:false,movieId:false,venueId:false,toggleTextDetails:function(_2bb){
this.setRecaptchaVisibility(false);
dojo.query("div#movie_"+_2bb+" .actions").removeClass("actions_invite");
dojo.toggleClass(dojo.query("div#movie_"+_2bb+" .actions")[0],"actions_text_details");
if(!this.recaptchaInitialized){
OrangeRecaptcha.create("recaptcha");
this.recaptchaInitialized=true;
}
},setRecaptchaVisibility:function(_2bc,_2bd){
dojo.query("div.movie .actions .text_details_initial").style("display","block");
dojo.query("div.movie .actions .text_details_recaptcha").style("display","none");
if(_2bd){
dojo.query("div#movie_"+_2bd+" .actions .text_details_initial").style("display",(_2bc?"none":"block"));
dojo.query("div#movie_"+_2bd+" .actions .text_details_recaptcha").style("display",(_2bc?"block":"none"));
if(_2bc){
var _2be=dojo.query("#recaptcha")[0];
dojo.query("div#movie_"+_2bd+" .text_details_recaptcha .recaptcha_area")[0].appendChild(_2be);
}
}
},preSendTextDetails:function(_2bf){
var _2c0=dojo.query("div#movie_"+_2bf+" .text_details input[name='phone_number']")[0].value;
var _2c1=dojo.query("input#venue_id_input")[0].value;
if(_2c0!=""&&_2c0!="enter your number here"){
this.number=_2c0;
this.venueId=_2c1;
this.movieId=_2bf;
this.setRecaptchaVisibility(true,_2bf);
}else{
dojo.query("div#movie_"+_2bf+" .text_details .header .errortext")[0].innerHTML="<span class=\"error\">Please re-enter the correct number.</span>";
}
},sendTextDetails:function(){
var _2c2=dojo.query("#movie_"+this.movieId+" .orange_recaptcha_challenge_response")[0].value;
if(!_2c2||_2c2=="enter the two words shown here"){
dojo.query("div#movie_"+this.movieId+" .text_details_recaptcha .header")[0].innerHTML="<span class=\"error\">Please enter the two words shown below before clicking Send."+"</span>";
return false;
}
dojo.xhrPost({url:"/movies/ajax.php?rm=sendMovieDetailsSms",timeout:15000,handleAs:"json",content:{to:this.number,movie_id:this.movieId,cinema_id:this.venueId,recaptcha_challenge:dojo.query("#recaptcha_challenge_field")[0].value,recaptcha_response:dojo.query("#movie_"+this.movieId+" .orange_recaptcha_challenge_response")[0].value},load:dojo.hitch(this,movieInvites.handleTextDetailsResponse)});
},handleTextDetailsResponse:function(_2c3,_2c4){
OrangeRecaptcha.reload("recaptcha");
if(_2c3.success=="1"){
this.setRecaptchaVisibility(false);
dojo.query("div#movie_"+_2c3.movieId+" .text_details .form").style("display","none");
dojo.query("div#movie_"+_2c3.movieId+" .text_details .header").style("display","none");
dojo.query("div#movie_"+_2c3.movieId+" .text_details .thanks").style("display","block");
}else{
if(_2c3.captchaError=="1"){
dojo.query("div#movie_"+_2c3.movieId+" .text_details_recaptcha .header")[0].innerHTML="<span class=\"error\">"+_2c3.error+"</span>";
}else{
this.setRecaptchaVisibility(false);
dojo.query("div#movie_"+_2c3.movieId+" .text_details div.header .errortext")[0].innerHTML="<span class=\"error\">"+_2c3.error+"</span>";
}
}
dojo.query("div#movie_"+_2c3.movieId+" .text_details input")[0].value="enter your number here";
dojo.query("div#movie_"+_2c3.movieId+" .text_details input")[0].style.color="#989898";
dojo.query("div#movie_"+_2c3.movieId+" input.orange_recaptcha_challenge_response")[0].value="enter the two words shown here";
dojo.query("div#movie_"+_2c3.movieId+" input.orange_recaptcha_challenge_response")[0].style.color="#989898";
},toggleInviteFriend:function(_2c5){
dojo.query("div#movie_"+_2c5+" .actions").removeClass("actions_text_details");
dojo.toggleClass(dojo.query("div#movie_"+_2c5+" .actions")[0],"actions_invite");
},pokeInviteReady:function(){
dojo.query("div.movie .email").style("display","block");
}};
function openMapPopup(_2c6){
window.open("http://search.orange.co.uk/ouk/portal/cinemalocator.html?p=portal&pt=film&venueid="+_2c6,"mapPopup","menubar=0,resizable=1,width=510,height=591,scrollbars=0");
};
function o_hasPackage(id){
var obj={url:"http://ofilm.i6a.co.uk/film/has_package.json?edi="+id,handleAs:"json",callbackParamName:"callback"};
dojo.require("dojo.io.script");
return dojo.io.script.get(obj);
};
function setupVideoOverlay(edi,id){
if(edi){
var io=o_hasPackage(edi);
io.addCallback(makeVideoOverlayCallback(id));
}
};
function makeVideoOverlayCallback(id){
return function(data){
var _2ce=data.package_id;
if(_2ce){
var elt=document.getElementById(id);
elt._openFunction=function(){
loadOverlay(_2ce);
};
dojo.query("#"+id+" a.more_clips")[0].style.display="block";
var _2d0=dojo.query("#"+id+" a.trailer")[0];
var _2d1=dojo.query("#"+id+" div.trailer img")[0];
if(_2d1){
_2d0.appendChild(_2d1);
}
}else{
var _2d2=dojo.query("#"+id+" a.more_clips")[0];
if(_2d2){
_2d2.parentNode.removeChild(_2d2);
}
var _2d0=dojo.query("#"+id+" a.trailer")[0];
if(_2d0){
_2d0.parentNode.removeChild(_2d0);
}
}
};
};
function openVideoOverlayForId(id){
var elt=document.getElementById(id);
if(elt._openFunction&&dojo.isFunction(elt._openFunction)){
elt._openFunction();
}
};
function openIMPVideo(_2d5){
var _2d6=document.createElement("a");
_2d6.rel="#filmOverlay";
_2d6.onclick=function(){
loadOverlay(_2d5);
};
document.body.appendChild(_2d6);
$(_2d6).overlay({onLoad:function(_2d7,link){
loadOverlay(link[0].href.split("/").pop());
},onBeforeLoad:function(){
$(".advert object, .advert embed").hide();
this.expose({zIndex:3,speed:1});
},onClose:function(_2d9){
jQuery.unexpose();
$(".advert object, .advert embed").show();
jQuery("#filmOverlay").html("<div class=\"filmOverlayContent\"></div>");
},top:0,speed:1});
$(_2d6).trigger("click");
document.body.removeChild(_2d6);
};
function openIMPVideoByEdi(edi){
getIMPVideoByEdi(edi,true);
};
function getIMPVideoByEdi(edi,open,id){
if(edi){
var io=o_hasPackage(edi);
io.addCallback(getIMPVideoByEdiCallback(edi,open,id));
}
};
function getIMPVideoByEdiCallback(edi,open,id){
return function(data){
if(data.package_id){
if(open){
openIMPVideo(data.package_id);
}
}else{
disableTrailerButton(edi,id);
}
};
};
function disableTrailerButton(edi,id){
dojo.query("#trailer-"+id+"-"+edi)[0].style.backgroundPosition="-73px 0";
dojo.query("#trailer-"+id+"-"+edi)[0].title="Sorry, no trailer is available for this film yet.";
dojo.query("#trailer-"+id+"-"+edi)[0].href="javascript:void(0)";
dojo.query("#trailer-"+id+"-"+edi)[0].style.cursor="default";
};
function initMoviesByCinemaTrailers(){
var _2e5=dojo.query("div.movie a.trailer");
for(var i=0;i<_2e5.length;i++){
var _2e7=_2e5[i].id.split("-");
var edi=_2e7.pop();
var id=_2e7.pop();
getIMPVideoByEdi(edi,false,id);
}
};
var MoviesPoll={pollArray:[],pollCallback:function(id){
dojo.query("p#loading_text_"+id)[0].style.display="none";
dojo.query("div#poll_text_area_"+id)[0].style.display="block";
dojo.xhrGet({url:"/movies/ajax.php?rm=getPoll&poll_id="+id+"&nocache="+Math.random(),timeout:5000,handleAs:"json",load:dojo.hitch(this,function(_2eb,_2ec){
this.pollArray[id]=_2eb;
document.getElementById("poll_"+id).initializePoll(_2eb);
})});
},mouseOverCallback:function(id,_2ee){
var _2ef=this.getPollObject(id,_2ee);
var text="<strong>"+_2ef.percentage+"</strong>% of Orange film fans agree with this";
this.getTextDiv(id).originalText=this.getTextDiv(id).innerHTML;
this.getTextDiv(id).innerHTML=text;
},mouseOutCallback:function(id,_2f2){
if(this.getTextDiv(id).originalText!="undefined"&&this.getTextDiv(id).originalText!=undefined){
this.getTextDiv(id).innerHTML=this.getTextDiv(id).originalText;
}
},voteCallback:function(id,_2f4){
dojo.xhrGet({url:"/movies/ajax.php?rm=registerVote&poll_id="+id+"&vote="+_2f4,timeout:1000,load:dojo.hitch(this,function(_2f5,_2f6){
this.getTextDiv(id).innerHTML=this.getTextDiv(id).originalText="Thanks for voting";
this.pollCallback(id);
}),error:dojo.hitch(this,function(_2f7,_2f8){
this.getTextDiv(id).innerHTML="Sorry, your vote could not be recorded";
})});
},resizedCallback:function(id,_2fa){
dojo.query("#poll_"+id)[0].style.height=_2fa+"px";
dojo.query("#loading_container_"+id)[0].style.height=_2fa+"px";
},getTextDiv:function(id){
return dojo.query("#poll_text_area_"+id)[0];
},getPollObject:function(id,_2fd){
var _2fe=this.pollArray[id];
for(var i=0;i<_2fe.length;i++){
if(_2fe[i].answerId==_2fd){
return _2fe[i];
}
}
return false;
}};
function moviesTrailerPopupDetect(){
var _300=document.location.search;
if(_300.indexOf("package")>-1){
_300=_300.substr(1);
getParamsArray=_300.split("&");
var _301=0;
var _302=0;
var _303;
while((_301==0)&&(_302<getParamsArray.length)){
getParamSplit=getParamsArray[_302].split("=");
if(getParamSplit[0]=="package"){
_301=parseInt(getParamSplit[1]);
}
_302++;
}
if(_301>0){
openIMPVideo(_301);
}
}
};
function MusicCommentForm(id){
this.id=id;
this.component=document.getElementById(this.id);
};
MusicCommentForm.prototype.addExtraField=function(name){
if(this.component){
var _306=document.createElement("input");
if(_306){
_306.setAttribute("type","hidden");
_306.setAttribute("value","1");
_306.setAttribute("name",name);
this.component.appendChild(_306);
}
}
return;
};
function CountingTextArea(id){
this.id=id;
this.component=document.getElementById(this.id);
this.countstatus=document.getElementById(this.id+"-countstatus");
this.limit=parseInt(this.countstatus.innerHTML);
};
CountingTextArea.prototype.setLimit=function(_308){
this.limit=_308;
};
CountingTextArea.prototype.updateCount=function(){
_309=0;
if(this.component&&this.countstatus){
var _309=this.limit-this.component.value.length;
if(_309<0){
_309=0;
this.component.value=this.component.value.substr(0,this.limit);
}
this.countstatus.innerHTML=_309+" ";
}
return;
};
CountingTextArea.prototype.resetField=function(){
this.component.value="";
this.updateCount();
return;
};
function showMusicMobileFeatureImage(_30a,id){
var _30c=getElementsByClassName("target_image","img",document.getElementById("target_image_area_"+id));
for(el in _30c){
_30c[el].style.visibility="hidden";
}
var _30d=getElementsByClassName("target_associated_copy","div",document.getElementById("target_associated_copy_area_"+id));
for(el in _30d){
_30d[el].style.visibility="hidden";
}
document.getElementById("target_image_"+id+"_"+_30a).style.visibility="visible";
document.getElementById("target_associated_copy_"+id+"_"+_30a).style.visibility="visible";
};
function MusicStore_PlayPreview(base,_30f,_310){
var _311={url:encodeURIComponent(base+"player.php?a=15&cdev=179&cp="+_30f)};
var so=swfobject.embedSWF("/images/furniture/musicstore/player.swf",_310,"35","22","9.0.0",false,{url:encodeURIComponent(base+"player.php?a=15&cdev=179&cp="+_30f)},{wmode:"transparent"});
};
function NewsCommentForm(id){
this.id=id;
this.component=document.getElementById(this.id);
};
NewsCommentForm.prototype.addExtraField=function(name){
if(this.component){
var _315=document.createElement("input");
if(_315){
_315.setAttribute("type","hidden");
_315.setAttribute("value","1");
_315.setAttribute("name",name);
this.component.appendChild(_315);
}
}
return;
};
function toggleDisplayForm(_316,_317){
var _318=document.getElementById(_316);
var _319=document.getElementById("firstToComment");
if(_318.style.display=="block"){
_318.style.display="none";
if(_319){
_319.style.display="block";
}
_317.style.display="block";
}else{
if(_319){
_319.style.display="none";
}
_318.style.display="block";
_318.name.focus();
_317.style.display="none";
}
return (true);
};
document.NewsSearchBarClicked=false;
function NewsSearchBar_onclick(){
if(!document.NewsSearchBarClicked){
document.forms.newsSearchForm.q.value="";
document.NewsSearchBarClicked=true;
}
};
function NewsTicker(id){
this.id=id;
this.component=document.getElementById(this.id);
this.current_xpos=0;
this.max_xpos=0;
this.interval=30;
this.timer;
this.totalwidth=0;
this.offset=0;
this.events_attached=false;
this.width;
};
NewsTicker.prototype.setWidth=function(_31b){
this.width=_31b;
};
NewsTicker.prototype.setOffset=function(_31c){
this.offset=_31c;
};
NewsTicker.prototype.init=function(){
if(this.component){
var len=this.component.childNodes.length;
if(len>0){
while(this.totalwidth<this.width){
for(var i=0;i<len;i++){
child=this.component.childNodes[i];
if(child.tagName=="LI"){
if(!this.events_attached){
this.attachEvent(child.firstChild,"onmouseover","pause");
this.attachEvent(child.firstChild,"onmouseout","start");
}
this.component.appendChild(child.cloneNode(true));
width=this.getComputedWidth(child);
if(window.getComputedStyle){
width+=12;
}
this.totalwidth+=parseInt(width);
}
}
this.events_attached=true;
if(this.max_xpos==0){
this.max_xpos=this.totalwidth;
}
}
}
}
this.start();
return;
};
NewsTicker.prototype.getComputedWidth=function(node){
if(window.getComputedStyle){
return parseInt(document.defaultView.getComputedStyle(node,null).getPropertyValue("width"));
}else{
return node.clientWidth;
}
};
NewsTicker.prototype.start=function(){
this.startTimer(this.interval,"scroll");
};
NewsTicker.prototype.pause=function(){
if(this.timer){
window.clearInterval(this.timer);
}
return;
};
NewsTicker.prototype.scroll=function(){
if(this.component){
this.component.style.clip="rect(0px "+(this.width+this.current_xpos)+"px 24px "+(0+this.current_xpos)+"px)";
this.component.style.left=(this.offset-this.current_xpos)+"px";
this.current_xpos++;
if(this.current_xpos>this.max_xpos){
this.current_xpos=0;
}
}
};
NewsTicker.prototype.attachEvent=function(node,_321,_322){
var _323=null;
var that=this;
var args=Array.prototype.slice.apply(arguments,[2]);
if(typeof _322==="string"){
_323=that[_322];
}else{
_323=_322;
}
if(node.attachEvent){
node.attachEvent(_321,function(){
_323.apply(that,args);
});
}else{
node.setAttribute(_321,this.id+"."+_322+"();");
}
return that;
};
NewsTicker.prototype.startTimer=function(_326,_327){
if(_326>0){
var that=this;
var args=Array.prototype.slice.apply(arguments,[2]);
if(typeof _327==="string"){
_327=that[_327];
}
this.timer=window.setInterval(function(){
_327.apply(that,args);
},_326);
return that;
}
return;
};
function g_GetCookie(_32a){
var _32b=document.cookie.match("(^|;) ?"+_32a+"=([^;]*)(;|$)");
if(_32b){
var _32c=unescape(_32b[2]);
return (unescape(_32b[2]));
}else{
return null;
}
};
function g_GetCookieArray(_32d){
var i=0;
var tmp="";
var _330=new Array();
while(tmp=g_GetCookie(""+_32d+i)){
i++;
_330.push(tmp);
}
if(_330.length<1){
return null;
}else{
return _330;
}
};
function g_SetCookie(_331,_332,exp,path,_335,_336){
var _337=_331+"="+escape(_332);
if(exp){
_337+="; expires="+exp.toGMTString();
}
if(path){
_337+="; path="+escape(path);
}
if(_335){
_337+="; domain="+escape(_335);
}
if(_336){
_337+="; secure";
}
document.cookie=_337;
};
function g_SetCookieArray(_338,_339,exp,path,_33c,_33d){
if(!_339||_339.length<1){
return null;
}
for(var i=0;i<_339.length;i++){
g_SetCookie(""+_338+i,_339[i],exp,path,_33c,_33d);
}
};
function g_DeleteCookie(_33f,path){
var _341=new Date();
_341.setTime(_341.getTime()-5);
if(document.domain.match("portaldev2.local")!==null){
domain="portaldev2.local";
}else{
domain="orange.co.uk";
}
g_SetCookie(_33f,"",_341,path,domain);
};
function g_DeleteCookieArray(_342,path){
var i=0;
var tmp="";
while(tmp=g_GetCookie(""+_342+i)){
g_DeleteCookie(""+_342+i,path);
i++;
}
};
function home_openSetAsHomepage(dest){
window.open(dest,"setashomepage","menubar=0,resizable=1,width=500,height=400,scrollbars=1");
return (false);
};
var revSci_segJs="<scr"+"ipt type=\"text/javascript\" src=\""+location.protocol+"//js.revsci.net/gateway/gw.js?csid=E05517\" charset=\"ISO-8859-1\"></sc"+"ript>";
var bSegIncluded=false;
function revSciProcess(){
segQS="";
};
function revSciInit(){
rsinetsegs=g_GetCookieArray("rsinetsegs");
if(!rsinetsegs){
document.write(revSci_segJs);
bSegIncluded=true;
}
};
function revSciCookie(){
var _347=new Date();
_347.setMonth(_347.getMonth()+1);
g_DeleteCookieArray("rsinetsegs","/");
g_SetCookieArray("rsinetsegs",rsinetsegs,_347,"/");
};
function revSciRegisterMeta(){
if(!_MetaRegister||_MetaRegister.length<1){
return;
}
for(var i=0;i<_MetaRegister.length;i++){
var _349=_MetaRegister[i];
if(_349.meta_value&&_349.meta_value.length>0){
DM_addToLoc("revsci_"+_349.meta_name,_349.meta_value);
}
}
};
function revSciSegment(){
segQS="";
if(typeof rsinetsegs!="undefined"){
segQS+=rsinetsegs.length>0?"seg0="+rsinetsegs[0]+";":"";
for(var i=1;i<rsinetsegs.length&&i<=6;i++){
segQS+=("seg"+i+"="+rsinetsegs[i]+";");
}
}
};
function revSciTag(){
if(!bSegIncluded){
document.write(revSci_segJs);
}
DM_tag();
};
var DM_CSID="E05517";
var DM_UIDS=3;
var DM_CHN=document.location.hostname;
var DM_PIX="pix01.revsci.net";
var DM_BPIX="pix01.revsci.net";
var DM_UIDD=document.location.hostname;
var DM_UIDP="/";
var DM_UIDC="";
var DM_UIDN="";
var DM_UIDE=0;
var DM_ADMG=1;
var DM_ANLY=1;
var DM_RTRY=0;
var DM_DREF=0;
var DM_LOAD_TIME=0;
var DM_TOUT_PIX_PATH="";
var DM_CSES=0;
var DM_CTST=0;
var DM_MULT=0;
var DM_FRAG=0;
var DM_RCRC=0;
var DM_BOOM_ON=0;
var DM_BOOM_DMN="";
var DM_BOOM_SRC="";
var DM_BOOM_DCN="";
var thisfsurl=new String(document.location);
var DM_TEST=0;
var DM_REQS=0;
var _DTE=new Date();
var _UNV=navigator;
var _UDC=document;
var _CHR=null;
var _sImg=new Array();
var _evts=new Array();
var _hexc=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");
var _BCL1="?&=%.()";
var _GCL2="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var _TGID="a"+_hexc[(DM_TEST<<3|DM_REQS<<2|DM_ADMG<<1|DM_ANLY)];
var _name=_UDC.title;
for(_CHR="",i=0;i<256;i++){
_CHR+=String.fromCharCode(i);
}
var _CRCTbl=new Array(0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117);
var _UID=0;
var _UTZ=(-1*_DTE.getTimezoneOffset())+720;
var _UCS=((DM_CTST)?(_gc(_sc("TC0",1,DM_CHN,"/",0,0))==1?1:0)+(_gc(_sc("TC1",1,DM_CHN,"/",1,0))==1?2:0):0);
var _USID=((DM_CSES)?_sessID():0);
var _CNV="";
var _LOC=_UDC.location.toString();
var _REF=_UDC.referrer.toString();
var _CLD=0;
function DM_tag(){
if(thisfsurl.indexOf("revenuesciencetest=1")!=-1){
document.write("rs ok");
}
if(_CLD==0||DM_MULT==1){
_CLD=1;
switch(DM_UIDS){
case 1:
case 2:
case 5:
var cke=_gc(DM_UIDC);
if(cke==null){
_UID=-1;
}else{
if(cke.indexOf("/")>=0||cke.indexOf("?")>=0){
_UID=-1;
}else{
_UID="DMID"+DM_UIDS+"="+escape(cke);
}
}
break;
case 4:
if((_UID=_gc(DM_UIDN))==null){
_UID=_genID();
_sc(DM_UIDN,_UID,DM_UIDD,DM_UIDP,DM_UIDE,0);
}
_UID="DMID4="+_UID;
break;
}
for(var i=0;i<_evts.length;i++){
_addNV("DM_EVT."+_evts[i].name,_evts[i].props);
}
if(DM_DREF==1){
_addNV("DM_LOC",_encd(_REF,_BCL1,0));
}else{
_addNV("DM_LOC",_encd(_LOC,_BCL1,0));
}
_addNV("DM_REF",_encd(_REF,_BCL1,0));
(_UID!=0&&_UID!=-1?_addNV("DM_HID",_encd(_UID,_BCL1,0)):0);
_addNV("DM_TIT",_encd(_UDC.title.toString(),_BCL1,0));
_CNV+="&DM_EOM=1";
if(_pack(_CNV)){
if(DM_BOOM_ON){
_checkBoom();
}
}
_rstReq();
}
};
function _pack(d){
var rdte=new Date();
var rid=_toHex(Math.floor(rdte));
var bse="",hdr="",dat="",seq=1;
var prt=location.protocol+"//";
var msl=(DM_PIX.length>DM_BPIX.length?DM_PIX.length:DM_BPIX.length);
var mrl=2000,usd=0;
d=_encd(d,_GCL2,1);
for(var shpd=0,f=1;((DM_FRAG)?(shpd<d.length):(f==1));shpd+=dat.length,f++){
hdr="/"+DM_CSID+"/"+_TGID+"/"+_UCS+"/"+DM_UIDS+"/"+_UTZ+"/"+seq+"/"+_USID+"/"+rid+"/"+_UID+"/";
bse="/"+Math.floor(Math.random()*Math.pow(10,9))+".gif?D=";
lst=(shpd+(mrl-msl-(prt+hdr+bse).length-10)>d.length?1:0);
if(!DM_FRAG){
sts=0;
}else{
if(f==1&&lst==0){
sts=1;
}else{
if(f>1&&lst==0){
sts=2;
}else{
if(f>1&&lst==1){
sts=3;
}else{
sts=0;
}
}
}
}
hdr+=sts+"/";
usd=(prt+hdr+bse).length+msl+8;
dat=d.substr(shpd,(mrl-usd-(d.charAt(shpd+(mrl-usd-1))=="%"?1:(d.charAt(shpd+(mrl-usd-2))=="%"?2:0))));
hdr+=_pad(((DM_RCRC)?_toHex(_crc32(dat)):0),8);
_ship(_toHex(Math.floor(Math.random()*Math.pow(10,9))),prt,DM_PIX,DM_BPIX,hdr+bse+dat,0);
seq++;
}
return 1;
};
function _ship(srl,p,s1,s2,u,t){
if(_sImg[srl]==null){
_sImg[srl]=new Image(2,3);
}
if(t<2){
_sImg[srl].src=p+s1+u;
}else{
if(t<4){
_sImg[srl].src=p+s2+u;
}
}
if(DM_LOAD_TIME>0){
setTimeout("isPixLoaded(_sImg['"+srl+"']);",parseInt(DM_LOAD_TIME)*1000);
}
if(DM_RTRY==1&&DM_LOAD_TIME==0){
_sImg[srl].onerror=function(){
setTimeout("_ship('"+srl+"','"+p+"','"+s1+"','"+s2+"','"+u+"',"+(t+1)+")",5000);
};
}
};
function isPixLoaded(pix){
var _361=new Image();
if(pix.complete){
return pix;
}else{
return pix.src=DM_TOUT_PIX_PATH;
}
};
function _addNV(n,v){
_CNV+=(_CNV?"&":"")+n+"="+v;
};
function _genID(){
return _toHex(Math.floor(_DTE))+"-"+_toHex(Math.floor(Math.random()*Math.pow(10,16)))+"-"+_toHex(_crc32("".concat(_UDC.referrer,_UDC.cookie,_UNV.userAgent,_UTZ,screen.width,screen.height)));
};
function _sessID(){
var sID=_gc("DMSID");
if(sID==null){
sID=_gc(_sc("DMSID",_genID(),DM_UIDD,DM_UIDP,0,0));
}
return (sID);
};
function _sc(n,v,d,p,e,o){
var _36b=new Date();
if((n!=""&&v!="")&&(_gc(n)==null||o==1)){
_36b.setDate(_DTE.getDate()+e);
_UDC.cookie=n+"="+v+(p!=""?";path="+p:"")+(d!=""?";domain="+d:"")+(e>0?";expires="+_36b.toGMTString():"");
}
return n;
};
function _gc(n){
var co=_UDC.cookie;
var pos=co.indexOf(n+"=");
return pos!=-1?co.substring(pos+n.length+1,(co.indexOf("; ",pos)!=-1?co.indexOf("; ",pos):co.length)):null;
};
function _encd(s,chrs,b){
for(var i=0,ns="",c="";i<s.length;i++){
if((b==1?chrs.indexOf(s.charAt(i))>=0:chrs.indexOf(s.charAt(i))<0)){
ns+=s.charAt(i);
}else{
if((c=_CHR.indexOf(s.charAt(i)))>0){
ns+="%"+_pad(_toHex(c),2);
}
}
}
return ns;
};
function _crc32(buf){
i=0;
cnt=buf.length;
crc=4294967295;
while(cnt--!=0){
crc=_CRCTbl[(crc^_CHR.indexOf(buf.charAt(i++)))&255]^(crc>>>8);
}
crc^=4294967295;
crc=(crc&2147483647)+((crc<0)?2147483648:0);
return crc;
};
function _appendToUrl(u,n,v){
return u+((u.indexOf("?")==-1)?"?":"&")+n+"="+v;
};
function _toHex(n){
var rmd=0,quo=0,hex="";
if(n<16){
return _hexc[n];
}else{
rmd=(n%16);
quo=Math.floor((n-rmd)/16);
return (_toHex(quo)+_toHex(rmd));
}
};
function _pad(d,p){
d+="";
while(d.length<p){
d="0"+d;
}
return d;
};
function _checkBoom(){
var segC="",bomc="",scrc=0,bcrc=0;
if((segC=_gc("DMSEG"))!=null){
if((bomc=_gc("DMBOM"))!=null){
scrc=_pad(_toHex(_crc32(segC)),8);
bcrc=bomc.substr(0,bomc.indexOf("&"));
if(scrc!=bcrc){
_sendBoom(segC,scrc,DM_BOOM_DMN,DM_BOOM_SRC,DM_BOOM_DCN);
}
}else{
_sendBoom(segC,_pad(_toHex(_crc32(segC)),8),DM_BOOM_DMN,DM_BOOM_SRC,DM_BOOM_DCN);
}
}
};
function _sendBoom(segC,crc,dmn,src,dcn){
var aTok,segs,rid=0,i=0,bl="",u="";
segC=unescape(segC);
aTok=segC.split("&");
if(aTok.length>=6){
if(aTok[5].length>0){
segs=aTok[5].split(",");
while(i<segs.length){
bl+="boom="+segs[i]+";";
i++;
}
rid=Math.floor(Math.random()*Math.pow(10,9));
u="/src="+src+";dcnet="+dcn+";"+bl+"sz=1x1;ord="+rid+"?";
_ship(rid,location.protocol+"//",dmn,dmn,u,0);
_setBoom(crc,1);
}else{
_setBoom(crc,0);
}
}else{
_setBoom(crc,0);
}
};
function _setBoom(crc,snt){
_sc("DMBOM",crc+"&"+_toHex(Math.floor(_DTE))+"&"+snt,DM_CHN,"/",0,1);
};
function _rstReq(){
_CNV="";
_LOC=_UDC.location.toString();
_REF=_UDC.referrer.toString();
_UID=0;
};
function DM_event(e,n,v){
for(var i=0;i<_evts.length;i++){
if(_evts[i].name==e){
if(_evts[i].props.indexOf("("+_encd(n,_BCL1,0)+".")<0){
_evts[i].props+="("+_encd(n,_BCL1,0)+"."+_encd(v,_BCL1,0)+")";
return 1;
}else{
return 0;
}
}
}
_evts[_evts.length]={name:_encd(e,_BCL1,0),props:"("+_encd(n,_BCL1,0)+"."+_encd(v,_BCL1,0)+")"};
return 1;
};
function DM_cat(cat){
_addNV("DM_CAT",_encd(cat,_BCL1,0));
};
function DM_name(f){
_addNV("DM_NAM",_encd(f,_BCL1,0));
};
function DM_keywords(k){
_addNV("DM_KYW",_encd(k,_BCL1,0));
};
function DM_segments(s){
_addNV("DM_SEG",_encd(s,_BCL1,0));
};
function DM_addToLoc(n,v){
_LOC=_appendToUrl(_LOC,n,v);
if(DM_DREF==1){
_REF=_appendToUrl(_REF,n,v);
}
};
function displayDate(){
var _39a=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var _39b=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var _39c=new Date();
document.write(_39a[_39c.getDay()]+" "+_39c.getDate()+" "+_39b[_39c.getMonth()]+" "+_39c.getFullYear());
};
function brighttopups_embedFlash(_39d,bReg){
var _39f="/brighttopups/flash/po_login.swf";
if(_39d==true){
_39f="/brighttopups/flash/po_prize.swf";
}
if(window.swfobject!=undefined){
if(swfobject.hasFlashPlayerVersion("9.0.115")){
var sReg=bReg?"true":"false";
var vars={registered:sReg};
var test=swfobject.embedSWF(_39f,"brighttopups_flash_container","960","379","9.0.124.0","expressInstall.swf",vars);
}else{
brighttopups_fallback();
}
}else{
brighttopups_fallback();
}
};
function brighttopups_embedTacticalFlash(draw){
var _3a4="/brighttopups/flash/entry.swf";
if(window.swfobject!=undefined){
if(swfobject.hasFlashPlayerVersion("9.0.0")){
var vars={drawid:draw};
var test=swfobject.embedSWF(_3a4,"brighttopups_flash_container","550","400","9.0.0","expressInstall.swf",vars);
}else{
}
}else{
}
};
function brighttopups_fallback(){
document.location="html.php";
};
function brighttopups_logout(){
document.location="/brighttopups/index.php?rm=logout";
return false;
};
function osborne_reload(){
brighttopups_reload();
};
function brighttopups_reload(){
window.location.reload(true);
};
function brighttopups_trackVoucherDownload(url){
brighttopups_track(url);
};
function brighttopups_track(url){
if(pageTracker!=undefined){
pageTracker._trackPageview(url);
}
};
var OrangeRecaptcha={publicKey:"",create:function(id){
Recaptcha.create(this.publicKey,id,{theme:"custom"});
},reload:function(id){
Recaptcha.destroy();
this.create(id);
},destroy:function(){
Recaptcha.destroy();
}};
var RelatedVideosCarousel_width;
var RelatedVideosCarousel_stepsRemaining=0;
var RelatedVideosCarousel_movementPerStep;
var RelatedVideosCarousel_xpos=0;
function RelatedVideosCarousel_init(){
var el=document.getElementById("RelatedVideosCarousel");
var _3ac=el.childNodes.length;
var _3ad=0;
for(var _3ae=0;_3ae<_3ac;_3ae++){
child=el.childNodes[_3ae];
if(child.tagName=="LI"){
if(window.getComputedStyle){
width=parseInt(document.defaultView.getComputedStyle(child,null).getPropertyValue("width"));
}else{
width=child.clientWidth;
}
_3ad+=parseInt(width);
}
}
alert(_3ad);
RelatedVideosCarousel_width=_3ad;
RelatedVideosCarousel_setButtons();
};
function RelatedVideosCarousel_startScrollLeft(){
if((RelatedVideosCarousel_stepsRemaining==0)&&(RelatedVideosCarousel_xpos>0)){
RelatedVideosCarousel_movementPerStep=-5;
RelatedVideosCarousel_stepsRemaining=22;
setTimeout("RelatedVideosCarousel_doScroll()",10);
}
return (false);
};
function RelatedVideosCarousel_startScrollRight(){
if((RelatedVideosCarousel_stepsRemaining==0)&&((RelatedVideosCarousel_xpos+749)<RelatedVideosCarousel_width)){
RelatedVideosCarousel_movementPerStep=5;
RelatedVideosCarousel_stepsRemaining=22;
setTimeout("RelatedVideosCarousel_doScroll()",10);
}
return (false);
};
function RelatedVideosCarousel_doScroll(){
if(RelatedVideosCarousel_stepsRemaining>0){
if(RelatedVideosCarousel_stepsRemaining==1){
RelatedVideosCarousel_movementPerStep=RelatedVideosCarousel_movementPerStep*2/5;
}
RelatedVideosCarousel_xpos+=RelatedVideosCarousel_movementPerStep;
document.getElementById("RelatedVideosCarousel").style.clip="rect(0px "+(740+RelatedVideosCarousel_xpos)+"px 107px "+(0+RelatedVideosCarousel_xpos)+"px)";
document.getElementById("RelatedVideosCarousel").style.left=(33-RelatedVideosCarousel_xpos)+"px";
RelatedVideosCarousel_stepsRemaining--;
setTimeout("RelatedVideosCarousel_doScroll()",10);
}else{
RelatedVideosCarousel_setButtons();
}
};
function RelatedVideosCarousel_setButtons(){
var _3af="pointer";
var _3b0="pointer";
var _3b1="leftscroll.gif";
var _3b2="rightscroll.gif";
if(RelatedVideosCarousel_xpos==0){
_3af="default";
_3b1="leftscroll_disabled.gif";
}
if((RelatedVideosCarousel_xpos+749)>=RelatedVideosCarousel_width){
_3b0="default";
_3b2="rightscroll_disabled.gif";
}
document.getElementById("RelatedVideosCarouselLeftScroller").style.cursor=_3af;
document.getElementById("RelatedVideosCarouselLeftScroller").firstChild.src="/images/furniture/video/relatedvideoscarousel/"+_3b1;
document.getElementById("RelatedVideosCarouselRightScroller").style.cursor=_3b0;
document.getElementById("RelatedVideosCarouselRightScroller").firstChild.src="/images/furniture/video/relatedvideoscarousel/"+_3b2;
};
function rugbylChangeSelectedCompetition(){
var _3b3=document.location.href.split("?");
var _3b4=_3b3[0]+"?competition="+escape(document.getElementById("competition_select").value);
if(document.getElementById("month_select").value){
_3b4+="&month="+escape(document.getElementById("month_select").value);
}
document.location=_3b4;
};
function rugbylChangeSelectedMonth(){
rugbylChangeSelectedCompetition();
};
function selectRad(_3b5){
var _3b6="radio";
document.getElementById("search_pt").value=_3b6+_3b5;
};
function validateSearch(){
if(trim(document.getElementById("search_q").value)==""){
alert("Please type in one or more search terms before searching");
return false;
}else{
if(document.getElementById("search_pt").value=="x"){
selectRad("web");
}
return true;
}
};
var ShareEquities={currentAjaxCall:null,init:function(){
dojo.connect(dojo.byId("ShareEquities_find_button"),"onclick",ShareEquities,"findButtonClicked");
dojo.connect(dojo.byId("ShareEquities_go"),"onclick",ShareEquities,"goButtonClicked");
},ajaxXhrGet:function(_3b7){
if(ShareEquities.currentAjaxCall){
ShareEquities.currentAjaxCall.cancel();
}
ShareEquities.currentAjaxCall=dojo.xhrGet({url:"/shares/ajax.php?rm="+_3b7.runmode+"&"+_3b7.parameter+"="+_3b7.value,handleAs:"json",timeout:2000,load:_3b7.loadFunction,error:_3b7.errorFunction});
},populateSelectBox:function(_3b8){
var _3b9=dojo.byId("ShareEquities_equity_result");
_3b9.options.length=0;
newOption=dojo.doc.createElement("option");
newOption.setAttribute("value","");
newOption.appendChild(dojo.doc.createTextNode(_3b8.length+" equit"+(_3b8.length>1?"ies":"y")+" found..."));
_3b9.appendChild(newOption);
for(key in _3b8){
share=_3b8[key];
newOption=dojo.doc.createElement("option");
newOption.setAttribute("value",share.code);
newOption.appendChild(dojo.doc.createTextNode(share.name));
_3b9.appendChild(newOption);
}
if(_3b8.length==1){
setTimeout("dojo.byId('ShareEquities_equity_result').selectedIndex=1",1);
}
},populateShareInfo:function(info){
var _3bb={0:"sell",1:"mid",2:"dayhigh",3:"previousclose",4:"buy",5:"change",6:"daylow"};
ddNodes=new Array();
dojo.query("div.ShareEquities dd").forEach(function(n){
ddNodes[ddNodes.length]=n;
});
for(var _3bd=0;_3bd<ddNodes.length;_3bd++){
ddNodes[_3bd].innerHTML=info[_3bb[_3bd]];
}
summary=dojo.byId("ShareEquities_summary");
summary.innerHTML=info.name+" "+info.mid;
},goButtonClicked:function(){
var _3be=dojo.byId("ShareEquities_equity_result");
if(_3be.selectedIndex>0){
var code=_3be.value;
ShareEquities.ajaxXhrGet({runmode:"EquityByCode",parameter:"code",value:code,loadFunction:function(_3c0,_3c1){
if(_3c0.length==1){
ShareEquities.populateShareInfo(_3c0[0]);
}
},errorFunction:function(){
}});
}
},findButtonClicked:function(){
var name=dojo.trim(dojo.byId("ShareEquities_name").value);
var code=dojo.trim(dojo.byId("ShareEquities_code").value);
var _3c4=dojo.byId("ShareEquities_equity_result");
_3c4.options.length=0;
dojo.query("div.ShareEquities dd").forEach(function(n){
n.innerHTML="";
});
dojo.byId("ShareEquities_summary").innerHTML="";
if(name!=""){
if(name.length>2){
dojo.xhrGet({url:"/shares/ajax.php?rm=EquitiesByName&name="+name,handleAs:"json",timeout:2000,load:function(_3c6,_3c7){
if(_3c6.length>0){
_3c4.disabled=false;
ShareEquities.populateSelectBox(_3c6);
if(_3c6.length==1){
var code=_3c6[0].code;
ShareEquities.ajaxXhrGet({runmode:"EquityByCode",parameter:"code",value:code,loadFunction:function(_3c9,_3ca){
ShareEquities.populateShareInfo(_3c9[0]);
},errorFunction:function(){
}});
}
}
},error:function(_3cb,_3cc){
}});
}else{
alert("Please enter a share name of at least 3 characters.");
}
}else{
if(code!=""){
ShareEquities.ajaxXhrGet({runmode:"EquityByCode",parameter:"code",value:code,loadFunction:function(_3cd,_3ce){
ShareEquities.populateSelectBox(_3cd);
if(_3cd.length==1){
ShareEquities.populateShareInfo(_3cd[0]);
}
},errorFunction:function(){
}});
}
}
}};
var ShareIndicesList={currentlySelectedRow:0,currentlySelectedTimePeriodIndex:2,timePeriodLookup:{0:{timeP:"1d",spanP:"0",graphType:"1",startTime:"8:00",endTime:"17:00"},1:{timeP:"5d",spanP:"4",graphType:"2",startTime:"",endTime:""},2:{timeP:"1y",spanP:"12",graphType:"3",startTime:"",endTime:""},3:{timeP:"5y",spanP:"60",graphType:"3",startTime:"",endTime:""}},updateGraph:function(_3cf,_3d0){
var _3d1=ShareIndicesList.indexLookup[_3cf];
var _3d2=ShareIndicesList.timePeriodLookup[_3d0];
dojo.byId("ShareIndicesList_indexgraph").src="http://webfund5.finexprestel.com/orange/gifchart.asp?code=N"+_3d1+"&span="+_3d2.spanP+"&gphtype="+_3d2.graphType+"&startTime="+_3d2.startTime+"&endTime="+_3d2.endTime+"&wd=264&ht=140&gpcolour=HFF6600&ftcolour=333333&bgcolour=HFFFFFF&gdcolour=HDEDFEF&bdcolour=FFFFFF&axcolour=H001410&ShowDate=0&chartbgcolour=HFFFFFF&gf=0&hdg=1&hdgpos=1&fg=3&fontsize=8&fontname=Arial";
},selectRow:function(_3d3){
idComponents=_3d3.currentTarget.id.split("_");
var _3d4=idComponents[2];
dojo.stopEvent(_3d3);
if(ShareIndicesList.currentlySelectedRow!=_3d4){
dojo.byId("ShareIndicesList_row_"+ShareIndicesList.currentlySelectedRow).className="";
dojo.byId("ShareIndicesList_row_"+_3d4).className="selected";
ShareIndicesList.updateGraph(_3d4,ShareIndicesList.currentlySelectedTimePeriodIndex);
ShareIndicesList.currentlySelectedRow=_3d4;
}
},selectTimePeriod:function(_3d5){
var _3d6=_3d5.currentTarget.id.split("_");
var _3d7=_3d6[2];
dojo.stopEvent(_3d5);
if(ShareIndicesList.currentlySelectedTimePeriodIndex!=_3d7){
dojo.byId("ShareIndicesList_timeperiod_"+ShareIndicesList.currentlySelectedTimePeriodIndex).className="";
var _3d8=dojo.byId("ShareIndicesList_timeperiod_"+_3d7);
_3d8.className="selected";
_3d8.blur();
ShareIndicesList.updateGraph(ShareIndicesList.currentlySelectedRow,_3d7);
ShareIndicesList.currentlySelectedTimePeriodIndex=_3d7;
}
},init:function(){
ShareIndicesList.indexLookup=new Array();
var _3d9=0;
var _3da;
dojo.query("div.ShareIndicesList tr").forEach(function(n){
if(_3d9==(ShareIndicesList.currentlySelectedRow+1)){
n.className="selected";
}
if(_3d9!=0){
_3da=n.getAttribute("id").split("_");
ShareIndicesList.indexLookup[ShareIndicesList.indexLookup.length]=_3da[2];
n.setAttribute("id","ShareIndicesList_row_"+(_3d9-1));
dojo.connect(n,"onmouseover",ShareIndicesList,"selectRow");
}
_3d9++;
});
var _3dc;
_3d9=0;
dojo.query("div.ShareIndicesList li").forEach(function(n){
_3dc=n.firstChild;
if(_3d9==ShareIndicesList.currentlySelectedTimePeriodIndex){
_3dc.className="selected";
}
_3dc.setAttribute("id","ShareIndicesList_timeperiod_"+_3d9);
dojo.connect(_3dc,"onclick",ShareIndicesList,"selectTimePeriod");
_3d9++;
});
ShareIndicesList.updateGraph(ShareIndicesList.currentlySelectedRow,ShareIndicesList.currentlySelectedTimePeriodIndex);
}};
function TabContainer(id){
this.id=id;
this.tab_no;
this.number_of_tabs;
this.component=document.getElementById(this.id);
this.timerstopped;
this.initial_tab;
this.timer;
this.useCssDisplay=false;
this.parentTabContainer=false;
this.parentTabHeightOffset=0;
};
TabContainer.prototype.select=function(_3df){
this.pause;
this.timerstopped=true;
this.switchto(_3df);
};
TabContainer.prototype.switchToInitialTab=function(){
var uri=window.location.href;
var re=new RegExp("#([0-9])");
var _3e2=re.exec(uri);
if(_3e2){
var idx=_3e2[1];
this.switchto(idx);
}else{
this.switchto(1);
}
};
TabContainer.prototype.switchto=function(_3e4){
if(this.component){
var _3e5=document.getElementById(this.id+"-"+this.tab_no);
if(_3e5){
if(this.useCssDisplay){
_3e5.style.display="none";
}else{
_3e5.style.visibility="hidden";
}
}
var _3e6=document.getElementById(this.id+"-"+_3e4);
if(_3e6){
if(this.useCssDisplay){
_3e6.style.display="block";
}else{
_3e6.style.visibility="visible";
}
}
var _3e7=document.getElementById(this.id+"-"+this.tab_no+"-tab");
if(_3e7){
_3e7.parentNode.className=_3e7.parentNode.className.replace(" current","");
_3e7.className="tab"+this.tab_no;
}
var _3e8=document.getElementById(this.id+"-"+_3e4+"-tab");
if(_3e8){
_3e8.parentNode.className=_3e8.parentNode.className+" current";
_3e8.className=_3e8.className+" current "+_3e8.className+"-current";
if(_3e4==this.number_of_tabs){
_3e8.className=_3e8.className+" last";
}
}
if(this.component&&_3e8&&_3e6){
this.setContainerHeight(_3e8.offsetHeight+_3e6.offsetHeight);
}
this.tab_no=_3e4;
}
return false;
};
TabContainer.prototype.setContainerHeight=function(_3e9){
if(!_3e9){
var _3ea=document.getElementById(this.id+"-"+this.initial_tab+"-tab");
var _3eb=document.getElementById(this.id+"-"+this.initial_tab);
if(_3ea&&_3eb){
_3e9=_3ea.offsetHeight+_3eb.offsetHeight;
}
}
var _3ec=document.getElementById(this.id+"-h3");
if(_3ec){
_3e9+=_3ec.offsetHeight;
}
this.component.style.height=_3e9+"px";
if(this.parentTabContainer){
this.component.style.height=(_3e9+this.parentTabHeightOffset)+"px";
this.parentTabContainer.switchto(this.parentTabContainer.tab_no);
}
return;
};
TabContainer.prototype.nextTab=function(){
if(this.tab_no<this.number_of_tabs){
return this.switchto(this.tab_no+1);
}else{
return this.switchto(1);
}
};
TabContainer.prototype.startTimer=function(_3ed,_3ee){
if(_3ed>0){
var that=this;
var args=Array.prototype.slice.apply(arguments,[2]);
if(typeof _3ee==="string"){
_3ee=that[_3ee];
}
this.timer=setInterval(function(){
_3ee.apply(that,args);
},_3ed);
return that;
}
return;
};
TabContainer.prototype.pause=function(){
if(this.timer){
clearInterval(this.timer);
}
return;
};
TabContainer.prototype.start=function(){
if(!this.timerstopped){
this.startTimer(this.interval*1000,"nextTab");
}
return;
};
TabContainer.prototype.initialise=function(_3f1,_3f2,_3f3){
this.number_of_tabs=_3f1;
this.interval=_3f2;
if(_3f3){
this.initial_tab=_3f3;
}else{
this.initial_tab=1;
}
this.tab_no=this.initial_tab;
this.setContainerHeight();
this.start();
return;
};
function tennisChangeSelectedTournament(){
var _3f4=document.location.href.split("?");
var _3f5=_3f4[0]+"?tournament="+(document.getElementById("tournament_select").value);
document.location=_3f5;
};
function orangeTrack(_3f6,mode,_3f8){
switch(_3f6){
case "webtrends":
orangeTrackWebtrends(mode,_3f8);
break;
case "spotlight":
orangeTrackSpotlight(_3f8);
break;
}
};
function orangeTrackWebtrends(mode,_3fa){
var _3fb=location.href.replace(/\?.*$/,"");
var _3fc=_3fb.replace(/http:\/\/[^\/]*/,"");
switch(mode){
case "partner":
var _3fd=_3fa.targetUrl.replace(/http:\/\//ig,"").split("/");
_3fd=_3fd[0];
dcsMultiTrack("DCS.dcsuri","/OC/partner/"+_3fd,"DCS.dcsref",_3fb,"WT.ti","Partner:"+_3fa.partnerId,"WT.cg_n","Partner:"+_3fd,"WT.cg_s","","WT.pi","","WT.mc_id","","WT.ac","","WT.srch","","WT.svl",_3fa.trackingRef);
break;
case "lightbox_gallery":
dcsMultiTrack("DCS.dcsuri",_3fc+"/lightbox_gallery/"+_3fa.galleryId,"WT.ti","lightbox: "+_3fa.title,"WT.cg_n",_3fa.contentGroup,"WT.cg_s","lightbox_gallery","DCSext.cg_3",_3fa.galleryId,"DCSext.pic_count",_3fa.imagePosition);
break;
}
};
function orangeTrackSpotlight(_3fe){
var axel=Math.random()+"";
var a=axel*1000000000000000000;
var _401=new Image();
_401.onload=function(){
document.location=_3fe.targetUrl;
};
_401.src="http://ad.uk.doubleclick.net/activity;src=2145760;type="+_3fe.spotlightType+";cat="+_3fe.spotlightCat+";ord=1;num="+a+"?";
return false;
};
var TwoDayResultsByCompetition_currentTab="";
function TwoDayResultsByCompetition_showCompetition(_402){
if(_402!=TwoDayResultsByCompetition_currentTab){
var el=document.getElementById(_402);
el.style.display="block";
var _404;
for(var _405=0;_405<el.childNodes.length;_405++){
outerChild=el.childNodes[_405];
if(outerChild.tagName=="UL"){
for(var _406=0;_406<outerChild.childNodes.length;_406++){
innerChild=outerChild.childNodes[_406];
if(window.getComputedStyle){
_404=parseInt(document.defaultView.getComputedStyle(innerChild,null).getPropertyValue("height"));
}else{
_404=innerChild.clientHeight-7;
}
if((_406&1)==1){
if(_404>lastInnerChildHeight){
lastInnerChild.style.height=_404+"px";
}else{
if(lastInnerChildHeight>_404){
innerChild.style.height=lastInnerChildHeight+"px";
}
}
if((_404<28)&&(lastInnerChildHeight<28)){
innerChild.style.height="28px";
lastInnerChild.style.height="28px";
}
}
if(((_406&1)==0)&&(_406==(outerChild.childNodes.length-1))){
if(_404<28){
innerChild.style.height="28px";
}
}
lastInnerChild=innerChild;
lastInnerChildHeight=_404;
}
}
}
if(document.getElementById(TwoDayResultsByCompetition_currentTab)){
document.getElementById(TwoDayResultsByCompetition_currentTab).style.display="none";
}
TwoDayResultsByCompetition_currentTab=_402;
}
};
function outputWeatherOverview(){
};
function getWeatherDescription(){
};
function writeWeather(){
for(index=0;index<=1;index++){
currentForecast=forcasts[index];
document.write("<div>");
document.write("<img width=\"35\" src=\"http://www.orange.co.uk/images/news/weather/icons/small/"+currentForecast.dayicon+".gif\"/>");
document.write("<h3>"+currentForecast.dayname+"</h3>");
document.write("<ul>");
document.write("<li><strong>L:</strong> "+currentForecast.low+"C</li>");
document.write("<li><strong>H:</strong> "+currentForecast.high+"C</li>");
document.write("</ul>");
document.write("</div>");
}
};
function syncRoadBlock(_407){
a=_407.split(";");
if(a.length>0){
for(x=0;x<=a.length-1;x++){
if(a[x].indexOf("sz=")==0){
size=a[x].substring(3);
dims=size.split("x");
height=dims[0];
width=dims[1];
loadRBs("lcBannerDiv",height,width,_407);
}
}
}
};
function loadRBs(s,w,h,_40b){
document.getElementById(s).innerHTML="<iframe src=\""+_40b+"\" id=\"ifr_companion\" width=\""+w+"\" height=\""+h+"\" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>"+"</iframe>";
};
function loadBanner(_40c,href){
var _40e=_40c;
var _40f=href;
var _410=_40e.toLowerCase();
var _411=_40e;
if(""==_40f||"DHTML"==_40f||"null"==_40f||0<_410.indexOf(".swf")){
_411="<HTML><IFRAME src=\""+_40e+"\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"100%\" marginwidth=\"0\" marginheight=\"0\"/></HTML>";
}else{
if(0==_411.indexOf("http")){
_411="<HTML><CENTER><A HREF=\""+_40f+"\" target=\"_blank\"><IMG SRC=\""+_40e+"\" border=\"0\"></A></CENTER></HTML>";
}else{
_411="<HTML>"+_40e+"</HTML>";
}
}
var oDiv=document.getElementById("lcBannerDiv");
oDiv.innerHTML=_411;
};
function displayBannerIMG(_413,_414){
var oDiv=document.getElementById("lcBannerDiv");
if(oDiv.hasChildNodes()==true){
var _416=oDiv.removeChild(oDiv.firstChild);
}
var _417=document.createElement("a");
var oImg=document.createElement("img");
_417.setAttribute("href",_414);
_417.setAttribute("target","_blank");
oImg.setAttribute("src",_413);
oImg.setAttribute("border",0);
_417.appendChild(oImg);
oDiv.appendChild(_417);
};
function displayBannerHTML(_419){
var oDiv=document.getElementById("lcBannerDiv");
oDiv.innerHTML="";
str="<iframe width=\"300\" height=\"250\" frameborder=\"0\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" src=\""+_419+"\"></iframe>";
oDiv.innerHTML=str;
};
function displayBannerSWF(_41b){
var oDiv=document.getElementById("lcBannerDiv");
oDiv.innerHTML="";
str="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"300\" height=\"250\" id=\"bannerSWF\" align=\"middle\"> ";
str+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
str+="  <param name=\"movie\" value=\""+_41b+"\" />";
str+="  <param name=\"quality\" value=\"high\" />";
str+="  <param name=\"bgcolor\" value=\"#ffffff\" />";
str+="  <embed src=\""+_41b+" \" quality=\"high\" bgcolor=\"#ffffff\" width=\"300\" height=\"250\" name=\"bannerSWF\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
str+="</object>";
oDiv.innerHTML=str;
};
var getElementsByClassName=function(_41d,tag,elm){
if(document.getElementsByClassName){
getElementsByClassName=function(_420,tag,elm){
tag=tag||"*";
elm=elm||document;
var _423=elm.getElementsByClassName(_420),_424=new RegExp("\\b"+((tag!=="*")?tag:"[a-z]+")+"\\b","i"),_425=[],_426;
for(var i=0,il=_423.length;i<il;i+=1){
_426=_423[i];
if(_424.test(_426.nodeName)){
_425.push(_426);
}
}
return _425;
};
}else{
if(document.evaluate){
getElementsByClassName=function(_429,tag,elm){
tag=tag||"*";
elm=elm||document;
var _42c=_429.split(" "),_42d="",_42e="http://www.w3.org/1999/xhtml",_42f=(document.documentElement.namespaceURI===_42e)?_42e:null,_430=[],_431,node;
for(var j=0,jl=_42c.length;j<jl;j+=1){
_42d+="[contains(concat(' ', @class, ' '), ' "+_42c[j]+" ')]";
}
try{
_431=document.evaluate(".//"+tag+_42d,elm,_42f,0,null);
}
catch(e){
_431=document.evaluate(".//"+tag+_42d,elm,null,0,null);
}
while((node=_431.iterateNext())){
_430.push(node);
}
return _430;
};
}else{
getElementsByClassName=function(_435,tag,elm){
tag=tag||"*";
elm=elm||document;
var _438=_435.split(" "),_439=[],_43a=(tag==="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),_43b,_43c=[],_43d;
for(var k=0,kl=_438.length;k<kl;k+=1){
_439.push(new RegExp("(^|\\s)"+_438[k]+"(\\s|$)"));
}
for(var l=0,ll=_43a.length;l<ll;l+=1){
_43b=_43a[l];
_43d=false;
for(var m=0,ml=_439.length;m<ml;m+=1){
_43d=_439[m].test(_43b.className);
if(!_43d){
break;
}
}
if(_43d){
_43c.push(_43b);
}
}
return _43c;
};
}
}
return getElementsByClassName(_41d,tag,elm);
};
function VideoInformationBoxBlogCopyOpen_setPosition(){
var left=0;
var top=0;
if(document.all){
var el=document.getElementById("VideoInformationBoxBlogCopyClosed");
while(el!=null){
offsetLeft=parseInt(el.offsetLeft);
offsetTop=parseInt(el.offsetTop);
if(el.id!="maincontainer"){
if(offsetLeft>0){
left+=offsetLeft;
}
if(offsetTop>0){
top+=offsetTop;
}
}
el=el.offsetParent;
}
}else{
left=document.getElementById("VideoInformationBoxBlogCopyClosed").offsetLeft;
top=document.getElementById("VideoInformationBoxBlogCopyClosed").offsetTop;
}
document.getElementById("VideoInformationBoxBlogCopyOpen").style.left=(left-5)+"px";
document.getElementById("VideoInformationBoxBlogCopyOpen").style.top=(top-7)+"px";
};
function VideoInformationBoxBlogCopyOpen_show(){
VideoInformationBoxBlogCopyOpen_setPosition();
document.getElementById("VideoInformationBoxBlogCopyOpen").style.visibility="visible";
return (false);
};
function VideoInformationBoxBlogCopyOpen_hide(){
document.getElementById("VideoInformationBoxBlogCopyOpen").style.visibility="hidden";
return (false);
};
function VideoInformationBoxBlogCopyOpen_DisplayCodeBox(_447){
var _448=new Array("WebsiteLink","ForumLink","EmailLink");
var _449;
for(box in _448){
if(_448[box]==_447){
_449="block";
}else{
_449="none";
}
document.getElementById("VideoInformationBoxBlogCopyOpen_"+_448[box]).style.display=_449;
}
return (false);
};
var VideoSectionsCarousel_width;
var VideoSectionsCarousel_stepsRemaining=0;
var VideoSectionsCarousel_movementPerStep;
var VideoSectionsCarousel_xpos=0;
function VideoSectionsCarousel_init(){
var el=document.getElementById("VideoSectionsCarousel");
var _44b=el.childNodes.length;
var _44c=0;
for(var _44d=0;_44d<_44b;_44d++){
child=el.childNodes[_44d];
if(child.tagName=="LI"){
if(window.getComputedStyle){
width=parseInt(document.defaultView.getComputedStyle(child,null).getPropertyValue("width"));
}else{
width=child.clientWidth;
}
_44c+=parseInt(width);
}
}
VideoSectionsCarousel_width=_44c;
VideoSectionsCarousel_setButtons();
};
function VideoSectionsCarousel_startScrollLeft(){
if((VideoSectionsCarousel_stepsRemaining==0)&&(VideoSectionsCarousel_xpos>0)){
VideoSectionsCarousel_movementPerStep=-5;
VideoSectionsCarousel_stepsRemaining=15;
setTimeout("VideoSectionsCarousel_doScroll()",10);
}
return (false);
};
function VideoSectionsCarousel_startScrollRight(){
if((VideoSectionsCarousel_stepsRemaining==0)&&((VideoSectionsCarousel_xpos+437)<VideoSectionsCarousel_width)){
VideoSectionsCarousel_movementPerStep=5;
VideoSectionsCarousel_stepsRemaining=15;
setTimeout("VideoSectionsCarousel_doScroll()",10);
}
return (false);
};
function VideoSectionsCarousel_doScroll(){
if(VideoSectionsCarousel_stepsRemaining>0){
if(VideoSectionsCarousel_stepsRemaining==1){
VideoSectionsCarousel_movementPerStep=VideoSectionsCarousel_movementPerStep*2/5;
}
VideoSectionsCarousel_xpos+=VideoSectionsCarousel_movementPerStep;
document.getElementById("VideoSectionsCarousel").style.clip="rect(0px "+(431+VideoSectionsCarousel_xpos)+"px 58px "+(0+VideoSectionsCarousel_xpos)+"px)";
document.getElementById("VideoSectionsCarousel").style.left=(27-VideoSectionsCarousel_xpos)+"px";
VideoSectionsCarousel_stepsRemaining--;
setTimeout("VideoSectionsCarousel_doScroll()",10);
}else{
VideoSectionsCarousel_setButtons();
}
};
function VideoSectionsCarousel_setButtons(){
var _44e="pointer";
var _44f="pointer";
var _450="leftscroll.gif";
var _451="rightscroll.gif";
if(VideoSectionsCarousel_xpos==0){
_44e="default";
_450="leftscroll_disabled.gif";
}
if((VideoSectionsCarousel_xpos+437)>=VideoSectionsCarousel_width){
_44f="default";
_451="rightscroll_disabled.gif";
}
document.getElementById("VideoSectionsCarouselLeftScroller").style.cursor=_44e;
document.getElementById("VideoSectionsCarouselLeftScroller").firstChild.src="/images/furniture/video/videosectionscarousel/"+_450;
document.getElementById("VideoSectionsCarouselRightScroller").style.cursor=_44f;
document.getElementById("VideoSectionsCarouselRightScroller").firstChild.src="/images/furniture/video/videosectionscarousel/"+_451;
};
var WeatherThreeDayForecast={cookieDelimiter:";",currentCityCode:[],currentCityLabel:[],searchTimer:false,searchDelay:230,cookieName:"weather_location",defaultLocation:"London",init:function(id){
dojo.require("dojo.cookie");
var _453=dojo.cookie(WeatherThreeDayForecast.cookieName);
if(_453){
var _454=_453.split(WeatherThreeDayForecast.cookieDelimiter);
WeatherThreeDayForecast.setCurrentCityCode(id,_454[0]);
WeatherThreeDayForecast.setCurrentCityLabel(id,_454[1]);
}
},populateForm:function(id){
dojo.require("dojo.cookie");
dojo.connect(dojo.byId("form_"+id),"onsubmit",this,"formSubmitted");
dojo.connect(dojo.byId("search_"+id),"onfocus",this,function(){
WeatherThreeDayForecast.clearLocationDefault(id);
});
dojo.connect(dojo.byId("saveLocation_"+id),"onclick",this,"formSubmitted");
dojo.connect(dojo.byId("changeLocation_"+id),"onclick",this,function(){
WeatherThreeDayForecast.showSearchLocation(id);
});
var _456=dojo.cookie(WeatherThreeDayForecast.cookieName);
if(_456){
WeatherThreeDayForecast.showDisplayLocation(id);
}else{
WeatherThreeDayForecast.showSearchLocation(id);
}
},getCurrentCityCode:function(id){
return WeatherThreeDayForecast.currentCityCode[id];
},setCurrentCityCode:function(id,_459){
WeatherThreeDayForecast.currentCityCode[id]=_459;
},getCurrentCityLabel:function(id){
return WeatherThreeDayForecast.currentCityLabel[id];
},setCurrentCityLabel:function(id,_45c){
WeatherThreeDayForecast.currentCityLabel[id]=_45c;
},getLocationCookie:function(){
var _45d=dojo.cookie(WeatherThreeDayForecast.cookieName);
if(_45d){
return _45d;
}
return false;
},setLocationCookie:function(_45e){
var _45f;
if(window.location.hostname.indexOf(".orange.co.uk")!=-1){
_45f="orange.co.uk";
}else{
_45f=window.location.hostname;
}
dojo.cookie(WeatherThreeDayForecast.cookieName,_45e,{domain:"."+_45f,expires:830,path:"/"});
},formSubmitted:function(_460){
_460.stopPropagation();
dojo.stopEvent(_460);
var _461=_460.currentTarget.id.split("_");
var _462=dojo.byId("search_"+_461[_461.length-1]);
WeatherThreeDayForecast.setCurrentCityCodeFromLocation(_461[_461.length-1],_462.value);
},setCurrentCityCodeFromLocation:function(id,_464){
if(_464.length>=2){
var _465={url:"/weather/ajax.php",content:{location:_464,townmatch:"on"},preventCache:true,timeout:2000,handleAs:"json",load:dojo.hitch(this,function(data){
if(data.gotStations&&data.stations[0]){
WeatherThreeDayForecast.setCurrentCityCode(id,data.stations[0].station_id);
WeatherThreeDayForecast.setCurrentCityLabel(id,_464);
WeatherThreeDayForecast.updateThreeDayForecast(id);
WeatherThreeDayForecast.showDisplayLocation(id);
}else{
WeatherThreeDayForecast.showLocationError(id);
}
}),error:dojo.hitch(this,function(_467){
WeatherThreeDayForecast.showLocationError(id);
})};
dojo.xhrGet(_465);
}
},updateThreeDayForecast:function(id){
if(!WeatherThreeDayForecast.getCurrentCityCode(id)){
return false;
}
WeatherThreeDayForecast.setLocationCookie(WeatherThreeDayForecast.getCurrentCityCode(id)+WeatherThreeDayForecast.cookieDelimiter+WeatherThreeDayForecast.getCurrentCityLabel(id));
var _469={url:"/weather/content.php",content:{rm:"forecast",json:"true",location:WeatherThreeDayForecast.getCurrentCityCode(id)},preventCache:true,timeout:1000,handleAs:"json",load:function(_46a){
var _46b=dojo.query("#WeatherThreeDayForecast_"+id+" .WeatherForecastDay");
_46b.forEach(function(node,_46d,_46e){
for(var key in _46a[_46d]){
var _470=dojo.query("."+key,node);
if(_470[0]){
var _471=_470[0];
if(_471.tagName.toLowerCase()!="img"){
_471.innerHTML=_46a[_46d][key];
}else{
_471.src="/images/furniture/news/weather/"+_46a[_46d][key]+".gif";
_471.alt=_46a[_46d]["summary"];
_471.title=_46a[_46d]["summary"];
}
}
}
});
},error:dojo.hitch(this,function(_472){
WeatherThreeDayForecast.showLocationError(id);
})};
dojo.xhrGet(_469);
},updateDisplayLocation:function(id){
var _474=WeatherThreeDayForecast.getLocationCookie();
var _475=dojo.query("#displayLocation_"+id+" p.location");
if(!_475[0]){
return false;
}
if(_474){
var _476=_474.split(WeatherThreeDayForecast.cookieDelimiter);
_475[0].innerHTML=_476[_476.length-1];
}else{
if(WeatherThreeDayForecast.getCurrentCityLabel(id)){
_475[0].innerHTML=WeatherThreeDayForecast.getCurrentCityLabel(id);
}
}
},showDisplayLocation:function(id){
WeatherThreeDayForecast.updateDisplayLocation(id);
dojo.style(dojo.byId("searchLocation_"+id),"display","none");
dojo.style(dojo.byId("displayLocation_"+id),"display","block");
},showSearchLocation:function(id){
WeatherThreeDayForecast.setLocationDefault(id);
dojo.style(dojo.byId("displayLocation_"+id),"display","none");
dojo.style(dojo.byId("searchLocation_"+id),"display","block");
},fiveDayForecast:function(id){
if(WeatherThreeDayForecast.getCurrentCityCode(id)){
document.location="http://orangeuk.accuweather.com/orange/forecast.asp?location="+WeatherThreeDayForecast.getCurrentCityCode(id);
}else{
document.location="http://orangeuk.accuweather.com/orange/forecast.asp?location="+WeatherThreeDayForecast.defaultLocation;
}
},weatherHomepage:function(id){
if(WeatherThreeDayForecast.getCurrentCityCode(id)){
document.location="http://orangeuk.accuweather.com/orange/index.asp?location="+WeatherThreeDayForecast.getCurrentCityCode(id);
}else{
document.location="http://orangeuk.accuweather.com/orange/index.asp?location="+WeatherThreeDayForecast.defaultLocation;
}
},clearLocationDefault:function(id){
var _47c=dojo.byId("search_"+id);
if(!_47c){
return false;
}
if(_47c.value=="enter postcode or town"||_47c.value=="location not found"){
_47c.value="";
}
},setLocationDefault:function(id){
var _47e=dojo.byId("search_"+id);
if(!_47e){
return false;
}
_47e.value="enter postcode or town";
},showLocationError:function(id){
var _480=dojo.byId("search_"+id);
if(!_480){
return false;
}
_480.value="location not found";
}};
function parseLayout(){
cnt=document.getElementById("maincontainer");
return new PillParser(cnt);
};
function fixLayout(_481){
for(var i=0;i<_481.length;i++){
_481[i].setHeight();
}
};
function printLayout(_483){
for(var i=0;i<_483.length;i++){
var _485=_483[i].debug();
document.write(_485);
}
};
PillParser=function(_486){
this.dom_node=_486;
return this.parse();
};
PillParser.prototype.isPlaceholder=function(node){
var _488=new RegExp("\\bwpm_ph\\b");
return _488.test(node.className);
};
PillParser.prototype.isPill=function(node){
var _48a=new RegExp("\\bpill_row\\b|\\bpill_col\\b");
return _48a.test(node.className);
};
PillParser.prototype.isCol=function(node){
var _48c=new RegExp("\\bcol\\b");
return _48c.test(node.className);
};
PillParser.prototype.isRow=function(node){
var _48e=new RegExp("\\brow\\b");
return _48e.test(node.className);
};
PillParser.prototype.parse=function(){
var _48f=new Array();
var _490=new Array();
for(var i=0;i<this.dom_node.childNodes.length;i++){
var node=this.dom_node.childNodes[i];
if(this.isPlaceholder(node)){
for(var j=0;j<node.childNodes.length;j++){
_490.push(node.childNodes[j]);
}
}else{
_490.push(node);
}
}
for(var i=0;i<_490.length;i++){
var node=_490[i];
var _494=false;
if(this.isPill(node)){
_494=new PillModel(node);
}else{
if(this.isCol(node)){
_494=new ColModel(node);
}else{
if(this.isRow(node)){
_494=new RowModel(node);
}
}
}
if(_494){
_494.parse();
_48f.push(_494);
}
}
return _48f;
};
PillModel=function(_495){
this.dom_node=_495;
this.Pill=1;
};
PillModel.prototype.parse=function(){
};
PillModel.prototype.getHeight=function(){
return this.dom_node.offsetHeight;
};
PillModel.prototype.getExtra=function(_496){
var _497=[["border-bottom-width","borderBottomWidth"],["border-top-width","borderTopWidth"],["padding-top","paddingTop"],["padding-bottom","paddingBottom"],["margin-top","marginTop"],["margin-bottom","marginBottom"]];
var _498=0;
for(var i=0;i<_497.length;i++){
var prop=_497[i];
var _49b=null;
if(_496.currentStyle){
_49b=_496.currentStyle[prop[1]];
}else{
if(window.getComputedStyle){
_49b=document.defaultView.getComputedStyle(_496,null).getPropertyValue(prop[0]);
}
}
var _49c=parseInt(_49b,10);
if(!isNaN(_49c)){
_498+=_49c;
}
}
return _498;
};
PillModel.prototype.reveal=function(){
};
PillModel.prototype.setHeight=function(_49d){
if(!_49d){
this.reveal();
return;
}
var _49e=_49d-this.getHeight();
var _49f=_49d-this.getExtra(this.dom_node);
this.dom_node.style.height=_49f+"px";
var _4a0=new RegExp("\\bexpandable\\b");
var _4a1=this.dom_node.getElementsByTagName("div");
for(var i=0;i<_4a1.length;i++){
var _4a3=_4a1[i];
if(_4a0.test(_4a3.className)){
var _4a4=this.getExtra(_4a3);
_4a4=isNaN(_4a4)?0:_4a4;
var _4a5=_4a3.offsetHeight;
var _4a6=_4a5+_49e-_4a4;
_4a3.style.height=_4a6+"px";
}
}
this.reveal();
};
PillModel.prototype.isFixedHeight=function(){
var _4a7=new RegExp("\\bfixed_height\\b");
return _4a7.test(this.dom_node.className);
};
PillModel.prototype.debug=function(){
return "<div style=\"border:2px solid red;padding:4px\">Pill: "+this.getHeight()+"</div>";
};
ColModel=function(_4a8){
this.dom_node=_4a8;
this.Col=1;
};
ColModel.prototype.parse=function(){
this.children=new PillParser(this.dom_node);
};
ColModel.prototype.getHeight=function(){
if(this.calcedHeight){
return this.calcedHeight;
}
var _4a9=0;
for(var i=0;i<this.children.length;i++){
_4a9+=this.children[i].getHeight();
}
this.calcedHeight=_4a9;
return _4a9;
};
ColModel.prototype.setHeight=function(_4ab){
var _4ac=this.getHeight();
var _4ad=_4ab-_4ac;
var _4ae=0;
var _4af=this.children.length;
for(var i=0;i<_4af;i++){
var _4b1=this.children[i];
if(_4b1.isFixedHeight&&!_4b1.isFixedHeight()){
_4ae++;
}
}
var _4b2=0;
var _4b3=0;
for(var i=0;i<_4af;i++){
var _4b4=Math.floor(_4ad/_4ae);
if(_4b3>=(_4ae-1)){
_4b4=_4ad-_4b2;
}
var _4b1=this.children[i];
if(_4b1.isFixedHeight&&_4b1.isFixedHeight()){
_4b1.setHeight();
continue;
}
if(_4ab){
_4b1.setHeight(_4b1.getHeight()+_4b4);
_4b2+=_4b4;
_4b3++;
}else{
_4b1.setHeight();
}
}
};
ColModel.prototype.debug=function(){
var str="<div style=\"border:2px solid green;padding:4px\">Col: "+this.getHeight();
for(var i=0;i<this.children.length;i++){
str+=this.children[i].debug();
}
str+="</div>";
return str;
};
ColModel.prototype.isFixedHeight=function(){
for(var i=0;i<this.children.length;i++){
if(!this.children[i].isFixedHeight()){
return false;
}
}
return true;
};
RowModel=function(_4b8){
this.dom_node=_4b8;
this.Row=1;
};
RowModel.prototype.parse=function(){
this.children=new PillParser(this.dom_node);
};
RowModel.prototype.setHeight=function(_4b9){
var _4ba=_4b9;
if(!_4b9){
_4ba=this.getHeight();
}
for(var i=0;i<this.children.length;i++){
var _4bc=this.children[i];
var _4bd=null;
if(this.isJustified()&&_4bc.getHeight()<_4ba||_4b9){
_4bd=_4ba;
}
_4bc.setHeight(_4bd);
}
};
RowModel.prototype.getHeight=function(){
if(this.calcedHeight){
return this.calcedHeight;
}
var _4be=0;
for(var i=0;i<this.children.length;i++){
var _4c0=this.children[i].getHeight();
if(_4c0>_4be){
_4be=_4c0;
}
}
this.calcedHeight=_4be;
return _4be;
};
RowModel.prototype.isJustified=function(){
var _4c1=new RegExp("\\justified\\b");
return _4c1.test(this.dom_node.className);
};
RowModel.prototype.debug=function(){
var str="<div style=\"border:2px solid blue;padding:4px\">Row: "+this.getHeight();
for(var i=0;i<this.children.length;i++){
str+=this.children[i].debug();
}
str+="</div>";
return str;
};
RowModel.prototype.isFixedHeight=function(){
for(var i=0;i<this.children.length;i++){
if(this.children[i].isFixedHeight()){
return true;
}
}
return false;
};
_MetaRegister=new Array();
function RegisterMeta(name,_4c6){
var tmp=new Object();
tmp.meta_name=name;
tmp.meta_value=_4c6;
_MetaRegister.push(tmp);
};
function widgetFeedbackSubmit(_4c8){
var _4c9=document.getElementById("feedback_"+_4c8).value;
if(!_4c9||_4c9==""){
alert("Please enter your feedback before you click send");
return false;
}
return true;
};
function widgetFeedbackForm(id){
this.id=id;
this.component=document.getElementById(this.id);
};
widgetFeedbackForm.prototype.addExtraField=function(name){
if(this.component){
var _4cc=document.createElement("input");
if(_4cc){
_4cc.setAttribute("type","hidden");
_4cc.setAttribute("value","1");
_4cc.setAttribute("name",name);
this.component.appendChild(_4cc);
}
}
return;
};

