<!--
//***********<MANEJADOR DE EVENTS PER IE I MOZILLA>*****************\\
	function addEvent(element, evType, fn, useCapture){
		//optimitzacio per compatibilitat amb IE i Mozilla
		if(element.addEventListener){
			element.addEventListener(evType, fn, useCapture);
			return true;
		}else if (element.attachEvent){
			var r = element.attachEvent('on'+evType, fn);
			return r;
		}else{
			element['on'+evType] = fn;
		}
	}
	
	
	//*****************************<CARREGA INICIAL>******************************\\
	//carrega inicial de listeners al window.load
	addEvent(window, 'load', addListeners, false);
	
	//conjunt de listeners i events que es carregaran on window.load
	function addListeners(e){
		//funcionalitat popup texte legal
		if(document.getElementById('popupVideo')){
			 var video = document.getElementById('popupVideo');
			 video.href = "javascript:void(0)";//substituim el event que se li passa a as
			 addEvent(video, 'click', popupVideo, false);
		}
		
	}	
	
	//posicio del popup
	var mac = (navigator.appVersion.indexOf("Mac") >0 )? true : false;
	function getPos(w,h){
		var nW = (mac && document.all)? w-16 : w;
		var nH = h;
		var list = {
			x : Math.round((screen.availWidth/2) - (nW/2)),
			y : Math.round((screen.availHeight/2) - (nH/2)),
			w : nW,
			h : nH		
		}
		return list;
	}
	
	//funcio per obrir popup legal
	function popupVideo(){
		var pos = getPos(690,560);
		
		var url = "video.htm";

		wlegal = window.open(url,"video","width=" + pos.w + ", height=" + pos.h + ", top=" + pos.y + ", left=" + pos.x + ", scrollbars=1");
	}
	
	function popupVideo2(){
		var pos = getPos(480,420);
		
		var url = "video2.htm";

		wlegal = window.open(url,"video","width=" + pos.w + ", height=" + pos.h + ", top=" + pos.y + ", left=" + pos.x + ", scrollbars=1");
	}
	
	function compra(){
		 nom = "compra";
		 urlx = "formul.htm";
		 alto = 300;
		 ancho = 485;
		 x = 50;
		 y = 20;
		 vl=window.open(urlx,nom,"location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,"+"width="+ancho+",height="+alto+",left="+x+",top="+y);
	 } 
//-->
