// JavaScript Document


function popup(popupfile,winwidth,winheight)
{
open(popupfile,"PopUpWindow","resizable=0,height=" + winheight + ",width=" + winwidth + ",scrollbars=0, status=0, toolbar=0");
      
}


// BPRM Digital

function showtrail(file) {
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1) {
		document.getElementById('ttimg').src=file
		w=document.getElementById('ttimg').width+5
		h=document.getElementById('ttimg').height+5 
		gettrailobj().width=w+"px"
		gettrailobj().height=h+"px"
		//gettrailobj().visibility="visible"
		document.onmousemove=followmouse
		//document.onclick=hidetrail
	}
}

function hidetrail() {
	document.onmousemove=""
	gettrailobj().visibility="hidden"
	gettrailobj().left=-1000
	gettrailobj().top=0
}

function followmouse(e) {
	gettrailobj().visibility="visible"
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1) {
		var xcoord=20
		var ycoord=20
		if (typeof e != "undefined") {
			xcoord+=e.pageX
			ycoord+=e.pageY
		}
		else if (typeof window.event !="undefined")	{
			xcoord+=truebody().scrollLeft+event.clientX
			ycoord+=truebody().scrollTop+event.clientY
		}
		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

		if (xcoord+w+3>docwidth)
			xcoord=xcoord-w-(20*2)

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
			ycoord=ycoord-h-20;

		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
	}
}

function gettrailobj() {
	if (document.getElementById) 
		return document.getElementById("trailimageid").style
	else if (document.all) 
		return document.all.trailimageid.style
}

function truebody() {
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

// BPRM Digital - FIM

