var lingua = linguadetect();

function nomepagina() {
	var x = location.href.split("?");
	return x[0];
}

function portfolioattivo() {
	var anchors = document.getElementsByTagName('a');
	
	for (var i=0; i<anchors.length; i++){
		
		var ancora = anchors[i];
		if (ancora.href == nomepagina()){
			ancora.style.color = "#e44500";
			//ancora.setAttribute("rel","portfolio_vuota");
		}
	}
}

function linguadetect(){
	indirizzo = document.location + "";
	if (indirizzo.lastIndexOf("_eng") > 0) {
		return  "eng"
	}
	else {
		return  "ita"
	}
	
	return (indirizzo.substring(str_start,str_end));
}

function sezione11(){
	indirizzo = document.location + "";
	str_start = indirizzo.lastIndexOf("/") + 1;
	if (indirizzo.indexOf("_",str_start) > 0) {
		str_end = indirizzo.indexOf("_",str_start);
	}
	else {
		str_end = indirizzo.lastIndexOf(".");
	}
	
	return (indirizzo.substring(str_start,str_end));
}

function sezione(){
	indirizzo = document.location + "";
	indirizzo = indirizzo.replace("http://www.albertonconsulting.it/","");
	str_end = indirizzo.indexOf("/");
	indirizzo = indirizzo.substring(0,str_end);
	indirizzo = indirizzo.replace("_","");
	//alert("sezione=" + indirizzo);
	return (indirizzo);
	
}


function swap(which){
	menuarray = which.split("_");
	
	if (menuarray.length == 2) {
		menuname = menuarray[0];
		menustatus = menuarray[1];
		document.getElementById(menuname).src = menu[which];
	}
}

function swapimg(which){
	if (which.src) {
	urlname = which.src.substring(0,which.src.lastIndexOf('_' + lingua + "."));
	urlext = which.src.substring(which.src.lastIndexOf('_' + lingua + "."),which.src.length);
	//alert(urlname);
	if (urlname.substring(urlname.length-1,urlname.length) == '1') {
		if (which.name != sezione()){
			which.src = urlname.substring(0,urlname.length -1) + urlext
			}
			}
	else {which.src = urlname + '1' + urlext;}
	}
	return false;
}

function start(){
	f = new Effect.Appear('conteiner', { duration: 0.2 , delay: 0.0});
	
	c = new Effect.Appear('logo', { duration: 0.3 , delay: 0.1});
	
	e = new Effect.Appear('pastpresentfuture', { duration: 0.3, delay: 0.2});
	
	d = new Effect.Appear('payoff', { duration: 0.2 , delay: 0.3});

	g = new Effect.Appear('menu', { duration: 0.2 , delay: 0.4});
	
	h = new Effect.Appear('portfolio', { duration: 0.2 , delay: 0.4});
	
	z = new Effect.Appear('content', { duration: 0.2 , delay: 0.1});
}

function startonload(){}