
var xMac,xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();function xInit()
{if(window.opera)
{var i=xUA.indexOf('opera');if(i!=-1)
{xOp7Up=(parseInt(xUA.charAt(i+6),10))>=7;xOp6Dn=!xOp7Up;}}
else if(navigator.vendor!='KDE'&&document.all&&xUA.indexOf('msie')!=-1)
{xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}
else if(document.layers)
{xNN4=true;}
xMac=xUA.indexOf('mac')!=-1;}
xInit();function xDef()
{for(var i=0;i<arguments.length;++i)
{if(typeof(arguments[i])=='undefined')
{return false;}}
return true;}
function xClientHeight()
{var h=0;if(xOp6Dn)
{h=window.innerHeight;}
else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientHeight)
{h=document.documentElement.clientHeight;}
else if(document.body&&document.body.clientHeight)
{h=document.body.clientHeight;}
else if(xDef(window.innerWidth,window.innerHeight,document.width))
{h=window.innerHeight;if(document.width>window.innerWidth)
{h-=16;}}
return h;}
function xClientWidth()
{var w=0;if(xOp6Dn)
{w=window.innerWidth;}
else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientWidth)
{w=document.documentElement.clientWidth;}
else if(document.body&&document.body.clientWidth)
{w=document.body.clientWidth;}
else if(xDef(window.innerWidth,window.innerHeight,document.height))
{w=window.innerWidth;if(document.height>window.innerHeight)
{w-=16;}}
return w;}
function $(e)
{if(typeof(e)!='string')
{return e;}
if(document.getElementById)
{e=document.getElementById(e);}
else if(document.all)
{e=document.all[e];}
else
{e=null;}
return e;}
function xGetComputedStyle(oEle,sProp,bInt)
{var s,p='undefined';var dv=document.defaultView;if(dv&&dv.getComputedStyle)
{s=dv.getComputedStyle(oEle,'');if(s)
{p=s.getPropertyValue(sProp);}}
else if(oEle.currentStyle)
{var a=sProp.split('-');var c;sProp=a[0];for(var i=1;i<a.length;++i)
{c=a[i].charAt(0);sProp+=a[i].replace(c,c.toUpperCase());}
p=oEle.currentStyle[sProp];}else{return null;}
return bInt?(parseInt(p,10)||0):p;}
function xNum()
{for(var i=0;i<arguments.length;++i)
{if(isNaN(arguments[i])||typeof(arguments[i])!='number'){return false;}}
return true;}
function xStr(s)
{for(var i=0;i<arguments.length;++i)
{if(typeof(arguments[i])!='string')
{return false;}}
return true;}
function xHeight(e,h)
{if(!(e=$(e)))
{return 0;}
if(xNum(h))
{if(h<0)
{h=0;}
else
{h=Math.round(h);}}
else
{h=-1;}
var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body')
{h=xClientHeight();}
else if(css&&xDef(e.offsetHeight)&&xStr(e.style.height))
{if(h>=0)
{var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=='CSS1Compat')
{var gcs=xGetComputedStyle;pt=gcs(e,'padding-top',1);if(pt!==null)
{pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1);}
else if(xDef(e.offsetHeight,e.style.height))
{e.style.height=h+'px';pt=e.offsetHeight-h;}}
h-=(pt+pb+bt+bb);if(isNaN(h)||h<0)
{return;}
else
{e.style.height=h+'px';}}
h=e.offsetHeight;}
else if(css&&xDef(e.style.pixelHeight))
{if(h>=0)
{e.style.pixelHeight=h;}
h=e.style.pixelHeight;}
return h;}
function xLeft(e,iX)
{if(!(e=$(e)))
{return 0;}
var css=xDef(e.style);if(css&&xStr(e.style.left))
{if(xNum(iX))
{e.style.left=iX+'px';}
else
{iX=parseInt(e.style.left,10);if(isNaN(iX))
{iX=0;}}}
else if(css&&xDef(e.style.pixelLeft))
{if(xNum(iX)){e.style.pixelLeft=iX;}else{iX=e.style.pixelLeft;}}
return iX;}
function xTop(e,iY)
{if(!(e=$(e)))
{return 0;}
var css=xDef(e.style);if(css&&xStr(e.style.top))
{if(xNum(iY))
{e.style.top=iY+'px';}
else
{iY=parseInt(e.style.top,10);if(isNaN(iY))
{iY=0;}}}
else if(css&&xDef(e.style.pixelTop))
{if(xNum(iY))
{e.style.pixelTop=iY;}
else
{iY=e.style.pixelTop;}}
return iY;}
function xMoveTo(e,x,y)
{xLeft(e,x);xTop(e,y);}
function xWidth(e,w)
{if(!(e=$(e)))
{return 0;}
if(xNum(w))
{if(w<0)
{w=0;}
else
{w=Math.round(w);}}
else
{w=-1;}
var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body')
{w=xClientWidth();}
else if(css&&xDef(e.offsetWidth)&&xStr(e.style.width))
{if(w>=0)
{var pl=0,pr=0,bl=0,br=0;if(document.compatMode=='CSS1Compat')
{var gcs=xGetComputedStyle;pl=gcs(e,'padding-left',1);if(pl!==null)
{pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1);}
else if(xDef(e.offsetWidth,e.style.width))
{e.style.width=w+'px';pl=e.offsetWidth-w;}}
w-=(pl+pr+bl+br);if(isNaN(w)||w<0)
{return;}
else
{e.style.width=w+'px';}}
w=e.offsetWidth;}
else if(css&&xDef(e.style.pixelWidth))
{if(w>=0)
{e.style.pixelWidth=w;}
w=e.style.pixelWidth;}
return w;}
function xResizeTo(e,w,h)
{xWidth(e,w);xHeight(e,h);}
function xOpacity(e,o)
{var set=xDef(o);if(!(e=$(e))){return 2;}
if(xStr(e.style.opacity)){if(set){e.style.opacity=o+'';}
else{o=parseFloat(e.style.opacity);}}
else if(xStr(e.style.filter)){if(set){e.style.filter='alpha(opacity='+(100*o)+')';}
else if(e.filters&&e.filters.alpha){o=e.filters.alpha.opacity/100;}}
else if(xStr(e.style.MozOpacity)){if(set){e.style.MozOpacity=o+'';}
else{o=parseFloat(e.style.MozOpacity);}}
else if(xStr(e.style.KhtmlOpacity)){if(set){e.style.KhtmlOpacity=o+'';}
else{o=parseFloat(e.style.KhtmlOpacity);}}
return isNaN(o)?1:o;}
function fadeDiv(div,opacity,endOpacity,millisIncrement,fadeIncrement)
{xOpacity(div,opacity);div.style.display='block';var tid=setInterval(function(){opacity+=fadeIncrement;if((fadeIncrement>0&&opacity>=endOpacity)||(fadeIncrement<0&&opacity<=endOpacity))
{opacity=endOpacity;tid=clearInterval(tid);}
xOpacity(div,opacity);if(opacity===0)
{div.style.display='none';}},millisIncrement);}
var jaru={};jaru.ie5=(document.all&&document.getElementById);jaru.ns6=(document.getElementById&&!document.all);jaru.onLoadFuncs=[];jaru.signUpForOnLoad=function(f)
{jaru.onLoadFuncs.push(f);};window.onload=function()
{for(var i=0;i<jaru.onLoadFuncs.length;i++)
{jaru.onLoadFuncs[i]();}};jaru.onUnloadFuncs=[];jaru.signUpForOnUnload=function(f)
{jaru.onUnloadFuncs.push(f);};window.onunload=function()
{for(var i=0;i<jaru.onUnloadFuncs.length;i++)
{jaru.onUnloadFuncs[i]();}};jaru.onKeyDownFuncs=[];jaru.onKeyPressFuncs=[];jaru.onKeyUpFuncs=[];jaru.signUpForOnKeyPress=function(f)
{jaru.onKeyPressFuncs.push(f);};jaru.signUpForOnKeyDown=function(f)
{jaru.onKeyDownFuncs.push(f);};jaru.signUpForOnKeyUp=function(f)
{jaru.onKeyUpFuncs.push(f);};document.onkeypress=function(e)
{e=e||window.event;var keynum=e.keyCode||e.which;var key=String.fromCharCode(keynum);for(var i=0;i<jaru.onKeyPressFuncs.length;i++)
{if(!jaru.onKeyPressFuncs[i](e,key,keynum))
{return false;}}
return true;};jaru.ctrlKey=false;jaru.altKey=false;document.onkeydown=function(e)
{e=e||window.event;jaru.ctrlKey=e.ctrlKey;jaru.altKey=e.altKey;var keynum=e.keyCode||e.which;var key=String.fromCharCode(keynum);for(var i=0;i<jaru.onKeyDownFuncs.length;i++)
{if(!jaru.onKeyDownFuncs[i](e,key,keynum))
{return false;}}
return true;};document.onkeyup=function(e)
{e=e||window.event;jaru.ctrlKey=e.ctrlKey;jaru.altKey=e.altKey;var keynum=e.keyCode||e.which;var key=String.fromCharCode(keynum);for(var i=0;i<jaru.onKeyUpFuncs.length;i++)
{if(!jaru.onKeyUpFuncs[i](e,key,keynum))
{return false;}}
return true;};jaru.localeValues=[];jaru.getDocumentHeight=function()
{return jaru.ie5?document.body.clientHeight:window.innerHeight;};jaru.strStartsWith=function(s,a)
{if(s===null||s===undefined||a===null||a===undefined)
{return false;}
else
{if(!s.slice)
{s=String(s);}
return a===s||a===s.slice(0,a.length);}};jaru.strEndsWith=function(s,a)
{if(s===null||s===undefined||a===null||a===undefined)
{return false;}
else
{if(!s.slice)
{s=String(s);}
return a===s||a===s.slice(-a.length);}};jaru.strTrim=function(str)
{var str=str.replace(/^\s\s*/,''),ws=/\s/,i=str.length;while(ws.test(str.charAt(--i)));return str.slice(0,i+1);};function makeEventHandler(jsObj,methodName)
{return(function(e)
{e=e||window.event;return jsObj[methodName](e,this);});}
function makeCallback(jsObj,methodName)
{return(function(result,exception)
{return jsObj[methodName](result,exception);});}
function centerDiv(d,w,h)
{if(d)
{if(!w)
{w=xWidth(d);}
if(!h)
{h=xHeight(d);}
var ww=xClientWidth(),wh=xClientHeight(),x=0,y=0;if(ww<w)
{w=ww;}
else
{x=(ww-w)/2;}
if(wh<h)
{h=wh;}
else
{y=(wh-h)/2;}
xResizeTo(d,w,h);xMoveTo(d,x,y);}}
function getMouseLocation(e)
{var posx=0;var posy=0;if(e)
{if(e.pageX||e.pageY)
{posx=e.pageX;posy=e.pageY;}
else if(e.clientX||e.clientY)
{posx=e.clientX+document.body.scrollLeft;posy=e.clientY+document.body.scrollTop;}}
return{'x':posx,'y':posy};}
function removeAllChildren(ele)
{if(ele)
{while(ele.firstChild)
{ele.removeChild(ele.firstChild);}}}
function getScrollXY()
{var sx=0,sy=0;if(typeof(window.pageYOffset)=='number')
{sy=window.pageYOffset;sx=window.pageXOffset;}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{sy=document.body.scrollTop;sx=document.body.scrollLeft;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{sy=document.documentElement.scrollTop;sx=document.documentElement.scrollLeft;}
return{x:sx,y:sy};}
function findLocation(obj)
{var totalVOffset=0;var totalHOffset=0;var tempObj=obj;while(tempObj.tagName!="BODY"&&tempObj.tagName!="HTML")
{if(tempObj.offsetParent)
{totalVOffset+=tempObj.offsetTop;totalHOffset+=tempObj.offsetLeft;tempObj=tempObj.offsetParent;}
else
{break;}}
return{x:totalHOffset,y:totalVOffset};}
function $$(prefix,key)
{var entire="",result;if(prefix)
{entire+=prefix;}
if(key)
{entire+=key;}
if(jaru.localeValues[entire])
{result=jaru.localeValues[entire];if(arguments.length>2)
{for(var i=2,j=arguments.length;i<j;i++)
{result=result.replace('{'+(i-2)+'}',arguments[i]);}}
return result;}
else
{return"!!"+entire+"!!";}}
function clone(obj)
{if(obj===null||obj===undefined)
{return obj;}
if(typeof(obj)!='object')
{return obj;}
var newObj;var i;if(obj instanceof Array)
{newObj=[];for(i=0;i<obj.length;i++)
{newObj.push(clone(obj[i]));}}
else
{newObj={};for(i in obj)
{newObj[i]=clone(obj[i]);}}
return newObj;}
jaru.insureInt=function(n)
{try
{n=parseInt(n,10);}
catch(e)
{n=0;}
if(isNaN(n))
{n=0;}
return n;};jaru.insureFloat=function(n)
{try
{n=parseFloat(n);}
catch(e)
{n=0;}
if(isNaN(n))
{n=0;}
return n;};jaru.windowBounds=function()
{return{w:document.body.clientWidth||window.innerWidth,h:document.body.clientHeight||window.innerHeight};};function bubble(e,b)
{if(!b)
{e.cancelBubble=true;if(e.stopPropagation)
{e.stopPropagation();}}
return b;}
function mainFrameLoad(url)
{if(url)
{try
{if(parent.displayedInIFrame)
{parent.frames.Main.allowJsonRpcExceptionAlert=false;}
else
{top.frames.Main.allowJsonRpcExceptionAlert=false;}}
catch(e)
{}
if(parent.displayedInIFrame)
{parent.frames.Main.location.href=url;}
else
{top.frames.Main.location.href=url;}}}