function buscar(){
	if(document.getElementById('q').value.length>=3){
		document.getElementById('frmBuscarHeader').submit();
	}else{
		alert("Debes ingresar al menos 3 letras");
	}
}


function popup(theURL,winName,ancho,alto,features) {
 var wleft = (screen.width - ancho)/2
 var wtop = (screen.height - alto)/2 
 if (features==null) {
	 features = "scrollbars=0,fullscreen=0,resizable=0,status=0,toolbar=0,directories=0,location=0,menubar=0,copyhistory=0";
	 }
 window.open(theURL, winName, "width="+ancho+", height="+alto+", "+ features +", top= "+ wtop.toString() +", left="+ wleft.toString());
}


function popupPrint(theURL,winName,ancho,alto,features) {
 var wleft = (screen.width - ancho)/2
 var wtop = (screen.height - alto)/2 
 if (features==null) {
	 features = "scrollbars=1,fullscreen=0,resizable=0,status=1,toolbar=0,directories=0,location=0,menubar=0,copyhistory=0";
	 }
 window.open(theURL, winName, "width="+ancho+", height="+alto+", "+ features +", top= "+ wtop.toString() +", left="+ wleft.toString());
}


function begin(){
  	window.setInterval("refreshh()",780000);
  	//window.setInterval("refreshh()",240000);
}

function refreshh(){
	//window.location = "http://www.cronica.com.ar/";
	location.reload();
}


function getTapa(){
    if (document.implementation && document.implementation.createDocument){
        xmlDoc = document.implementation.createDocument("", "", null);
        xmlDoc.onload = function(){
			//alert(xmlDoc.documentElement.getElementsByTagName('thumb').item(0).firstChild.data);
			document.getElementById('imgTapa').src = xmlDoc.documentElement.getElementsByTagName('thumb').item(0).firstChild.data;
			document.getElementById('linkTapa').href = xmlDoc.documentElement.getElementsByTagName('imagen').item(0).firstChild.data;
		};
    }else if (window.ActiveXObject){
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.onreadystatechange = function () {
            if (xmlDoc.readyState == 4){
				//alert(xmlDoc.documentElement.getElementsByTagName('thumb').item(0).firstChild.data);
				document.getElementById('imgTapa').src = xmlDoc.documentElement.getElementsByTagName('thumb').item(0).firstChild.data;
				document.getElementById('linkTapa').href = xmlDoc.documentElement.getElementsByTagName('imagen').item(0).firstChild.data;
			}
        };
    }else{
        alert('Your browser can\'t handle this script');
        return;
    }
	xmlDoc.load('/xml_data/getTapa.xml');
}    