function launchIF(WHERE) {

if (document.getElementById('CFRAME')) {

 document.getElementById('CFRAME').style.display = "block";
 document.getElementById('CFRAME').src= WHERE
 document.getElementById('CFRAMELOC').innerHTML = WHERE
 document.getElementById('SCROLLTOP').innerHTML = 0
 
}

}

function SetCwinHeight(){
  var cwin=document.getElementById("CFRAME");
  if (document.getElementById){
      if (cwin && !window.opera) {
          if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
              cwin.height = cwin.contentDocument.body.offsetHeight + 20;
          else if(cwin.Document && cwin.Document.body.scrollHeight)
              cwin.height = cwin.Document.body.scrollHeight + 20;
      }
  }
}


function GetObj(objName){
    if(document.getElementById){
        return eval('document.getElementById("' + objName + '")');
    }else if(document.layers){
        return eval("document.layers['" + objName +"']");
    }else{
        return eval('document.all.' + objName);
    }
}



function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
  }
  	return curtop;
}



function TOPIC (GOTO) {
 if (document.getElementById("CFRAMELOC")) {var LOCATION = document.getElementById("CFRAMELOC").firstChild.nodeValue;}

 document.getElementById("CFRAME").src = LOCATION + "&" + GOTO;

}



function CLOSE(WHICH) {
 document.getElementById(WHICH).innerHTML = "";
 document.getElementById(WHICH).style.display = "none";
 var INFOLAYER = document.getElementById("INFOLAYER");
 INFOLAYER.removeChild(document.getElementById(WHICH))
 if (INFOLAYER.innerHTML == "") {
    INFOLAYER.style.display = "none";
 }
 
}


function GOLO (WHERE) {

var d = new Date();
var m = d.getMinutes();
var s = d.getSeconds();
var mm = d.getMilliseconds();
ID = "D_" +m+s+mm;


if (WHERE.match("http")) {GOWHERE = WHERE}
else {GOWHERE = "/CLASSESDB/iframe.php"+WHERE}

 LAYER = "<div id='"+ID+"' class='INFOLAY'><div onclick='CLOSE(\""+ID+"\")' style='background:black;color:white;border:1px solid black; width:50px; cursor:pointer; font:bold 8pt arial; position:absolute; right:0px'>CLOSE</div>";
 LAYER += "<iframe src='"+GOWHERE+"' width=100% height=98% scrolling=auto frameborder=0></iframe></div>";


 var vscroll = f_scrollTop()

 document.getElementById("INFOLAYER").style.display = "block";
 document.getElementById("INFOLAYER").style.top = vscroll + "px"
 document.getElementById("INFOLAYER").innerHTML += LAYER
// window.scroll(0,vscroll);
}



function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}










