// JavaScript Document
	function activaenlace(idenla){
	var enlace=document.getElementById(idenla);
	TB_ShowObj(enlace);
	}

function resolucion(){
 if (screen.height <= 864 || screen.width <= 1152 )
 {
 
//  aqui va lo que quieras que haga cuando no sea la resolucion deseada en este caso 768 x 1024
document.getElementById("principal").style.marginTop = "0px";
document.getElementById("principal").style.top = "0px";
 }
}


function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}


function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



//TOOLTIP

var tooltip=function(){
	var id = 'tt';
	var top = -10;
	var left = 10;
	var maxw = 300;
	var speed = 10;
	var timer = 50;
	var endalpha = 85;
	var alpha = 0;
	var tt,t,c,b,h;
	var ie = document.all ? true : false;
	return{
		show:function(v,w){
			if(tt == null){
				tt = document.createElement('div');
				tt.setAttribute('id',id);
				t = document.createElement('div');
				t.setAttribute('id',id + 'top');
				c = document.createElement('div');
				c.setAttribute('id',id + 'cont');
				b = document.createElement('div');
				b.setAttribute('id',id + 'bot');
				tt.appendChild(t);
				tt.appendChild(c);
				tt.appendChild(b);
				document.body.appendChild(tt);
				tt.style.opacity = 0;
				tt.style.filter = 'alpha(opacity=0)';

				document.onmousemove = this.pos;
			}
			tt.style.display = 'block';
			c.innerHTML = v;
			tt.style.width = w ? w + 'px' : 'auto';
			if(!w && ie){
				t.style.display = 'none';
				b.style.display = 'none';
				tt.style.width = tt.offsetWidth;
				t.style.display = 'block';
				b.style.display = 'block';
			}
			if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
			h = parseInt(tt.offsetHeight) + top;
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(1)},timer);
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			tt.style.top = (u - h) + 'px';
			tt.style.left = (l + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				tt.style.opacity = alpha * .01;
				tt.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(tt.timer);
				if(d == -1){tt.style.display = 'none'}
			}
		},
		hide:function(){
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
		}
	};
}();

// begin absolutely positioned scrollable area object scripts 
// Extension developed by David G. Miles 
// Original Scrollable Area code developed by Thomas Brattli 
function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=50 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 

function ConstructObject2(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp2;this.down=MoveAreaDown2; 
    this.MoveArea2=MoveArea2; this.x; this.y; 
    this.obj = obj + "Object2" 
    eval(this.obj + "=this") 
    return this 
} 

function ConstructObject3(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp3;this.down=MoveAreaDown3; 
    this.MoveArea3=MoveArea3; this.x; this.y; 
    this.obj = obj + "Object3" 
    eval(this.obj + "=this") 
    return this 
} 


function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y + "px"
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 

function MoveArea2(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y + "px"
} 
 
function MoveAreaDown2(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea2(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp2(move){ 
	if(this.y<0){ 
    this.MoveArea2(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 

function MoveArea3(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y + "px"
} 
 
function MoveAreaDown3(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea3(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp3(move){ 
	if(this.y<0){ 
    this.MoveArea3(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 















function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
function PerformScroll2(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller2.down(speed) 
		else objScroller2.up(speed) 
	} 
} 

function PerformScroll3(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller3.down(speed) 
		else objScroller3.up(speed) 
	} 
} 

function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 


function CeaseScroll2(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 

function CeaseScroll3(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 


var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer') 
    objScroller=new ConstructObject('divContent','divContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 
var initialised2; 
function InitialiseScrollableArea2(){ 
	    objContainer2=new ConstructObject2('divContainer2') 
	    objScroller2=new ConstructObject2('divContent2','divContainer2') 
	    objScroller2.MoveArea2(0,0) 
	    objContainer2.css.visibility='visible'
    initialised2=true; 
} 

var initialised3; 
function InitialiseScrollableArea3(){ 
	    objContainer3=new ConstructObject3('divContainer3') 
	    objScroller3=new ConstructObject3('divContent3','divContainer3') 
	    objScroller3.MoveArea3(0,0) 
	    objContainer3.css.visibility='visible'
    initialised3=true; 
} 
// end absolutely positioned scrollable area object scripts 


//------------------------------CHROMELESS WINDOW -----------------------//



var platform;
var browser;
var version;
var adjWidth;
var adjHeight;
var winSize,winOptions;

version = parseInt(navigator.appVersion);

if(navigator.userAgent.indexOf('Win') == -1) {
        platform = 'Macintosh';
} else {
        platform = 'Windows';
}

if(navigator.appName.indexOf('Netscape') == -1) {
        browser = 'IE';
} else {
        browser = 'Netscape';
}

function FullScreen(number) {
      if ((platform == 'Macintosh') && (browser == 'Netscape')) {
            adjWidth = 20;
            adjHeight = 35;
      }
      if ((platform == 'Macintosh') && (browser == 'IE')) {
            adjWidth = 20;
            adjHeight = 35;
            winOptions = ',fullscreen=yes';
      }
	if ((platform == 'Windows') && (browser == 'Netscape')) {
      	adjWidth = 12;
            adjHeight = 12;
      }
	
	if ( (platform == 'Windows') && (browser == 'IE') ) {
		winOptions = ',fullscreen=yes';
	} 

	if (number == 1){ 
		theurl="/catalogos/ferreteria.html"
		wname ="CHROMELESSWIN"
	}
	else if (number == 2){ 
		theurl="/catalogos/Productos_dentales.html"
		wname ="CHROMELESSWIN"
	}
	else if (number == 3){ 
		theurl="/catalogos/material_agroindustrial.html"
		wname ="CHROMELESSWIN"
	}	
	else if (number == 401){ 
		theurl="/catalogos/equipos_laboratorio.html"
		wname ="CHROMELESSWIN"
	}
	else if (number == 402){ 
		theurl="/catalogos/mobiliario_laboratorio.html"
		wname ="CHROMELESSWIN"
	}	
	else if (number == 5){ 
		theurl="/catalogos/cilindros_de_gas.html"
		wname ="CHROMELESSWIN"
	}
	else if (number == 601){ 
		theurl="/catalogos/ball_valves.html"
		wname ="CHROMELESSWIN"
	}	
	else if (number == 602){ 
		theurl="/catalogos/valvulas_acero_forjado.html"
		wname ="CHROMELESSWIN"
	}	
	else if (number == 603){ 
		theurl="/catalogos/valvulas_acero_fundido.html"
		wname ="CHROMELESSWIN"
	}
		else if (number == 7){ 
		theurl="/catalogos/superficies_de_terminacion.html"
		wname ="CHROMELESSWIN"
	}	
		else if (number == 8){ 
		theurl="/catalogos/mobiliario_espacios_publicos.html"
		wname ="CHROMELESSWIN"
	}	
	else if (number == 9){ 
		theurl="/catalogos/aislamiento_productos_industriales.html"
		wname ="CHROMELESSWIN"
	}	
	else if (number == 10){ 
	theurl="/catalogos/rodamientos.html"
	wname ="CHROMELESSWIN"
	}	
	else if (number == 100){ 
		theurl="/es/index.asp"
		wname ="CHROMELESSWIN100"
	}
		else if (number == 101){ 
		theurl="/en/index.asp"
		wname ="CHROMELESSWIN100"
	}
	else if (number == 11){ 
	theurl="/catalogos/pesca_tradicional.html"
	wname ="CHROMELESSWIN"
	}	
	else if (number == 12){ 
	theurl="/catalogos/material_escolar.html"
	wname ="CHROMELESSWIN"
	}
	else if (number == 13){ 
	theurl="/catalogos/mobiliario_urbano_infantil.html"
	wname ="CHROMELESSWIN"
	}	
	else if (number == 14){ 
	theurl="/catalogos/material_escolar_infantil.html"
	wname ="CHROMELESSWIN"
	}	
	else if (number == 15){ 
	theurl="/catalogos/aguas_residuales.html"
	wname ="CHROMELESSWIN"
	}	
	W=screen.availWidth+1;
	H=screen.availHeight-21;
	windowCERRARa 		= "img/close_a.gif"
	windowCERRARd 		= "img/close_d.gif"
	windowCERRARo 		= "img/close_o.gif"
	windowTIT 	    	= ""
	windowBORDERCOLOR   	= "#000000"
	windowBORDERCOLORsel	= "#FFFFFF"
	windowTITBGCOLOR    	= "#e0e0e0"
	windowTITBGCOLORsel 	= "#a0a0a0"
	//location.href="/en/index.html";
	openchromeless(theurl, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowTIT, windowBORDERCOLOR, windowBORDERCOLORsel, 
windowTITBGCOLOR, windowTITBGCOLORsel)

}

//--------------------//----------------------------------//-----------------------------------//
//Funciones para el acordeon- ingenieria industrial
//Poner los tabs con la configuracion inicial cuando se pulsa sobre ellos

function cambiacapa1(){ 
MM_changeProp('1','','textTransform','UPPERCASE','DIV');
MM_changeProp('1','','paddingLeft','24px','DIV');
MM_changeProp('1','','backgroundPosition','10px 8px','DIV');
MM_changeProp('1','','borderBottom','2px solid #FF6600','DIV');
}

function cambiacapa3(){ 
MM_changeProp('3','','textTransform','UPPERCASE','DIV');
MM_changeProp('3','','paddingLeft','24px','DIV');
MM_changeProp('3','','backgroundPosition','10px 8px','DIV');
MM_changeProp('3','','borderBottom','2px solid #FF6600','DIV');
}

function cambiacapa2(){ 
MM_changeProp('2','','textTransform','UPPERCASE','DIV');
MM_changeProp('2','','paddingLeft','24px','DIV');
MM_changeProp('2','','backgroundPosition','10px 8px','DIV');
MM_changeProp('2','','borderBottom','2px solid #FF6600','DIV');
}

function cambia1fondo2y3(){ 
MM_changeProp('1','','backgroundColor','#ffffff','DIV');
MM_changeProp('3','','backgroundColor','#eeeeee','DIV');
MM_changeProp('2','','backgroundColor','#eeeeee','DIV');
MM_changeProp('2','','borderBottom','1px solid #cccccc','DIV');
MM_changeProp('3','','borderBottom','1px solid #cccccc','DIV');
MM_changeProp('1','','borderBottom','2px solid #ff6600','DIV');
MM_changeProp('3','','backgroundPosition','0px 8px','DIV');
MM_changeProp('3','','paddingLeft','14px','DIV');
MM_changeProp('2','','backgroundPosition','0px 8px','DIV');
MM_changeProp('2','','paddingLeft','14px','DIV');
MM_changeProp('1','','backgroundPosition','10px 8px','DIV');
MM_changeProp('1','','paddingLeft','24px','DIV');
}

function cambia2fondo1y3(){ 
MM_changeProp('2','','backgroundColor','#ffffff','DIV');
MM_changeProp('3','','backgroundColor','#eeeeee','DIV');
MM_changeProp('1','','backgroundColor','#eeeeee','DIV');
MM_changeProp('1','','borderBottom','1px solid #cccccc','DIV');
MM_changeProp('3','','borderBottom','1px solid #cccccc','DIV');
MM_changeProp('2','','borderBottom','2px solid #ff6600','DIV');
MM_changeProp('1','','backgroundPosition','0px 8px','DIV');
MM_changeProp('1','','paddingLeft','14px','DIV');
MM_changeProp('3','','backgroundPosition','0px 8px','DIV');
MM_changeProp('3','','paddingLeft','14px','DIV');
MM_changeProp('2','','backgroundPosition','10px 8px','DIV');
MM_changeProp('2','','paddingLeft','24px','DIV');
}

function cambia3fondo1y2(){ 
MM_changeProp('3','','backgroundColor','#ffffff','DIV');
MM_changeProp('1','','backgroundColor','#eeeeee','DIV');
MM_changeProp('2','','backgroundColor','#eeeeee','DIV');
MM_changeProp('3','','borderBottom','2px solid #ff6600','DIV');
MM_changeProp('2','','borderBottom','1px solid #cccccc','DIV');
MM_changeProp('1','','borderBottom','1px solid #cccccc','DIV');
MM_changeProp('2','','backgroundPosition','0px 8px','DIV');
MM_changeProp('1','','backgroundPosition','0px 8px','DIV');
MM_changeProp('1','','paddingLeft','14px','DIV');
MM_changeProp('2','','backgroundPosition','0px 8px','DIV');
MM_changeProp('2','','paddingLeft','14px','DIV');
MM_changeProp('3','','backgroundPosition','10px 8px','DIV');
MM_changeProp('3','','paddingLeft','24px','DIV');
}



function validaform_susc(){
			missinfo="";
			if (document.boletin.nombre.value==""){ 
			missinfo += "\n     - Nombre";
			}
			if (document.boletin.empresa.value==""){ 
			missinfo += "\n     - Empresa ";
			}
			if (document.boletin.web.value==""){ 
			missinfo += "\n     - Web";
			}
			if (document.boletin.email.value==""){ 
			missinfo += "\n     - Email ";
			}
			if (document.boletin.movil.value==""){ 
			missinfo += "\n     - Movil ";
			}
			if (document.boletin.pais.options[0].selected || document.boletin.pais.options[1].selected ){ 
			missinfo += "\n     - Pais para prefijo internacional";
			}
			if (!document.boletin.priv.checked){ 
			missinfo += "\n     - Aceptar nuestra politica de privacidad ";
			}
			if (missinfo !=""){
			missinfo= "__________________________\n" +
			"Debe rellenar los siguientes campos \n" + 
			missinfo + "\n__________________________" +
			"\nPor favor intentelo de nuevo";
			alert(missinfo);
			return false;
			}
			else{
			document.boletinsms.submit();
			}
			}			

function prefijo(){
	document.boletin.prefijo.value=document.boletin.pais.options[document.boletin.pais.selectedIndex].value;
	document.boletin.pais.options[document.boletin.pais.selectedIndex].value = document.boletin.pais.options[document.boletin.pais.selectedIndex].text;
	document.boletin.movil.value="+"+document.boletin.prefijo.value+document.boletin.movil.value;
	}


