var titulo;
var formu;
var arrNot;
var arrT = new Array();
var arrC = new Array();
var posit=0;
var titulo;
var singletext=new Array();
var actual;
var to;
var newwin;
var codN=0;

function launchwin(winurl,winname,winfeatures,cod){
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if(cod){
		codN=cod;
	}

	if(javascript_version > 1.0){
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250); 
	}
}

function noticia(num){
	alert("Noticia: "+num);
}



function addNot(titul,enlace,cod){
	arrT[arrT.length]="<a href='../noticias/index.php?cod="+cod+"' target='blank'><span class='MenuNoticia'>"+titul+"</span></a>";	
}



function cargaForm(formulario){
	formu = formulario;
}



function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

// -->



function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}





function abreVentana(theURL,winName,features) {
		nuevaVentana = window.open(theURL,winName,features);
		nuevaVentana.window.focus();
}



var vImagen;



function verImagen(srcImagen){
	if(ventanaAbierta(vImagen)){
		vImagen.close()
	}

	var imagen=new Image()
	imagen.src=srcImagen
	var anchoVentana=Math.min(imagen.width+2,400)
	var altoVentana=Math.min(imagen.height+25);
	var dimVentana="width="+anchoVentana+",height="+altoVentana
	vImagen=window.open('','',dimVentana)
	vImagen.document.writeln('<html>')
	vImagen.document.writeln('<head>')
	vImagen.document.writeln('<title>')
	vImagen.document.writeln('Noticias OCULSUR <Imágen ampliada>')
	vImagen.document.writeln('</title>')
	vImagen.document.writeln('</head>')
    vImagen.document.writeln('<link rel="stylesheet" href="/noticiasOculsur/css/noticiasCSS.css" type="text/css"><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">')
	vImagen.document.writeln('</head>')
	vImagen.document.writeln('<div id="imagen" style="position:absolute; z-index:1">')
	vImagen.document.writeln('<table width="'+anchoVentana+'" height="'+altoVentana+'" class="texto" cellpadding="0" cellspacing="0">')
	vImagen.document.writeln('<tr>')
	vImagen.document.writeln('<td align="center" valign="middle"><img src="'+srcImagen+'" width="'+anchoVentana+'"></td>')
	vImagen.document.writeln('</tr>')
	vImagen.document.writeln('<tr>')
	vImagen.document.writeln('<td align="center" valign="middle" class="textoLink" onClick="window.close()">CERRAR</td>')
	vImagen.document.writeln('</tr>')
	vImagen.document.writeln('</head>')
	vImagen.document.writeln('</head>')
	vImagen.document.writeln('</head>')
	vImagen.document.writeln('</table>')
//	vImagen.document.writeln(dimVentana)
	vImagen.document.writeln('</div>')
    vImagen.document.writeln('</body>') 
    vImagen.document.writeln('</html>') 
    vImagen.document.close()
}



function ventanaAbierta(v){
	if(!v) {return false}
	else if(v.closed){return false}
	else {return true}
}



function moverCuadroInfi(obj){
	var tem=100;
	var puntos=2;
	var e=document.getElementById(obj);
	var c = document.getElementById(e.parentElement.id);
	var tm = e.offsetTop;
	var tf = c.offsetTop;
	var lm = e.offsetHeight;
	var lf = c.offsetHeight;
	if(tm<=-lm){
		tm=lf;
	}else{
		tm=tm-puntos;
	}
	e.style.top = tm+'px';
	to = setTimeout('moverCuadroInfi("'+obj+'")',tem);
}





function vNoticia(cod){
	abreVentana('../noticiasOculsur/?fCodNoticia='+cod,cod,'height=550,width=725');
}



function pararCuadro(){
	clearTimeout(to);
}

//-->

