function replace(par){
	 //document.getElementById("central").src = par;
}

function reinit(){
	document.getElementById("central").opacity = 1;
	slidein();
}

function preslide(){
	
	document.getElementById('c1').style.opacity = 0;
	document.getElementById('c1').style.filter = "alpha(opacity="+0+")"; 
	document.getElementById('c2').style.opacity = 0;
	document.getElementById('c2').style.filter = "alpha(opacity="+0+")"; 
	start = "c3";
	start2 = "c2"
	op=100;
	a=0;
	setTimeout("slideout(start,start2,"+op+")", 2000);
	//setTimeout("slideout(start,start2,"+op+")", 2000);
	//setTimeout("slidein(start,"+op+")", 2000);
}

/*function slidein(st,op){
	start = st;
	if(op>0){
		op-=2.5;
		document.getElementById(start).style.opacity = (op/100);
		document.getElementById(start).style.filter = "alpha(opacity="+op+")"; 
		setTimeout("slidein(start,"+op+")",50);
	}
	if(op==0){
		switch(start){
		 case "c3" : start="c2"; setTimeout("slidein(start,"+100+")",2000); break;
		 //case "c2" : start = "c1";break;
		}
	}
}*/

function slideout(st1,st2,op){

	start1=st1;
	start2=st2;
	if(op>0){
		op-=2.5;
		document.getElementById(start1).style.opacity = (op/100);
		document.getElementById(start1).style.filter = "alpha(opacity="+op+")";
		document.getElementById(start2).style.opacity = ((100-op)/100);
		document.getElementById(start2).style.filter = "alpha(opacity="+(100-op)+")";
		return setTimeout("slideout(start1,start2,"+op+")",50);
	}
	if(op==0){
		switch(start1){
		 case "c3" : 
				start1="c2"; 
				start2="c1";
				return setTimeout("slideout(start1,start2,"+100+")",2000); 
				break;
		 case "c2" :
				start1="c1"; 
				start2="c3"; 
				return setTimeout("slideout(start1,start2,"+100+")",2000); 
				break;
		case "c1" :
				start1="c3"; 
				start2="c2"; 
				return setTimeout("slideout(start1,start2,"+100+")",2000); 
				break;
		 //case "c1" : start1="c3"; start2="c2"; setTimeout("slideout(start1,start2,"+100+")",2000); break;
		}
	}
}

function createImage(par){
	 immagine = document.createElement("IMG");
	 immagine.setAttribute("src","./img/pallets1.JPG");
	 document.getElementById("imgcont").appendChild(immagine);

	}

function replaceImg(par){
	immagine.setAttribute("src","./img/"+par+".JPG");
	}

function daiLargh(){
	//alert(document.getElementById('tabbase').offsetWidth);
}

