var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;


function getMouseXY(e) {
	if (IE) {
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}
	else {
		tempX = e.pageX;
		tempY = e.pageY;
	}  

	if (tempX < 0){tempX = 0};
	if (tempY < 0){tempY = 0}  ;

	return true;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}


function hideAllFrameworkPopups() {
	MM_showHideLayers('sp','','hide');
	MM_showHideLayers('sf','','hide');
	MM_showHideLayers('p','','hide');
	MM_showHideLayers('mr','','hide');
	MM_showHideLayers('op','','hide');
}

function showFrameworkPopup(arg, dir) {
	hideAllFrameworkPopups();
	MM_showHideLayers(arg,'','show');
	if(dir==-1) {
		MM_changeProp(arg,'','style.top',tempY-200,'DIV'); //show upwards
	}
	else {
		MM_changeProp(arg,'','style.top',tempY-50,'DIV');
	}
	MM_changeProp(arg,'','style.left',tempX,'DIV');
}


