Number.prototype.toStringPad=function(p,s){var n=Math.abs(this).toString();while(n.length<p)n='0'+n;return s ||0>this?(0>this?'-':'+')+n:n;};if(!document.getElementsByTagName){document.getElementsByTagName=function(t){var n,q=[];if(document.all)for(n=0;n<document.all.length;++n)if(t==document.all[n].nodeName)q[q.length]=document.all[n];return q;};}if(!document.getElementById){document.getElementById=function(i){return document.all&&document.all[i]?document.all[i]:{};}}function $F(f,e){var x =document.forms[f];return!x||!e?x:(x.elements[e]);}function $I(i){return document.getElementById(i);}function $N(i){return document.getElementsByTagName(i);}function $L(i){if(i)window.location.href=i;else return window.location.href;}function $W(i,m,w,h){if(!w)var w =800;if(!h)var h =600;var x =(!m?',status=0,toolbar=0,location=0,menubar=0,directories=0':'');window.open(i,'_blank','status=0,toolbar=0,resizable=0,width='+w+',height='+h+x);}function $E(e,l,t){if('string'==typeof(e))e=$I(e);if(!t)var t ='click';if(!!e){if(!l)var l =false;if(!!e.addEventListener)e.addEventListener(t,l,false);else e['on'+t]=l;e[t+'_act_']=l;}}function $R(){return document.referrer?document.referrer:'';}function $S(f){if(!window._load)window._load=(!window.onload?[]:[window.onload]);window._load[window._load.length]=f;window.onload=function(){var n;for(n=0;n<window._load.length;++n)if('function'==typeof(window._load[n]))window._load[n]();};}if(!HTMLButtonElement)var HTMLButtonElement={prototype:{}};if(!HTMLInputElement)var HTMLInputElement={prototype:{}};if(!HTMLSelectElement)var HTMLSelectElement={prototype:{}};if(!HTMLTextAreaElement)var HTMLTextAreaElement={prototype:{}};if(!HTMLFormElement)var HTMLFormElement={prototype:{}};HTMLButtonElement.prototype.on=HTMLInputElement.prototype.on=HTMLSelectElement.prototype.on=HTMLTextAreaElement.prototype.on=HTMLFormElement.prototype.on=function(){var n,a=arguments;for(n=0;n<a.length-1;++n){var i =a[n].toLowerCase();this['vue'==i?'onclick':'on'+i]=this.act_;if(true!==a[a.length-1]){this[i+'_act_']=a[a.length-1];}}};HTMLButtonElement.prototype.act_=HTMLInputElement.prototype.act_=HTMLSelectElement.prototype.act_=HTMLTextAreaElement.prototype.act_=HTMLFormElement.prototype.act_=function(e){if(!e)var e =(window.event?window.event:{internal_:true});if(this.vue_&&this.vue_act_&&('click'==e.type||'dblclick'==e.type))this.vue_act_(e);if('change'==e.type&&this.check)this.check(true);if(!this[e.type+'_act_'])if(!this.form||!this.form[e.type+'_act_'])return true;if(!e.internal_){e.from=e.relatedTarget||e.fromElement;e.src=(window.event?e.srcElement:e.target);if(3==e.src.nodeType)e.src=e.src.parentNode;e.to=e.relatedTarget||e.fromElement;if('click'==e.type||'dblclick'==e.type)e.btn=(e.which&&1==e.which?1:(e.button&&(0==e.button||1==e.button)?1:0))+(e.which&&3==e.which?2:(e.button&&2==e.button?2:0))+(e.which&&2==e.which?4:(e.button&&4==e.button?4:0));if(e.pageX||e.pageY){e.xps=e.pageX;e.yps=e.pageY;}else if(e.clientX||e.clientY){e.xps=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;e.yps=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}else e.xps=e.yps=0;}return this[e.type+'_act_']?this[e.type+'_act_'](e):this.form[e.type+'_act_']?this.form[e.type+'_act_'](e):true;};HTMLButtonElement.prototype.vue_act_=HTMLInputElement.prototype.vue_act_=HTMLSelectElement.prototype.vue_act_=HTMLTextAreaElement.prototype.vue_act_=HTMLFormElement.prototype.vue_act_=function(){};HTMLButtonElement.prototype.get=HTMLInputElement.prototype.get=HTMLSelectElement.prototype.get=HTMLTextAreaElement.prototype.get=HTMLFormElement.prototype.get=function(v){var n=0,l,r=[];if('FORM'==this.tagName){var k,t=this.elements;if(!v){for(n=0;n<t.length;++n)if(t[n].get){if(t[n].name)r[t[n].name]=t[n].get();else if(t[n].id)r[t[n].id]=t[n].get();}}else{for(k in v )if(t[v[k]]&&t[v[k]].get)r[k]=t[v[k]].get();}return r;}else switch(this.type){case'select-one':case'select-multiple':while(n<this.options.length)if(true==this.options[n++].selected)r[r.length]=this.options[n-1].value;return 0==r.length?false:r.join(';');case'radio':for(l=this.form[this.name];n<l.length;++n)if(true==l[n].checked)r[r.length]=l[n].value;return 0==r.length?false:r.join(';');case'checkbox':return this.checked&&this.value?this.value:this.checked;default:return this.value;}};HTMLButtonElement.prototype.toString=HTMLInputElement.prototype.toString=HTMLSelectElement.prototype.toString=HTMLTextAreaElement.prototype.toString=function(){return this.get().toString();};HTMLButtonElement.prototype.set=HTMLInputElement.prototype.set=HTMLSelectElement.prototype.set=HTMLTextAreaElement.prototype.set=HTMLFormElement.prototype.set=function(v,t,sv){var n=0,l,o,k;if(undefined===v)var v ='';if('FORM'==this.tagName){var t =this.elements;for(k in v )if(t[k])t[k].set(v[k]);}else switch(this.type){case'select-one':case'select-multiple':if('object'==typeof(v)){this.options.length=0;for(k in v ){this.options[this.options.length]=new Option(v[k],k);if(t==k)this.selectedIndex=this.options.length-1;}}else{for(n=0;n<this.options.length;++n){if(this.options[n].value==v){this.selectedIndex=n;if(this.set_act_)this.act_({type:'set',internal_:true});return this;}}if(t){o=new Option(t,v);if(this.add){for(n=0;n<this.options.length;++n){if(sv?this.options[n].value>v:this.options[n].name>t){try{this.add(o,this.options[n]);}catch(ie){this.add(o,n);}this.selectedIndex=n;if(this.set_act_)this.act_({type:'set',internal_:true});return this;}}}this.options[this.options.length]=o;this.selectedIndex=this.options.length-1;}}return this;case'radio':for(l=this.form[this.name];n<l.length;++n)l[n].checked=!!(l[n].value==v);break;case'checkbox':this.checked=!!v;break;default:this.value=v;}if(this.set_act_)this.act_({type:'set',internal_:true});return this;};HTMLButtonElement.prototype.check=HTMLInputElement.prototype.check=HTMLSelectElement.prototype.check=HTMLTextAreaElement.prototype.check=function(md){var k ={numi:'0123456789',numn:'0123456789.',numb:'01',numh:'0123456789abcdefABCDEF',numo:'01234567',nump:'0123456789.',numd:'0123456789.',nume:'0123456789.',nums:'0123456789.',numz:'0123456789- ',luhn:'0123456789',txta:'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',tele:'0123456789+',post:'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'},p={nump:'£',numd:'$',nume:'E'},s={},h={nums:'+-'},t={},j={numn:'.',nump:'.',numd:'.',nume:'.',nums:'.',emal:'@'},f={lowr:function(q){return q.toLowerCase();},uppr:function(q){return q.toUpperCase();},post:function(q){var c =q.toUpperCase();return c.substr(0,c.length-3)+' '+c.substr(c.length-3,3);},emal:function(q){var c =q.split(' ').join('').split('@');return 2 ==c.length&&-1!=c[1].indexOf('.')?c[0]+'@'+c[1].toLowerCase():false;},name:function(q){var n,f=true,r='';for(n=0;n<q.length;++n,f=(-1<" .-'".indexOf(r.charAt(r.length-1))))r+=(f?q.charAt(n).toUpperCase():q.charAt(n).toLowerCase());return r;}},vm=(!this.className?[0,'']:this.className.split('-')),vp='',vs='',vc='',v,n;v=this.get();if(!!k[vm[1]]){for(n=0;n<v.length;++n)if(-1!=k[vm[1]].indexOf(v.charAt(n)))vc+=v.charAt(n);}else vc=v;if(!!j[vm[1]]){vc=vc.split(j[vm[1]]);vc[0]+=j[vm[1]];vc=vc.join('');}if(!!f[vm[1]])if(false===(vc=f[vm[1]](vc)))return false;if(!!p[vm[1]])vc=p[vm[1]]+vc;if(!!s[vm[1]])vc=vc+s[vm[1]];if(vc!=v&&!!md)this.set(v=vc);return vc==v&&(!vm[2]?0:parseInt('0'+vm[2]))<=vc.length&&vc.length<=(!vm[3]?999999:parseInt('0'+vm[3]))&&(!this.oncheck||this.oncheck({internal_:true,type:'check'}));};{var idn_=0,ids_=0;if(!Date.prototype.getAge){Date.prototype.getAge=function(d){if(!d)var d =new Date;return d.getFullYear()-this.getFullYear()+(d.getMonth()>this.getMonth()||(d.getMonth()==this.getMonth()&&d.getDate()>this.getDate())?1:0);};}if(!Date.prototype.getFullYear){Date.prototype.getFullYear=function(){return this.getYear()+1900;};}if(!Date.prototype.setFullYear){Date.prototype.setFullYear=function(y){this.setYear(y);};}Date.prototype.getDayName=function(n){var d =['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];return d[n?n%7:this.getDay()%7];};Date.prototype.getMonthName=function(n){var m =['January','Febuary','March','April','May','June','July','August','September','October','November','December'];return m[n?n%12:this.getMonth()%12];};Date.prototype.calendar=function(ce,nt,s,ml){var m,b,l,r,i=this.id_=++idn_;var n,c,d,t,h=['<table class="calendar" cellspacing="0" cellpadding="0">'];if(!s)var s =(this.interval?this.interval:1440);this.interval=s;if(!ml)var ml=12;if(nt)h[h.length]='<tr><th colspan="'+(1440<=this.interval?7:16)+'"><h4><input type="button" class="date-hide" id="date-hide-'+i+'" value="X"> &nbsp;'+nt+'</h4></th></tr>';h[h.length]='<tr><th>'+['S','M','T','W','T','F','S'].join('</th><th>')+(1440<=this.interval||this.noClock?'</th></tr>':'</th><th rowspan="8">&nbsp;</th><th colspan="8">Time</th></tr>');for(n=c=0,t=50;n<6;++n){h[h.length]='<tr>';for(m=0;m<7;++m){h[h.length]='<td><input type="button" class="date-grey" name="date-'+(++c)+'-'+i+'" value=""></td>';}if(1440>this.interval&&!this.noClock){for(m=0;m<8;++m){h[h.length]='<td><input type="button" class="date-grey" name="date-'+(++t)+'-'+i+'" value=""></td>';}}h[h.length]='</tr>';}h[h.length]='<tr><td><input type="button" class="date-pick" name="date-back-'+i+'" value="&larr;"></td><td colspan="5"><select class="date-pick" name="date-pick-'+i+'">';for(n=0,(d=new Date(this)).setDate(1);n<ml;++n){h[h.length]='<option value="'+(d.getFullYear()*100+d.getMonth()+1)+'">'+d.getMonthName()+' '+d.getFullYear()+'</option>';d.setMonth(d.getMonth()+1);}h[h.length]='</select></td><td><input type="button" class="date-pick" name="date-next-'+i+'" value="&rarr;"></td></tr></table>';h[h.length]='</table>';if(document.createElement){var e =document.createElement('DIV');e.innerHTML=h.join('');if('string'==typeof(ce))ce=$I('view-'+ce);if(!ce)ce=document.body;ce.appendChild(e);}for(n=0;n<document.forms.length;++n){if(document.forms[n].elements['date-pick-'+i]){document.forms[n]['date-'+i]=this;this.form=document.forms[n];this.form.elements['date-back-'+i].onclick=function(){this.form['date-'+i].setDate(0);this.form['date-'+i].refresh();};this.form.elements['date-next-'+i].onclick=function(){this.form['date-'+i].setMonth(this.form['date-'+i].getMonth()+1);this.form['date-'+i].setDate(1);this.form['date-'+i].refresh();};this.form.elements['date-pick-'+i].onchange=function(){var v =this.options[this.selectedIndex].value;this.form['date-'+i].setMonth(v%100-1);this.form['date-'+i].setFullYear(Math.floor(v/100));this.form['date-'+i].refresh();};for(m=1;m<43;++m){this.form.elements['date-'+m+'-'+i].onclick=function(){if(''!=this.value){var dd=this.form['date-'+i];var dn=new Date(dd);dn.setDate(this.value-0);if(dd.minimum<=dn&&dn<=dd.maximum){dd.setDate(this.value-0);dd.refresh();if($I('view-'+dd.name))$I('view-'+dd.name).className='view-hide';}}};}if(1440>this.interval&&!this.noClock)for(m=51;m<99;++m){this.form.elements['date-'+m+'-'+i].onclick=function(){var b =this.form['date-'+i];var s =(!b.interval?15:b.interval),t=b.getHours()*60+b.getMinutes();switch(this.value){case'<':t-=b.interval;case'':break;case'>':t+=b.interval;case'00':break;default:if(!isNaN(this.value-0)&&this.value<24)t=this.value*60;}t=Math.round(t/b.interval)*b.interval;b.setHours(Math.floor(t/60));b.setMinutes(t%60);b.setSeconds(0);b.refresh();};}}}if(nt)$E('date-hide-'+i,function(){ce.className='view-hide';});this.refresh();return this;};Date.prototype.refresh=function(s){var n,c,d,l,b,i=this.id_;if(!s)var s =++ids_;else if(this.seq_&&s==this.seq_)return;this.seq_=s;if(!this.lastDate)this.lastDate=this;if(this.minimum)while(this.minimum>this){if(this.getFullYear()<(this.minimum.getFullYear()-2))this.setFullYear(this.minimum.getFullYear()-1);else if(this.getMonth()<this.minimum.getMonth())this.setMonth(this.getMonth()+1);else if(this.getMonth()==this.minimum.getMonth()&&this.getDate()<this.lastDate.getDate())this.setMonth(this.getMonth()+1);else this.setDate(this.getDate()+1);}else this.minimum=new Date(1901,1,1);if(this.maximum)while(this.maximum<this){if(this.getFullYear()>(this.maximum.getFullYear()+2))this.setFullYear(this.maximum.getFullYear()+2);else if(this.getMonth()<this.maximum.getMonth())this.setMonth(this.getMonth()-1);else this.setDate(this.getDate()-1);}else this.maximum=new Date(3001,1,1);if(this.setMinimum)while(this.setMinimum>this)this.setMinimum.setTime(this.setMinimum.getTime()-(this.setMinimum.interval?this.setMinimum.interval:1440)*60000);else this.setMinimum=new Date(this.minimum);if(this.setMaximum)while(this.setMaximum<this)this.setMaximum.setTime(this.setMaximum.getTime()+(this.setMaximum.interval?this.setMaximum.interval:1440)*60000);else this.setMaximum=new Date(this.maximum);if(i){if(this.form){d=new Date(this);d.setDate(1);d=d.getDay()+1;l=new Date(this);l.setDate(1);l.setMonth(l.getMonth()+1);l.setDate(-1);l=d+l.getDate();c=new Date(this);c.setDate(1);for(n=1;n<43;++n){b=this.form.elements['date-'+n+'-'+i];if(n<d||n>l){b.value='';b.className='date-grey';}else{if(c<this)b.className=(this.setMinimum&&c<this.setMinimum?'date-below':'date-before');else if(c>this)b.className=(this.setMaximum&&c>this.setMaximum?'date-above':'date-after');else b.className='date-this';c.setDate((b.value=c.getDate())+1);}if(!b.get)b.get=HTMLInputElement.prototype.get;if(!b.set)b.set=HTMLInputElement.prototype.set;}if(1440>this.interval&&!this.noClock){var clk=[55,56,57,65,66,74,82,90,89,97,96,95,94,93,92,84,83,75,67,59,60,52,53,54];for(n=0;n<clk.length;++n){b=this.form.elements['date-'+clk[n]+'-'+i];b.value=n;b.className=(n<this.getHours()?'date-before':(n>this.getHours()?'date-after':'date-this'));if(!b.get)b.get=HTMLInputElement.prototype.get;if(!b.set)b.set=HTMLInputElement.prototype.set;}this.form.elements['date-70-'+i].value=this.getHours().toStringPad(2);this.form.elements['date-71-'+i].value=this.getMinutes().toStringPad(2);this.form.elements['date-78-'+i].value='<';this.form.elements['date-79-'+i].value='>';}b=this.form.elements['date-pick-'+i];if(!b.get)b.get=HTMLSelectElement.prototype.get;if(!b.set)b.set=HTMLSelectElement.prototype.set;b.set(this.getFullYear()*100+this.getMonth()+1,this.getMonthName()+' '+this.getFullYear(),true);}}if(this.dates_&&this.dates_.length)for(n=0;n<this.dates_.length;++n)this.dates_[n].refresh(s);if(this.targets_&&this.targets_.length)for(n=0;n<this.targets_.length;++n)this.targets_[n].setDate(this);if(this.x_)this.x_();};Date.prototype.setLink=function(){var n;if(!this.dates_)this.dates_=arguments;else for(n=0;n<arguments.length;++n)this.dates_[this.dates_.length]=arguments[n];return this;};Date.prototype.setTarget=function(){var n,t;if(!this.targets_)this.targets_=[];for(n=0;n<arguments.length;++n){t=this.targets_[this.targets_.length]=arguments[n];t.date=this;if(!t.act_||!t.get||!t.set||!t.on){t.act_=HTMLInputElement.prototype.act_;t.get=HTMLInputElement.prototype.get;t.set=HTMLInputElement.prototype.set;t.on=HTMLInputElement.prototype.on;}t.on('change','blur',function(){var n,x=this.get(),th=this.date.getHours(),tm=this.date.getMinutes(),ts=this.date.getSeconds(),d=this.date.getDate(),m=1+this.date.getMonth(),y=this.date.getFullYear();this.date.lastDate=new Date(this.date);if(''==x){for(n=0;n<this.date.targets_.length;++n)this.date.targets_[n].set('');return;}var ss=(x+'//').split('/'),sh=(x+'--').split('-'),c=this.className.split('-'),id=0,im=0;switch(c[2]?c[2]:(''!=ss[2]?'uk':(''!=sh[2]?'iso':(''!=ss[1]?'myuk':(''!=sh[1]?'myiso':(-1<x.indexOf(':')?'time':'stamp')))))){case'time':x=(x+'::').split(':');th=x[0]-0;tm=x[1]-0;ts=x[2]-0;break;case'us':if(-1<x.indexOf('/')){d=ss[1]-0;m=ss[0]-0;y=ss[2]-0;}else if(6==x.length||8==x.length){d=x.substring(2,4)-0;m=x.substring(0,2)-0;y=x.substring(4)-0;}break;case'uk':if(-1<x.indexOf('/')){d=ss[0]-0;m=ss[1]-0;y=ss[2]-0;}else if(6==x.length||8==x.length){d=x.substring(0,2)-0;m=x.substring(2,4)-0;y=x.substring(4)-0;}break;case'myus':case'myuk':d=1;if(-1<x.indexOf('/')){m=ss[0]-0;y=ss[1]-0;}else if(4==x.length||6==x.length){m=x.substring(0,2)-0;y=x.substring(2)-0;}break;case'iso':d=sh[2]-0;m=sh[1]-0;y=sh[0]-0;break;case'myiso':d=1;m=sh[1]-0;y=sh[0]-0;break;case'second':ts=x-0;break;case'minute':tm=x-0;break;case'hour':th=x-0;break;case'day':d=x-0;break;case'month':m=x-0;break;case'year':y=x-0;break;case'my':m=x%100;y=Math.floor(x/100);break;case'days':if(this.date.setMinimum){d=x-1+this.date.setMinimum.getDate();m=1+this.date.setMinimum.getMonth();y=this.date.setMinimum.getFullYear();}break;case'months':if(this.date.setMinimum){d=this.date.setMinimum.getDate();m=x-0+1+this.date.setMinimum.getMonth();y=this.date.setMinimum.getFullYear();}break;case'dstamp':case'stamp':x=this.get().split('T')[0];d=x%100;m=Math.floor(x/100)%100;y=Math.floor(x/10000);x=(this.get()+'T').split('T')[1];case'tstamp':th=x.substring(0,2)-0;tm=x.substring(2,4)-0;ts=x.substring(4,6)-0;break;}if(isNaN(y))y=this.date.getFullYear();this.date.setFullYear(y+(y<33?2000:(y<100?1900:0)),(isNaN(m)?this.date.getMonth()+1:m)+im-1,(isNaN(d)?this.date.getDate():d)+id);if(!isNaN(th))this.date.setHours(th);if(!isNaN(tm))this.date.setMinutes(tm);if(!isNaN(ts))this.date.setSeconds(ts);this.date.refresh();});t.setDate=function(q){var v ='',c=this.className.split('-'),th=q.getHours(),tm=q.getMinutes(),ts=q.getSeconds(),d=q.getDate(),m=1+q.getMonth(),n=q.getMonthName(),y=q.getFullYear(),x=this.get();var ss=(x+'//').split('/'),sh=(x+'--').split('-');switch(c[2]?c[2]:(''!=ss[2]?'uk':(''!=sh[2]?'iso':(''!=ss[1]?'myuk':(''!=sh[1]?'myiso':(-1<x.indexOf(':')?'time':'stamp')))))){case'time':v=th.toStringPad(2)+':'+tm.toStringPad(2)+(0==ts?'':':'+ts.toStringPad(2));break;case'us':v=m.toStringPad(2)+'/'+d.toStringPad(2)+'/'+y;break;case'uk':v=d.toStringPad(2)+'/'+m.toStringPad(2)+'/'+y;break;case'myus':case'myuk':v=m.toStringPad(2)+'/'+y;break;case'iso':v=y+'-'+m.toStringPad(2)+'-'+d.toStringPad(2);break;case'myiso':v=y+'-'+m.toStringPad(2);break;case'second':v=ts;break;case'minute':v=tm;break;case'hour':v=th;break;case'day':v=d;break;case'month':v=m;break;case'year':v=y;break;case'my':v=y*100+m;break;case'days':v=(this.date.setMinimum?Math.ceil((this.date.getTime()-this.date.setMinimum.getTime())/(24*60*60*1000))+1:'');break;case'months':x=new Date(this.date.setMinimum?this.date.setMinimum:this.date.minimum);v=(this.date.getFullYear()-x.getFullYear())*12+this.date.getMonth()-x.getMonth()+(this.date.getDate()<=x.getDate()?0:1);break;case'rfc':v=q.getDayName().substring(0,3)+', '+d+' '+q.getMonthName().substring(0,3)+' '+y+' '+q.getHours().toStringPad(2)+':'+q.getMinutes().toStringPad(2)+':'+q.getSeconds().toStringPad(2)+' '+(Math.floor(q.getTimezoneOffset()/60)*100+q.getTimezoneOffset()%60).toStringPad(4,true);break;case'stamp':v=y*10000+m*100+d+(0==th&&0==tm&&0==ts?'':'T'+(th*10000+tm*100+ts).toStringPad(6));break;case'dstamp':v=y*10000+m*100+d;break;case'tstamp':v=(th*10000+tm*100+ts).toStringPad(6);break;}if(this.set)this.set(v);};t.setDate(this);}return this;};Date.prototype.getHTML=function(i,s,m,x){var n,d,h=[];if(!this.interval)this.interval=1440;if(!s)s=this.interval;else this.interval=s;if(!m)m=this.minimum;else this.minimum=m;if(!x)x=this.maximum;else this.maximum=x;if(s&&0!=(s%1440)){h[h.length]='<div class="datetime"><select name="'+i+'-time" id="'+i+'-time" class="date-pick-tstamp">';for(n=0;n<1440;n+=s)h[h.length]='<option value="'+(Math.floor(n/60)*100+n%60).toStringPad(4)+'00">'+Math.floor(n/60)+':'+(n%60).toStringPad(2)+'</option>';h[h.length]='</select>';}else h[h.length]='<div class="date">';h[h.length]='<select name="'+i+'-day" id="'+i+'-day" class="date-pick-day">';for(n=1;n<32;++n)h[h.length]='<option value="'+n+'">'+n+'</option>';h[h.length]='</select><select name="'+i+'-my" id="'+i+'-my" class="date-pick-my">';for((d=new Date(m.getTime())).setDate(1);d<=x;d.setMonth(d.getMonth()+1)){h[h.length]='<option value="'+(d.getFullYear()*100+d.getMonth()+1)+'">'+d.getMonthName().substring(0,3)+' '+d.getFullYear()+'</option>';}h[h.length]='</select><input type="hidden" id="'+i+'-date" name="'+i+'-date" value="" class="date-pick-stamp"><input type="button" id="'+i+'-calendar" class="'+i+'-calendar" value=" "></div>';h[h.length]='<div id="view-'+i+'" class="view-hide">&nbsp;</div>';this.name=i;return h.join('');};Date.prototype.activateHTML=function(i){var s =$I(i+'-time');if(s)this.setTarget(s);this.setTarget($I(i+'-day'),$I(i+'-my'),$I(i+'-date'));$E(i+'-calendar',function(e){if(!e)var e =window.event;if(!!e)var i =$I('view-'+(e.target?e.target:(e.srcElement?e.srcElement:this)).className.split('-')[0]);if(!!i)i.className=('view-show'==i.className?'view-hide':'view-show');});return this.refresh();};}String.prototype.luhnCheck=function(){var cc=this.replace(/[^0-9]/g,'');if(''==cc)return false;var n,d,s=0,oe=cc.length&1;for(n=0;n<cc.length;++n){d=parseInt(cc.charAt(n));if(!((n&1)^oe))if(9<(d*=2))d-=9;s+=d;}return 0 ==(s%10);};String.prototype.toStringXML=String.prototype.encodeTag=String.prototype.encodeData=function(){return this.split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;').split('"').join('&quot;');};String.prototype.decodeTag=String.prototype.decodeData=function(){return this.split('&quot;').join('"').split('&gt;').join('>').split('&lt;').join('<').split('&amp;').join('&');};String.prototype._base64='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';String.prototype.encodeBase64=function(){var r ='',n=0,c1,c2,c3,t,k=this._base64;while(n<this.length){c1=this.charCodeAt(n++);c2=this.charCodeAt(n++);c3=this.charCodeAt(n++);r+=k.charAt(c1>>2);t=(c1&3)<<4;if(!isNaN(c2)){r+=k.charAt(t+(c2>>4));t=(c2&15)<<2;if(!isNaN(c3)){r+=k.charAt(t+(c3>>6));t=c3&63;}}r+=k.charAt(t);}return r;};String.prototype.decodeBase64=function(){var r ='',n=0,s=this+'===',e1,e2,e3,e4,k=this._base64;while(n<this.length){e1=k.indexOf(s.charAt(n++));e2=k.indexOf(s.charAt(n++));e3=k.indexOf(s.charAt(n++));e4=k.indexOf(s.charAt(n++));if(-1!=e1&&-1!=e2){r+=String.fromCharCode((e1<<2)|(e2>>4));if(-1!=e3){r+=String.fromCharCode((e2&15)<<4|(e3>>2));if(-1!=e4)r+=String.fromCharCode(((e3&3)<<6)|e4);}}}return r;};String.prototype.utf8=function(){var n,c,u='';for(n=0;n<this.length;++n)if((c=this.charCodeAt(n))<128)u+=String.fromCharCode(c);else if(c<2048)u+=String.fromCharCode((c>>6)|192)+String.fromCharCode((c&63)|128);else u +=String.fromCharCode((c>>12)|224)+String.fromCharCode(((c>>6)&63)|128)+String.fromCharCode((c&63)|128);return u;};function Store(n,l){this.cn=n;this.lm=(l?l:0);this.vx=['B64'];var m,x,c=document.cookie.split(';'),q=n+'=';for(m=0,x=c[0];m<c.length;x=c[++m]){while(' '==x.charAt(0))x=x.substring(1,x.length);if(0==x.indexOf(q)){this.vx=x.substring(q.length,x.length).split('.');if('B64'!=this.vx[0])this.vx=['B64'];break;}}}Store.prototype.set=function(i,v){if(!i)var i =0;if(!v)var v ='';var n,d=new Date();d.setDate(d.getDate()+this.lm);for(n=this.vx.length;n<=i;++n)this.vx[n]='';this.vx[i+1]=(''+v).encodeBase64();document.cookie=this.cn+'='+this.vx.join('.')+'; expires='+d.toGMTString()+'; path=/';};Store.prototype.get=function(i){if(!i)var i =0;return(i+1)<this.vx.length?this.vx[i+1].decodeBase64():'';};Store.prototype.wipe=function(i){if(!i){var d =new Date();d.setDate(d.getDate(-1));document.cookie=this.cn+'=; expires='+d.toGMTString()+'; path=/';}else this.set('',i);};Store.prototype.getAll=function(l){var n;for(n=0;n<l.length;++n)if(!!l[n]&&!!l[n].form&&(n+1)<this.vx.length){if(!l[n].get||!l[n].set){l[n].get=HTMLInputElement.prototype.get;l[n].set=HTMLInputElement.prototype.set;}l[n].set(this.get(n));}return this;};Store.prototype.setAll=function(l){var n;for(n=0;n<l.length;++n)if(!!l[n]&&!!l[n].form){if(!l[n].get||!l[n].set){l[n].get=HTMLInputElement.prototype.get;l[n].set=HTMLInputElement.prototype.set;}if(l[n].get)this.set(n,l[n].get());}else this.set(n,(!!l[n]?l[n]:''));return this;};var auto_select={'policy':{'ski':['ski','snow','winter'],'backpacker':['backpack','gap'],'long-stay':['long'],'annual':['annual','multi'],'cruise':['cruise'],'golf':['golf'],'business':['business']}};function SlideShow(id,cls){var n,l=[],e=$I(id);this.position=0;this.slides=[];this.buttons=[];this.delay=7000;if(e){l=(this.within=e).getElementsByTagName('IMG');for(n=0;n<l.length;++n)if(l[n].className&&cls==l[n].className)this.slides[this.slides.length]={tag:l[n],src:l[n].src,alt:l[n].alt,clk:l[n].onclick};if(0<this.slides.length){this.tag=this.slides[0].tag;this.tag._show=this;this.tag.onmouseover=function(){this._show.stop();};this.tag.onmouseleave=function(){this._show.start();};this.tag.onmouseout=function(ev){if(ev&&ev.relatedTarget){var n =ev.relatedTarget;while((n=n.parentNode))if(n==this._show.within)return false;}this._show.start();};this.tag.onclick=function(ev){return this._show.link(!ev?window.event:ev);};}}}SlideShow.prototype.button=function(action,x1,y1,x2,y2){if(this.within){this.within.style.position='relative';if(!x1)var x1=0;if(!y1)var y1=0;var div=document.createElement('DIV');div.className='slide-show-button';div.style.position='absolute';div.style.top=y1+'px';div.style.left=x1+'px';div.style.width=(x2-x1)+'px';div.style.height=(y2-y1)+'px';div.style.overflow='hidden';div.style.cursor='pointer';div.style.backgroundColor='#fff';div.style.opacity=0;div.style.filter='alpha(opacity=1)';div._show=this;div._act=action;if('number'==typeof(action))div.onclick=function(){this._show.go(div._act);return false;};else div.onclick=function(){$L(div._act);return false;};this.within.appendChild(div);}return this;};SlideShow.prototype.selects=function(count,x1,y1,x2,y2,step_x,step_y){var n;if(this.slides.length<count)count=this.slides.length;for(n=0;n<count;++n){this.button(n,x1,y1,x2,y2);x1+=step_x;x2+=step_x;y1+=step_y;y2+=step_y;}return this;};SlideShow.prototype.start=function(delay,name){if(delay)this.delay=(2500<delay?delay:2500);if(name)this.name=name;if(this.interval)clearInterval(this.interval);if(this.name)this.interval=setInterval(this.name+'.next()',this.delay);return this;};SlideShow.prototype.stop=function(){if(this.interval)clearInterval(this.interval);this.interval=false;return this;};SlideShow.prototype.next=function(){return this.go(this.position+1);};SlideShow.prototype.last=function(){return this.go(this.position-1);};SlideShow.prototype.link=function(e){if(!e)var e =window.event;this.stop();if(this.slides[this.position].clk)this.slides[this.position].clk(e);return false;};SlideShow.prototype.go=function(position){if(this.tag){if((this.position=position)>=this.slides.length)this.position=0;else if(0>this.position)this.position=this.slides.length-1;if(document.all&&this.tag.filters){this.tag.style.filter="blendTrans(duration=2)";this.tag.style.filter="blendTrans(duration=1.5)";this.tag.filters.blendTrans.Apply();this.tag.src=this.slides[this.position].src;this.tag.filters.blendtrans.Play();}else{this.tag.src=this.slides[this.position].src;}this.tag.alt=this.tag.title=this.slides[this.position].alt;}return this;};function help_over(e){if(!!this._title){if(!e)var e =window.event;var h =$I('help');h.innerHTML=this._title;var x,y,o=this,ox=0,oy=0;if(e.pageX||e.pageY){y=e.pageY;}else if(e.clientX||e.clientY){y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}else x =y=0;while(o.offsetParent&&('FORM'!=o.tagName||'form'!=o.id))o=o.offsetParent;while(o.offsetParent){oy+=o.offsetTop;o=o.offsetParent;}h.style.top=(y-oy-h.offsetHeight-6)+'px';}}function help_out(){$I('help').style.top='-99999px';}function help_change(){this._title=this.options[this.selectedIndex]._title;$I(this.id+'-help')._title=this._title;return true;}function ti_upper(){this.value=this.value.toUpperCase();this.style.backgroundColor=(''==this.value?'#fcc':'#fff');return true;}function ti_title(){var x =this.value,n,s=0,r='';for(n=0;n<x.length;++n){if(' '==x.charAt(n)||"'"==x.charAt(n)||'-'==x.charAt(n)){if(0!=s){r+=x.charAt(n);s=0;}}else if(0==s){r+=x.charAt(n).toUpperCase();s=1;}else{r+=x.charAt(n).toLowerCase();}}if('Mc'==r.substring(0,2))r='Mc'+r.charAt(2).toUpperCase()+r.substring(3);this.style.backgroundColor=(''==(this.value=r)?'#fcc':'#fff');return true;}function ti_digits(){var x =this.value,n,r='';for(n=0;n<x.length;++n)if('0'<=x.charAt(n)&&'9'>=x.charAt(n))r+=x.charAt(n);this.value=r;return true;}function ti_phone(){var x =this.value,n,m,r='';for(n=m=0;n<x.length;++n)if('0'<=x.charAt(n)&&'9'>=x.charAt(n)){r+=x.charAt(n);if(4==++m){r+=' ';m=0;}}this.value=r;return true;}function ti_post(){var n,l,i,p='',x=this.value.toUpperCase();for(n=0;n<x.length;++n)if(-1!='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.indexOf(x.charAt(n)))p+=x.charAt(n);this.value=('BFPO'!=p.substr(0,4)?p.substr(0,p.length-3)+' '+p.substr(p.length-3):'BFPO '+p.substr(4));this.style.backgroundColor=(''==p?'#fcc':'#fff');return true;}function ti_card(){var x =this.value,n,m,r='';for(n=m=0;n<x.length;++n)if('0'<=x.charAt(n)&&'9'>=x.charAt(n)){r+=x.charAt(n);if(4==++m){r+=' ';m=0;}}this.style.backgroundColor=(!(this.value=r).luhnCheck()?'#fcc':'#fff');return true;}function ti_res(){alert('You and everyone to be insured must be a UK resident. This means that your main home must be in the United Kingdom and that you have not spent more than 6 months abroad in the year prior to purchasing the policy. You must also be registered with a medical practitioner in the United Kingdom.');}function build_help(){var n,m,h,help=$I('tihelp'),text=$I('titext'),f=document.forms;if(help)for(n=0;n<f.length;++n)for(m=0;m<f[n].elements.length;++m)if(f[n].elements[m].title){var title=f[n].elements[m].title.split('|');var title0=title[0];title[0]='';f[n].elements[m]._title='<div class="wrap"><div class="head"><h3>'+title0+'</h3></div><div class="body"><div class="text">'+title.join('<br />').substr(6)+'</div></div><div class="foot">&nbsp;</div></div>';f[n].elements[m]._title=f[n].elements[m].title;f[n].elements[m].title='';f[n].elements[m].onmouseover=function(e){if(!e)var e =window.event,ie=true;var title=this._title;if(''==title&&'select-one'==this.type)title=this.options[this.selectedIndex].title;if(!!title&&''!=title){help.innerHTML=title;if(e.pageX||e.pageY){x=e.pageX-0;y=e.pageY-0;}else if(e.clientX||e.clientY){x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}else x =y=0;if(ie){var o =this;for(x=0;o.offsetParent;o=o.offsetParent)x+=o.offsetLeft;x+=this.offsetWidth;}help.style.left=(x+6)+'px';help.style.top=(0<(y-help.offsetHeight+96)?(y-help.offsetHeight+96)+'px':'0px');}};f[n].elements[m].onmouseout=function(){help.style.top='-55555px';};}}function build_forms(){var page=(!!document.body.id?document.body.id:'page');$I('form').parentNode.parentNode.innerHTML+='<form action="#"><div id="view-start">&nbsp;</div><div id="view-return">&nbsp;</div></form>';{var n,m,h,e=$I('help'),ta,t0;if(!e)$I('form').innerHTML+='<div id="help">.</div>';for(n=0,e=$N('INPUT');n<e.length;++n)if(e[n].title){e[n].parentNode.innerHTML+='<input type="button" class="help" id="'+e[n].id+'-help" value="" />';h=$I(e[n].id+'-help');ta=e[n].title.split('|');t0=ta[0];ta[0]='';h._title=e[n]._title='<div class="wrap"><div class="head"><h3>'+t0+'</h3></div><div class="body"><div class="text">'+ta.join('<br />').substr(6)+'</div></div><div class="foot">&nbsp;</div></div>';e[n].title='';$E(h,help_over,'click');$E(h,help_out,'mouseout');}for(n=0,e=$N('SELECT');n<e.length;++n){e[n].parentNode.innerHTML+='<input type="button" class="help" id="'+e[n].id+'-help" value="" />';h=$I(e[n].id+'-help');ta=e[n].title.split('|');t0=ta[0];ta[0]='';h._title=e[n]._title='<div class="wrap"><div class="head"><h3>'+t0+'</h3></div><div class="body"><div class="text">'+ta.join('<br />').substr(6)+'</div></div><div class="foot">&nbsp;</div></div>';e[n].title='';$E(h,help_over,'click');$E(h,help_out,'mouseout');$E(e[n],help_change,'change');for(m=0;m<e[n].options.length;++m)if(e[n].options[m].title){ta=e[n].options[m].title.split('|');t0=ta[0];ta[0]='';e[n].options[m]._title='<div class="wrap"><div class="head"><h3>'+t0+'</h3></div><div class="body"><div class="text">'+ta.join('<br />').substr(6)+'</div></div><div class="foot">&nbsp;</div></div>';if(e[n].selectedIndex==m)h._title=e[n]._title=e[n].options[m]._title;}}}if(!!$I('retrieve'))return;{var c =new Date;var y =c.getFullYear(),m=c.getMonth(),d=c.getDate();var da=new Date(y,m,d,0,0,0,0),dr=new Date(y,m,d+(-1==page.indexOf('backpack')?3:31),0,0,0,0),dm=new Date(y,m,d,0,0,0,0),dx=new Date(y+2,m,d,0,0,0,0);da.minimum=dm;da.setMaximum=dr;da.interval=1440;da.maximum=dx;dr.minimum=dm;dr.setMinimum=da;dr.interval=1440;dr.maximum=dx;$I('start').parentNode.innerHTML+=da.getHTML('start');$I('return').parentNode.innerHTML+=dr.getHTML('return');da.calendar('start','Start Date').setLink(dr).activateHTML('start');dr.calendar('return','End Date').setLink(da).activateHTML('return');$I('start').style.display='none';$I('return').style.display='none';}function traveller_ages(){var n,h,x=$I('ages'),a=[],c=this.options[this.selectedIndex].value-0;if(0==c)c=1;if(!$I('large-form'))h=(1==c?'Traveller Age<br />':'Traveller Ages<br />');else h =(1==c?'<label for="age1">Traveller Age</label>':'<label for="age1">Traveller Ages</label>');for(n=0;n<c;++n)a[n]=(!$I('age'+(n+1))?'':$I('age'+(n+1)).value);for(n=0;n<c;++n){h+='<input type="text" name="age'+(n+1)+'" id="age'+(n+1)+'" maxlength="2" value="'+a[n]+'" />&nbsp;years<br />';if(0==((n-3)%4)&&!!$I('large-form'))h+='</div><div>';}if(!$I('large-form')){if(0<this.selectedIndex||''!=a[0]){$I('submit').src='/images/quote-nexts.png';$I('submit').style.width='112px';x.innerHTML='<div id="age">'+h+'</div>';}}else x.innerHTML='<div id="age"><div>'+h+'</div></div>';}$E('travellers',traveller_ages);$E('travellers',traveller_ages,'change');$E('policy',function(){var v =this.options[this.selectedIndex].value,g=$I('group');if('backpacker'==v||'long-stay'==v){g.selectedIndex=0;if(!!g.click_act_)g.click_act_();if(!!g.change_act_)g.change_act_();g.disabled=true;g.style.backgroundColor='#ccc';}else{g.disabled=false;g.style.backgroundColor='#fff';}if(!!$I('returns'))$I('returns').style.visibility=('annual'==v?'hidden':'visible');if(!!$I('line-returns'))$I('line-returns').style.visibility=('annual'==v?'hidden':'visible');});$E('group',function(){var v =this.options[this.selectedIndex].value,t=$I('travellers');if('couple'==v){t.selectedIndex=2;if(!!t.click_act_)t.click_act_();if(!!t.change_act_)t.change_act_();t.disabled=true;t.style.backgroundColor='#ccc';}else{t.disabled=false;t.style.backgroundColor='#fff';}});{var n,ac,as,ar=(-1==$R().indexOf('/www.cheaptravelinsurance.com/')?$R():'');for(ac in auto_select)if(!!$I(ac))for(as in auto_select[ac])for(n=0;n<auto_select[ac][as].length;++n)if(-1!=ar.indexOf(auto_select[ac][as][n])){if(!$I(ac).set){$I(ac).get=HTMLInputElement.prototype.get;$I(ac).set=HTMLInputElement.prototype.set;}$I(ac).set(as);break;}}if(!!$I('form')){var f =$I('form'),cke=new Store('travel',30);cke.getAll([f.policy,f.group,f.zone,f['start-date'],f['return-date'],f.travellers,f.age1,f.age2,f.age3,f.age4,f.age5,f.age6,f.age7,f.age8,f.age9,f.age10,f.age11,f.age12,f.age13,f.age14,f.age15,f.age16,f.affiliate,f.track,f.ref]);if(!!f.travellers&&0<(('0'+cke.get(5))-0))f.travellers.click_act_();cke.getAll([f.policy,f.group,f.zone,f['start-date'],f['return-date'],f.travellers,f.age1,f.age2,f.age3,f.age4,f.age5,f.age6,f.age7,f.age8,f.age9,f.age10,f.age11,f.age12,f.age13,f.age14,f.age15,f.age16,f.affiliate,f.track,f.ref]);cke.setAll([f.policy,f.group,f.zone,f['start-date'],f['return-date'],f.travellers,f.age1,f.age2,f.age3,f.age4,f.age5,f.age6,f.age7,f.age8,f.age9,f.age10,f.age11,f.age12,f.age13,f.age14,f.age15,f.age16,f.affiliate,f.track,f.ref]);f['start-date'].change_act_();f['return-date'].set(cke.get(4)).change_act_();f['start-date'].date.refresh();if(!!f.ref&&''==f.ref.value){f.value=($R()+'//').split('//')[1];}}{var n,as,al=$L();if(!!auto_select.policy&&!!$I('policy'))for(as in auto_select.policy)for(n=0;n<auto_select.policy[as].length;++n)if(-1!=al.indexOf(auto_select.policy[as][n])){if(!$I('policy').set){$I('policy').get=HTMLInputElement.prototype.get;$I('policy').set=HTMLInputElement.prototype.set;}$I('policy').set(as);break;}f.policy.click_act_();f.group.click_act_();}$E('submit',function(){var f =$I('form');cke.setAll([f.policy,f.group,f.zone,f['start-date'],f['return-date'],f.travellers,f.age1,f.age2,f.age3,f.age4,f.age5,f.age6,f.age7,f.age8,f.age9,f.age10,f.age11,f.age12,f.age13,f.age14,f.age15,f.age16,f.affiliate,f.track,f.ref]);var t =('0'+this.form.travellers.options[this.form.travellers.selectedIndex].value)-0;var g =$I('group');g=g.options[g.selectedIndex].value;var p =$I('policy');p=p.options[p.selectedIndex].value;var n,m,a=0,c=0,s=0,e='';if(0==t&&!!$I('age1'))t=1;for(n=0;n<t;++n)if($I('age'+(n+1))){var w ='',v=$I('age'+(n+1)).value;for(m=0;m<v.length;++m)if(-1!='0123456789'.indexOf(v.charAt(m)))w+=v.charAt(m);if(''==w)e='Please enter the ages for each person to be covered on this policy';if(18<=(w-0))++a;else++c;if(40<=(w-0))++s;}if(''==e){if(0==a&&0==c)e='Please select at least one person for the policy';else if(0==a)e='Policies booked online must have at least one adult (18+), please phone 08450-264-264 to book a child-only policy';else if('couple'==g&&(2!=a||0!=c))e='Policies for a couple expect only two people.\n(A couple can be either legally married, a common law husband and wife or an adult couple who have cohabited for at least one year. All limits and excesses are per person irrespective of one or both travelling on the same trip.)';else if('family'==g&&2<a)e='Policies for a family expect no more than two adults.\n(A family is considered to be a legally married couple, a common law husband and wife, a single parent or adult couple who have cohabited for at least one year and includes children (aged under 18).)\nPlease purchase seperate policies for the other adults.';else if('family'==g&&0==c)e='Policies for a family expect at least one child.\n';else if('group'==g&&8>(a+c))e='Policies for a group expect 8 or more people, please select Individual(s) instead.\n(A group is 8 or more people travelling on a single trip and insured under the same policy. If your group has more than 16 people, please call us at 08450-264-264.)';else if(('long-stay'==p||'backpacker'==p)&&0!=(c+s))e='Long stay policies are only available for 18 to 39s';}if(''!=e){alert(e);return false;}return true;});{if(-1!=page.indexOf('single'))sshow.go(1).stop();else if(-1!=page.indexOf('annual'))sshow.go(2).stop();else if(-1!=page.indexOf('cruise'))sshow.go(3).stop();else if(-1!=page.indexOf('family'))sshow.go(4).stop();else if(-1!=page.indexOf('backpack')||-1!=page.indexOf('long'))sshow.go(5).stop();else if(-1!=page.indexOf('ski')||-1!=page.indexOf('snow'))sshow.go(6).stop();}if(!!$I('thawte')){var d =new Date;$I('thawte').innerHTML='<p>'+d.getFullYear()+'.'+(1+d.getMonth()).toStringPad(2)+'.'+d.getDate().toStringPad(2);$E('thawte',function(){$W('https://seal.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=www.cheaptravelinsurance.com&size=L&lang=en',false,500,600);});}}var AHP={dates:{1:'1st',2:'2nd',3:'3rd',4:'4th',5:'5th',6:'6th',7:'7th',8:'8th',9:'9th',10:'10th',11:'11th',12:'12th',13:'13th',14:'14th',15:'15th',16:'16th',17:'17th',18:'18th',19:'19th',20:'20th',21:'21st',22:'22nd',23:'23rd',24:'24th',25:'25th',26:'26th',27:'27th',28:'28th',29:'29th',30:'30th',31:'31st'},months:{1:'Januaray',2:'Feburary',3:'March',4:'April',5:'May',6:'June',7:'July',8:'August',9:'September',10:'October',11:'November',12:'December'},mons:{1:'Jan',2:'Feb',3:'Mar',4:'Apr',5:'May',6:'Jun',7:'Jul',8:'Aug',9:'Sep',10:'Oct',11:'Nov',12:'Dec'},parks:{'abz':'Aberdeen','bfs':'Belfast','bhx':'Birmingham','blk':'Blackpool','brs':'Bristol','cwl':'Cardiff','dsa':'Doncaster (Robin Hood)','dov':'Dover Port','mme':'Durham Valley (Teesside)','ema':'East Midlands (Nottingham)','edi':'Edinburgh','ext':'Exeter','lgw':'Gatwick (London)','gla':'Glasgow','lhr':'Heathrow (London)','huy':'Humberside (Kirmington)','inv':'Inverness','lba':'Leeds Bradford','lpl':'Liverpool (John Lennon)','lcy':'London City','ltn':'Luton','man':'Manchester','ncl':'Newcastle','nwi':'Norwich','pik':'Prestwick (Glasgow)','sou':'Southampton','stn':'Stansted (London)'},hotels:{'abz':'Aberdeen','bfs':'Belfast','blk':'Blackpool','bhx':'Birmingham','brs':'Bristol','cwl':'Cardiff','cvt':'Coventry','dov':'Dover Port','dub':'Dublin','mme':'Durham Valley (Teesside)','ema':'East Midlands (Nottingham)','edi':'Edinburgh','fol':'Folkstone (Eurotunnel)','lgw':'Gatwick (London)','gla':'Glasgow','lhr':'Heathrow (London)','huy':'Humberside (Kirmington)','lba':'Leeds Bradford','lpl':'Liverpool','lcy':'London City','ltn':'Luton','man':'Manchester','ncl':'Newcastle','nwi':'Norwich','sou':'Southampton','stn':'Stansted (London)'},rooms:{'s10':'Single - 1 Adult','t20':'Twin - 2 Adults','d20':'Double - 2 Adults','t12':'Triple - 1 Adult 2 Children','t21':'Triple - 2 Adults 1 Child','t30':'Triple - 3 Adults','f13':'Family - 1 Adult 3 Children','f22':'Family - 2 Adults 2 Children','f23':'Family - 2 Adults 3 Children','f31':'Family - 3 Adults 1 Child','f32':'Family - 3 Adults 2 Children'},parkdays:{0:'No, thanks',1:'1 day',2:'2 days',3:'3 days',4:'4 days',5:'5 days',6:'6 days',7:'7 days',8:'8 days',9:'9 days',10:'10 days',11:'11 days',12:'12 days',13:'13 days',14:'14 days',15:'15 days'}};function html_select(nm,id,ttl,min,max,pik,txt,txts){var n,x=[];for(n=min;n<=max;++n)x[x.length]=n+(pik&&pik==n?'" selected="selected">':'">')+(txt&&0==n?'No':n)+(txt?' '+(1==n&&txts?txts:txt):'');return'<select name="'+nm+'" id="'+id+'" title="'+ttl+'"><option value="'+x.join('</option><option value="')+'</option></select>';}function html_select_list(nm,id,ttl,lst,pik){var k,x=[];for(k in lst)x[x.length]=k+(pik&&pik==k?'" selected="selected">':'">')+lst[k];return'<select name="'+nm+'" id="'+id+'" title="'+ttl+'"><option value="'+x.join('</option><option value="')+'</option></select>';}function html_select_date(nm,id,ttl,lim,d){var n,mn,yn,l=[],m=AHP.months;if(!d)var d =new Date;for(n=0,mn=d.getMonth()+1,yn=d.getFullYear();n<lim;++n,++mn){l[yn*100+mn]=AHP.months[mn]+' '+yn;if(12==mn){mn=0;++yn;}}return'<div class="date" id="'+id+'-calendar">'+html_select_list(nm+'-d',id+'-d',ttl,AHP.dates,d.getDate()).replace('<select name','<select class="date-day" name')+html_select_list(nm+'-my',id+'-my',ttl,l).replace('<select name','<select class="date-my" name')+'</div>';}function html_select_date_time(nm,id,ttl,lim,c){var n,mn,yn,l=[],t={30:'0:30'},m=AHP.months,d=new Date;if(!c)var c =new Date;for(n=1;n<24;++n){t[n*100]=n+':00';t[n*100+30]=n+':30';}for(n=0,mn=d.getMonth()+1,yn=d.getFullYear();n<lim;++n,++mn){l[yn*100+mn]=AHP.mons[mn]+' '+yn;if(12==mn){mn=0;++yn;}}return'<div class="timedate" id="'+id+'-calendar">'+html_select_list(nm+'-hm',id+'-hm',ttl,t,c.getHours()*100+'').replace('<select name','<select class="time-hm" name')+html_select_list(nm+'-d',id+'-d',ttl,AHP.dates,c.getDate()+'').replace('<select name','<select class="date-day" name')+html_select_list(nm+'-my',id+'-my',ttl,l,c.getFullYear()*100+c.getMonth()+1+'').replace('<select name','<select class="date-my" name')+'</div>';}function form_builder(nm,pk,lst){var k,l=[];for(k in lst)l[l.length]='<div class="line"><label>'+k+':</label><div>'+lst[k]+'</div></div>';return'<form id="'+nm+'"><h3>'+pk+'</h3>'+l.join('')+'<input class="run" type="button" value="'+pk+'" onclick="return form_goto(this.form)"></form>';}function form_parking(d,e,p){return form_builder('formparks','Compare Airport Parking',{'Parking At':html_select_list('airport','park-airport','',AHP.parks,'lhr'),'Arrival':html_select_date_time('from','park-from','',12,d),'Return':html_select_date_time('to','park-to','',18,e),'Passengers':html_select('people','park-people','',1,10,p,'People','Person')});}function form_hotels(d,a,c){if(9<c)c=0;if(3<a)a=3;return form_builder('formhotel','Compare Airport Hotels',{'Hotels At':html_select_list('airport','hotel-airport','',AHP.hotels,'lgw'),'Arrival':html_select_date('from','hotel-from','',6,d),'Rooms':html_select_list('room1','hotel-room1','',AHP.rooms,'d'+a+c),'Parking':html_select_list('parking','hotel-parking','',AHP.parkdays,0)});}function form_to_date(my,d,hm){return my+(9<d?''+d:'0'+d)+(hm?'%20'+hm:'');}function form_goto(f){if('formparks'==f.id){window.location.href='http://www.best-airport-parking-deals.co.uk/compare-parks.html?site=ctibook&airport='+f.airport.value+'&people='+f.people.value+'&from='+form_to_date(f['from-my'].value,f['from-d'].value,f['from-hm'].value)+'&until='+form_to_date(f['to-my'].value,f['to-d'].value,f['to-hm'].value);}else if('formhotel'==f.id){window.location.href='http://www.airport-hotels.co.uk/list-hotels.html.php?site=ctibook&airport='+f.airport.value+'&room1='+f.room1.value+'&parking='+f.parking.value+'&date='+form_to_date(f['from-my'].value,f['from-d'].value);}return false;}function build_stage2(){var n,q=$I('tiemailc'),e=$I('ti2').elements;if(!!q){build_help();q.onclick=function(){$I('tiemail').style.display='none';return false;};if(!!$I('ti2e'))$I('ti2e').onclick=function(){var n,o,x,y,i=$I('tiemail');for(o=this,x=y=0;o.offsetParent;o=o.offsetParent){x+=o.offsetLeft;y+=o.offsetTop;}i.style.left=(x-120)+'px';i.style.top=(y+30)+'px';i.style.display='block';for(n=0;n<this.form.policy.length;++n)if(this.form.policy[n].checked)this.form.email.className=this.form.policy[n].value;return false;};$I('send-email').onclick=function(){var e =this.form.email.value,i=this.form.sid.value,p=this.form.email.className;if(-1!=e.indexOf('@'))$L($L().split('&esid=')[0]+'&esid='+i+'&epolicy='+p+'&email='+e);return false;};}}function build_stage3(){build_help();var m,e=$I('ti3').elements;for(m=0;m<e.length;++m){if(e[m].name&&'opt'==e[m].name.split('-')[0]){e[m].onclick=function(e,fr){var i,r,cn=this.className.split('-');if('ref'==cn[0]){i='opt-'+cn[1];r=this.form.elements[i];if(r&&this.checked)r.checked=true;if(r&&r.onclick){r.onclick(true,(cn[1]==cn[2]&&this.checked));r.back_=this;}}if(!this.checked&&this.back_&&this.back_.checked){this.back_.checked=false;this.back_.onclick(true);}if($I){var pt=$I('price-'+this.name);if(pt){if(!pt.orig_)pt.orig_=pt.innerHTML;pt.innerHTML=(fr?'<span>FREE</span>':pt.orig_);}}return true;};e[m].onclick(true);}if(e[m].name&&'gp'==e[m].name){e[m].onclick=function(){var b,v,c=(this.className+'-').split('-'),x=this.value.split('-');for(b=1;b<c.length;++b)for(v=1;v<x.length;++v){var i =$I('gph-'+x[v]+(''==c[b]?'':'_'+c[b]));if(i)i.className=(c[b]==x[0]?'ti3ext':'ti3hide');if((i=$I('opt-'+x[v]+(''==c[b]?'':'_'+c[b]))))i.checked=false;}};e[m].onclick();}}}function build_stage4(){build_help();var b,c,e=$I('ti4').elements;if(e.address)e.address.onchange=ti_title;if(e.address2)e.address2.onchange=ti_title;if(e.town)e.town.onchange=ti_title;if(e.county)e.county.onchange=ti_title;if(e.postcode)e.postcode.onchange=ti_post;if(e.phone)e.phone.onchange=ti_phone;if(!!$I('resdef'))$I('resdef').onclick=ti_res;for(b=1;b<999;++b){if(e['dob-'+b]){var x =new Date;x.minimum=new Date(1901,0,1);x.maximum=new Date;c=e['dob-'+b].value;x.setTarget(e['dob-'+b]);e['dob-'+b].set(c);if(e['name-'+b])e['name-'+b].onchange=ti_title;if(e['surname-'+b])e['surname-'+b].onchange=ti_title;}else break;}if($I('ti4c')&&$I('ti4cb'))$I('ti4c').onclick=$I('ti4cb').onclick=function(){var b,pl=0,pn=0,e=this.form.elements;for(b=1;b<999;++b){if(!e['dob-'+b])break;if(''==e['dob-'+b].value||''==e['name-'+b].value||''==e['surname-'+b].value){alert('Please complete the details for member #'+b);return false;}}for(b=pl=pn=0;b<e.postcode.value.length;++b){var pc=e.postcode.value.charAt(b).toUpperCase();if(-1!='0123456789'.indexOf(pc))++pn;if(-1!='ABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(pc))++pl;}if(''==e.email.value&&''==e.phone.value){alert('Please enter either an email or a telephone number.\n(This allows us to contact you in the event of an error on your policy.)');return false;}else if(''==e.email.value&&!confirm('Continue without entering an email?\n(You will need to download your Policy Certificate after payment.)')){return false;}if(''==e.address.value||''==e.town.value||''==e.postcode.value)alert('Please complete your address details');else if(0==pl||0==pn)alert('Your address does not appear to contain a valid UK postcode, please check or call us on 08450 264 264.\n(Please note that we only offer travel insurance for UK residents.)');else if(!e.read1none.checked&&''==e.medical.value&&!e.skipmed.checked){if(this.id&&'ti4cb'==this.id)alert('Please confirm that you do not have any Pre-existing Medical Conditions.\n(If you believe you may have pre-existing conditions select that option.\nYou can then check if you need to contact the medical pre-screening helpline.)');else alert('Please enter the code given to you by our medical screening, or confirm you\'ll be calling medical screening later.');}else if(!e.read2.checked)alert('Please read the policy documents before continuing.\n(You can use the links provided on this page.)');else if(!e.read3.checked)ti_res();else{if(!e.read1none.checked&&''==e.medical.value)alert('No claim arising directly or indirectly from a Pre-existing Medical Condition affecting any person travelling under this insurance will be covered unless You have declared ALL Pre-existing Medical Conditions to the Medical Screening Helpline prior to the commencement of any trip.');return true;}return false;};function medical_q(){$I('timedw').style.top='80px';return true;};if($I('med'))$I('med').onclick=medical_q;if($I('timedq'))$I('timedq').onclick=medical_q;function medical_yes(){$I('timedw').style.top='-55555px';$I('timedw3').style.top='400px';return true;};if($I('medy'))$I('medy').onclick=medical_yes;if($I('timedy'))$I('timedy').onclick=medical_yes;if($I('timeds'))$I('timeds').onclick=function(){var e =this.form.elements;function rv(f){var n;for(n=0;n<f.length;++n)if(f[n].checked)return f[n].value.charAt(0).toLowerCase();return'';}var pmc=''+rv(e.pmc1)+rv(e.pmc2)+rv(e.pmc3a)+rv(e.pmc3b)+rv(e.pmc3c);if(5!=pmc.length){this.value='Is Medical Screening Needed?\nPlease answer yes/no for all questions';$I('timedq').checked=false;return false;}else if('nnnnn'==pmc){$I('timedq').checked=true;$I('read1none').checked=true;alert('Thank-you, you do not require medical screening');}else if('y'==pmc.charAt(0)){$I('timedw2').style.top='500px';$I('timedy').checked=true;}else{$I('timedw3').style.top='400px';}$I('timedw').style.top='-55555px';};$I('timedx').onclick=function(){$I('timedw').style.top='-55555px';};$I('timedx2').onclick=function(){$I('timedw2').style.top='-55555px';};$I('timedx3').onclick=function(){$I('timedw3').style.top='-55555px';};}function build_stage5(){build_help();var error_timer=new Date(2000,01,01);var cfm=new Date,cto=new Date;var e =$I('ti5').elements;if(e.card){e.card.onchange=ti_card;}if(e.valid){cfm.setTarget(e.valid);e.valid.set('');}if(e.expire){cto.setTarget(e.expire);e.expire.set('');}if(e.cardname)e.cardname.onchange=ti_upper;if(e.issue)e.issue.onchange=ti_digits;if(e.cvv)e.cvv.onchange=ti_digits;if(!!$I('copydetails'))$I('copydetails').onclick=function(){var e =this.form.elements;if(this.checked){e.cardname.value=e.copyname.value;e.cardaddress.value=e.copyaddress.value;e.cardpostcode.value=e.copypostcode.value;}else e.cardname.value=e.cardaddress.value=e.cardpostcode.value='';};if(!!$I('ti5c'))$I('ti5c').onclick=function(){var e =this.form.elements;var t =e.cardtype.options[e.cardtype.selectedIndex].value.toLowerCase();if(''==e.cardname.value||''==e.card.value)alert('Please enter your credit/debit card details.');else if(''==e.cardtype.options[e.cardtype.selectedIndex].value)alert('Please select the type of your payment card; e.g., VISA, MasterCard, &c.');else if(!e.card.value.luhnCheck())alert('The payment card number appears to be invalid.\nPlease check you have entered it correctly.');else if(e.issue.value.length>4)alert('Issue numbers, where present, are no more than 4 digits in length.');else if(''!=e.issue.value&&!('maes'==t||'solo'==t))alert('Only Maestro, Solo, or Switch cards use an issue number.\nThe issue number is not required on your selected card type.');else if(''==e.expire.value)alert('Please enter the expiry date for your payment card.');else if(''==e.cvv.value)alert('Please enter the CVV code.\n(This is typically found as the last set of digits on the strip on the back of your card.)');else if(e.cvv.value.length>4)alert('CVV Security codes, where present, are no more than 4 digits in length.');else if(3!=e.cvv.value.length&&'amex'!=t)alert('The CVV Security code should be three digits in length, e.g., 123');else if(((new Date()).getTime()-2000)<error_timer.getTime()){return false;}else{var d =new Date,dn,dv=e.valid.value.split('/'),de=e.expire.value.split('/');dn=((d.getMonth()+1)+(d.getFullYear()*100))-0;dv=dv[1]*100+(dv[0]-0);de=de[1]*100+(de[0]-0);if(dv>de)alert('Please check the valid from and expiry dates you have entered.');else if(0!=dv&&dn<dv)alert('Your credit/debit card is not yet valid.\n(Please check the valid from date is correct.)');else if(dn>de)alert('Your credit/debit card has expired.\n(Please check the expiry date is correct.)');else{this.style.cursor='wait';error_timer=new Date;return true;}}return false;};}var sshow;window.onload=function(){if(!!$I('travel-insurance-cycle')){sshow=new SlideShow('travel-insurance-cycle','cycle');if(!$I('form'))sshow.start(5000,'sshow');sshow.selects(7,27,175,42,200,18,0);}if(!!$I('form'))build_forms();if(!!$I('quote-2-stage'))build_stage2();if(!!$I('quote-3-stage'))build_stage3();if(!!$I('quote-4-stage'))build_stage4();if(!!$I('quote-5-stage'))build_stage5();var cke=new Store('travel',30);if(''==cke.get(24))cke.set(24,($R()+'//').split('//')[1]);if(!!$I('thawte')){var d =new Date;$I('thawte').innerHTML='<p>'+d.getDate().toStringPad(2)+'-'+(1+d.getMonth()).toStringPad(2)+'-'+d.getFullYear()+'</p>';$E('thawte',function(){$W('https://seal.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=www.cheaptravelinsurance.com&size=L&lang=en',false,500,600);});}};

