//Show & Hide div
function toggleDetails(theDiv) {
	var currentStyle = document.getElementById(theDiv).style;
	currentStyle.display = currentStyle.display ? "" : "block";
}
/**************************/
function x_vota_candidatas(frm,id){
	frm.selec_id_ya.value=1;	
	frm.voteid.value=id;
	//frm.submit();
//	alert("hola");
}
///----------------------------------/

function updateMask(width, height) {
		
	if (!gInitPopUpCalled) {
		initPopUp();
	}
	
	if (gPopupIsShown == true) {
		
		if (width == null || isNaN(width)) {
			width = gPopupContainer[gTopmostPopup].offsetWidth;
		}
		
		if (height == null) {
			height = gPopupContainer[gTopmostPopup].offsetHeight;
		}
			
		var fullHeight = getViewportHeight();				
		var fullWidth = getViewportWidth();
				
		var theBody = document.body;
		
		var scTop = parseInt(theBody.scrollTop,10);
		var scLeft = parseInt(theBody.scrollLeft,10);
				
		gPopupMask[gTopmostPopup].style.height = fullHeight + "px";
				
		// compensating for a horizontal scrollbar for non IE browsers
		if (!document.all && document.body.scrollHeight > document.body.clientHeight) {
			// Not IE and has a vertical scrollbar
			fullWidth -= 21;
		}
	
		gPopupMask[gTopmostPopup].style.width = fullWidth + "px";
						
		gPopupMask[gTopmostPopup].style.top = scTop + "px";
		gPopupMask[gTopmostPopup].style.left = scLeft + "px";
	}
}


////////////////////////
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    //scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    //scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    //scrOfX = document.documentElement.scrollLeft;
  }
//  return [ scrOfX, scrOfY ];

   return  scrOfY;
}
function mostrar_foto (strFoto) {
	
	var y=getScrollXY();
	//alert(y);
	document.all.div_mostrar_foto.style.top=y;
	//document.all.div_mostrar_foto.style.top=10;
	document.all.div_mostrar_foto.style.visibility='visible';
	document.all.imgGrande.src = strFoto;
	document.all.disabled=true;
}
function ocultar_foto () {
	document.all.div_mostrar_foto.style.visibility='hidden';
	document.all.imgGrande.src = 'candidatas/cargando.gif';
	document.all.disabled=false;
}

function setAction(){
	document.form1.action = 'estructura.asp?idMod=7';
	
	if(document.form1.strGaleria.value==6 || document.form1.strGaleria.value==7){
		document.form1.action = 'estructura.asp?idMod=17';
	}
}
/*********************/
var temp_top_oio=1;

function Para_video()
{
	var PeliFlash=window.document.mipelicula;

	ocultar_popup();
	PeliFlash.StopPlay();
}

function mostrar_popup () {

	document.all.layer_candidatas.style.visibility='visible';
	document.all.disabled=true;
	move_popup();
	

	
}
function move_popup ()
{
	if(temp_top_oio<=300)
	{
		
		temp_top_oio+=5;
		layer_candidatas.style.top = temp_top_oio;
		setTimeout("move_popup ()",5);
	}
	else
	{
		setTimeout("ocultar_popup ()",10000);
		
	}
}

function ocultar_popup () {
	//move_popup_left();
	
	
	document.all.layer_candidatas.style.visibility='hidden';
	document.all.disabled=true;
	
	
}

var temp_left_oio=(screen.width) / 2;
//alert(layer_candidatas.left);

function move_popup_left()
{
	//
	if(temp_left_oio<=(screen.width-170))
	{
		
		temp_left_oio+=5;
		layer_candidatas.style.left = temp_left_oio;
		setTimeout("move_popup_left ()",5);
	}
	else
	{
		document.all.layer_candidatas.style.visibility='hidden';
		document.all.disabled=false;
		//document.all.imgtoprigth.src = "images/admision2007.jpg";
		//document.all.reftoprigth.href="?op=Tm90aWNpYXM9MTk0";
	}
}
/**************************/


function AbrirasVentana(paginota,nombrisimo,caracteristicas){
	window.open(paginota,nombrisimo,caracteristicas);
}
// ventana=window.open("http://mio","","width=800,height=600,status=1,scrollbars=1,location=1,menubar=1,resizable=1,directories=1");
function gotoUrl(url,targetLink){
	if (targetLink == '') {
		window.location = url;
	}
}
function alerta(){
	alert("Por el momento NO existen noticias en esta sección\n                       ¡¡Gracias!!");
}
function abrirventana(myurl,w,h,xscroll){
	var newWindow;
	var winl = (screen.width - w) / 2;
	var wint = ((screen.height - h) / 2);
	var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+xscroll+', status=yes,toolbar=no,scrollbars=yes,titlebar=yes,menubar=no,resizable=no,directories=no,location=no'
	window.open(myurl,"ventana", winprops,0 );
}
function control_encuesta(frm){	
	if(frm.selec_id_ya.value==0){
		alert("Necesita seleccionar una opción!!!\n\n           ¡¡Gracias!!");
		return false;
	}else{
		return true;	
	}	
}
function x_vota(frm){
	frm.selec_id_ya.value=1;	
}
function ya_voto(){
	alert("Estimado usuario la encuesta esta limitada a un voto por persona.\n\n¡¡Gracias por participar!!");	
	return false;
}
function ya_concurso(){
	alert("Estimado usuario el concurso esta limitado a un voto por persona.\n\n¡¡Gracias por participar!!");	
}
/*-------------------------------------------------------------------*/
function control_comunidad_insert(frm){
	if(frm.x_nombre.value==""){
		alert("Este campo no puede estar vacio!!!\n- Indique tu nombre\n\n            ¡¡Gracias!!");
		frm.x_nombre.focus();
		return;
	}
	if(frm.x_mail.value==""){
		alert("Este campo no puede estar vacio!!!\n- Indique tu Correo Electrónico\n\n            ¡¡Gracias!!");
		frm.x_mail.focus();
		return;
	}
	if(frm.x_asunto.value==""){
		alert("Este campo no puede estar vacio!!!\n- Indique el asunto\n\n            ¡¡Gracias!!");
		frm.x_asunto.focus();
		return;
	}
	if(frm.x_comentario_gral.value==""){
		alert("Este campo no puede estar vacio!!!\n- Indique tu comentario\n\n            ¡¡Gracias!!");
		frm.x_comentario_gral.focus();
		return;
	}
	frm.submit();
}
/*-------------------------------------------------------------------*/
function concurso(form){
	for(var i=0;i<=form.vot.length;i++){
		if(form.vot[i].checked){
			break;
		}
	}
	var answer="";
	if(i<=form.vot.length){
		answer=form.vot[i].value;
	}
	form.id_enc.value=answer;
	form.submit();
//	alert(form.id_enc.value);
}
/*-------------------------------------------------------------------*/
function mail_utec(frm){
	if(frm.imapuser.value==""){
		alert("Indica tu usuario por favor.\n\n            ¡¡Gracias!!");
		frm.imapuser.focus();
		return;
	}
	if(frm.pass.value==""){
		alert("Indica tu Passwd por favor.\n\n            ¡¡Gracias!!");
		frm.pass.focus();
		return;
	}
	frm.submit();
	frm.imapuser.value="";
	frm.pass.value="";
	frm.imapuser.focus();
}
/*-------------------------------------------------------------------*/