function g(e){return document.getElementById(e);}
function ce(e){return document.createElement(e);}
function ac(c){document.body.appendChild(c);}

var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";with(this){'+f+'}')};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');LyrFn('w','if(p)(isNS4?sty.clip:sty).width=p+px;else return(isNS4?ref.document.width:ref.offsetWidth)');LyrFn('h','if(p)(isNS4?sty.clip:sty).height=p+px;else return(isNS4?ref.document.height:ref.offsetHeight)');LyrFn('vis','sty.visibility=p');LyrFn('write','if(isNS4)with(ref.document){write(p);close()}else ref.innerHTML=p');LyrFn('alpha','var f=ref.filters,d=(p==null),o=d?"inherit":p/100;if(f){if(!d&&sty.filter.indexOf("alpha")==-1)sty.filter+=" alpha(opacity="+p+")";else if(f.length&&f.alpha)with(f.alpha){if(d)enabled=false;else{opacity=p;enabled=true}}}else if(isDOM)sty.opacity=sty.MozOpacity=o');if(!self.page)var page={win:self,minW:0,minH:0,MS:isIE&&!isOp};page.db=function(p){with(this.win.document)return(isDOM?documentElement[p]:0)||body[p]||0};page.winW=function(){with(this)return Math.max(minW,MS?db('clientWidth'):win.innerWidth)};page.winH=function(){with(this)return Math.max(minH,MS?db('clientHeight'):win.innerHeight)};page.scrollX=function(){with(this)return MS?db('scrollLeft'):win.pageXOffset};page.scrollY=function(){with(this)return MS?db('scrollTop'):win.pageYOffset};function TipObj(myName){this.myName=myName;this.template='';this.tips=new Array();this.parentObj=null;this.div=null;this.actTip='';this.showTip=false;this.xPos=this.yPos=this.sX=this.sY=this.mX=this.mY=0;this.trackTimer=this.fadeTimer=0;this.alpha=0;this.doFades=true;this.minAlpha=0;this.maxAlpha=100;this.fadeInSpeed=20;this.fadeOutSpeed=20;this.tipStick=1;this.showDelay=50;this.hideDelay=250;this.IESelectBoxFix=0;TipObj.list[myName]=this};TipObj.list=[];var ToPt=TipObj.prototype;ToPt.track=function(evt){with(this){if(!isIE||document.body){evt=evt||window.event;sX=page.scrollX();sY=page.scrollY();mX=evt.pageX||sX+evt.clientX||0;mY=evt.pageY||sY+evt.clientY||0;if(tipStick==1)position()}}};ToPt.position=function(forcePos){with(this){if(!actTip)return;var wW=page.winW(),wH=page.winH();if(!isIE||isOp){wW-=16;wH-=16}var t=tips[actTip],tipX=eval(t[0]),tipY=eval(t[1]),tipW=div.w(),tipH=div.h(),adjY=1;if(typeof(t[0])=='number')tipX+=mX;if(typeof(t[1])=='number')tipY+=mY;if(tipX+tipW+5>sX+wW)tipX=sX+wW-tipW-5;if(tipY+tipH+5>sY+wH)tipY=sY+wH-tipH-5;if(tipX<sX+5)tipX=sX+5;if(tipY<sY+5)tipY=sY+5;if((!showTip&&(doFades?!alpha:true))||forcePos){xPos=tipX;yPos=tipY}xPos+=(tipX-xPos)*tipStick;yPos+=(tipY-yPos)*tipStick;div.x(xPos);div.y(yPos);return}};ToPt.replaceContent=function(tipN){with(this){actTip=tipN;if(tipStick==parseInt(tipStick)){var rE='';if(isNS4){div.ref.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);rE=';return this.routeEvent(evt)'}div.ref.onmouseover=new Function('evt',myName+'.show("'+tipN+'"'+(parentObj?','+parentObj.myName:'')+')'+rE);div.ref.onmouseout=new Function('evt',myName+'.hide()'+rE)}var str=template;for(var i=0;i<tips[tipN].length;i++)str=str.replace(new RegExp('%'+i+'%','g'),tips[tipN][i]);if(window.createPopup&&IESelectBoxFix){var filt='filter:progid:DXImageTransform.Microsoft.Alpha(opacity=';str+='<iframe src="about:blank" style="position:absolute;left:0px;top:0px;height:expression('+myName+'.div.h());z-index:1;border:none;'+filt+'0)"></iframe><div style="position:absolute;left:0px;top:0px;z-index:2;'+filt+'100)">'+str+'</div>'}if(isDOM&&!isOp)div.sty.width='auto';div.write(str+(isIE&&!isOp&&!window.external?'<small><br/></small>':''));position(true)}};ToPt.show=function(tipN,par){with(this){if(!isDyn)return;clearTimeout(fadeTimer);parentObj=par;if(par)par.show(par.actTip,par.parentObj);if(!div)div=getLyr(myName+'Layer');if(!div)return;clearInterval(trackTimer);if(tipStick!=parseInt(tipStick))trackTimer=setInterval(myName+'.position()',50);var showStr='with('+myName+'){showTip=true;'+(actTip!=tipN?'replaceContent("'+tipN+'");':'')+'fade()}';if(showDelay&&!actTip)fadeTimer=setTimeout(showStr,showDelay);else eval(showStr)}};ToPt.newTip=function(tName){with(this){if(!tips[tName])tips[tName]=[];for(var i=1;i<arguments.length;i++)tips[tName][i-1]=arguments[i];show(tName);return}};ToPt.hide=function(){with(this){clearTimeout(fadeTimer);if(!isDyn||!actTip||!div)return;if(isNS4&&tipStick==0&&xPos<=mX&&mX<=xPos+div.w()&&yPos<=mY&&mY<=yPos+div.h())return;with(tips[actTip])if(parentObj)parentObj.hide();fadeTimer=setTimeout('with('+myName+'){showTip=false;fade()}',hideDelay);return}};ToPt.fade=function(){with(this){clearTimeout(fadeTimer);if(showTip){div.vis('visible');if(doFades){alpha+=fadeInSpeed;if(alpha>maxAlpha)alpha=maxAlpha;div.alpha(alpha);if(alpha<maxAlpha)fadeTimer=setTimeout(myName+'.fade()',75)}}else{if(doFades&&alpha>minAlpha){alpha-=fadeOutSpeed;if(alpha<minAlpha)alpha=minAlpha;div.alpha(alpha);fadeTimer=setTimeout(myName+'.fade()',75);return}div.vis('hidden');actTip='';clearInterval(trackTimer)}}};var tipOR=window.onresize,nsWinW=window.innerWidth,nsWinH=window.innerHeight;document.tipMM=document.onmousemove;if(isNS4)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=function(evt){for(var t in TipObj.list)TipObj.list[t].track(evt);return document.tipMM?document.tipMM(evt):(isNS4?document.routeEvent(evt):true)};window.onresize=function(){if(tipOR)tipOR();if(isNS4&&(nsWinW!=innerWidth||nsWinH!=innerHeight))location.reload()};

var requests=new Array();var requestcount=0;function createXMLHttpRequest(){var req=false;if(window.XMLHttpRequest!=null){try{req=new XMLHttpRequest()}catch(e){req=false}}else if(window.ActiveXObject!=null){try{req=new ActiveXObject(" Msxml2.XMLHTTP")}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){req=false}}}return req}function RequestObject(url,id,Handler,post){var request=createXMLHttpRequest();var handler=Handler;var murl=url;function onStateChange(){if( request.readyState==4){try{if(request.status==200){handler(request.responseText)}else{SetStatus("Error with ajax call.("+request.status+")")}}catch(e){}}}this.request=request;this.murl=url;request.onreadystatechange=onStateChange;request.open(post==null?"GET":"POST",url,true);request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');request.send(post)}function addRequest(url,handler,post){if( url.match(/\?/gi)){url=url+'&'}else{url=url+'?'}url=url+"num="+Math.random()*10;var reqID=++requestcount;var reqObj=new RequestObject(url,reqID,handler,post);requests[reqID]=reqObj;return reqID}

/*function g(e){return document.getElementById(e);}
function ce(e){return document.createElement(e);}
function ac(c){document.body.appendChild(c);}

var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";with(this){'+f+'}')};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');LyrFn('w','if(p)(isNS4?sty.clip:sty).width=p+px;else return(isNS4?ref.document.width:ref.offsetWidth)');LyrFn('h','if(p)(isNS4?sty.clip:sty).height=p+px;else return(isNS4?ref.document.height:ref.offsetHeight)');LyrFn('vis','sty.visibility=p');LyrFn('write','if(isNS4)with(ref.document){write(p);close()}else ref.innerHTML=p');LyrFn('alpha','var f=ref.filters,d=(p==null),o=d?"inherit":p/100;if(f){if(!d&&sty.filter.indexOf("alpha")==-1)sty.filter+=" alpha(opacity="+p+")";else if(f.length&&f.alpha)with(f.alpha){if(d)enabled=false;else{opacity=p;enabled=true}}}else if(isDOM)sty.opacity=sty.MozOpacity=o');if(!self.page)var page={win:self,minW:0,minH:0,MS:isIE&&!isOp};page.db=function(p){with(this.win.document)return(isDOM?documentElement[p]:0)||body[p]||0};page.winW=function(){with(this)return Math.max(minW,MS?db('clientWidth'):win.innerWidth)};page.winH=function(){with(this)return Math.max(minH,MS?db('clientHeight'):win.innerHeight)};page.scrollX=function(){with(this)return MS?db('scrollLeft'):win.pageXOffset};page.scrollY=function(){with(this)return MS?db('scrollTop'):win.pageYOffset};function TipObj(myName){this.myName=myName;this.template='';this.tips=new Array();this.parentObj=null;this.div=null;this.actTip='';this.showTip=false;this.xPos=this.yPos=this.sX=this.sY=this.mX=this.mY=0;this.trackTimer=this.fadeTimer=0;this.alpha=0;this.doFades=true;this.minAlpha=0;this.maxAlpha=100;this.fadeInSpeed=20;this.fadeOutSpeed=20;this.tipStick=1;this.showDelay=50;this.hideDelay=250;this.IESelectBoxFix=0;TipObj.list[myName]=this};TipObj.list=[];var ToPt=TipObj.prototype;ToPt.track=function(evt){with(this){if(!isIE||document.body){evt=evt||window.event;sX=page.scrollX();sY=page.scrollY();mX=evt.pageX||sX+evt.clientX||0;mY=evt.pageY||sY+evt.clientY||0;if(tipStick==1)position()}}};ToPt.position=function(forcePos){with(this){if(!actTip)return;var wW=page.winW(),wH=page.winH();if(!isIE||isOp){wW-=16;wH-=16}var t=tips[actTip],tipX=eval(t[0]),tipY=eval(t[1]),tipW=div.w(),tipH=div.h(),adjY=1;if(typeof(t[0])=='number')tipX+=mX;if(typeof(t[1])=='number')tipY+=mY;if(tipX+tipW+5>sX+wW)tipX=sX+wW-tipW-5;if(tipY+tipH+5>sY+wH)tipY=sY+wH-tipH-5;if(tipX<sX+5)tipX=sX+5;if(tipY<sY+5)tipY=sY+5;if((!showTip&&(doFades?!alpha:true))||forcePos){xPos=tipX;yPos=tipY}xPos+=(tipX-xPos)*tipStick;yPos+=(tipY-yPos)*tipStick;div.x(xPos);div.y(yPos);return}};ToPt.replaceContent=function(tipN){with(this){actTip=tipN;if(tipStick==parseInt(tipStick)){var rE='';if(isNS4){div.ref.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);rE=';return this.routeEvent(evt)'}div.ref.onmouseover=new Function('evt',myName+'.show("'+tipN+'"'+(parentObj?','+parentObj.myName:'')+')'+rE);div.ref.onmouseout=new Function('evt',myName+'.hide()'+rE)}var str=template;for(var i=0;i<tips[tipN].length;i++)str=str.replace(new RegExp('%'+i+'%','g'),tips[tipN][i]);if(window.createPopup&&IESelectBoxFix){var filt='filter:progid:DXImageTransform.Microsoft.Alpha(opacity=';str+='<iframe src="about:blank" style="position:absolute;left:0px;top:0px;height:expression('+myName+'.div.h());z-index:1;border:none;'+filt+'0)"></iframe><div style="position:absolute;left:0px;top:0px;z-index:2;'+filt+'100)">'+str+'</div>'}if(isDOM&&!isOp)div.sty.width='auto';div.write(str+(isIE&&!isOp&&!window.external?'<small><br/></small>':''));position(true)}};ToPt.show=function(tipN,par){with(this){if(!isDyn)return;clearTimeout(fadeTimer);parentObj=par;if(par)par.show(par.actTip,par.parentObj);if(!div)div=getLyr(myName+'Layer');if(!div)return;clearInterval(trackTimer);if(tipStick!=parseInt(tipStick))trackTimer=setInterval(myName+'.position()',50);var showStr='with('+myName+'){showTip=true;'+(actTip!=tipN?'replaceContent("'+tipN+'");':'')+'fade()}';if(showDelay&&!actTip)fadeTimer=setTimeout(showStr,showDelay);else eval(showStr)}};ToPt.newTip=function(tName){with(this){if(!tips[tName])tips[tName]=[];for(var i=1;i<arguments.length;i++)tips[tName][i-1]=arguments[i];show(tName);return}};ToPt.hide=function(){with(this){clearTimeout(fadeTimer);if(!isDyn||!actTip||!div)return;if(isNS4&&tipStick==0&&xPos<=mX&&mX<=xPos+div.w()&&yPos<=mY&&mY<=yPos+div.h())return;with(tips[actTip])if(parentObj)parentObj.hide();fadeTimer=setTimeout('with('+myName+'){showTip=false;fade()}',hideDelay);return}};ToPt.fade=function(){with(this){clearTimeout(fadeTimer);if(showTip){div.vis('visible');if(doFades){alpha+=fadeInSpeed;if(alpha>maxAlpha)alpha=maxAlpha;div.alpha(alpha);if(alpha<maxAlpha)fadeTimer=setTimeout(myName+'.fade()',75)}}else{if(doFades&&alpha>minAlpha){alpha-=fadeOutSpeed;if(alpha<minAlpha)alpha=minAlpha;div.alpha(alpha);fadeTimer=setTimeout(myName+'.fade()',75);return}div.vis('hidden');actTip='';clearInterval(trackTimer)}}};var tipOR=window.onresize,nsWinW=window.innerWidth,nsWinH=window.innerHeight;document.tipMM=document.onmousemove;if(isNS4)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=function(evt){for(var t in TipObj.list)TipObj.list[t].track(evt);return document.tipMM?document.tipMM(evt):(isNS4?document.routeEvent(evt):true)};window.onresize=function(){if(tipOR)tipOR();if(isNS4&&(nsWinW!=innerWidth||nsWinH!=innerHeight))location.reload()};

var requests=new Array();var requestcount=0;function createXMLHttpRequest(){var req=false;if(window.XMLHttpRequest!=null){try{req=new XMLHttpRequest()}catch(e){req=false}}else if(window.ActiveXObject!=null){try{req=new ActiveXObject(" Msxml2.XMLHTTP")}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){req=false}}}return req}function RequestObject(url,id,Handler,post){var request=createXMLHttpRequest();var handler=Handler;var murl=url;function onStateChange(){if( request.readyState==4){try{if(request.status==200){handler(request.responseText)}else{SetStatus("Error with ajax call.("+request.status+")")}}catch(e){}}}this.request=request;this.murl=url;request.onreadystatechange=onStateChange;request.open(post==null?"GET":"POST",url,true);request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');request.send(post)}function addRequest(url,handler,post){if( url.match(/\?/gi)){url=url+'&'}else{url=url+'?'}url=url+"num="+Math.random()*10;var reqID=++requestcount;var reqObj=new RequestObject(url,reqID,handler,post);requests[reqID]=reqObj;return reqID} 

var requests=new Array();var requestcount=0;function createXMLHttpRequest(){var req=false;
if(window.XMLHttpRequest!=null){
  try{req=new XMLHttpRequest()}
  catch(e){req=false}}
  else if(window.ActiveXObject!=null){
    try{req=new ActiveXObject("Msxml2.XMLHTTP")}
    catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP")}
    catch(e){req=false
    }
    }
    }
    return req}function RequestObject(url,id,Handler,post){var request=createXMLHttpRequest();
    var handler=Handler;var murl=url;
    function onStateChange()
    {if(request.readyState==4){
      try{if(request.status==200){handler(request.responseText)
      }else{SetStatus("Error with ajax call.("+request.status+")")}}
      catch(e){}}}this.request=request;
      this.murl=url;
      request.onreadystatechange=onStateChange;
      //return false;
      request.open("POST",url,true);

      //request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
      //request.setRequestHeader('Content-Length', 0);
      request.send('')}
      function addRequest(url,handler,post)
      {if(url.match(/\?/gi)){url=url+'&'}
      else{url=url+'?'}url=url+"num="+Math.random()*10;
      var reqID=++requestcount;
      var reqObj=new RequestObject(url,reqID,handler,post);
      requests[reqID]=reqObj;
      return reqID}


var requests=new Array();var requestcount=0;function createXMLHttpRequest(){var req=false;if(window.XMLHttpRequest!=null){try{req=new XMLHttpRequest()}catch(e){req=false}}else if(window.ActiveXObject!=null){try{req=new ActiveXObject(" Msxml2.XMLHTTP")}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){req=false}}}return req}function RequestObject(url,id,Handler,post){var request=createXMLHttpRequest();var handler=Handler;var murl=url;function onStateChange(){if( request.readyState==4){try{if(request.status==200){handler(request.responseText)}else{SetStatus("Error with ajax call.("+request.status+")")}}catch(e){}}}this.request=request;this.murl=url;request.onreadystatechange=onStateChange;request.open(post==null?"GET":"POST",url,true);request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');request.send(post)}function addRequest(url,handler,post){if( url.match(/\?/gi)){url=url+'&'}else{url=url+'?'}url=url+"num="+Math.random()*10;var reqID=++requestcount;var reqObj=new RequestObject(url,reqID,handler,post);requests[reqID]=reqObj;return reqID}
*/

var loadToolBox;
var loadJailToolBox;
var loadNotepad;
var loadTimers;
var loadtime;
var loadComms;
var showUserPopup;
var docProfile;
var loadJournal;

var minihelp = null;

var qLinkToClick;
var qClientX;
var qClientY;

var bc = new Array(
	'green',
	'red',
	'blue',
	'fuchsia',
	'purple',
	'orange',
	'grey',
	'lime',
	'pink',
	'brown'
);

function doLoadMainmessages()
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/communications/comms.asp">Inbox</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/communications/compose.asp">Compose</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/communications/smscompose.asp">SMS</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/communications/comms.asp?display=sent">Sent Items</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/communications/comms.asp?display=saved">Saved Items</a></td></tr>';
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadMainjournal()
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/journal/journal.asp">Journal</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/journal/journal.asp?display=requests">Requests/Offers</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/journal/journal.asp?display=saved">Saved Journals</a></td></tr>';
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadincome(rsExpCrimeLevel, rsLocation, rsHomecity, rsOccupation, rsPolice, rsRank)
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/income/earn.asp">Earns</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/income/agcrime.asp">Aggravated Crimes</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/income/communityservice.asp">Community Service</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/income/bank.asp">Bank</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/income/charskills.asp">Character Skills</a></td></tr>';
        if ( rsPolice == "yes" ) {
        html += '<tr><td class="toolitem"><a href="/income/duties.asp">Police Duties</a></td></tr>';
	}
	if (( rsOccupation == "Mortician" || rsOccupation == "Funeral Director" ) && rsHomecity == rsLocation )  {
           html += '<tr><td class="toolitem"><a href="/income/funeral.asp">Autopsy Work</a></td></tr>';
	}
	if (( rsOccupation == "Fire Fighter" || rsOccupation == "Volunteer Fire Fighter" || rsOccupation == "Fire Chief" ))  {
           html += '<tr><td class="toolitem"><a href="/income/fireduties.asp">Fire Fighter Duties</a></td></tr>';
	}
	if ( rsOccupation == "Loan Officer" && rsLocation == rsHomecity ) {
           html += '<tr><td class="toolitem"><a href="/income/loans.asp">Bank Work</a></td></tr>';
	}
	if ( rsOccupation == "Bank Manager" && rsLocation == rsHomecity ) {
           html += '<tr><td class="toolitem"><a href="/income/bankwork.asp">Bank Work</a></td></tr>';
	}
        if ( rsExpCrimeLevel > 2 ) {
           html += '<tr><td class="toolitem"><a href="/income/BlackMarket.asp">Black Market</a></td></tr>';
	}
        if ( rsHomecity != rsLocation && rsExpCrimeLevel > 1 ) {
           html += '<tr><td class="toolitem"><a href="/income/laundering.asp">Money Laundering</a></td></tr>';
	}
        if  (( rsOccupation == "Bank Teller" || rsOccupation == "Loan Officer" || rsOccupation == "Bank Manager" ) && ( rsLocation == rsHomecity )) {
           html += '<tr><td class="toolitem"><a href="/income/banklaunder.asp">Convert Dirty Money</a></td></tr>';
        }
        if  (( rsOccupation == "Mechanic" || rsOccupation == "Technician" || rsOccupation == "Engineer" || rsOccupation == "Chief Engineer" ) && ( rsLocation == rsHomecity )) {
           html += '<tr><td class="toolitem"><a href="/income/construction.asp">Maintenance and Construction</a></td></tr>';
        }
        if (rsRank == "Dealer" || rsRank == "Giovane D`Honore" || rsRank == "Enforcer" || rsRank == "Piciotto" || rsRank == "Sgarrista" || rsRank == "Capodecima" || rsRank == "Caporegime" || rsRank == "Boss" || rsRank == "Don" || rsRank == "Godfather" || rsRank == "Capo di tutti capi") {
           html += '<tr><td class="toolitem"><a href="/income/drugs.asp">Drugs</a></td></tr>';
	}

	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadquickincome(lastearn, randomcount)
{
	var html = "";
	html += '<tr><td class="toolitem"><form name="myform" action="/income/earning.asp?quick=yes&rndcnt='+ randomcount +'" method="POST" style="padding: 0px; margin: 0px; "><input type="text" name="work" readonly="readonly" value="'+ lastearn +'" style="background-color: #8DA0A4;" onclick="document.myform.submit();">';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadtravel(rsVehicle)
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/travel/airport.asp">Airport</a></td></tr>';
	if ( rsVehicle != "" && rsVehicle != "None") {
           html += '<tr><td class="toolitem"><a href="/travel/travel.asp">Private ' + rsVehicle + '</a></td></tr>';
        }
        html += '<tr><td class="toolitem"><a href="/travel/vacation.asp">Book a Vacation</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/income/locate.asp">Locate a Person</a></td></tr>';
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadquicktravel(rsLocation, rsis_staff)
{
	var html = "";
	html += '<tr><td class="toolitem"><form name="myform" action="/travel/depart.asp" method="POST" style="padding: 0px; margin: 0px; "><select name="vehicletravel" style="background-color: #8DA0A4; color: white; width: 200px; border: 1px solid black;" onchange="document.myform.submit();" style="width: 95%;"><option value="">Travel To...</option>';


	if ( rsLocation != "Auckland" ) {
		html += '<option value="Auckland">Auckland</option>';
	}
	if ( rsLocation != "Beirut" ) {
		html += '<option value="Beirut">Beirut</option>';
	}
	if ( rsLocation != "Chicago" ) {
		html += '<option value="Chicago">Chicago</option>';
	}
	if ( rsLocation != "Hong Kong" ) {
		html += '<option value="Hong Kong">Hong Kong</option>';
	}
	if ( rsLocation != "Las Vegas" ) {
		html += '<option value="Las Vegas">Las Vegas</option>';
	}
	if ( rsLocation != "London" ) {
		html += '<option value="London">London</option>';
	}
	if ( rsLocation != "Manchester" ) {
		html += '<option value="Manchester">Manchester</option>';
	}
	if ( rsLocation != "New York" ) {
		html += '<option value="New York">New York</option>';
	}
	if ( rsLocation != "Toronto" ) {
		html += '<option value="Toronto">Toronto</option>';
	}
	if ( rsis_staff == "True" && rsLocation != "Hell" ) {
   		html += '<option value="Hell">Hell</option></select></form></td></tr>';
	} else {
                html += '</select></form></td></tr>';
        }
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
        docTips.show('adminBox');
}

function doLoadBusinesses()
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/business/business.asp">Businesses for sale</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/business/manage.asp?display=manage">Manage Business</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/business/business.asp?display=apartments">Apartments</a></td></tr>';
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadPolitics(rsOccupation, rsRank, rsLocation, rsHomecity)
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/politics/politics.asp">Politics Menu</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/politics/policies.asp">Review Campaign Policies</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/politics/vote.asp">Vote in an election</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/politics/polls.asp">View election polls</a></td></tr>';
        if (( rsLocation == rsHomecity ) && ( rsRank == "Mayor" || rsRank == "Commissioner" || rsOccupation == "Chief Engineer" || rsOccupation == "Funeral Director" || rsOccupation == "Hospital Director" || rsOccupation == "Fire Chief" || rsOccupation == "Bank Manager" || rsOccupation == "Supreme Court Judge" || rsRank == "Commissioner-General" || rsRank == "Brigadier"  || rsRank == "Major General"  || rsRank == "Lieutenant General"  || rsRank == "Field Marshal" )) {
             html += '<tr><td class="toolitem"><a href="/politics/campaign.asp">Run for mayor</a></td></tr>';
        }
        html += '<tr><td class="toolitem"><a href="/politics/opinionpoll.asp">Vote in an opinion poll</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/politics/whackfestresults.asp">View Whackfest results</a></td></tr>';
        if ( rsRank == "Mayor" && rsLocation == rsHomecity ) {
             html += '<tr><td class="toolitem"><a href="/politics/duties.asp">Mayoral Duties</a></td></tr>';
        }
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}


function doLoadArmy(rsRank, rsLocation, rsHomecity, mgmt)
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/forum/forum.asp?t=13">Army Bulletin</a></td></tr>';
        if ( rsLocation == rsHomecity ) {
           html += '<tr><td class="toolitem"><a href="/army/training.asp?display=training">Military Academy</a></td></tr>';
        }
        if ( mgmt == "yes" ) {
             html += '<tr><td class="toolitem"><a href="/army/management.asp">Army Management</a></td></tr>';
        }
        if ( rsRank == "Brigadier" || rsRank == "Major General"  || rsRank == "Lieutenant General"  || rsRank == "Field Marshal" ) {
             html += '<tr><td class="toolitem"><a href="/army/commanderoptions.asp">Army Command</a></td></tr>';
        }
	html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadConflict(rsCrewleader)
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/conflict/conflict.asp">Contracts</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/conflict/bodyguard.asp">Bodyguards</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/conflict/gbh.asp">Grievous Bodily Harm</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/conflict/conflict.asp?display=whack">Whack</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/conflict/conflict.asp?display=dogwhack">Whack a dog</a></td></tr>';
        if ( rsCrewleader == "Family" || rsCrewleader == "Crew" || rsCrewleader == "Gang"  ) {
           html += '<tr><td class="toolitem"><a href="/conflict/mhs.asp">Mafia Hit</a></td></tr>';
	}
        html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadPolice()
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a href="/police/intray.asp">Intray</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/forum/forum.asp?t=5">Interpol</a></td></tr>';
	html += '<tr><td class="toolitem"><a href="/police/police.asp?display=station">Police Station</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/police/police.asp?display=training">Police Training</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/police/policedatabase.asp">Police Database</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/localcity/weaponregister.asp">Weapon Register</a></td></tr>';
        html += '<tr><td class="toolitem"><a href="/police/911.asp">911 and 11-99</a></td></tr>';
        html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadJudge(rsOccupation)
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	if ( rsOccupation == "Judge" || rsOccupation == "Supreme Court Judge" ) {
          html += '<tr><td class="toolitem"><a href="/court/sentence.asp">Sentence Cases</a></td></tr>';
          html += '<tr><td class="toolitem"><a href="/court/internal.asp">Internal Affairs Reports</a></td></tr>';
          html += '<tr><td class="toolitem"><a href="/court/warrants.asp">Search Warrants</a></td></tr>';
          html += '<tr><td class="toolitem"><a href="/court/cases.asp">Cases under investigation</a></td></tr>';
          html += '<tr><td class="toolitem"><a href="/court/managelaw.asp">Manage Law</a></td></tr>';
          html += '<tr><td class="toolitem"><a href="/localcity/paroleboard.asp">View parole hearings</a></td></tr>';
        } else {
          html += '<tr><td class="toolitem"><a href="/court/lawyer.asp?display=defend">Defend Cases</a></td></tr>';
          html += '<tr><td class="toolitem"><a href="/court/lawyer.asp?display=new">Available Cases</a></td></tr>';
        }
        html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadCrew(rsCrewleader, rsRank)
{
	var html = "";
        html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
        if (( rsRank == "Capodecima"  || rsRank == "Caporegime" || rsRank == "Boss"  || rsRank == "Don") && rsCrewleader != "Crew" && rsCrewleader != "Family" ) {
           html += '<tr><td class="toolitem"><a href="/crew/nocrew.asp">Start a crew</a></td></tr>';
        } else if ( rsRank == "Godfather" || rsRank == "Capo di tutti capi") {
           html += '<tr><td class="toolitem"><a href="/crew/gf.asp?display=forums">Family Forums</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gf.asp?display=finance">Finance</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gf.asp?display=bonus">Demand Bonus</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gf.asp?display=underboss">Assign Underboss</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gf.asp?display=exile">Exile Family</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gf.asp?display=features">Family Features</a></td></tr>';
        } else if ( rsCrewleader == "Family" ) {
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp">Crew forum</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp?display=rules">Rules</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp?display=tasks">Tasks</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp">Management</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp?display=invites">Invites</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp?display=finance">Finance</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp?display=massmsg">Mass message</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp?display=features">Family Features</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp?display=demands">Business Demands</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp?display=crewlisting">Crew Listing</a></td></tr>';
        } else if ( rsCrewleader == "Gang") {
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp">Crew forum</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp?display=rules">Rules</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp?display=tasks">Tasks</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp">Management</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gang.asp?display=invites">Invites</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/gang.asp?display=finance">Finance</a></td></tr>';
        } else {
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp">Crew forum</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp?display=rules">Rules</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/crew.asp?display=tasks">Tasks</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/management.asp">Management</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/capo.asp?display=features">Features</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/capo.asp?display=invites">Invites</a></td></tr>';
           html += '<tr><td class="toolitem"><a href="/crew/capo.asp?display=finance">Finance</a></td></tr>';
        }
        html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadNewspaper()
{
	var html = "";
	html += '<table id="admintoolstable" cellpadding="0" cellspacing="0" onMouseOut="docTips.hide()">';
	html += '<tr><td class="toolitem"><a target="AuxWindow" href="http://news.mafiamatrix.com/">The Daily Matrix</a></td></tr>';
        //html += '<tr><td class="toolitem"><a target="AuxWindow" href="http://www.mmtimes.org">MM Times</a></td></tr>';
        html += '</table>';

	docTips.newTip('adminBox', -4, -4, 100, html);
	docTips.show('adminBox');
}

function doLoadnotepad()
{
	if ( loadNotepad ) {
		loadNotepad();
	} else {
		var div = ce('script');
		div.src = '/js/notepad.js';
		ac(div);
	}
}

function doLoadjournal()
{
	if ( loadJournal ) {
		loadJournal();
	} else {
		var div = ce('script');
		div.src = '/js/journal.js';
		ac(div);
	}
}


function doLoadcomms()
{
	if ( loadComms ) {
		loadComms();
	} else {
		var div = ce('script');
		div.src = '/js/comms.js?2';
		ac(div);
	}
}

function doLoadquicktools(e)
{
	if ( loadToolBox != null ) {
		loadToolBox();
	} else {
		qClientX = e.clientX;
		qClientY = e.clientY;
		var div = ce('script');
		div.src = '/skin/js/quick.js';
		ac(div);
	}
	return false;
}

function doLoadquickjailtools(e)
{
	if ( loadJailToolBox != null ) {
		loadJailToolBox();
	} else {
		qClientX = e.clientX;
		qClientY = e.clientY;
		var div = ce('script');
		div.src = '/skin/js/quick.js';
		ac(div);
	}
}

function doShowUserPopup(user, cstatus, e)
{
 if ( showUserPopup != null ) {
		showUserPopup(user, cstatus);
	} else {
		qLinkToClick = 'profileLink' + user
		qClientX = e.clientX;
		qClientY = e.clientY;
		var div = ce('script');
		div.src = '/skin/js/profile.js?1';
		ac(div);
	}
}

function loadwhosonline(list, local, pcount) {
	buddies = buddies.split(',');

	for ( b=0; b<buddies.length; b++ ) {
		buddies[b] = buddies[b].split('|');
	}

	names = new Array();
	cur = 1;

        names[0] = '<a href="/forum/forum.asp?t=8"><span style="font: 11px Tahoma; "><font color=orange><b>Helpdesk</b></font></span></a>';

	list = list.split(',');
	for ( i=0; i<list.length; i++ ) {
		data = list[i].split('|');

		n = data[0];
		if ( data[1] != '' ) {
			data[1] = '<font color="orange"><b>*</b></font>';
		}

		if ( data[2] != '' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color=#8DA0A4>' + data[2].replace('%', n) + '</font></span></a>' + data[1];
		} else if ( data[3] == 'j' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color=#336666>' + n + '</font></span></a>' + data[1];
		} else if ( data[3] == 'd' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color=red>' + n + '</font></span></a>' + data[1];
		} else if ( data[3] == 'c' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color=#FFFFFF><b>' + n + '</b></font></span></a>' + data[1];
		} else if ( data[3] == 'g' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color="#FDD017"><b>' + n + '</b></font></span></a>' + data[1];
		} else if ( data[3] == 'gf' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color="#EAC117"><b>' + n + '</b></font></span></a>' + data[1];
		} else if ( data[3] == 'm' ) {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color=#FFFFFF><i>' + n + '</i></font></span></a>' + data[1];
		} else {
			names[cur] = '<a onClick="doShowUserPopup(\'' + data[0] + '\', \'' + data[4] + '\', event); event.returnValue=false;" href="javascript:doNothing()" id="profileLink' + data[0] + '"><span style="font: 11px Tahoma; "><font color=#8DA0A4>' + n + '</font></span></a>' + data[1];
		}
		for ( b=0; b<buddies.length; b++ ) {
			if (buddies[b][0] == data[0]) {
				names[cur] = "<span style=\"background:" + bc[buddies[b][1]] + "\">" + names[cur] + "</span>";
				break;
			}
		}
		cur++;
	}

	html = names.join(' <b>|</b> ');

	woc = g("whosonlinecell");
	if ( woc ) {
		if ( local == 1 ) {
			woc.innerHTML = '<a href="/profile/onlinelistoptions.asp?action=all#ollist" name="ollist" style="font-size: 16px; color: #8DA0A4; font-weight: bold; text-decoration: none;">Local Players Currently Online:</a><br><font color="#8DA0A4">(click to toggle online list)<br>Local: ' + list.length + ' (Total: ' + pcount + ')<br></font>' + html;
		} else {
			woc.innerHTML = '<a href="/profile/onlinelistoptions.asp?action=local#ollist" name="ollist" style="font-size: 16px; color: #8DA0A4; font-weight: bold; text-decoration: none;">Players Currently Online:</a><br><font color="#8DA0A4">(click to toggle online list)<br>Total: ' + list.length + '<br></font>' + html;
		}
	}
	uwoc = g("upperwhosonline");
	if ( uwoc) {
		uwoc.innerHTML = 'Total: ' + list.length + '<br>' + html;
	}
}

function show_help(page)
{
	if ( minihelp ) { minihelp.close(); }
	minihelp = window.open("/minihelp.asp?url=" + page, "Intray", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=300, height=350");
}

function doNothing(){}

var docTips = new TipObj('docTips');
with (docTips) {
	template = '<div class="tipClass">%3%</div>';
	showDelay = 0;
	hideDelay = 1000;
	maxAlpha = 95;
	fadeInSpeed = 50;
	fadeOutSpeed = 30;
	tipStick = 0;
}
