function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	return [curleft,curtop];
	}
}


function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function getDocWidth() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
        Math.max(D.body.offsetWidth, D.documentElement.offsetWidth),
        Math.max(D.body.clientWidth, D.documentElement.clientWidth)
    );
}

function winsize(){
			winW = getDocWidth();
			winH = getDocHeight();
}

function findcenter(sizestring){
	var myReg= new RegExp("width=(.*) height=(.*)");
	var results= sizestring.match(myReg);
		
	lpos=Math.round(parseFloat((winW-results[1])/2));
	
	tpos=Math.round(parseFloat((winH-results[2])/2));
}

function xmlmore(prpos, mode,id,aka,prem,blurb,reading,oBj){
	switch(reading){
		case '1':
			var readservice="Credit Card";
			break;
		case '2':
			var readservice="Telephone";
			break;
		default:
			var readservice="Telephone & Credit Card";
			break;
	}

			if(prpos==1){
				document.getElementById('psychicreader').innerHTML="<table cellpadding=0 cellspacing=5 width=350px><tr><td colspan=3><div id=divclosed >CLICK TO CLOSE</div></td></tr><tr><td style=\"font-size: 18px;font-weight: bold;color: #1272CE\">"+aka+"</td><td style=\"width: 80%\"><div style=\"width: 100%;height: 5px;border-bottom: 2px #cccccc solid\">&nbsp;</div></td><td style=\"text-align: right;font-size: 13px;font-weight: bold;color: #1272CE;white-space: nowrap\">Pin: "+prem+"</td></tr><tr><td colspan=3><div style=\"clear: both;font-size: 11px;line-height: 1.3;color: #666666;margin: 0px 0 10px 30px;min-height: 150px\"><div style=\"width: 300px;float: left;margin-top: 8px;margin-bottom: 10px;font-size: 14px\"><img src=\"../readerimg/noimage.gif\" width=\"130px\" min-height=\"140px\" align=\"left\" style=\"margin-right: 20px;margin-bottom: 10px\">"+blurb+"</div></div></td></tr></table><table cellpadding=0 cellspacing=5 width=350px><tr><td style=\"width: 45%\"><div style=\"width: 100%;height: 5px\">&nbsp;</div></td><td style=\"text-align: right;font-size: 13px;font-weight: bold;color: #1272CE;;white-space: nowrap\">"+readservice+"</td><td style=\"width: 45%\"><div style=\"width: 100%;height: 5px\">&nbsp;</div></td></tr></table>";
			}else
			{
				document.getElementById('psychicreader').innerHTML="<table cellpadding=0 cellspacing=5 width=350px><tr><td colspan=3><div id=divclosed >CLICK TO CLOSE</div></td></tr><tr><td style=\"font-size: 18px;font-weight: bold;color: #1272CE\">"+aka+"</td><td style=\"width: 80%\">&nbsp;</td><td style=\"text-align: right;font-size: 13px;font-weight: bold;color: #1272CE;white-space: nowrap\">Pin: "+prem+"</td></tr><tr><td colspan=3><div style=\"clear: both;font-size: 11px;line-height: 1.3;color: #666666;margin: 0px 0 10px 30px;min-height: 150px\"><div style=\"width: 300px;float: left;margin-top: 8px;margin-bottom: 10px;font-size: 14px\"><img src=\"../readerimg/"+id+".jpg\" width=\"130px\" min-height=\"140px\" align=\"left\" style=\"margin-right: 20px;margin-bottom: 10px\">"+blurb+"</div></div></td></tr></table><table cellpadding=0 cellspacing=5 width=350px><tr><td style=\"width: 45%\"><div style=\"width: 100%;height: 5px\">&nbsp;</div></td><td style=\"text-align: right;font-size: 13px;font-weight: bold;color: #1272CE;white-space: nowrap\">"+readservice+"</td><td style=\"width: 45%\"><div style=\"width: 100%;height: 5px;\">&nbsp;</div></td></tr></table>";
			}
			
			winsize();
			findcenter('width=390 height=300');
			
			
			if(!document.getElementById('psychicreader').style.posLeft){
				document.getElementById('psychicreader').style.left=lpos+'px';
				document.getElementById('psychicreader').style.top=tpos+'px';
			}
			else{
				document.getElementById('psychicreader').style.left=lpos+'px';
				document.getElementById('psychicreader').style.top=100+'px';
			}
			document.getElementById('psychicreader').style.display='block';

}

function gup(oBj){
	document.getElementById('divclosed').style.color='#1272CE';
	document.getElementById('divclosed').style.fontWeight='bold';
}

function gdown(oBj){
	document.getElementById('divclosed').style.color='#A89BC6';
	document.getElementById('divclosed').style.fontWeight='normal';
}

function less(){
	document.getElementById('psychicreader').style.display='none';
}

function cellhover(oBj){
	oBj.style.filter='alpha(opacity=70)';
	oBj.style.MozOpacity='.70';
	oBj.style.filter='opacity:.70';
}

function uncellhover(oBj){
	oBj.style.filter='alpha(opacity=100)';
	oBj.style.MozOpacity='1';
	oBj.style.filter='opacity:1';
}

