//google analytic
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-13194943-1");
pageTracker._trackPageview();
} catch(err) {}

//Funciones para roll-overs
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//Menus


function MM_showHideLayers() { //v6.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 writeCookie() 
{
 var today = new Date();
 var the_date = new Date("December 31, 2023");
 var the_cookie_date = the_date.toGMTString();
 var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
 document.cookie=the_cookie;
	 
}


//Nuevo Menu Javascript 17-12-09

var visibidad_menu = false;

function tratar_menu(variableRuta){
	if (visibidad_menu){
		eliminarElemento("perfiles_menu",variableRuta);
	}else{
		insertarElemento(variableRuta);
	}
}

function insertarElemento(variableRuta){
	var flecha = document.getElementById('flecha_perfil');
	flecha.setAttribute('src',variableRuta+'imagenes/estructura/icon_menu_perfiles_flecha_2.gif');
	var contenedor = document.getElementById('contenedor_menu');
	var div = document.createElement('div');
	var ul = document.createElement('ul');
	var li1 = document.createElement('li');
	var li2 = document.createElement('li');
	var li3 = document.createElement('li');
	var li4 = document.createElement('li');
	var li5 = document.createElement('li');

	div.className='menu_prueba';
	ul.className='menu_prueba';
	li1.className='menu_prueba';
	li2.className='menu_prueba';
	li3.className='menu_prueba';
	li4.className='menu_prueba';
	li5.className='menu_prueba';

	var perfil1 = document.createElement('a');
	var perfil2 = document.createElement('a');
	var perfil3 = document.createElement('a');
	var perfil4 = document.createElement('a');
	var perfil5 = document.createElement('a');
	
	div.setAttribute('id','perfiles_menu');
	div.setAttribute('class','menu_prueba');

	perfil1.setAttribute('href',variableRuta+'contenido/perfil_alumno/index_alumno.php');
	perfil2.setAttribute('href',variableRuta+'contenido/perfil_profesor/index_profesor.php');
	perfil3.setAttribute('href',variableRuta+'contenido/perfil_pas/index_pas.php');
	perfil4.setAttribute('href',variableRuta+'contenido/perfil_empresa/index_empresa.php');
	perfil5.setAttribute('href',variableRuta+'contenido/perfil_f_alumno/index_futuro_alumno.php');

	perfil1.innerHTML = 'Alumno';
	perfil2.innerHTML = 'Profesor';
	perfil3.innerHTML = 'P.A.S.';
	perfil4.innerHTML = 'Empresa';
	perfil5.innerHTML = 'Futuro Alumno';
	
	li1.appendChild(perfil1);
	li2.appendChild(perfil2);
	li3.appendChild(perfil3);
	li4.appendChild(perfil4);
	li5.appendChild(perfil5);
	
	ul.appendChild(li1);
	ul.appendChild(li2);
	ul.appendChild(li3);
	ul.appendChild(li4);
	ul.appendChild(li5);
	div.appendChild(ul);
	contenedor.appendChild(div);
	
	visibidad_menu = true;

}

function eliminarElemento(id,variableRuta){
	var tabla_menu = document.getElementById(id);
	var celda_perfil = document.getElementById('celda_perfiles');
	if (!tabla_menu){
		alert("El elemento selecionado no existe.");
	} else {
		celda_perfil.style.backgroundColor="#FFFFFF";
		var flecha = document.getElementById('flecha_perfil');
		flecha.setAttribute('src',variableRuta+'imagenes/estructura/icon_menu_perfiles_flecha.gif');
		var padre = tabla_menu.parentNode;
		padre.removeChild(tabla_menu);
		visibidad_menu = false;
	}
}





