
var g_moveFocus=null;function _afs()
{g_moveFocus.focus();if(g_moveFocus.select)g_moveFocus.select();}
function asyncFocus(element)
{g_moveFocus=$(element);setTimeout('_afs();',0);}
function displayNotice(className,msg,moveFocus)
{var notice=$('notice');if(msg==null)
{notice.style.display='none';}
else
{notice.className=className;notice.innerHTML=msg;notice.style.display='block';if(moveFocus!=null)
asyncFocus(moveFocus);}}
function displayProblem(msg,moveFocus)
{displayNotice('Problem',msg,moveFocus);}
function displayInfo(msg,moveFocus)
{displayNotice('Confirm',msg,moveFocus);}
function evalResponse(responseText)
{if(responseText.substr(0,9)=='while(1);')
{responseText=responseText.substring(9);return responseText.evalJSON(true);}
return null;}
function random()
{return Math.round(999999999*Math.random());}
var g_newCaptcha;function reloadCaptcha(clear)
{var captcha_image=$('captcha_image');captcha_image.src=__g_static+'img/s.gif';g_newCaptcha=new Image();g_newCaptcha.onload=displayCaptcha;g_newCaptcha.src='/captcha?'+random();if(clear)
{$('captcha').value='';asyncFocus('captcha');}}
function displayCaptcha()
{if(g_newCaptcha)
{var captcha_image=$('captcha_image');captcha_image.src=g_newCaptcha.src;}}
String.prototype.trim=function()
{return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function()
{return this.replace(/^\s+/,"");}
String.prototype.rtrim=function()
{return this.replace(/\s+$/,"");}
function addEvent(obj,evType,fn,useCapture)
{if(obj.addEventListener)
{obj.addEventListener(evType,fn,useCapture);return true;}
else if(obj.attachEvent)
{var r=obj.attachEvent("on"+evType,fn);return r;}
else
{return false;}}
function removeEvent(obj,evType,fn,useCapture)
{if(obj.removeEventListener)
{obj.removeEventListener(evType,fn,useCapture);return true;}
else if(obj.detachEvent)
{var r=obj.detachEvent("on"+evType,fn);return r;}
else
{return false;}}