var tmr;
var t;
var obj;
	var fadeW = 390;
	var fadeH = 150;
	var tempX = 0;
	var tempY = 0;
	var tempPX = 20;
	var tempPY = -80;
	var winW = 800;
    var winH = 600;
	var theitem = 0;
	var xmlitemreq = null;
	var ftimer = null;
	var xtimer = null;	
	var dadelay = 0;

function sFa(qqqq) {
         theitem = qqqq;
	    alertSize();
		obj = gObj();
		if((tempX + fadeW) > winW) {tempPX = 0 - fadeW;} else {tempPX = -60;}
	    //if((tempY + fadeH) > winH) {tempPY = 0 - fadeH - 20;} else {tempPY = -60;}
	    //if(tempY < fadeH) {tempPY = fadeH + 20;}
		obj.style.left = tempX + tempPX;
	    obj.style.top = tempY + tempPY;

	sLft();
	shw(true);
	t = 0;
	sTmr();
	loadXMLDoc("/schedgridinner.php?item=" + qqqq);
	
}

function hFa() {
     	setTimeout("chglastq()",150);
	t = -100;
	sTmr();
	document.getElementById('fa').innerHTML='<h1><i>Loading<img src="/images/loading.gif" width="100" height="10"></i></h1>';
	isvis = false;
	return false;
}

function sTmr() {
	tmr = setInterval("fd()",20);
}

function fd() {
	var amt = Math.abs(t+=10);
	if(amt == 0 || amt == 100) clearInterval(tmr);
	amt = (amt == 100)?99.999:amt;
  	
	obj.style.filter = "alpha(opacity:"+amt+")";
	obj.style.KHTMLOpacity = amt/100;
	obj.style.MozOpacity = amt/100;
	obj.style.opacity = amt/100;
	
	if(amt == 0) shw(false);
}

function sLft() {
					

	
}

function gObj() {
	return document.getElementById("fa");	
}

function shw(b) {
	(b)? obj.className = 'show':obj.className = '';	
}

function alertSize() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winW = window.innerWidth;
    winH = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winW = document.documentElement.clientWidth;
    winH = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winW = document.body.clientWidth;
    winH = document.body.clientHeight;
  }
}

function getMouseXY(e) {
if (dozeIE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
}
else {  // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}  
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}  
return true;
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function loadXMLDoc(url)
{
xmlitemreq=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlitemreq=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlitemreq=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlitemreq!=null)
  {
  xmlitemreq.onreadystatechange=state_Change
  xmlitemreq.open("GET",url,true)
  xmlitemreq.send(null)
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlitemreq.readyState==4)
  {
  // if "OK"
  if (xmlitemreq.status==200)
  {
  
  document.getElementById('fa').innerHTML= xmlitemreq.responseText;
  }
  }
}

function delayfade()
{
   xtimer=setTimeout("hFa()",50);
   }
   
function delayfadein(qqqq)
{
	dadelay = "sFa(" + qqqq + ")";
   ftimer=setTimeout(dadelay,490); 
   }

function clrtimer()
   {clearTimeout(ftimer);} 

