/********************************** CATALOGO DE SOLUCIONES ****************************************/
function Detecta(solucio,espai){
	window.location.href='gamas.jsp?P_SOLUCION='+solucio+'&P_ESPACIO='+espai
}


var IdActual='Empotrar'
var IdAntiguo='Oculto'


////////////QUE ES SIMON HOLDING ////////////////////
var ActiuActual = "Habitaciones"
var ActiuAntic = "Habitaciones"

var Actiu2Actual = "Taula1"
var Actiu2Antic = "Taula1"
//////////////////////////////////////////////////////


function OcultarMapa(IdElemento){
	id = document.getElementById(IdElemento);
	id.style.display='none';
}

function MostrarMapa(IdElemento){
	id = document.getElementById(IdElemento);
	id.style.display='';
	}
	
function Comprueba(IdElemento){
	IdActual = IdElemento
	MostrarMapa(IdActual)
	OcultarMapa(IdAntiguo)
	if (IdAntiguo==IdActual){IdActual='Oculto';}
	IdAntiguo = IdActual
}
	
function EntrarDestacat(src) {
	src.bgColor="#ffffff";
	src.style.cursor="hand";
	}

function SortirDestacat(src) {
	src.bgColor='#F5F5F5';
	src.style.cursor="default";
	}

function EntrarProducte(src) {
	src.bgColor="#0A3770";
	src.style.cursor="hand";
	}
	
function SortirProducte(src) {
	src.bgColor='#D6DFE0';
	src.style.cursor="default";
	}

function EnviaMail() {
	location.href="mailto:hogar@simon-sa.es"
}

function entrar(src) {if(navigator.appName!="Netscape"){src.bgColor="#0A3770";src.style.cursor="default";}}
function sortir(src) {if(navigator.appName!="Netscape"){src.bgColor='#ffffff';src.style.cursor="default";}}
function sortir2(src) {if(navigator.appName!="Netscape"){src.bgColor='#D6DFE0';src.style.cursor="default";}}
function sortir3(src) {if(navigator.appName!="Netscape"){src.bgColor='#7D96B5';src.style.cursor="default";}}

function entrarlink(src) {if(navigator.appName!="Netscape"){src.bgColor="#E0E9F3";src.style.cursor="default";}}
function sortirlink(src) {if(navigator.appName!="Netscape"){src.bgColor='#ffffff';src.style.cursor="default";}}

function entrartecnica(src) {if(navigator.appName!="Netscape"){src.bgColor="#ffffff";src.style.cursor="default";}}
function sortirtecnica(src) {if(navigator.appName!="Netscape"){src.bgColor='#F0F4F9';src.style.cursor="default";}}

function entraravanzada(src) {if(navigator.appName!="Netscape"){src.bgColor="#E1E1E1";src.style.cursor="hand";}}
function sortiravanzada(src) {if(navigator.appName!="Netscape"){src.bgColor="#F5F5F5";src.style.cursor="default";}}

function entraravanzada_azul(src) {if(navigator.appName!="Netscape"){src.bgColor="#E0E9F3";src.style.cursor="hand";}}
function sortiravanzada_azul(src) {if(navigator.appName!="Netscape"){src.bgColor="#FFFFFF";src.style.cursor="default";}}


function CompruebaAvanzada()
	{
	// si es la primera vez que entra:
			setTimeout("Oculta();",3000)
	// si ya ha visto la búsqueda avanzada:
			//document.all.Busqueda.style.left=775;
	}
	
var x2=555; 
function Oculta()
	{
	document.all.Busqueda.style.left=x2;
	x2=x2+10;
	this.a=setTimeout('Oculta()',10);
	if (x2>775)
		{
		clearTimeout(this.a);
		x2=555;
		}
	}

function clickaravanzada(src,url) {
	if(navigator.appName!="Netscape")
		{
		src.bgColor='#F0F4F9';
		src.style.cursor="hand";
		parent.location.href=url}
	}

function clickar(src,url) {
	if(navigator.appName!="Netscape")
		{
		src.bgColor='#F0F4F9';
		src.style.cursor="hand";
		location.href=url}
	}

							 


function ocultarElemento(IdElemento){
	var Soportado = (document.getElementById || document.all);
	if(Soportado){id = document.getElementById(IdElemento);id.style.display='none';}
}
function mostrarElemento(IdElemento){
	var Soportado = (document.getElementById || document.all);
	if(Soportado){id = document.getElementById(IdElemento);id.style.display='';}
}

var cont=1;
var i=360;

function Incrementa(text,id)
	{
	document.getElementById(id).innerHTML = text;
	cont++;
	}

function Mueve()
	{
	MM_showHideLayers('Clip','','show')
	Clip.style.top=i;
	i=i-15;
	this.a=setTimeout('Mueve()',10);
	if (i<40)
		{
		clearTimeout(this.a);
		MM_showHideLayers('Clip','','hide')
		//alert('Hemos incluido un nuevo artículo a su “lista de referencias”\nRecuerde que podrá recuperar e imprimir su listado \nhaciendo click en “LISTA DE REFERENCIAS”.')
		i=360;
		}
	}

var x=775;
var x2=555;
function MuestraBAvanzada()
	{
	Busqueda.style.left=x;
	x=x-20;
	this.a=setTimeout('MuestraBAvanzada()',10);
	if (x<555)
		{
		clearTimeout(this.a);
		x=775;
		}
	}

function OcultaAvanzada()
	{
	parent.document.all.Busqueda.style.left=x2;
	x2=x2+20;
	this.a=setTimeout('OcultaAvanzada()',10);
	if (x2>775)
		{
		clearTimeout(this.a);
		x2=555;
		}
	}


function noScrollIE(){document.body.scroll="no"}

function scrollIE(){document.body.scroll="yes"}

function cssHorScrolls(val){document.body.style.overflowX = val}

function cssVerScrolls(val){document.body.style.overflowY = val}

/*************************** seccion tecnica ************************************************************/
function AbreLista()
	{
	var posX=screenLeft+20;
	var posY=screenTop+50;
	window.open('lista.htm','ventana', 'scrollbars=yes,width=638,height=420,left='+posX+',top='+posY+'')
	}
	
function AbreAcabados(serie)
	{
	var posX=screenLeft+20;
	var posY=screenTop+50;
	window.open('acabados'+serie+'.htm','ventana', 'scrollbars=yes,width=638,height=420,left='+posX+',top='+posY+'')
	}

function AbrePriv()
	{
	var posX=(screen.width/2)-395;
	var posY=(screen.height/2)-180;
	window.open('/privacidad.html','ventana', 'scrollbars=no,width=775,height=370,left='+posX+',top='+posY+'')
	}
	
////////////////////////////////////////////////
////                                        ////
////                                        ////
////                                        ////
////          S I M U L A D O R             ////
////                                        ////
////                                        ////
////                                        ////
////////////////////////////////////////////////
//---------------------------------------------------------------- Start Simulador
var d_paret;
var d_intermigs;
var d_marc;
var d_tecla;

function selec1(src)
{
	src.border=1;	
}

function selec2(src)
{
	src.border=0;	
}

function newpulsador(str1) 
{
	//var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	//var objecte = isInternetExplorer ? document.all.movie : document.movie;
	objecte = thisMovie("movie");
	objecte.SetVariable("img", str1);
	objecte.SetVariable("execute", "1");
	objecte.Play();
/*	objecte = document.getElementById("movie")
	objecte.SetVariable("img", str1);
	objecte.SetVariable("execute", "1");
	objecte.Play();*/
}


function newmarc(str1)
{
	//var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	//var objecte = isInternetExplorer ? document.all.movie : document.movie;
	//objecte = document.getElementById("movie")
	objecte = thisMovie("movie");
	objecte.SetVariable("img", str1);
	objecte.SetVariable("execute", "2");
	objecte.Play();
}
function newintermigs(str1)
{
	//objecte = document.getElementById("movie")
	//var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	//var objecte = isInternetExplorer ? document.all.movie : document.movie;
	objecte = thisMovie("movie");
	objecte.SetVariable("img", str1);
	objecte.SetVariable("execute", "3");
	objecte.Play();
}
function newparet(str1)
{
	//var objecte = thisMovie("movie");
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	var objecte = isInternetExplorer ? document.all.movie : document.movie;
	//alert(objecte.id);
	objecte.SetVariable("img", str1);
	objecte.SetVariable("execute", "4");	
	objecte.Play();
}
function thisMovie(movieName)
 {
  // IE y Netscape se refieren a la pelicula objeto de distinta forma
  // Esta función retorna la sintaxis apropiada dependiendo del navegador
  if (navigator.appName.indexOf ("Microsoft") !=-1) 
  {
    return window[movieName]
  } 
  else
  {
    return document[movieName]
  }
}

function solution(str)
{
	
	//objecte = document.getElementById("movie")
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	var objecte = isInternetExplorer ? document.all.movie : document.movie;
	objecte.SetVariable("execute", str);
	objecte.Play();
}

function EscribeCodigo(id,text)
	{
	document.getElementById(id).innerHTML = text;
	}

function EscribeHolding(id,text)
	{
	//window.parent.document.getElementById(id).innerHTML = text;
	document.getElementById(id).innerHTML = text;
	}
	
// Simulador

function addform(scr,val)
{
	obj = document.getElementById(scr)
	obj.value = val
}

function predefinit82()
{
	setTimeout("newmarc('82914-33.swf')", 1000);
	setTimeout("newparet('0005.jpg')", 500);
	setTimeout("newintermigs('82088-33.swf');",1500);
	setTimeout("newpulsador('82010-33.swf');",2000);
}

function predefinit27()
{
	setTimeout("newmarc('27603-34.swf')", 1000);
	setTimeout("newparet('0002.jpg')", 500);
	setTimeout("newintermigs('27907-32.swf');",1500);
	setTimeout("newpulsador('27101-34.swf');",2000);
}
function predefinit28()
{
	setTimeout("newmarc('28610-31.swf')", 1000);
	setTimeout("newparet('0005.jpg')", 500);
	//setTimeout("newintermigs('27916-32.swf');",1500);
	setTimeout("newpulsador('28010-31.swf');",2000);
}
function predefinit31()
{
	setTimeout("newmarc('31611-34.swf')", 1000);
	setTimeout("newparet('0005.jpg')", 500);
	//setTimeout("newintermigs('27916-32.swf');",1500);
	setTimeout("newpulsador('31101-34.swf');",2000);
}

function predefinit75()
{
	setTimeout("newmarc('75610-63.swf')", 1000);
	setTimeout("newparet('0002.jpg')", 500);
	setTimeout("newintermigs('75918-39.swf');",1500);
	setTimeout("newpulsador('75010-33.swf');",2500);
}

function predefinit88()
{
	setTimeout("newmarc('88612-38.swf')", 1000);
	setTimeout("newparet('0003.jpg')", 500);
	//setTimeout("newintermigs('75907-39.swf');",1500);
	setTimeout("newpulsador('88010-38.swf');",2000);
}

//---------------------------------------------------------------- End Simulador


// -------------------------------------------------------------------------- scroll
// *** COMMON CROSS-BROWSER COMPATIBILITY CODE ***

var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=navigator.appName=='Netscape'&&!isDOM?1:0;
var isOp=window.opera?1:0;
var isDyn=isDOM||isIE||isNS4;

function getRef(id, par)
{
 par=!par?document:(par.navigator?par.document:par);
 return isIE ? par.all[id] :
  (isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
  (isNS4 ? par.layers[id] : null));
}

function getSty(id, par)
{
 var r=getRef(id, par);
 return r?(isNS4?r:r.style):null;
}

if (!window.LayerObj) var LayerObj = new Function('id', 'par',
 'this.ref=getRef(id, par); this.sty=getSty(id, par); return this');
function getLyr(id, par) { return new LayerObj(id, par) }

function LyrFn(fn, fc)
{
 LayerObj.prototype[fn] = new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; ' +
  'with (this) { '+fc+' }');
}
LyrFn('x','if (!isNaN(p)) sty.left=p+px; else return parseInt(sty.left)');
LyrFn('y','if (!isNaN(p)) sty.top=p+px; else return parseInt(sty.top)');
LyrFn('w','if (p) (isNS4?sty.clip:sty).width=p+px; ' +
 'else return (isNS4?ref.document.width:ref.offsetWidth)');
LyrFn('h','if (p) (isNS4?sty.clip:sty).height=p+px; ' +
 'else return (isNS4?ref.document.height:ref.offsetHeight)');
LyrFn('vis','sty.visibility=p');

// *** MAIN SCROLLER FUNCTIONS ***

function ilsLoad(pageToLoad) { with (this)
{
 if (!isDyn) return;

 // Pre-existing page? Hide it, and reset the div object to null.
 if (div)
 {
  (isNS4?div:divCont).vis('hidden');
  div = null;
 }

 // Record this as the active page, scroll back to 0 position.
 pageName = pageToLoad;
 scrollTo(0, 0);
}}

function ilsScrollTo(xPos, yPos) { with (this)
{
 if (!pageName || !isDyn) return;

 // Get references and set up divs....
 if (!div)
 {
  // Get a reference to either the very outer ILAYER (NS4), or this page's container (others).
  divCont = getLyr(myName + '_Container' + (isNS4?'':'_'+pageName));
  if (!divCont.ref) return;
 
  // In NS4, record ILAYER's dimensions as the scroller dimensions now.
  if (isNS4) { scrW = divCont.sty.clip.width; scrH = divCont.sty.clip.height }

  // The inside page div in question that is actually moved within its container(s).
  div = getLyr(myName + '_' + pageName, isNS4?divCont.ref:null);
  if (!div.ref) return;

  // We show the inner page divs themselves in NS4, or their containers in others.
  (isNS4?div:divCont).vis('visible');

  // Add mousewheel support in IE6+, you may wish to alter the scrolling amount or direction.
  if (isIE) div.ref.onmousewheel = new Function(myName +
   '.scrollBy(0,event.wheelDelta/-3); return false');
 }

 // Find the dimensions of the scrolling content. Opera 5 doesn't want to return width of
 // in-scroller page content, so we let it scroll right forever (Opera 6 is fine).
 // If you have many vocal Opera 5 users, perhaps hardcode page widths in somewhere.
 
 var divW = div.w(), divH = isOp?div.sty.pixelHeight:div.h();

 // Check the scroll position for content edges & scroll!

 if (xPos + scrW > divW) xPos = divW - scrW;
 if (xPos < 0) xPos = 0;
 scrLeft = xPos;
 div.x(0 - parseInt(xPos));
 
 if (yPos + scrH > divH) yPos = divH - scrH;
 if (yPos < 0) yPos = 0;
 scrTop = yPos;
 div.y(0 - parseInt(yPos));
}}


function ilsScrollBy(xDiff, yDiff) { with (this)
{
 // Scrolls the div by a certain amount of pixels.
 if (!pageName) return;
 scrollTo(scrLeft + xDiff, scrTop + yDiff);
}}


function ilsSetScroll(newX, newY, steps) { with (this)
{
 if (!pageName || !isDyn) return;

 // Alter scroller velocity in steps to the new speed, set timer interval.
 stepsLeft = steps;

 if (timer) { clearInterval(timer); timer = null }
 timer = setInterval('with (' + myName + ') { if (stepsLeft > 0) { xSpeed += ' +
  ((newX-xSpeed)/steps) + '; ySpeed += ' + ((newY-ySpeed)/steps) + '; stepsLeft-- } ' +
  'scrollBy(xSpeed, ySpeed) }', 50);
}}

// *** IE/NS6/OPERA DIV CONSTRUCTION FUNCTIONS ***

function ilsStartArea(w, h) { with (this)
{
 // Record dimensions of scrolling area, and write out container div.
 scrW = w;
 scrH = h;
 document.write('<div style="position: relative; width: '+w+'px; height: '+h+'px; overflow: hidden">');
}}

function ilsStartPage(pN) { with (this)
{
 document.write('<div id="' + myName + '_Container_' + pN + '" style="position: absolute; ' +
  'width: '+scrW+'px; height: '+scrH+'px; clip:rect(0px '+scrW+'px '+scrH+'px 0px); ' +
  'overflow: hidden; visibility: hidden"><div id="' + myName + '_' + pN + '" style="position: ' +
  (isIE?'absolute':'relative') + '">');
}}

// *** SCROLLER OBJECT SETUP ***

function InlineScrollbox(myName)
{
 // These are the properties and function bindings used.

 this.myName = myName;
 this.divCont = null;
 this.div = null;
 this.pageName = '';

 this.scrW = this.scrH = this.scrTop = this.scrLeft = 0;
 this.xSpeed = this.ySpeed = this.stepsLeft = 0;

 this.timer = 0;

 this.load = ilsLoad;
 this.scrollTo = ilsScrollTo;
 this.scrollBy = ilsScrollBy;
 this.setScroll = ilsSetScroll;
 this.startArea = ilsStartArea;
 this.startPage = ilsStartPage;
}

// **** START EDITING HERE ****


// First, we create one or more scroller objects. These correspond to a set of layers/divs
// beneath in the page and bundle together all the properties we need to scroll them.

// Syntax: var scrollerName = new InlineScrollbox('scrollerName');

var scr = new InlineScrollbox('scr');
//var anotherScroller = new InlineScrollbox('anotherScroller');


// Then set them to activate on page load like this (backing up old onload event...).
// Pass the name of a scroller page you want to show first (see below for the pages).

var ilsOldOL = window.onload;
window.onload = function()
{
 if (ilsOldOL) ilsOldOL();

 scr.load('Page1');
 //anotherScroller.load('PageNameHere');
}


// A small function that refreshes NS4 on horizontal resize, just leave this here.
var nsWinW = window.innerWidth, nsWinH = window.innerHeight;
function ns4BugCheck()
{
 if (isNS4 && (nsWinW!=innerWidth || nsWinH!=innerHeight)) history.go(0);
}

var ilsOldOR = window.onresize;
window.onresize = function()
{
 if (ilsOldOR) ilsOldOR();
 ns4BugCheck();
}

// -------------------------------------------------------------------------- fin scroll

function MM_SwapImagesAll1()
{
MM_swapImage('Image25','','../../images/HomePage/nav/Secc01r.gif',1)
MM_swapImage('Image26','','../../images/HomePage/nav/Secc02.gif',1)
MM_swapImage('Image21','','../../images/HomePage/nav/Secc03.gif',1)
MM_swapImage('Image22','','../../images/HomePage/nav/Secc04.gif',1)
MM_showHideLayers('CapaSoluciones','','hide','TituloSoluciones','','hide')
MM_showHideLayers('FonsSoluciones','','hide')
}
function MM_SwapImagesAll2()
{
MM_swapImage('Image25','','../../images/HomePage/nav/Secc01.gif',1)
MM_swapImage('Image26','','../../images/HomePage/nav/Secc02r.gif',1)
MM_swapImage('Image21','','../../images/HomePage/nav/Secc03.gif',1)
MM_swapImage('Image22','','../../images/HomePage/nav/Secc04.gif',1)
MM_showHideLayers('CapaSoluciones','','hide','TituloSoluciones','','hide')
MM_showHideLayers('FonsSoluciones','','hide')
}
function MM_SwapImagesAll3()
{
MM_swapImage('Image25','','../../images/HomePage/nav/Secc01.gif',1)
MM_swapImage('Image26','','../../images/HomePage/nav/Secc02.gif',1)
MM_swapImage('Image21','','../../images/HomePage/nav/Secc03r.gif',1)
MM_swapImage('Image22','','../../images/HomePage/nav/Secc04.gif',1)
MM_showHideLayers('CapaSoluciones','','hide','TituloSoluciones','','hide')
MM_showHideLayers('FonsSoluciones','','hide')
}
function MM_SwapImagesAll4()
{
MM_swapImage('Image25','','../../images/HomePage/nav/Secc01.gif',1)
MM_swapImage('Image26','','../../images/HomePage/nav/Secc02.gif',1)
MM_swapImage('Image21','','../../images/HomePage/nav/Secc03.gif',1)
MM_swapImage('Image22','','../../images/HomePage/nav/Secc04r.gif',1)
MM_showHideLayers('CapaSoluciones','','hide','TituloSoluciones','','hide')
MM_showHideLayers('FonsSoluciones','','hide')
}
function alertDialog(num)
{
showModalDialog("Dialog.htm?"+num, "aviso", "resizable: no; help: no; status: no; scroll: no; dialogWidth:250px; dialogHeight:250px: align:center;");
}
function getURL(url)
{
	location.href=url
}


////////////////////// animación 3d

function changev(swf)
{
	//obj = document.getElementById("movie")
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	var obj = isInternetExplorer ? document.all.movie : document.movie;
	obj.loadMovie(0,"videos/"+swf)
}

/////////////////QUE ES SIMON HOLDING ////////////////////////////////////////////////////

function Ocultar(Actiu){
	id = document.getElementById(Actiu);
	id.style.display='none';
}

function Mostrar(Actiu){
	id = document.getElementById(Actiu);
	id.style.display='';
	}
	
	function Comprova(Actiu){
	ActiuActual = Actiu
	Mostrar(ActiuActual)
	if (ActiuAntic!=ActiuActual){Ocultar(ActiuAntic)}
	ActiuAntic = ActiuActual
	}
function Comprova2(Actiu2){
	Actiu2Actual = Actiu2
	Mostrar(Actiu2Actual)
	if (Actiu2Antic!=Actiu2Actual){Ocultar(Actiu2Antic)}
	Actiu2Antic = Actiu2Actual
	}
	
/////////////////////////////////////////////////////////////////////////
