// Menu Principal
/*listas = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
					node.style.backgroundColor = "grey"; 
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
					//this.bgcolor = #CCCCCC;
				}
			}
		}
	}
}
window.onload=listas;*/
//
function _HoverElement(node, className, events) {
	if(!node.hovers) node.hovers = {};
	if(node.hovers[className]) return;
	node.hovers[className] = true;

	if (node.className.indexOf("submenu") != -1) {
		node.wch = true;
		node.submenu = node.getElementsByTagName("ul")[0];
	}
	node.parentMenu = node.parentNode;

	node.attachEvent(events.on,
		function() { node.className += ' ' + className; if (node.wch) {_Apply(node.submenu, node, true); node.parentMenu.shownMenu = node.submenu;} });
	node.attachEvent(events.off,
		function() { node.className = 
			node.className.replace(new RegExp('\\s+'+className, 'g'),''); _HideWCH(node.parentMenu); });
}

// Login
function validar() {
	if (document.formLogin.usuario.value == '') {
		alert('Ingrese el nombre de usuario');
		document.formLogin.usuario.focus();
		return false; }
	if (document.formLogin.clave.value == '') {
		alert('Ingrese la clave');
		document.formLogin.clave.focus();
		return false; }
	return true;
}

//Detalle de diplomados
function dipDetalle(codigo){
	if (!document.layers&&!document.all&&!document.getElementById)
	return;
	if (document.layers){
		document.layers.detDiplomado.document.write(vData[codigo]);
		document.layers.detDiplomado.document.close();}
	else if (document.all)
		detDiplomado.innerHTML=vData[codigo];
	else if (document.getElementById)
		document.getElementById("detDiplomado").innerHTML=vData[codigo];
}

// Abre ventana de chat
function launchCenter(url, name, dp) {
	var str2 = "center,left=0,screenX=0,top=0,screenY=0";
	if (window.screen) {
	//  var ah2 = screen.availHeight - 30;
	//  var aw2 = screen.availWidth - 10;
	  var ah2 = screen.availHeight - 40;
	  var aw2 = screen.availWidth - 20;

	  str2 += ",height=" + ah2;
	  str2 += ",innerHeight=" + ah2;
	  str2 += ",width=" + aw2;
	  str2 += ",innerWidth=" + aw2;
	} else {
	  str2 += ",resizable"; // so the user can resize the window manually
	}
  var str = "height=" + ah2;// + ",innerHeight=" + ah2;
  str += ",width=" + aw2;// + ",innerWidth=" + aw2;
  var strurl = "?h=" + ah2 + "&w=" + aw2 + "&dip=" + dp;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - aw2) / 2;
    var yc = (ah - ah2) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  
  // star:bloque cookie
		document.cookie = "usuario_chat" + ",''," + -3600;
	//if (Get_Cookie(name)) document.cookie = name + "=" + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ";expires=Thu, 01-Jan-70 00:00:01 GMT"; 
	//setcookie("usuario_chat", $usuario_chat, time() + 3600 * 24 * 30);
  // end:bloque cookie
	//alert(str);
	//url = url + strurl;
  return window.open(url+strurl, name, str);
}