
//promociones
function init_promos(lang,idp,cat) {
	getPromoContent(lang,1,idp,cat);
}
	
function enviar(promo){
	document.forms['formpromo' + promo].submit();
}

//general
//abrir ventana centrada
function WindowCenter (url,ancho, alto, stl, name) {
  var width = ancho
  var height = alto
  var x=(640 - width)/2
  var y=(480-height)/2
  var ndate = new Date();

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2

  window.width=width
  window.height=height
  window.x=x
  window.y=y

  estilo = stl ? stl : "toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0";
  name = name ? name : 'newwin';

  vn = window.open(url, name, estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px");
  vn.focus();
}

//abrir ventana centrada, con foto
function showphoto (url,foot,lang) {	
  var width = 150;
  var height = 150;
  var x=(640 - width)/2
  var y=(480-height)/2

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2

  window.width=width
  window.height=height
  window.x=x
  window.y=y

  estilo="toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0";
  params = foot ? 'url='+url+'&foot='+escape(foot) : 'url='+url ;

  vn = window.open('../modules/photo.php?'+params+'&lang='+lang, 'newwinphoto', estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px");
  vn.focus();
}

//abrir ventana centrada, con foto
function showphotonew (idn,num,foot,lang) {	
  var width = 150;
  var height = 150;
  var x=(640 - width)/2
  var y=(480-height)/2

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2

  window.width=width
  window.height=height
  window.x=x
  window.y=y

  estilo="toolbar=0, status=0, location=0, directories=0, menubar=0, scrollbars=0, resize=0,resizable=0";
  params ='id='+idn+'&n='+num+'&lang='+lang;
  params += foot ? '&foot='+foot : '' ; 

  vn = window.open('../modules/photonew.php?'+params, 'newwinphotonew', estilo + ",width=" + width + "px,height=" + height + "px,top=" + y + "px,left=" + x + "px");
  vn.focus();
}


/*Para Hacer Blink En Internet Explorer */
function parpadear() {
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function empezar() {
  if (document.all)
    setInterval("parpadear()",800)
}
