// use wherever _details_ boxes are used

var detailsStartPos=0;

function scrollDetails() {
detailsFrameObj=document.getElementById('div_details');

	if (detailsStartPos==0)
		detailsStartPos=detailsFrameObj.offsetTop;

curScrollY=getScrollY();

posDif=curScrollY-detailsStartPos;

	if (posDif>0)
		detailsFrameObj.style.top=(posDif+30)+"px";
	else
		detailsFrameObj.style.top="0px";
}


function autoScrollDetails() {
	if (!isObjVisible(document.getElementById('div_details'))) {
		scrollDetails();
	}
}


function showDetails(type,id,name) {
scrollDetails();

	switch(type) {
		case "pub": waitMsg="Locating pub..."; dURL="modules/mod-pubdetails.asp?tk="+id; break;
		case "ent":	waitMsg="Locating entertainer..."; dURL="modules/mod-entdetails.asp?tk="+id; break;
		case "fixture": waitMsg="Locating fixture..."; dURL="modules/mod-sportsdetails.asp?mode=fixtures&id="+id; break;
		case "channel": waitMsg="Locating channel..."; dURL="modules/mod-sportsdetails.asp?mode=channels&id="+id; break;
		case "league": waitMsg="Locating league..."; dURL="modules/mod-sportsdetails.asp?mode=leagues&id="+id; break;
		default: return false;
	}

	if (name!=null && name!="") waitMsg="Locating <i>"+name+"</i>...";

document.getElementById("div_details").innerHTML="<div style='font-size:11pt; font-weight:bold;'>"+waitMsg+"</div>";

getAjax(null, document.getElementById("div_details"), dURL, false,
	function() {
		imgObj=document.getElementById("details_picture");
			if (imgObj) {
				imgWidth=imgObj.width;
				if (imgWidth>230)
					imgObj.width=230;
			}
			else {
				jsDbg("missing imgObj");
			}
	} );
}

