

function RenderPopup(windowsource, windowname, width, height, scrollbars, directories, location, menubar, status, toolbar, resizable) {
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	var windowfeatures = 'width=' + width +
	',top='+wint+',left='+winl+',height=' + height + ',directories=' + directories +
	',location=' + location + ',menubar=' + menubar +
	',scrollbars=' + scrollbars + ',status=' + status +
	',toolbar=' + toolbar + ',resizable=' + resizable;
	window.open(windowsource, windowname, windowfeatures);
}
/*
función que escribe el flash en el html para evitar el problema de iExplorer del 11 de abril de 2006
*/

function insertFlash(movie,ancho,alto){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ancho+'" height="'+alto+'">');
document.write('<param name="movie" value="'+movie+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="menu" value="false">');
document.write('<embed src="'+movie+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'" menu="false"></embed>');
document.write('</object>');
}

//////////////
//////////////////
//////------>>>>>> Funciones para el scroll del menu -------------


vbaja=true;
vsube=true;
function sube(valor){
		if (valor){
			vbaja=true;
			var alturacapa=document.getElementById("scrollIn").offsetHeight;
			top1= new String(document.getElementById("scrollIn").style.top);
			var pos=top1.indexOf("px");
			top1=parseInt(top1.substring(0,pos));
			if ((0-top1+173)<alturacapa) {
				document.getElementById("scrollIn").style.top = top1 -10;
			} else {
				vsube=false;
			}
			if (vsube) {
					setTimeout("sube(true)",100);
			} /*else {
				vsube=true;
			}*/
		}
}

/// Funciones Scroll

function baja(valor){
		if (valor){
			vsube=true;
			var alturacapa=document.getElementById("scrollIn").offsetHeight;
			top1= new String(document.getElementById("scrollIn").style.top);
			var pos=top1.indexOf("px");
			top1=parseInt(top1.substring(0,pos));
			if (top1<0) {
				document.getElementById("scrollIn").style.top = top1 +10;
			} else {
				vbaja=false;
			}
			if (vbaja) {
					setTimeout("baja(true)",100);
			} /*else {
				vbaja=true;
			}*/

			//if ((0-top1+520)>alturacapa) document.getElementById("scrollIn").style.top = top1 +15;
		}
}

function para(valor){
	
	if (valor==1)	vbaja=false;
	if (valor==2)	vsube=false;
	
}

////////////////////////////////////

// Rollovers de las flechas

//---->>>>> Funciones cambia imagen del menu superior (efecto rollover)

function cambia_imagen_arriba(imagen){
		document.getElementById('adalt').src=imagen;
}
function cambia_imagen_abajo(imagen){
		document.getElementById('abaix').src=imagen;
}

//

// Funcion Popup 

ventanas=new Array();
function abre(destino,name,ancho,alto){
	//alert(destino);
	anchura="";
	altitud="";
	anchura+="width=";
	anchura+=ancho;
	altitud+="height=";
	altitud+=alto;
	tamany="";
	tamany=anchura;
	tamany+=",";
	tamany+=altitud;
            if (ventanas[name]!=undefined) ventanas[name].close();{	
	ventanas[name]=window.open(destino,name,tamany);
			}			
}

// imagen de las noticias

function abreme(esta,titol){
	
	abre('pops/imagen.php?imagen='+esta+'&titulo='+titol,'imagen',100,100);
	
}

function tamany(ancho,alto){	
	
	window.moveTo(0,0);	
	
	if (document.all){
	  top.window.resizeTo(ancho,alto);
	}else if (document.layers||document.getElementById){
				  
		top.window.outerHeight = alto;
		top.window.outerWidth = ancho;
		
	}

	
}
