// JavaScript Document

function showsumario(form) {
  var URL = document.form.site.options[document.form.site.selectedIndex].value;
  if (URL != "") URL = "sumarios/" + URL + ".htm";
  window.location.replace(URL);
}

function showsumario1(form) {
  var URL = document.form.site.options[document.form.site.selectedIndex].value;
  if (URL != "") URL = "../sumarios/" + URL + ".htm";
  window.location.replace(URL);
}

function mirrorGo(form) {
  var URL = document.mirrorForm.mirror.options[document.mirrorForm.mirror.selectedIndex].value;
  window.location.replace(URL);
}

function showBackcover(img,height,width) {
  var URL = "novedades/fotosdeporte/" + img;
  newWindow(URL,height,width);
}

function showImg(img,height,width) {
  var URL = "galeria/" + img;
  newWindow(URL,height,width);
}

function newWindow(URL,height,width) {
  var fheight = height + 20;
  var fwidth  = width  + 20;
  var winl = (screen.width - fwidth) / 2;
  var wint = (screen.height - fheight) / 2;
  var windowprops = "height=" + fheight + ",width=" + fwidth + ",top=" + wint + ",left=" + winl
                    + ",location=no," + "scrollbars=no,menubars=no,toolbars=no,resizable=yes";
  popup = window.open(URL,"MenuPopup",windowprops);
}

function searchOnTemas() {
  document.search.submit();
  document.search.disabled = true;
}

function pwd2MD5() {
  var md5pwd = hex_md5(document.loginTemas.pwd.value);
  var catvar = document.loginTemas.login.value+md5pwd+document.loginTemas.timestamp.value;
  document.loginTemas.hashpass.value = hex_md5(catvar);
  document.loginTemas.pwd.value = "";
  document.loginTemas.submit();
}
