var lingua = linguadetect();


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

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

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){
	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.4 , delay: 0.0});
	//c = new Effect.Appear('logo', { duration: 0.6 , delay: 0.4});
	
	c = new Effect.Parallel(
    [ new Effect.Morph('logobox', {sync: true, style:'top:1px'}), 
      new Effect.Appear('logobox', {sync: true, to: 1.0, from: 0.0 } ) ],
    { duration: 0.7, delay: 0.2});
	
	b = new Effect.Appear('iscriviti', { duration: 0.7, delay: 0.6});
	a = new Effect.Appear('menubox', { duration: 0.5, delay: 0.8});
	//d = new Effect.Appear('loghi', { duration: 0.7 , to: 0.9 , delay: 0.5});
	//d = new Effect.Morph('loghi', { duration: 0.7 ,style:'height:34px;', delay: 0.5});
	d = new Effect.Parallel(
    [ new Effect.Morph('loghi', {sync: true, style:'top:0px;'}), 
      new Effect.Appear('loghi', {sync: true, to: 0.9, from: 0.0 } ) ],
    { duration: 0.7, delay: 0.9});
	
	e = new Effect.Parallel(
    [ new Effect.Morph('footerbox', {sync: true, style:'top:20px;'}), 
      new Effect.Appear('footerbox', {sync: true, to: 1.0, from: 0.0 } ) ],
    { duration: 0.7, delay: 1.1});
	
	//e = new Effect.SlideDown('footer', { duration: 0.7, delay: 1.2});
}

function startonload(){}
