	//*************************************************************************
	// Ir al Departamento
	//*************************************************************************
	function f_IrAlDepto(){
	url = document.frm_listDeptos.cbo_listDeptos.options[document.frm_listDeptos.cbo_listDeptos.selectedIndex].value
	if (url != "no") window.open('about:blank').window.location = url;
	}
	//*************************************************************************
	// Ir al Clima de ru region
	//*************************************************************************
	function Alclima(){
	url = document.clima.regionesclima.options[document.clima.regionesclima.selectedIndex].value
	if (url != "no") window.open('about:blank').location = url;
	}
	
	//funcion para buscador
	function envia(t)
		{	if (t=="")
			{
				alert("Debe ingresar la palabra a buscar.");
			}
			else
			{
				document.fbuscar.submit();
			}
		}

		function valida()
		{	if (document.fbuscar.q.value=="")
			{
				alert("Debe ingresar la palabra a buscar.");
				return false;
			}
			else
				return true;
		}		

	//abrir una ventana nueva o popup
        function abrir_ventana(foto,ancho,alto)
                {
                nuevaVentana = window.open (foto,"newwindow0","height="+alto+",width="+ancho+", resizable=0,noresize=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto")
                }
        //abrir una ventana nueva o popup para encuesta
        function abrir_encuesta(foto,ancho,alto)
                {
                nuevaVentana1 = window.open (foto,"newwindow1","height="+alto+",width="+ancho+", resizable=0,noresize=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto")
                }

        //enviar una noticia
        function enviar_noticia(foto,ancho,alto)
                {
                nuevaVentana2 = window.open (foto,"newwindow2","height="+alto+",width="+ancho+", resizable=0,noresize=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto")
                }
        //imprimir una noticia
        function imprimir_noticia(foto,ancho,alto)
                {
                nuevaVentana3 = window.open (foto,"newwindow3","height="+alto+",width="+ancho+", resizable=0,noresize=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes")
                }
        //imprimir un chiste
        function abrir_ventana_chiste(foto,ancho,alto)
                {
                nuevaVentana4 = window.open (foto,"newwindow4","height="+alto+",width="+ancho+", resizable=1,noresize=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,left=200,top=200")
                }

         //cambio de colores de las celdas del menu
         function uno(src,color_entrada) {
                src.bgColor=color_entrada;src.style.cursor="hand";
        }
        function dos(src,color_default) {
                src.bgColor=color_default;src.style.cursor="default";
        }
        
	//*************************************************************************
	// área de Impresión de noticias
        
	function Imprimir()
		{
		var dc = document.getElementById;
		var contenido =  dc('noticiacompleta').innerHTML;
		var impDoc1 =window.open('','imprime',areaimpre(650,435));
		var imp1 = '<html><head>';
			imp1 = imp1 + '<title>Piura Online | &Aacute;rea de Impresi&oacute;n de noticias</title><meta HTTP-EQUIV="Expires" CONTENT="0"><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">';
			imp1 = imp1	+ '<link href="http://www.cipca.org.pe/cipca/noticias/stilo.css" type="text/css" rel="stylesheet" title="estilos"></head>';
			imp1 = imp1	+ '<body>';
			imp1 = imp1	+ '<table width="100%" border="0" style="padding: 0px" cellspacing="0" cellpadding="10" bgcolor="#ffffff">';
			imp1 = imp1	+ '<tr><td align="right" valign="center" bgcolor="#ffffff"><table border="0" cellspacing="0" style="padding: 0px" cellpadding="0" bgcolor="#ffffff" align="right" align="top"><tr><td align="center"><a href="javascript:window.print();"><img border="0" width="70" height="20" alt="Imprimir." src="http://www.piuraonline.org/noticias/images/boton_imprimir.gif" hspace="0" vspace="0"></a></td><td align="center"><a href="javascript:self.close();"><img border="0" width="53" height="20" alt="Cerrar." src="http://www.piuraonline.org/noticias/images/boton_cerrar.gif" hspace="0" vspace="0"></a></td></tr></table></td></tr>';
			imp1 = imp1	+ '<tr><td bgcolor="#ECF4DF" style="padding: 0px"><img src="http://www.piuraonline.org/noticias/images/topimp.gif"></td></tr>';
			imp1 = imp1	+ '<tr><td>' + contenido + '</td></tr>';
			imp1 = imp1	+ '<tr><td id="pieimpresion"><hr color="#6CB72A"> \n &nbsp;&nbsp;&nbsp;&copy; PiuraOnline - CEDIR - CIPCA - Programaci&oacute;n y Dise&ntilde;o -PESZ- todos los derechos reservados 2006.</td></tr></table>\n';
			imp1 = imp1	+ '</body>\n</html>';
		impDoc1.document.write(imp1);
		impDoc1.document.close();
		}

	function areaimpre(ancho,alto)
		{
		var objWin = new Object();
		objWin.width = ancho;
		objWin.height = alto;
		if (navigator.appName == "Netscape")
		{
			objWin.left = window.screenX + ((window.outerWidth - objWin.width) / 2);
			objWin.top = window.screenY + ((window.outerHeight - objWin.height) / 2);
			var atributo = 'screenX=' + objWin.left + ',screenY=' + objWin.top + ',resizable=no,width=' + objWin.width + ',height=' + objWin.height + ',scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,directories=no';
		}
		else if (document.all)
		{
			objWin.left = ((screen.width-objWin.width) / 2);
			objWin.top = ((screen.height-objWin.height) / 2);
			var atributo = 'left=' + objWin.left + ',top=' + objWin.top + ',resizable=no,width=' + objWin.width + ',height=' + objWin.height + ',scrollbars=yes,menubar=no,location=no,toolbar=no,status=no,directories=no';
		}
		return atributo;
		}
	//*************************************************************************
	
//Empieza texto ampliar y reducir - FONT SIZE MANAGEMENT 
function 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=FindObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function ChangeProp(objName,x,theProp,theValue) { //v6.0
var obj = FindObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}

function LoadActualFontSize() {
tempArray = document.cookie.split(";");
for (tA = 0; tA < tempArray.length; tA++){
if (tempArray[tA].indexOf('fontSize') > -1){
fontSizeValue = tempArray[tA].split("=")
ACTUAL_FONTSIZE = parseInt(fontSizeValue[1]);
}
}
}

function SaveActualFontSize() {
var expire = new Date ();
expire.setTime (expire.getTime() + (6000 * 24 * 3600000));
expire = expire.toGMTString();
document.cookie="fontSize="+ACTUAL_FONTSIZE+"; path=/; expires="+expire;
}

function Ampliar() {
ACTUAL_FONTSIZE = ACTUAL_FONTSIZE+1;
if (ACTUAL_FONTSIZE > LARGEST_FONTSIZE) { ACTUAL_FONTSIZE = LARGEST_FONTSIZE }
ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
SaveActualFontSize();
}

function Reducir() {
ACTUAL_FONTSIZE = ACTUAL_FONTSIZE-1
if (ACTUAL_FONTSIZE < SMALLEST_FONTSIZE) { ACTUAL_FONTSIZE = SMALLEST_FONTSIZE }
ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
SaveActualFontSize();
}

ACTUAL_FONTSIZE = 12;
SMALLEST_FONTSIZE = 12;
LARGEST_FONTSIZE = 22;
//Termina texto ampliar y reducir


//funcion ampliar imagenes de la semana
function ampliar(numImagen)
{
	var URLimagen = "imgsemana/ampliar.asp?numImg=" + numImagen;
	mostrarDatos(URLimagen,'imagenes',600,420,'no');
}

function mostrarDatos(url,nombre,ancho,alto,scroll)
{
	var objWin = new Object();
	objWin.width = ancho;
	objWin.height = alto;
	if (navigator.appName == "Netscape")
	{
		objWin.left = window.screenX + ((window.outerWidth - objWin.width) / 2);
		objWin.top = window.screenY + ((window.outerHeight - objWin.height) / 2);
		var atributo = 'screenX=' + objWin.left + ',screenY=' + objWin.top + ',resizable=no,width=' + objWin.width + ',height=' + objWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	}
	else if (document.all)
	{
		objWin.left = ((screen.width-objWin.width) / 2);
		objWin.top = ((screen.height-objWin.height) / 2);
		var atributo = 'left=' + objWin.left + ',top=' + objWin.top + ',resizable=no,width=' + objWin.width + ',height=' + objWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	}
window.open(url,nombre,atributo);
}
