/* Codigo comun para abrir popups i ventanas del sitio */
abreHelpRSS = function() {
	leftX = (screen.availWidth-370)/2
	topY = (screen.availHeight-400)/2
	if(document.all) he = 400
	else he = 400

	helpRSS = window.open('noti_04.html', 'nextWin', 'left='+leftX+',top='+topY+',width=370,height='+he+',toolbar=no,scrollbars=yes,resizable=no,status=no').focus()
	
}


abreTaxand = function() {
	leftX = (screen.availWidth-510)/2
	topY = (screen.availHeight-497)/2
	if(document.all) he = 506
	else he = 497

	brand = window.open('p_taxand.html', 'nextWin', 'left='+leftX+',top='+topY+',width=508,height='+he+',toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}

abreAffinitas = function() {
	leftX = (screen.availWidth-510)/2
	topY = (screen.availHeight-497)/2
	if(document.all) he = 506
	else he = 497
	brand = window.open('p_affinitas.html', 'nextWin', 'left='+leftX+',top='+topY+',width=508,height='+he+',toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}


abreBranding = function(que) {
	leftX = (screen.availWidth-510)/2
	topY = (screen.availHeight-497)/2
	if(document.all) he = 506
	else he = 497

	brand = window.open(que, 'nextWin', 'left='+leftX+',top='+topY+',width=508,height='+he+',toolbar=no,scrollbars=no,resizable=no').focus()
}

abreContacto = function() {
	leftX = (screen.availWidth-464)/2
	topY = (screen.availHeight-420)/2
	brand = window.open('../contacto_01.asp', 'nextWin', 'left='+leftX+',top='+topY+',width=464,height=420,toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}

abreContactoPMA = function() {
	leftX = (screen.availWidth-465)/2
	topY = (screen.availHeight-535)/2
	brand = window.open('../formularioPMA.html', 'nextWin', 'left='+leftX+',top='+topY+',width=465,height=535,toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}

abreLegal = function() {
	if(document.all) he = 460
	else he = 455 
	
	leftX = (screen.availWidth-510)/2
	topY = (screen.availHeight-497)/2
	brand = window.open('../legal_01.html', 'nextWin', 'left='+leftX+',top='+topY+',width=508,height='+he+',toolbar=no,scrollbars=no,resizable=no,status=no').focus()
}


abrePortugal = function() {
	leftX = (screen.availWidth-436)/2
	topY = (screen.availHeight-124)/2
	popport = window.open('oficinas_popup.html', 'nextWin', 'left='+leftX+',top='+topY+',width=436,height=124,toolbar=no,scrollbars=no,resizable=no,status=no').focus()
	
}

abreBcn = function() {
	leftX = (screen.availWidth-436)/2
	topY = (screen.availHeight-124)/2
	popport = window.open('oficinas2_popup.html', 'nextWin', 'left='+leftX+',top='+topY+',width=436,height=124,toolbar=no,scrollbars=no,resizable=no,status=no').focus()
	
}

abreHome = function() {
	leftX = (screen.availWidth-436)/2
	topY = (screen.availHeight-124)/2
	popport = window.open('oficinas3_popup.html', 'nextWin', 'left='+leftX+',top='+topY+',width=436,height=124,toolbar=no,scrollbars=no,resizable=no,status=no').focus()
	
}


// Codigo que automatiza los rollovers de la pagina
RO = {
	init:	function() {
		var all = document.getElementsByTagName('img');
		var img = new Array()
		for(var i=0; i<all.length; i++) {
				var o = all[i].id;
				if(o.match(/rm/i)) { 
					var str = all[i].src.split(".gif")
					img[i] = new Image()
					img[i].src = str[0] + "r.gif"
					//stp += str[0] + "r.gif"
					all[i].onmouseover = RO.roll
					all[i].onmouseout = RO.out
				}
		}
		
	},
	
	roll: function() {
		var str = this.src.split(".gif")
		//alert(this.src.indexOf(".gif"))
		RO.old = str[0] + ".gif"
		this.src = str[0] + "r.gif"
	}, 
	out: function() {
		this.src = RO.old
	}
}
// funcion global para aņadir eventos al onload de la pagina
RO.addLoadEvent = function(f) { 
		var old = window.onload; 
		if (typeof old != 'function') window.onload = f 
		else { window.onload = function() { old(); f() }} 
} 

RO.addLoadEvent(RO.init)
 