function changeIdiom(idioma)
{
	url = window.location;
	url = url.toString();
	var flag = false;
	
	if (url.indexOf("?") == -1)	
		prefix = "?"
	else
		prefix = "&"	
		
	if (url.indexOf("&lang=es") != -1){
		url = url.replace("&lang=es", "");
		flag = true;
	}
	else if (url.indexOf("&lang=en") != -1){
		url = url.replace("&lang=en", "");
		flag = true;		
	}
	else if (url.indexOf("&lang=fr") != -1){
		url = url.replace("&lang=fr", "");
		flag = true;		
	}
	else if (url.indexOf("&lang=al") != -1){
		url = url.replace("&lang=al", "");
		flag = true;		
	}
		
	if (flag)
		url = url +"&lang=" + idioma;
	else
		url = url + prefix +"lang=" + idioma;
		
	window.location = url;
		
	window.location = url;
}

function idiomaIlumina(idioma){
	if (document.getElementById("img_" + idioma)!=null){
		document.getElementById("img_" + idioma).src = "/img/boton_marron.gif";		
	}
}

function addOpt(oCntrl, iPos, sTxt, sVal)
{
    var selOpcion=new Option(sTxt, sVal);
	eval(oCntrl.options[iPos]=selOpcion);	
}

function centrarVentana(objvent, width, height)
{
	objvent.moveTo((screen.width-width)/2,(screen.height-height)/2);
}

/* Funciones para scroll
*/
	timerID = null;
	var active = 0;
	
	function ChangePage(num){
				if(document.getElementById){
					obj[active].style.visibility = "hidden";
					active = num;
					obj[active].style.top = 0;
					obj[active].style.visibility = "visible";
				}
	}
			
	function ScrollUp(speed){
//		alert(active)
				if(document.getElementById){
					if(parseInt(obj[active].style.top) < 0){
						obj[active].style.top = parseInt(obj[active].style.top) + speed + "px";
			}
					timerID = setTimeout("ScrollUp("+speed+")",30);
				}
	}
	
	function ScrollDown(speed){
//		alert(active)				
				if(document.getElementById){                        
					if(parseInt(obj[active].style.top) > document.getElementById('cont').offsetHeight - obj[active].offsetHeight){ 
						obj[active].style.top = parseInt(obj[active].style.top) - speed + "px";
			}
					timerID = setTimeout("ScrollDown("+speed+")",30);
				}
	}
	
	function ScrollStop(){
				if(document.getElementById){
					clearTimeout(timerID);
				}
	}
	
	function ScrollPageInit() {
			if(document.getElementById){
				obj = document.getElementById("cont").getElementsByTagName("div");
				obj['page1'].style.visibility = "visible";
				obj['page1'].style.top = 0;	
			}	
			
			if(document.addEventListener){
					for(i=0;i<document.getElementsByTagName('a').length;i++){
						document.getElementsByTagName('a')[i].style.position = "relative";
				}
			}
	}

