var cookie={getExpDate:function(d,a,c){var b=new Date();if(typeof d==="number"&&typeof a==="number"&&typeof c==="number"){b.setDate(b.getDate()+parseInt(d,10));b.setHours(b.getHours()+parseInt(a,10));b.setMinutes(b.getMinutes()+parseInt(c,10));return b.toUTCString()}return},get:function(c){var d,a,b;d=document.cookie.indexOf(c+"=");a=d+c.length+1;if((!d)&&(c!==document.cookie.substring(0,c.length))){return null}if(d===-1){return null}b=document.cookie.indexOf(";",a);if(b===-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))},set:function(b,d,a,f,c,e){document.cookie=b+"="+escape(d)+((a)?";expires="+a:"")+((f)?";path="+f:"")+((c)?";domain="+c:"")+((e)?";secure":"");return},clear:function(a,c,b){if(this.get(a)){document.cookie=a+"="+((c)?";path="+c:"")+((b)?";domain="+b:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}return}};var cfkit_util={display:function(c,b){var a=dojo.byId(c);if(b){a.style.display="block"}else{a.style.display="none"}return},byId:function(a){if(document.getElementById){return document.getElementById(a)}else{if(document.all){return document.all[a]}else{if(document.layers){return document.layers[a]}else{return null}}}},gup:function(b){var a,d,c;b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a="[\\?&]"+b+"=([^&#]*)";d=new RegExp(a);c=d.exec(window.location.href);if(c===null){return""}else{return c[1]}},m2km:function(a){return a*0.001},km2m:function(a){return a*1000},miles2m:function(a){return a*1609.344},m2miles:function(a){return a*0.0006213712},m2ft:function(a){return a*3.28084},ft2m:function(a){return a*0.3048},fromMetersTo:function(a,b){switch(a){case"km":return cfkit_util.m2km(b);case"m":return b;case"miles":return cfkit_util.m2miles(b);case"ft":return cfkit_util.m2ft(b);default:alert("Unknown conversion in fromMeterTo")}return 0},toMetersFrom:function(a,b){switch(a){case"km":return cfkit_util.km2m(b);case"m":return b;case"miles":return cfkit_util.miles2m(b);case"ft":return cfkit_util.ft2m(b);default:alert("Unknown conversion in fromMeterTo")}return 0},fromDBdate:function(a){return new Date(a.substring(5,9),(a.substring(10,12)-1),a.substring(13,15),a.substring(16,18),a.substring(19,21),a.substring(22,24))},toDBdate:function(b){var a="{ts '";a=a+b.getFullYear()+"-";a=a+cfkit_util.padDigit((b.getMonth()+1),2)+"-";a=a+cfkit_util.padDigit(b.getDate(),2)+" ";a=a+cfkit_util.padDigit(b.getHours(),2)+":";a=a+cfkit_util.padDigit(b.getMinutes(),2)+":";a=a+cfkit_util.padDigit(b.getSeconds(),2)+"'}";return a},padDigit:function(d,a){var b,c;b="";d=d.toString();if(a>d.length){for(c=0;c<(a-d.length);c++){b+="0"}}return b+d.toString()},trim:function(a){return a.replace(/^\s+|\s+$/g,"")},ltrim:function(a){return a.replace(/^\s+/,"")},rtrim:function(a){return a.replace(/\s+$/,"")},sort:function(e,d){var a,g,f,c,b;if(e.length===0){return e}a=0;g=e.length;f=cfkit_util.round(g/2,0);while(f>0){for(c=f;c<=g-1;c++){b=e[c];a=c;while(a>=f&&e[a-f][d]>b[d]){e[a]=e[a-f];a=a-f}e[a]=b}f=cfkit_util.round(f/2.2,0)}return e},round:function(c,a){var b=Math.round((c*Math.pow(10,a)));return(b/Math.pow(10,a))},createGUID:function(){return(this._S4()+this._S4()+"-"+this._S4()+"-"+this._S4()+"-"+this._S4()+"-"+this._S4()+this._S4()+this._S4())},_S4:function(){return(((1+Math.random())*65536)|0).toString(16).substring(1)},fadeIn:function(b){var a=function(c){return Math.pow(c,10)};dojo.fadeIn({node:b,duration:2000,easing:a,beforeBegin:function(){var c=dojo.byId(b);dojo.style(c,"opacity",0);dojo.style(c,"display","block")}}).play();return},fadeOut:function(b){var a=function(c){return Math.pow(c,10)};dojo.fadeOut({node:widget,duration:2000,easing:a}).play();return},fadeInOut:function(b){var a=function(c){return Math.pow(c,10)};dojo.fadeIn({node:b,duration:1000,easing:a,beforeBegin:function(){var c=dojo.byId(b);dojo.style(c,"opacity",0);dojo.style(c,"display","block");return},onEnd:function(){dojo.fadeOut({node:b,duration:2000,easing:a,delay:2500,onEnd:function(){var c=dojo.byId(b);dojo.style(c,"display","none");return}}).play();return}}).play();return},redirect:function(a){window.location=a;return}};var cfkit_fb={initConnect:function(b){var a=new FB_RequireFeatures(["Connect"],function(){FB.init(CFKIT_GLOBAL.FB_API_KEY,"/cfkit/client/script/xd_receiver.htm");FB.Connect.requireSession(b);return});return}};var cfkit_InfoPane=function(a){this.init(a);return};cfkit_InfoPane.prototype={prefix:"",pnl_overlay:"",pnl_container:"",pnl_busy:"",pnl_msg:"",init:function(a){this.prefix=a;this.pnl_overlay=a+"_overlay";this.pnl_container=a+"_container";this.pnl_busy=a+"_busy";this.pnl_msg=a+"_msg"},busy:function(){cfkit_util.display(this.pnl_overlay,true);cfkit_util.display(this.pnl_container,true);cfkit_util.display(this.pnl_busy,true);cfkit_util.display(this.pnl_msg,false);return},hide:function(){cfkit_util.display(this.pnl_overlay,false);cfkit_util.display(this.pnl_container,false);cfkit_util.display(this.pnl_busy,false);cfkit_util.display(this.pnl_msg,false);return},log:function(a){dojo.byId(this.prefix+"_msg_inset").innerHTML=a;cfkit_util.display(this.pnl_overlay,true);cfkit_util.display(this.pnl_container,true);cfkit_util.display(this.pnl_busy,false);cfkit_util.display(this.pnl_msg,true);cfkit_util.display(this.prefix+"_msg_close",false);return},msg:function(d,a,c){dojo.byId(this.prefix+"_msg_inset").innerHTML=d;cfkit_util.display(this.pnl_overlay,true);cfkit_util.display(this.pnl_container,true);cfkit_util.display(this.pnl_busy,false);cfkit_util.display(this.pnl_msg,true);cfkit_util.display(this.prefix+"_msg_close",true);if(a===undefined){window.scrollTo(0,0)}else{if(a>=0){window.scrollTo(0,a)}}if(c!==undefined){var b=dojo.byId(this.prefix+"_btnClose");if(window.addEventListener){b.addEventListener("click",c,false)}else{object.attachEvent("onclick",c)}}return}};var cfkit_ctx={initialised:false,locale:"",init:function(){cfkit_ctx.locale=cookie.get("CFKITINT");if(!cfkit_ctx.locale){cfkit_ctx.locale=new Array(5);cfkit_ctx.locale[0]=2;cfkit_ctx.locale[1]="en";cfkit_ctx.locale[2]="2";cfkit_ctx.locale[3]="0"}else{cfkit_ctx.locale=cfkit_ctx.locale.split("|")}cfkit_ctx.initialised=true;return},getLanguage:function(){if(!cfkit_ctx.initialised){cfkit_ctx.init()}return cfkit_ctx.locale[1]},getLocaleID:function(){if(!cfkit_ctx.initialised){cfkit_ctx.init()}return cfkit_ctx.locale[2]},getTZ:function(){if(!cfkit_ctx.initialised){cfkit_ctx.init()}return cfkit_ctx.locale[3]}};var localeWidget={setLocale:function(){var c,d,a,b;d=document.getElementById("frmIntPref");a=cookie.get("CFKITINT");b="";if(!a){a=new Array(5)}else{a=a.split("|")}a[0]=1;a[1]=d.language.options[d.language.selectedIndex].value;a[2]=d.localeID.options[d.localeID.selectedIndex].value;a[3]=d.tz.options[d.tz.selectedIndex].value;a[4]=d.tzSummerTime.options[d.tzSummerTime.selectedIndex].value;a[5]=d.isMetric.options[d.isMetric.selectedIndex].value;b=a[0];for(c=1;c<a.length;c++){b=b+"|"+a[c]}cookie.set("CFKITINT",b,cookie.getExpDate(365,0,0),"/");this.hide();if(dojo.byId("request_method").value==="get"){if(dojo.byId("cfkit_L10N").value==="dynamic"){window.location.reload()}else{window.location="/"}}else{alert("Changes will be applied on next page request.")}return},show:function(){var a=document.getElementById("localeWidget");a.style.display="block";return},hide:function(){var a=document.getElementById("localeWidget");a.style.display="none";return},toggle:function(){var a=document.getElementById("localeWidget");if(a.style.display==="none"){this.show()}else{this.hide()}return}};var loc={language:"",txt:function(d,c,b){var a="";if(typeof(b)==="undefined"){b=d}a=dojo.byId(d);if(a===null){alert("Could not find id:"+d)}else{a.innerHTML=loc.get(b,c)}return},get:function(b,d){var a,c,f,e;switch(loc.language){case"de":c=de;break;case"en":c=en;break;default:c=en}f=c[b];e="";if(typeof(d)==="undefined"){return f}if(typeof(d)==="string"||typeof(d)==="number"){return f.replace("%1",d)}if(d!==null){for(a=0;a<d.length;a++){e="%"+(a+1);f=f.replace(e,d[a])}}return f}};function detectLanguage(){var a,b,c;a=cfkit_util.gup("ctx_lan");if(a===""){a=cfkit_ctx.getLanguage()}if(a!==""){loc.language=a;return}b=/de/;c=document.domain.search(b);if(c!==-1){loc.language="de";return}loc.language="en";return}var RadioGroup=function(b){var a,c;this.name=b;this.data=[];this.selectedIndex=0;a=document.getElementsByName(b);for(c=0;c<a.length;c++){this.data[c]={};this.data[c].btn=a[c];if(this.data[c].btn.checked){this.selectedIndex=c}}return};RadioGroup.prototype={set:function(b){this.selectedIndex=0;for(var a=0;a<this.data.length;a++){this.data[a].btn.checked=(this.data[a].btn.value===b)?true:false;if(this.data[a].btn.checked){this.selectedIndex=a}}return this.selectedIndex},get:function(){for(var a=0;a<this.data.length;a++){if(this.data[a].btn.checked){return this.data[a].btn.value}}return null}};var SelectBox=function(a){this.id=a;return};SelectBox.prototype={id:"",setValue:function(c){var b,a;b=dojo.byId(this.id);for(a=0;a<b.options.length;a++){if(b.options[a].value===c){b.selectedIndex=a}}return b.selectedIndex},getValue:function(){var a=dojo.byId(this.id);return a.options[a.selectedIndex].value},getText:function(){var a=dojo.byId(this.id);return a.options[a.selectedIndex].text},getSelectedIndex:function(){var a=dojo.byId(this.id);return a.selectedIndex}};var pop_up;function open_popup(c,b,d,a){pop_up=window.open(c,b,"width="+d+",height="+a+",toolbar=0,menubar=0,scrollbars=1");if(window.focus){pop_up.focus()}return pop_up}function viewProfile(b){var a="/usr/profile.cfm?popup=true&userid="+b;open_popup(a,"profile",600,600);return}function help(a){open_popup("/xmas/"+CFKIT_GLOBAL.language+"/help.cfm?popup=1#"+a,"Help",400,400);return}function vIE(){return(navigator.appName==="Microsoft Internet Explorer")?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1}function blockIE(){var a=vIE();if(a===-1||a>6){return}document.location="/xmas/legacy.htm";return}var cfkit_award={display:function(a){if(!a.AWARDED){return}dojo.byId("awardContent").innerHTML=a.MSG.DISPLAYTXT;cfkit_util.fadeInOut("awardWidget");return}};var menu=(function(){var e=15,g=50,f=6,d;function c(a){this.n=a;this.h=[];this.c=[];return}c.prototype.init=function(o,q){var n,j=document.getElementById(o),m=j.getElementsByTagName("ul"),a=m.length,k=0;d=q;for(k;k<a;k++){n=m[k].parentNode;this.h[k]=n;this.c[k]=m[k];n.onmouseover=new Function(this.n+".st("+k+",true)");n.onmouseout=new Function(this.n+".st("+k+")")}};c.prototype.st=function(a,j){var l=this.c[a],i=this.h[a],k=i.getElementsByTagName("a")[0];clearInterval(l.t);l.style.overflow="hidden";if(j){k.className+=" "+d;if(!l.mh){l.style.display="block";l.style.height="";l.mh=l.offsetHeight;l.style.height=0}if(l.mh===l.offsetHeight){l.style.overflow="visible"}else{l.style.zIndex=g;g++;l.t=setInterval(function(){b(l,1)},e)}}else{k.className=k.className.replace(d,"");l.t=setInterval(function(){b(l,-1)},e)}return};function b(l,i){var k,j,a=l.offsetHeight;if((a<=0&&i!==1)||(a>=l.mh&&i===1)){if(i===1){l.style.filter="";l.style.opacity=1;l.style.overflow="visible"}clearInterval(l.t);return}k=(i===1)?Math.ceil((l.mh-a)/f):Math.ceil(a/f);j=a/l.mh;l.style.opacity=j;l.style.filter="alpha(opacity="+(j*100)+")";l.style.height=a+(k*i)+"px"}return{dd:c}}());var cfkit_auth={successUrl:"",isFB:false,isAuto:false,infoPanel:new cfkit_InfoPane("login"),login:function(a){var b;cfkit_auth.infoPanel.busy();if(a){cfkit_auth.isFB=true;b={REQUEST_ID:cfkit_util.createGUID(),METHOD:"FB_CONNECT_SIGNIN",setCookies:1}}else{cfkit_auth.isFB=false;b={REQUEST_ID:cfkit_util.createGUID(),METHOD:"USR_SIGNIN",HASHPASSWORD:1,setCookies:1}}dojo.xhrPost({url:"/cfkit/server/user/api.cfm",load:cfkit_auth.loginOk,error:cfkit_auth.submitError,form:"frmLogin",handleAs:"json",content:b});return},loginOk:function(b,a){if(b.STATUS===2){cfkit_auth._postLogin(b.STRACTION)}else{if(!cfkit_auth.isFB){cfkit_auth.infoPanel.msg(b.MSG.DISPLAYTXT);return}if(window.location.href.indexOf(CFKIT_GLOBAL.fb_url)!==-1){cfkit_auth.infoPanel.msg(b.MSG.DISPLAYTXT);return}document.location=CFKIT_GLOBAL.fb_url}return},_postLogin:function(a){if(a.AWARDED){cfkit_award.display(a);setTimeout("cfkit_auth._redirect();",5000)}else{cfkit_auth._redirect()}},_redirect:function(){if(cfkit_auth.successUrl===""){if(dojo.byId("request_method").value==="get"){window.location.reload()}else{document.location=CFKIT_GLOBAL.login_url}}else{document.location=cfkit_auth.successUrl}return},autoLogin:function(){var d,a,b,c=cookie.get("CFKITAUTOLOGIN");if(CFKIT_GLOBAL.authenticated||c===null){return}b=c.split("|");if(b.length>=3&&parseInt(b[2],10)===1){a=true}else{a=false}cfkit_auth.successUrl=CFKIT_GLOBAL.login_url;if(a){cfkit_auth.infoPanel.msg("Waiting on Facebook.");d=function(){cfkit_auth.login(a=true);return};cfkit_fb.initConnect(d);return}return},clickConnect:function(){var a=function(){cfkit_auth.login(true);return};cfkit_fb.initConnect(a);return},logout:function(){var a=function(){cfkit_util.redirect(CFKIT_GLOBAL.logout_url);return};FB_RequireFeatures(["Connect"],function(){FB.init(CFKIT_GLOBAL.FB_API_KEY,"/cfkit/client/script/xd_receiver.htm");FB.Connect.logout(a);return});return},submitError:function(b,a){console.log(b);cfkit_auth.infoPanel.msg("Error contacting the server.");return}};var cfkit_account={infoPanel:new cfkit_InfoPane("login"),isFB:false,isCaptchaOn:false,initCaptcha:false,initFrm:true,create:function(a){cfkit_account.infoPanel.busy();if(a){cfkit_account.isFB=true;dojo.xhrPost({url:"/cfkit/server/user/api.cfm",load:cfkit_account.createOk,error:cfkit_account.submitError,form:"frmFBJoin",handleAs:"json",content:{REQUEST_ID:cfkit_util.createGUID(),METHOD:"FB_CONNECT_NEW"}})}else{cfkit_account.isFB=false;if(cfkit_account.isCaptchaOn&&!cfkit_account.captchaInit){cfkit_account.createCaptcha();return false}dojo.xhrPost({form:"frmJoin",url:"/cfkit/server/user/api.cfm",handleAs:"json",load:cfkit_account.createOk,error:cfkit_account.submitError,content:{REQUEST_ID:cfkit_util.createGUID(),METHOD:"USR_NEW"}})}return},createOk:function(b,a){if(b.STATUS===2){if(cfkit_account.isFB){cfkit_account.infoPanel.msg(b.MSG.DISPLAYTXT);cfkit_auth.login(isFB=true)}else{cfkit_util.display("pnl_login",false);cfkit_util.display("pnl_join",false);cfkit_util.display("login_done",true);cfkit_account.infoPanel.hide()}}else{cfkit_account.infoPanel.msg(b.MSG.DISPLAYTXT)}return},linkToFB:function(){cfkit_account.infoPanel.busy();dojo.xhrPost({url:"/cfkit/server/user/api.cfm",form:"frmLogin",load:cfkit_account.linkToFBOK,error:cfkit_account.submitError,handleAs:"json",content:{REQUEST_ID:cfkit_util.createGUID(),METHOD:"FB_CONNECT_LINK"}});return},linkToFBOK:function(b,a){var c;if(b.STATUS===2){c=function(){cfkit_auth.login(isFB=true);return};cfkit_account.infoPanel.msg("Account is now linked. Click to continue.",0,c)}else{cfkit_account.infoPanel.msg(b.MSG.DISPLAYTXT)}return},submitError:function(b,a){console.log(b);cfkit_account.infoPanel.msg("Error contacting the server.");return},removeHint:function(){var a;if(!cfkit_account.initFrm){return}a=dojo.byId("username");a.value="";a.style.color="black";cfkit_account.initFrm=false;return}};var Grid=function(){this.tbody="";return};Grid.prototype={tbody:"",rows:0,cols:0,cell_count:0,pageNr:0,template:[],data:[],class_odd:"row_odd",class_even:"row_even",init:function(b,f){var e,g,a,d,c;this.tbody=dojo.byId(b);this.rows=f;this.data=[];this.pageNr=0;this.template=[];a=this.tbody.getElementsByTagName("tr");d=a[0].getElementsByTagName("td");for(c=0;c<d.length;c++){this.template[c]=d[c].innerHTML}this.cols=d.length;this.cell_count=this.rows*this.cols;this._clear();return},show:function(a){this.pageNr=a;this._draw()},_draw:function(){var c,b,e,f,a=this.tbody,d="";this._clear(a);if(this.data.length===0){return}for(c=0;c<this.rows;c++){e=a.insertRow(a.rows.length);if(c%2!==0){e.className=this.class_odd}else{e.className=this.class_even}for(b=0;b<this.cols;b++){d=this._fetchData(b,c);if(d!=="&nbsp;"){f=e.insertCell(e.cells.length);f.innerHTML=d}}}return},_fetchData:function(g,i){var e,d,h,f,b,a,c;e="";b=(this.pageNr*this.rows);a=i+b;c=this.data;if(a>=c.length){return"&nbsp;"}d=c[a];e=this.template[g];for(h in d){if(true){f=new RegExp(f="%"+h,"g");e=e.replace(f,d[h])}}return e},_clear:function(){while(this.tbody.rows.length>0){this.tbody.deleteRow(0)}return}};var Grid_Pager=function(){return};Grid_Pager.prototype={grid:"",pagerID:"",current_page:0,page_count:0,start:0,end:0,objName:"",init:function(a,b,c){this.pagerID=a;this.grid=b;this.objName=c;this.page_count=Math.ceil(this.grid.data.length/this.grid.rows);this._draw();this.setCurrentPage(this.grid.pageNr);return},updateData:function(a){this.grid.data=a;this.page_count=Math.ceil(this.grid.data.length/this.grid.rows);this._draw();this.setCurrentPage(1);return},_draw:function(){var b,a=dojo.byId(this.pagerID);this._clear();a.appendChild(this._new_li("li_prev","prev",'<div class="li_prev">&nbsp</div>'));for(b=1;b<=this.page_count;b++){a.appendChild(this._new_li("li_"+b,b,b))}a.appendChild(this._new_li("li_next","next",'<div class="li_next">&nbsp;</div>'));dojo.byId("li_prev").style.display="none";if(this.page_count<=1){dojo.byId(this.pagerID).style.display="none"}else{dojo.byId(this.pagerID).style.display="block"}return},_new_li:function(h,g,f){var b,c,e,d;b=document.createElement("LI");c=document.createElement("A");e=""+this.objName+'._click("'+g+'");';d="java_script:";d=d.replace("_","");c.setAttribute("href",d+e);c.innerHTML=""+f;b.setAttribute("id",h);b.appendChild(c);return b},_clear:function(){var a=dojo.byId(this.pagerID);a.innerHTML="";return},setCurrentPage:function(c){var b,a="";this.current_page=c;for(b=1;b<=this.page_count;b++){a=dojo.byId("li_"+b);if(b===this.current_page){a.className="current"}else{a.className=""}}if(this.page_count>1){if(this.current_page===1){dojo.byId("li_prev").style.display="none"}else{dojo.byId("li_prev").style.display="inline"}if(this.current_page===this.page_count){dojo.byId("li_next").style.display="none"}else{dojo.byId("li_next").style.display="inline"}}this.grid.show(this.current_page-1);return},_click:function(b){var a=this.current_page;if(this.current_page===b){return}if(b==="next"){a++;if(a>this.page_count){a=1}this.setCurrentPage(a);return}if(b==="prev"){a--;if(a<1){a=this.page_count}this.setCurrentPage(a);return}this.setCurrentPage(b);return}};