////////// WEBCAM ACTUALIZA //////////

var t = 5 // interval in seconds
imgsrc = "";
function ErrorImg() {
setTimeout("LoadImg()", t*1000);
}

function LoadImg() {
if (imgsrc == "") imgsrc = document.images.visiongs.src;
document.images.visiongs.onload = ""; 
tmp = new Date();
tmp = "?"+tmp.getTime();
document.images.visiongs.src = imgsrc+tmp;
setTimeout("LoadImg()", t*1000);
}

////////// WEBCAM POPUP //////////
function ventanaWebCam (url,h,b)
{
window.open(url,null,"height="+ h +",width="+ b +",status=yes,toolbar=no,menubar=no,location=no");
}

////////// FORMULARIO BOLETIN //////////
function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
      alert("Por favor, introduce tu "+fieldnames[i]);
      eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
      return false;
    }
  }
   return true;
}

var fieldstocheck = new Array();
var fieldnames = new Array();
function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}
// ---- POP-UP de confirmacion -- //
function openTarget (form, features, windowName) {
  if (!windowName)
    windowName = 'formTarget' + (new Date().getTime());
  form.target = windowName;
  open ('', windowName, features);
}
