function abrir_pdf(url)
{
	ancho=640;
	largo=480;
	nuevo_pdf = window.open("","nuevo_pdf","width="+ancho+",height="+largo+",resizable=yes");
	nuevo_pdf.location.href = url;
	nuevo_pdf.focus();
}

function abrir_sawindow(url)
{
	ancho=400;
	largo=400;
	izq=(screen.width-ancho)/2;
	sup=(screen.height-largo)/4;
	nuevo_saw = window.open("","nuevo_saw","width="+ancho+",height="+largo+",resizable=no,left="+izq+",top="+sup);
	nuevo_saw.location.href = url;
	nuevo_saw.focus();
}

function abrir_sbwindow(url,coef)
{
	ancho=500*coef;
	largo=580*coef;
	izq=(screen.width-ancho)/2;
	sup=(screen.height-largo)/4;
	nuevo_saw = window.open("","nuevo_saw","width="+ancho+",height="+largo+",resizable=no,left="+izq+",top="+sup);
	nuevo_saw.location.href = url;
	nuevo_saw.focus();
}


//Hide status bar msg javascript

function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus


function cambiamail(buzon){
var res="";
for (var n=0;n<buzon.length;n++)
res+=String.fromCharCode(buzon.charCodeAt(n));
if (res.indexOf('@')<0)
res=res+'@'+'rogu.es'
location="mail"+"to:"+res;
}

function submitform(fname)
{
	document.getElementById(fname).submit();
}


function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

function fnDispThis(active)
{
constMaxItem=2;
//alert(active);
for (i=1; i < constMaxItem+1; i++)
	{
	if (i!=active)
		{
		//alert(i);
		//document.all("sub"+i).style.display="NONE"
		document.getElementById("sub"+i).style.display="NONE"
		}
	else
		{
		//alert(i);
		//document.all("sub"+active).style.display="BLOCK"
		document.getElementById("sub"+i).style.display="BLOCK"
		}
	}
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
 
    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
     
}
 
//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
 
function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it invisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 100, millisec);
    } else {
        opacity(id, 100, 0, millisec);
    }
}

//the next 3 lines are browser detection for user-agent DOMS
ns4 = (document.layers) ? true:false //required for Functions to work
ie4 = (document.all) ? true:false //required for Functions to work
ng5 = (document.getElementById) ? true:false //required for Functions to work

function hideSec(n) {
if (ng5) document.getElementById(n).style.visibility = "hidden"
else if (ns4) document.layers[n].visibility = "hide"
else if (ie4) document.all[n].style.visibility ="hidden"

}

function showSec(n,w,h) {
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
//TopPosition = (screen.height) ? (screen.height-h)/4 : 0;	
TopPosition = 40;	
hideSec(n);
if (ng5) {
		document.getElementById(n).style.visibility = "visible";
		document.getElementById(n).style.left = LeftPosition;
		document.getElementById(n).style.top = TopPosition;	
	}
else if (ns4) {
		document.layers[n].visibility = "show";
		document.layers[n].left = LeftPosition;
		document.layers[n].top=TopPosition;
	}
else if (ie4) {
		document.all[n].style.visibility = "visible";
		document.all[n].style.left=LeftPosition;			
		document.all[n].style.top=TopPosition;			
	}

/*shiftOpacity('sec' + n, 0); return false;
shiftOpacity('sec' + n, 2000); return false;*/
changeOpac(0,n);
shiftOpacity(n, 1000); return false;
}

function showAllSec(n) {
if (ng5) document.getElementById(n).style.visibility = "visible";
else if (ns4) document.layers[n].visibility = "show";
else if (ie4) document.all[n].style.visibility = "visible";
}

