
var showMessages=false;var preferAlert=window.all&&!window.opera;Array.push=function(arr,value){arr[arr.length]=value;return arr.length;};Array.find=function(arr,element){for(var i=0;i<arr.length;i++){if(arr[i]==element){return i;}}
return-1;};function $import(path){var script=document.createElement('script');script.type='text/javascript';script.src=path;document.getElementsByTagName('head')[0].appendChild(script);}
function trim(str){return str.replace(/^\s*|\s*$/g,"");}
function randomString(length){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var randomstring='';for(var i=0;i<length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1);}
return randomstring;}
function printfire()
{if(window.console)
{console.log(arguments[0].toString());}
else if(document.createEvent&&document.dispatchEvent&&!window.opera)
{printfire.args=arguments;var ev=document.createEvent("Events");ev.initEvent("printfire",false,true);dispatchEvent(ev);}
else if(window.opera)
{window.opera.postError(arguments);}}
function gen_log(str)
{if(!this.showMessages||!str)
{return;}
str=str.toString();if(str.indexOf("ERROR: ")==0)
{alert(str);}
else
{print_msg(str);}}
function print_msg(msg)
{if(preferAlert)
{alert(msg);}
else
{printfire(msg);}}
function Log(){}
Log.prototype={error:function(str)
{if(window.console&&showMessages)
{console.trace();console.error(str);}
else gen_log("ERROR: "+str);},info:function(str)
{if(window.console&&showMessages)console.info(str);else gen_log("INFO: "+str);},warn:function(str)
{if(window.console&&showMessages)
{console.trace();console.warn(str);}
else gen_log("WARNING: "+str);},debug:function(str)
{if(window.console&&showMessages)console.debug(str);else gen_log("DEBUG: "+str);}};function handleError(message,URI,line){gen_log("ERROR: "+message+" at line "+line);return true;}
if(window.onerror)
{window.onerror=handleError;}
function hashToString(hash)
{var str='';var len=0;for(key in hash)
{str+=key+':'+hash[key]+', ';len++;}
return'['+len+']: '+str;}
function xmlToString(xmlDocument)
{if(window.opera)
{var xmlSerializer=document.implementation.createLSSerializer();return xmlSerializer.writeToString(xmlDocument);}
else if(document.all)
{return xmlDocument.xml;}
else
{var xmlSerializer=new XMLSerializer();return xmlSerializer.serializeToString(xmlDocument);}}
function getXmlValueOf(xmldoc,valuename)
{var val="";var elems=xmldoc.getElementsByTagName(valuename);if(elems.length==0)
{return val;}
var localItem=elems.item(0);if(localItem===null||localItem.firstChild===null||localItem.firstChild.nodeValue===null)
{return val;}
val=localItem.firstChild.nodeValue;return val;}
function Query(){this.values=[];}
Query.prototype.add=function(key,val){this.values[key]=val;}
Query.prototype.toString=function(){var sortedKeys=[];for(key in this.values)
{sortedKeys[sortedKeys.length]=key;}
sortedKeys.sort();var buffer="?";for(var i=0;i<sortedKeys.length;++i)
{buffer+=sortedKeys[i]+'='+this.values[sortedKeys[i]]+'&';}
return buffer.substring(0,buffer.length-1);}
var areCookiesEnabled=null;function cookiesEnabled()
{if(areCookiesEnabled!==null)
{return areCookiesEnabled;}
createCookie('fncTestCookie','fncTestValue','');if(getCookieValue('fncTestCookie')=="fncTestValue")
{eraseCookie('fncTestCookie');areCookiesEnabled=true;}else
{areCookiesEnabled=false;}
return areCookiesEnabled;}
var waitElement=null;var waitElementCurValue="";function wait(element)
{if(element!==null&&element!==undefined)
{waitElement=element;waitElementCurValue=waitElement.style.cursor;waitElement.style.cursor='wait';}
else if(waitElement!==null&&waitElement!==undefined)
{if(waitElement.style.cursor!='wait')
{waitElementCurValue=waitElement.style.cursor;waitElement.style.cursor='wait';}}}
function unwait()
{if(waitElement!==null&&waitElement!==undefined)
{waitElement.style.cursor=waitElementCurValue;waitElement=null;}}