/********************************************************************************/
/*                                                                              */
/* Plataforma e-ducativa.  Version 6.08.05-13 - Argentina                       */
/*                                                                              */
/* Copyright (c) 1998-2008 de e-ducativa Educación Virtual S.A.                 */
/*                                                                              */
/********************************************************************************/
// Layer desplazable para ventanas.
// UTILIZADO EN: location.cgi

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

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

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function loadwindow(width,height){
var w = screen.width;
var l = parseInt((w-400)/2);
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
//document.getElementById("dwindow").style.height=initialheight=height+"px"
//alert(document.getElementById("dwindow").style.height)
document.getElementById("dwindow").style.left=l;
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+130+"px" : iecompattest().scrollTop*1+130+"px"
}

// Cerrar ventanas
// UTILIZADO EN: location.cgi correlativas.cgi

function closeit(parametro){
	document.getElementById("dwindow").style.display="none";
	if (parametro == 1) {
	    window.open("","_parent","");
		setTimeout('window.close()',500);
//		window.opener='';
//		window.close();
	}

}

// Deshabilitar click derecho en links y archivos
// UTILIZADO EN: links.cgi archivos.cgi y templates de programa

// la variable clickmessage esta en cada uno de los cgis
function disableclick(e) {
	if (document.all) {
		if (event.button==2||event.button==3) {
			if ((event.srcElement.tagName=="A") && (event.srcElement.name.indexOf("linkcontenido") >=0 )){
				alert(clickmessage);
				return false;
			}
		}
	} else if (document.layers) {
		if (e.which == 3) {
			alert(clickmessage);
			return false;
		}
	} else if (document.getElementById){
		if ((e.which==3 && e.target.tagName=="A") && (e.target.name.indexOf("linkcontenido") >= 0)){
			alert(clickmessage)
			return false
		}
	}
}

function associatelinks(){
	for(i=0;i<document.links.length;i++) {
		if (document.links[i].name.indexOf("linkcontenido") >= 0) {
			document.links[i].onmousedown=disableclick;
		}
	}
}

// UTILIZADO por el menu izquierdo, la funcion windowOpener esta disponible desde DisplayaEncabezado() y es la misma que usa el chat, mensajeria, etc.
function OpenWebConference (){
    var windowX = (screen.width/2)-390;
    var windowY = (screen.availHeight/2)-293;
    void windowOpener('webconference.cgi','Webconference','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=780,height=570,top='+windowY+',screenY='+windowY+',left='+windowX+',screenX='+windowX);
}

if (document.all) {
	document.onmousedown=disableclick
} else if (document.getElementById) {
	window.onclick=disableclick
} else if (document.layers) {
	associatelinks()
}
