// copyright (c) 2006 Majigs, LLC

function abr(el){el.appendChild(c('BR'));}
function ac(el,ch){el.appendChild(ch);}
function anbsp(el){el.appendChild(t('\u00a0'));}
function aft(el,txt){var strs=txt.split(/[\n\r]/);for(var i=0;i<strs.length;i++){at(el,strs[i]);if(i<(strs.length-1)){abr(el);}}}
function at(el,txt){el.appendChild(t(txt));}
function c(nm){return document.createElement(nm);}
function cc(el){while(el.childNodes.length>0){d(el.childNodes[0])}}
function cls(el,c){el.className=c;}
function d(el){p(el).removeChild(el);}
function ds(el){el.style.display='block';}
function f(el){if(v(el)){h(el)}else{s(el)}}
function g(id){return document.getElementById(id);}
function h(el){el.style.visibility='hidden';el.style.display='none';}
function i(x){return parseInt(x);}
_i=i;function m(elem,x,y){elem.style.left=x+'px';elem.style.top=y+'px';}
function mn(x,y){return(x<y)?x:y;}
function mx(x,y){return(x>y)?x:y;}
function p(x){return x.parentNode;}
function re(x,y){p(x).insertBefore(y,x);d(x);}
function s(el){el.style.visibility='visible';el.style.display='block';}
function si(el){el.style.visibility='visible';el.style.display='inline';}
function sl(el){el.focus();el.select();}
function sz(elem,w,h){elem.style.width=w+'px';elem.style.height=h+'px';}
function t(txt){return document.createTextNode(uu(txt));}
function trh(tr){tr.style.display='none';}
function trs(tr){tr.style.display=document.all?'block':'table-row';}
function uu(str){var i;str=str+'';while((i=str.search(/\%u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]/))!=-1){var b=str.substring(0,i);var a=str.substr(i+6);var code=str.substring(i+2,i+6);str=b+eval('\'\\u'+code+'\'')+a;}
return str;}
function v(el){return el.style.visibility=='visible';}
function vh(el){el.style.visibility='hidden';}
function vs(el){el.style.visibility='visible';}
function push(arr,el){arr[arr.length]=el;}
function pop(arr){var r=arr[arr.length-1];arr.length--;return r;}
function shft(arr){var r=arr[0];var i;for(i=0;i<arr.length-1;i++){arr[i]=arr[i+1];}
arr.length--;return r;}
function arrRemoveAt(arr,idx){var i;for(i=idx+1;i<arr.length;i++){arr[i-1]=arr[i];}
arr.length=arr.length-1;}
function arrRemoveEqual(arr,obj){var i;for(i=0;i<arr.length;i++){if(arr[i]===obj){arrRemoveAt(arr,i);return;}}}
function table(cp,cs){var tb=c('TABLE');tb.cellPadding=cp;tb.cellSpacing=cs;tb.border=0;return tb;}
function tbod(tb){var tbd=c('TBODY');ac(tb,tbd);return tbd;}
function getPos(elem){var offTop=0;var offLeft=0;var cur=elem;do{offTop+=cur.offsetTop;offLeft+=cur.offsetLeft;cur=cur.offsetParent;}while(cur!=document.body&&cur!=null);return[offLeft,offTop];}
function getStyle(x,styleProp)
{if(x.currentStyle)
var y=x.currentStyle[styleProp];else if(window.getComputedStyle)
var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);return y;}
function isNull(a){return typeof a=='object'&&!a;}
function setCookie(cookieName,cookieValue,nDays,path){var today=new Date();var expire=new Date();if(nDays==null||nDays==0)nDays=1;expire.setTime(today.getTime()+3600000*24*nDays);var cookie=cookieName+"="+escape(cookieValue)
+";expires="+expire.toGMTString()
+((path==null)?'':(";path="+path));document.cookie=cookie;}
function urlencode(str){var nstr=escape(str);if(escape('+')=='+'){nstr=nstr.replace(/\+/g,'%2B');}
if(escape(' ')!='+'){nstr=nstr.replace(new RegExp(escape(' '),'g'),'+');}
return nstr;}
function handleScriptError(message,url,lineNumber){try{if(url.indexOf('sandbox.')!=-1){alert('[Line #'+lineNumber+'] '+message);}
return true;}catch(e){}}
function sendLogMessage(logURI,message,level){var detailedMessage='message=';detailedMessage+=escape(message);detailedMessage+='&source='+escape(location.href);detailedMessage+='&agent='+escape(navigator.userAgent);detailedMessage+='&browser='+escape(navigator.appName);detailedMessage+='&os='+escape(navigator.platform);detailedMessage+='&level='+escape(level);}
window.onerror=handleScriptError;function getXmlHttpPrefix()
{if(getXmlHttpPrefix.prefix)
{return getXmlHttpPrefix.prefix;}
var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var activeXObj;for(var i=0;i<prefixes.length;i++)
{try
{activeXObj=new ActiveXObject(prefixes[i]+".XmlHttp");return getXmlHttpPrefix.prefix=prefixes[i];}
catch(ex)
{}}
throw new Error("Could not find an installed XML parser");}
function XmlHttp()
{}
XmlHttp.create=function()
{try
{if(window.XMLHttpRequest)
{var req=new XMLHttpRequest();if(req.readyState==null)
{req.readyState=1;req.addEventListener("load",function()
{req.readyState=4;if(typeof req.onreadystatechange=="function")
{req.onreadystatechange();}},false);}
return req;}
if(window.ActiveXObject)
{return new ActiveXObject(getXmlHttpPrefix()+".XmlHttp");}}
catch(ex)
{}
throw new Error("Your browser does not support XmlHttp objects");}
function noCacheURI(uri){var timestamp=new Date();return uri+(uri.indexOf("?")>0?"&":"?")+"ts="+timestamp.getTime();}
var _IG_Prefs;var igPrefs;if(_IG_Prefs){igPrefs=new _IG_Prefs();}
function isSafari(){return navigator.vendor&&navigator.vendor.indexOf('Apple')!=-1;}
function prepareURI(uri){var login=window.loginValue||(igPrefs&&igPrefs.getString('login'));if(isSafari()&&login&&uri&&uri.indexOf('login=')==-1){uri=uri+(uri.indexOf('?')>0?'&':'?')+'login='+encodeURIComponent(login);}
return uri;}
function mjXR(uri,handler,method,data){this.uri=uri;this.handler=handler;this.method=(method===null)?"GET":method;this.data=data;}
new mjXR();mjXR.prototype.commonSend=function(aSync){var xmlHttp=XmlHttp.create();if(this.method=="UGET"){xmlHttp.open("GET",noCacheURI(prepareURI(this.uri)),aSync);}else{xmlHttp.open(this.method,prepareURI(this.uri),aSync);}
if(this.method=="POST"){xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}
this.xmlHttp=xmlHttp;}
mjXR.prototype.send=function(){this.commonSend(true);var localThis=this;this.xmlHttp.onreadystatechange=function(){localThis.onStateChange()};this.xmlHttp.send(this.data);}
mjXR.prototype.sendSync=function(){this.commonSend(false);this.xmlHttp.send(this.data);this.handler(this.xmlHttp,this);}
mjXR.prototype.resend=mjXR.prototype.send;mjXR.prototype.resendSync=mjXR.prototype.sendSync;mjXR.prototype.onStateChange=function(){if(this.xmlHttp.readyState==4){try{this.handler(this.xmlHttp,this);}catch(e){}
try{urchinTracker(this.uri);}catch(e){}}}