function NuevoAjax(){
		
	var xmlhttp=false; 
		try { 
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
		} 
		catch (e) { 
			try { 
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			} 
			catch (E) { 
				xmlhttp = false; 
			} 
		}
		if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 
			xmlhttp = new XMLHttpRequest();
		}
		return xmlhttp;
}
	
function aleatorio(inferior,superior){ 
		numPosibilidades = superior - inferior 
		aleat = Math.random() * numPosibilidades 
		aleat = Math.round(aleat) 
		return parseInt(inferior) + aleat 
}
function AbrirVentana(theURL,winName,features)
{
   
	neu=window.open(theURL,winName,features);
	neu.focus()
	neu.moveTo(Math.round((screen.availWidth-952)/2),Math.round((screen.availHeight-240)/2))  
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//INICIO ÁREA DE PERIODISTAS (SUGERENCIAS)

function enviar_sugerencia(){
	if (document.miform_sugerencia.sugerencia_edit.value == '') {
		alert('Por favor, indica la sugerencia.')
	}else{
		document.miform_sugerencia.submit();
	}
}

function LongitudTextoArea(elemento, longitud) {
	 var longitud_maxima = longitud;
	 var longitud_texto = elemento.value.length;
	 if (longitud_texto > longitud_maxima) {
	  elemento.value = elemento.value.substring(0,longitud_maxima);
	  //alert ("EL TEXTO TIENE QUE TENER UN MAXIMO DE "+longitud_maxima+" CARACTERES.");
	  return false
	 } else {
	  return true;
	 }
}

//FIN ÁREA DE PERIODISTAS (SUGERENCIAS)

function if_ToObject(id) {
		if(document.layers){
			return (document.layers[id])?eval(document.layers[id]):null;
		}
		else if(document.all && !document.getElementById){
			return (eval("window."+id))?eval("window."+id):null;
		}
		else if(document.getElementById && document.body.style) {
			return (document.getElementById(id))?eval(document.getElementById(id)):null;
		}
	}
  
function if_FlashWrite(string){
  document.write(string);
  }

function if_FlashInnerHTML(htmlElementId,code){
  var x=if_ToObject(htmlElementId);
  if(x){
    if(document.getElementById||document.all){
      x.innerHTML='';
      x.innerHTML=code;
      }
    else if(document.layers){
      x.document.open();
      x.document.write(code);
      x.document.close();
      }
    }
  }
  
function IsDigitFF(e)
{
var key = window.event ? e.keyCode : e.which;
var keychar = String.fromCharCode(key);
reg = /[0-9]/;
return (reg.test(keychar) || e.keyCode == 8)
}
/*
function posicionarCapa(){
	
mitopLateral = findPos(document.getElementById("imgMenu"))[1]-10;
mileftLateral = findPos(document.getElementById("imgMenu"))[0]-22;
mitopTop = findPos(document.getElementById("imgMenu7"))[1]-22;
mileftTop = findPos(document.getElementById("imgMenu7"))[0]-22;

mitop = findPos(document.getElementById("imgMenu"))[1]+44;
mileft = findPos(document.getElementById("imgMenu"))[0];
mitopconocenos = findPos(document.getElementById("imgMenu7"))[1]+44;
mileftconocenos = findPos(document.getElementById("imgMenu7"))[0];

document.getElementById("capaMenuModelos").style.left = mileft + "px";
document.getElementById("capaMenuModelos").style.top = mitop + "px";
document.getElementById("capaLateralModelos").style.left = mileftLateral + "px";
document.getElementById("capaLateralModelos").style.top = mitopLateral + "px";
document.getElementById("capaMenuconocenos").style.left = mileftconocenos + "px";
document.getElementById("capaMenuconocenos").style.top = mitopconocenos + "px";
document.getElementById("capatop").style.left = mileftTop + "px";
document.getElementById("capatop").style.top = mitopTop + "px";
}

function mostrarCapa(){
	document.getElementById("capaMenuModelos").style.visibility = "visible";
}

function mostrarCapa1(){
	document.getElementById("capaMenuconocenos").style.visibility = "visible";
}

function ocultarCapa(){
	document.getElementById("capaMenuModelos").style.visibility = "hidden";
}

function ocultarCapa1(){
	document.getElementById("capaMenuconocenos").style.visibility = "hidden";
}
*/
function ajusta()
	{
		document.getElementById("videoTV").style.left = findPosX(document.getElementById("imgPosicion"))+"px"
	}
	
//window.onload=posicionarCapa;
//window.onresize=posicionarCapa;
window.onresize=ajusta;

