// JavaScript Document

var gradientshadow={}
gradientshadow.depth=6 //Depth of shadow in pixels
gradientshadow.containers=[]

gradientshadow.create=function(){
var a = document.all ? document.all : document.getElementsByTagName('*')
for (var i = 0;i < a.length;i++) {
	if (a[i].className == "shadow") {
		for (var x=0; x<gradientshadow.depth; x++){
			var newSd = document.createElement("DIV")
			newSd.className = "shadow_inner"
			newSd.id="shadow"+gradientshadow.containers.length+"_"+x //Each shadow DIV has an id of "shadowL_X" (L=index of target element, X=index of shadow (depth) 
			if (a[i].getAttribute("rel"))
				newSd.style.background = a[i].getAttribute("rel")
			else
				newSd.style.background = "black" //default shadow color if none specified
			document.body.appendChild(newSd)
		}
	gradientshadow.containers[gradientshadow.containers.length]=a[i]
	}
}
gradientshadow.position()
window.onresize=function(){
	gradientshadow.position()
}
}

gradientshadow.position=function(){
if (gradientshadow.containers.length>0){
	for (var i=0; i<gradientshadow.containers.length; i++){
		for (var x=0; x<gradientshadow.depth; x++){
  		var shadowdiv=document.getElementById("shadow"+i+"_"+x)
			shadowdiv.style.width = gradientshadow.containers[i].offsetWidth + "px"
			shadowdiv.style.height = gradientshadow.containers[i].offsetHeight + "px"
			shadowdiv.style.left = gradientshadow.containers[i].offsetLeft + x + "px"
			shadowdiv.style.top = gradientshadow.containers[i].offsetTop + x + "px"
		}
	}
}
}

if (window.addEventListener)
window.addEventListener("load", gradientshadow.create, false)
else if (window.attachEvent)
window.attachEvent("onload", gradientshadow.create)
else if (document.getElementById)
window.onload=gradientshadow.create

//Contents for menu 1
var menu1=new Array()

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="./Producto1.html">tabiques</a>'
menu2[1]='<a href="./Producto2.html">trasdosados</a>'
menu2[2]='<a href="./Producto3.html">reformas comerciales</a>'
menu2[3]='<a href="./Producto4.html">techos continuos</a>'
menu2[4]='<a href="./Producto5.html">techos registrables</a>'
menu2[6]='<a href="./Producto7.html">aislamientos</a>'

var menu3=new Array()

var menu4=new Array()

var menu5=new Array()


var menu6=new Array()

var oficinas=new Array()
oficinas[0]=' <a href="">Grupo Damm (Madrid)</a>'
oficinas[1]=' <a href="">Aukor (Ourense) </a>       '
oficinas[2]=' <a href="">Grupo DHO (Madrid) </a>         '
oficinas[3]=' <a href="">Dursa (Oviedo)</a>             '
oficinas[4]=' <a href="">Samoa (Gijón)</a>              '


var hoteles=new Array()
hoteles[0]=' <a href="">Benalup Costa Golf (Cádiz)</a> '
hoteles[1]=' <a href="">Valentín Santipetri (Cádiz)</a>'
hoteles[2]=' <a href="">Pazo dos Escudos (Vigo)</a> '
hoteles[3]=' <a href="">Hesperia Hermosilla (Madrid)</a> '
hoteles[4]=' <a href="">HUSA Santodomingo (Oviedo)</a> '

var centros=new Array()
centros[0]=' <a href="">Travesía (Vigo)</a> '
centros[1]=' <a href="">Costa Sol (Torremolinos)</a>'
centros[2]=' <a href="">Carrefour Pulianas (Granada)</a> '
centros[3]=' <a href="">Carrefour Ponferrada (Ponferrada)</a> '

var naves=new Array()
naves[0]=' <a href="">Edificio Plaintec (Tui-Pontevedra)</a> '

var puertos=new Array()
puertos[0]=' <a href="">Terminal T4 Barajas (Madrid)</a> '
puertos[1]=' <a href="">Terminal T1 Barajas (Madrid)</a> '
puertos[2]=' <a href="">Aeropuerto de Málaga</a> '


var locales=new Array()
locales[0]=' <a href="">Diversos establecimientos</a>      '
locales[1]=' <a href="">comerciales en España y</a>        '
locales[2]=' <a href="">Portugal de las cadenas:</a>       '
locales[3]=' <a href="">&nbsp;</a>    '
locales[4]=' <a href="">Blanco, C&A, Adolfo</a>            '
locales[5]=' <a href="">Dominguez, Carolina Herrera,</a>   '
locales[6]=' <a href="">H&M, Vitaldent, Clínicas</a>       '
locales[7]=' <a href="">Baviera, Massimo Dutti.</a>        '

		
var menuwidth='165px' //default menu width
var menubgcolor='rgb(204,226,244)'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")+10
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function dropdownmenu1(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")+150
dropmenuobj.y=getposOffset(obj, "top")-90
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}


function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

function Abrir_Ventana(theURL,w,h, winName) {

var windowprops ="top=0,left=0,toolbar=no,location=no,status=no, menubar=no,scrollbars=no, resizable=no,width=" + w + ",height=" + h;

window.open(theURL,winName,windowprops);
} 


if (hidemenu_onclick=="yes")
document.onclick=hidemenu
