﻿/*Funciones utilizadas en el sitio*/
function NewWindow(mypage, args, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+scroll;

	mypage += escape(args);
	
	win = window.open(mypage, myname, winprops);	
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus();
	 }
	
}

function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
   if (btn[i].checked) {cnt = i; i = -1;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}


function EnviaLiga(liga, cont){
	createCookie("UDEM:Menu", cont, 0);
	document.location.href=liga;
}
function onFocusEmail(emailField, valor) {
    if (emailField.value == valor) {
        emailField.value = '';
    }
    return true;
}
function onBlurEmail(emailField, valor) {
    if (emailField.value == '') {
        emailField.value = valor;
    }
    return true;
}
function onFocusPassword(textDisplayPasswordFieldId, passwordFieldId) {
    passwordField = document.getElementById(passwordFieldId);
    textDisplayPasswordField = document.getElementById(textDisplayPasswordFieldId);

    passwordField.style.display = 'block';
    textDisplayPasswordField.style.display = 'none';
    passwordField.focus();
    return true;
}
function onBlurPassword(textDisplayPasswordFieldId, passwordFieldId) {
    passwordField = document.getElementById(passwordFieldId);
    textDisplayPasswordField = document.getElementById(textDisplayPasswordFieldId);

    if (passwordField.value == '') {
        passwordField.style.display = 'none';
        textDisplayPasswordField.style.display = 'block';
    }
    return true;
}
function cerrarSesion() {
    if (confirm('Se procederá a cerrar la sesión actual en el sistema Bolsa de Trabajo de UDEM, ¿estás seguro de continuar?')) {
        document.location.href = '/micrositio-empleo/';
    }
};

function tabs() {
    $(".tab_det_carre span").mouseover(function() {
        $(this).addClass("spanover");
    }).mouseout(function() {
        $(this).removeClass("spanover");
    });
    $(".tab_det_carre2 span").mouseover(function() {
        $(this).addClass("spanover");
    }).mouseout(function() {
        $(this).removeClass("spanover");
    });
 }
