
var Runner={version:'1.0'};Runner.apply=function(obj,cfg,defaults){if(defaults){Runner.apply(obj,defaults);}
if(obj&&cfg&&typeof cfg=='object'){for(var prop in cfg){obj[prop]=cfg[prop];}}
return obj;};Runner.emptyFn=function(){};(function(){var idCounter=0;var zIndexMax=window.zindex_max;var userAgent=navigator.userAgent.toLowerCase();var isOpera=userAgent.indexOf("opera")>-1;var isIE=!isOpera&&userAgent.indexOf("msie")>-1;var isIE6=!isOpera&&userAgent.indexOf("msie 6")>-1;var isIE7=!isOpera&&userAgent.indexOf("msie 7")>-1;var isIE8=!isOpera&&userAgent.indexOf("msie 8")>-1;var isChrome=userAgent.indexOf("chrome")>-1;var isSafari=!isChrome&&(/webkit|khtml/).test(userAgent);var isSafari3=isSafari&&userAgent.indexOf('webkit/5')!=-1;var isGecko=!isSafari&&!isChrome&&userAgent.indexOf("gecko")>-1;var isGecko3=isGecko&&userAgent.indexOf("rv:1.9")>-1
Runner.apply(Runner,{extend:function(){var overrideFunc=function(obj){for(var prop in obj){this[prop]=obj[prop];}};var baseObjConstr=Object.prototype.constructor;return function(subBase,supPar,overrides){if(typeof supPar=='object'){overrides=supPar;supPar=subBase;subBase=(overrides.constructor!=baseObjConstr)?overrides.constructor:function(){supPar.apply(this,arguments);};}
var F=function(){},subBaseProt,supParProt=supPar.prototype;F.prototype=supParProt;subBaseProt=subBase.prototype=new F();subBaseProt.constructor=subBase;subBase.superclass=supParProt;if(supParProt.constructor==baseObjConstr){supParProt.constructor=supPar;}
subBase.override=function(obj){Runner.override(subBase,obj);};subBaseProt.override=overrideFunc;Runner.override(subBase,overrides);subBase.extend=function(obj){Runner.extend(subBase,obj);};return subBase;};}(),override:function(origClass,overrides){if(overrides){var origProt=origClass.prototype;for(var method in overrides){origProt[method]=overrides[method];}
if(Runner.isIE&&overrides.toString!=origClass.toString){origProt.toString=overrides.toString;}}},loadJS:function(src,onload,scope){scope=scope||this;var js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',src);if(onload&&Runner.isIE){js.onreadystatechange=function(){if(js.readyState=='complete'||js.readyState=='loaded'){onload.call(scope);}};}else if(onload){js.onload=function(){onload.call(scope);}}
document.getElementsByTagName('HEAD')[0].appendChild(js);},htmlDecode:function(txt){txt=txt.replace(/&gt;/ig,"\>");txt=txt.replace(/&lt;/ig,"\<");txt=txt.replace(/&amp;/ig,"&");return txt;},namespace:function(name){var params=name.split('.'),current=Runner;for(var i=1;i<params.length;i++){if(!current[params[i]]){current[params[i]]={};}
current=current[params[i]];}
return current;},genId:function(pref){pref=pref||"runner";return pref+(++idCounter);},getZindex:function(elObj){++zindex_max;zIndexMax=zindex_max;if(elObj){elObj.css("z-index",zIndexMax);}
return zIndexMax;},goodFieldName:function(fName){return fName.replace(/\W/g,'_');},isOpera:isOpera,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7&&!isIE8,isIE7:isIE7,isIE8:isIE8,isChrome:isChrome});})();Runner.namespace('Runner.controls');Runner.namespace('Runner.search');String.prototype.entityify=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace('"','&quot;');};String.prototype.quote=function(){return this.replace("\\","\\\\").replace("'","\\'");};String.prototype.xTempl=function(o){return this.replace(/{([^{}]*)}/g,function(a,b){var r=o[b];return typeof r==='string'||typeof r==='number'?r:a;});};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};String.prototype.slashdecode=function(){var out='';var pos=0;for(var i=0;i<this.length-1;i++)
{var c=this.charAt(i);if(c=='\\')
{out+=this.substr(pos,i-pos);pos=i+2;var c1=this.charAt(i+1);i++;if(c1=='\\'){out+="\\";}else if(c1=='r'){out+="\r";}else if(c1=='n'){out+="\n";}else{i--;pos-=2;}}}
if(pos<this.length)
out+=this.substr(pos);return out;}
Array.prototype.isInArray=function(value,caseSensitive){for(var i=0;i<this.length;i++){if(caseSensitive){if(this[i]==value){return true;}}else{if(this[i].toString().toLowerCase()==value.toString().toLowerCase()){return true;}}}
return false;};Array.prototype.getIndexOfElem=function(value,callBack,caseSensitive){for(var i=0;i<this.length;i++){if(callBack){if(callBack(value,this[i])){return i;}}else if(caseSensitive){if(this[i]==value){return i;}}else{if(this[i].toString().toLowerCase()==value.toString().toLowerCase()){return i;}}}
return-1;};Runner.namespace('Runner.util.Event');Runner.util.Event.getTarget=function(e){return e.target||e.srcElement;}
Runner.util.DelayedTask=function(fn,scope,args){var id=null,delay,time;var call=function(){var now=new Date().getTime();if(now-time>=delay){clearInterval(id);id=null;fn.apply(scope,args||[]);}};this.delay=function(newDelay,newFn,newScope,newArgs){if(id&&delay!=newDelay){this.cancel();}
delay=newDelay;time=new Date().getTime();fn=newFn||fn;scope=newScope||scope;args=newArgs||args;if(!id){id=setInterval(call,delay);}};this.cancel=function(){if(id){clearInterval(id);id=null;}};};Runner.util.PageLoader=Runner.extend(Runner.emptyFn,{postLoadStep:Runner.emptyFn,beforePool:null,afterPool:null,isBeforeCalled:false,isAfterCalled:false,isPostLoadStepCalled:false,id:-1,constructor:function(cfg){Runner.util.PageLoader.superclass.constructor.call(this,cfg);this.beforePool=[];this.afterPool=[];Runner.apply(this,cfg);},addBe4PostLoad:function(func){if(!func){return false;}
if(this.isBeforeCalled){func();}else{return this.beforePool.push(func);}},addPostLoadStep:function(func){if(!func){return false;}
this.isPostLoadStepCalled=false;this.postLoadStep=func;},add2PostLoad:function(func){if(!func){return false;}
if(this.isAfterCalled){func();}else{return this.afterPool.push(func);}},callBeforePool:function(){for(var i=0;i<this.beforePool.length;i++){this.beforePool[i]();}
this.isBeforeCalled=true;return this.beforePool.length;},callPostLoadStep:function(){this.postLoadStep();this.isPostLoadStepCalled=true;},callAfterPool:function(){for(var i=0;i<this.afterPool.length;i++){this.afterPool[i]();}
this.isAfterCalled=true;return this.afterPool.length;},callJS:function(){if(!this.isBeforeCalled){this.callBeforePool();}
if(!this.isPostLoadStepCalled){this.callPostLoadStep();}
if(!this.isAfterCalled){this.callAfterPool();}}});Runner.util.ScriptLoader=function(){return{cssFiles:[],jsFiles:[],pageLoaders:{},addJS:function(files){var isAdded=false;for(var i=0;i<files.length;i++){for(var j=0;j<this.jsFiles.length;j++){if(this.jsFiles[j].name==files[i]){isAdded=true;break;}}
if(!isAdded){this.jsFiles.push({name:files[i],isLoaded:false,requirements:Array.prototype.slice.call(arguments,1)});}
isAdded=false;}},loadCSS:function(files){for(var i=0;i<files.length;i++){var idx=this.cssFiles.getIndexOfElem(files[i],function(val,arrElem){if(val==arrElem.name){return true;}});if(idx!=-1&&this.cssFiles[idx].isLoaded){return true;}
this.cssFiles.push({name:files[i],isLoaded:true})
var head=$(document).find('head')[0];var css=document.createElement('link');css.setAttribute('rel','stylesheet');css.setAttribute('type','text/css');css.setAttribute('href',"include/"+files[i]+".css");head.appendChild(css);}},load:function(pageId){for(var i=0;i<this.jsFiles.length;i++){this.loadJS(i,pageId);}
if(typeof pageId!="undefined"){this.callPageJS(pageId);}else{this.callAllPagesJS();}},loadJS:function(idx,pageId){if(!this.jsFiles[idx]){return false;}
if(this.jsFiles[idx].isLoaded){this.postLoad(idx,pageId);return true;}
if(!this.checkReq(this.jsFiles[idx])){return false;}
var js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',"include/"+this.jsFiles[idx].name+".js");var sl=this;if(Runner.isIE){js.onreadystatechange=function(){if(js.readyState=='complete'||js.readyState=='loaded'){sl.postLoad(idx,pageId);}};}else{js.onload=function(){sl.postLoad(idx,pageId);};}
document.getElementsByTagName('HEAD')[0].appendChild(js);return true;},checkReq:function(fileObj){for(var i=0;i<fileObj.requirements.length;i++){for(var j=0;j<this.jsFiles.length;j++){if(fileObj.requirements[i]==this.jsFiles[j].name&&!this.jsFiles[j].isLoaded){return false;}}}
return true;},postLoad:function(idx,pageId){this.jsFiles[idx].isLoaded=true;this.loadDependent(idx);if(typeof pageId!="undefined"){this.callPageJS(pageId);}else{this.callAllPagesJS();}},loadDependent:function(idx){for(var i=0;i<this.jsFiles.length;i++){for(var j=0;j<this.jsFiles[i].requirements.length;j++){if(i!=idx&&this.jsFiles[i].requirements[j]==this.jsFiles[idx].name){this.loadJS(i);}}}},callPageJS:function(pageId){for(var i=0;i<this.jsFiles.length;i++){if(!this.jsFiles[i].isLoaded){return;}}
var loader=this.checkPageLoader(pageId);loader.callJS();},callAllPagesJS:function(){for(var i=0;i<this.jsFiles.length;i++){if(!this.jsFiles[i].isLoaded){return;}}
for(var pageId in this.pageLoaders){this.callPageJS(pageId)}},addBe4PostLoad:function(func,pageId){var loader=this.checkPageLoader(pageId);loader.addBe4PostLoad(func);},add2PostLoad:function(func,pageId){var loader=this.checkPageLoader(pageId);loader.add2PostLoad(func);},addPostLoadStep:function(func,pageId){var loader=this.checkPageLoader(pageId);loader.addPostLoadStep(func);},checkPageLoader:function(pageId){if(!this.pageLoaders[pageId]){this.pageLoaders[pageId]=new Runner.util.PageLoader({id:pageId});}
return this.pageLoaders[pageId];}}}();Runner.namespace('Runner.util.IEHelper');Runner.util.IEHelper.iframe=function(cfg){var cfg=cfg||{},id;if(cfg.constructor===Object){cfg.w=cfg.w||0,cfg.h=cfg.h||0,cfg.t=cfg.t||0,cfg.l=cfg.l||0,id=cfg.id||Runner.genId();}else{var el=cfg;id=Runner.genId();}
var iframe=$('#'+id);if(!iframe.length){$(document).find('body').append('<iframe src="javascript:false;" id="'+id+'" frameborder="1" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" style="background:white;position:absolute;display:block;opacity:0;filter:alpha(opacity=0);"></iframe>');iframe=$('#'+id);}
var iframeObj={move:function(t,l){if(t!==undefined&&l!==undefined){iframe.css('top',t+'px').css('left',l+'px');}
return this;},destroy:function(){iframe.remove();return this;},resize:function(w,h){if(w!==undefined&&h!==undefined){iframe.css('height',h).css('width',w);}
return this;},hide:function(){iframe.hide();return this;},show:function(){iframe.show();return this;},reset:function(coors){coors=coors||this.getPos()||cfg;this.move(coors.t,coors.l).resize(coors.w,coors.h).show();Runner.getZindex(iframe);return this;},getPos:function(){if(!el){this.getPos=function(){return false;}}else{this.getPos=function(){var posObj=getAbsolutePosition(el),coors={};coors.w=el.offsetWidth,coors.h=el.offsetHeight,coors.t=posObj.t,coors.l=posObj.l;return coors;}}
this.getPos();}}
return iframeObj.reset();}
Runner.util.IEHelper.selectsHider=function(el){var selToHide=[],elem=el;return{checkIntersection:function(selCoors,elCoors){if((Math.abs((elCoors.x-selCoors.x))<=(elCoors.w+selCoors.w)/2)&&(Math.abs((elCoors.y-selCoors.y))<=(elCoors.h+selCoors.h)/2)){return true;}},getCenter:function(coors){coors.x=coors.l+coors.w/2;coors.y=coors.t+coors.h/2;return coors;},hideSels:function(){for(var i=0;i<selToHide.length;i++){$(selToHide[i]).hide();}
return this;},showSels:function(){for(var i=0;i<selToHide.length;i++){$(selToHide[i]).show();}
return this;},getSelects:function(elPos){var elCoors=elPos||{},selToCheck=$('select');selToHide=[];if(!elPos){var pos=findPos(el);elCoors.l=pos[0];elCoors.t=pos[1];elCoors.w=el.offsetWidth;elCoors.h=el.offsetHeight;}
elCoors=this.getCenter(elCoors);var coors={};for(var i=0;i<selToCheck.length;i++){pos=findPos(selToCheck[i]);coors.l=pos[0];coors.t=pos[1];coors.w=selToCheck[i].offsetWidth;coors.h=selToCheck[i].offsetHeight;coors=this.getCenter(coors);if(this.checkIntersection(coors,elCoors)){selToHide.push(selToCheck[i]);}}
return selToHide;}}}