
var body='';var runedOnce=false;var base_img=base_page+'img/';var ie=((ua_name=='ie')?true:false);window.onerror=ErrorFunction;window.onError=ErrorFunction;function ErrorFunction(msg,url,line){var x,y,z;return true;}
function __(str){return str;}
function undef(cvar){if(typeof cvar!="undefined"&&cvar!==''&&cvar!==null&&cvar!=false){return false;}else{return true;}}
function runOnce(func){if(!this.runedOnce){this.runedOnce=true;func.call(this);}else{return;}}
function requireOnce(file,afterLoad,id){if(!scriptIncludes){scriptIncludes={};var scriptTags=document.getElementsByTagName("script");for(var i=0,len=scriptTags.length;i<len;i++){if(scriptTags[i].src){scriptIncludes[scriptTags[i].src]=true;}}}
if(!scriptIncludes[file]){var scriptTag=document.createElement("script");if(id){scriptTag.id=id;}
scriptTag.type="text/javascript";if(file.substr(0,7)=="http://"){scriptTag.src=file;}else{scriptTag.src=base_page+"js/"+file;}
scriptIncludes[file]=true;document.getElementsByTagName("head")[0].appendChild(scriptTag);if(window.opera){afterLoad();}else{scriptTag.onreadystatechange=function(){if(this.readyState=='complete'){if(afterLoad){afterLoad();}}};scriptTag.onload=function(){if(afterLoad){afterLoad();}};}}}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();};}}
function descriptor(str){for(i=0;i<str.length;i++){str=str.replace(/[^A-Za-z0-9_]/,"_");}
return str;}
function forceMaxLength(){var maxLength=this.getAttribute('maxlength');if(this.value.length>maxLength){this.value=this.value.substring(0,maxLength);}}
Array.prototype.del=function(delvar){this.returner=[];for(var i=0;i<this.length;i++){if(this[i]!=delvar){this.returner.push(this[i]);}}
return this.returner;};Number.prototype.max=function(max){var temp=this;if(temp>max){return max;}
return this;};String.prototype.tf=function(){str=this.split("/");for(this.i=0;this.i<str.length;this.i++){if(str[this.i]=='img'&&lang!=CONFIG.i18n.fallback_locale){str[this.i]='img/'+lang;}}
return str.join("/");};String.prototype.descriptor=function(){str=this;for(this.i=0;this.i<str.length;this.i++){str=str.replace(/[^A-Za-z0-9_]/,"_");}
return str;};String.prototype.shorten=function(num){str=this;if(str.length>num){str=str.slice(0,num);str+='...';}
return str;}
Array.prototype.shuffle=function(){var tmp,rand;for(var i=0;i<this.length;i++){rand=Math.floor(Math.random()*this.length);tmp=this[i];this[i]=this[rand];this[rand]=tmp;}};function in_array(array,search){for(var i=0;i<array.length;i++){if(array[i]==search){return true;}}
return false;}
function opera_refreshcss(){if(ua_name!="safari"){cssObj=document.getElementsByTagName("head")[0].appendChild(document.createElement("link"));cssObj.type="text/css";cssObj.rel="Stylesheet";cssObj.href="";document.getElementsByTagName("head")[0].removeChild(cssObj);}}