var timeOn;


function showmenu(sub){
resetTimer();
	closeAll();

	document.getElementById(sub).style.display='block';
	return false;
}
function closeAll(){
var elem1=document.getElementById('submenu1');
var elem2=document.getElementById('submenu2');
var elem3=document.getElementById('submenu3');
var elem4=document.getElementById('submenu4');
var elem5=document.getElementById('submenu5');
elem1.style.display='none';
elem2.style.display='none';
elem3.style.display='none';
elem4.style.display='none';
elem5.style.display='none';
}

function mouseOut(){
	timeOn=setTimeout('closeAll()',300)	;
	return false;
}

function resetTimer(){

	clearTimeout(timeOn);	
	return false;
}

function startbanner(){

zonez=document.getElementById('zonma');
elementele=zonez.firstChild;
listatotala= new Array();
marginile=new Array();

	while(elementele.nodeType == 3) {
		elementele = elementele.nextSibling;
	}
	stocbannere.curentchild=elementele;
i=0;
	while(elementele.getAttribute('id')!='laste'){
			listatotala[i++]=elementele;
		elementele=elementele.nextSibling
		while(elementele.nodeType == 3) {
			elementele = elementele.nextSibling;
		}	
	
	}
	
	marginea=0;
	for(i=0;i<listatotala.length;i++){
		marginile[i]=marginea;
		listatotala[i].style.margin="0px "+marginea+"px";
		marginea=listatotala[i].offsetWidth+marginea;
		listatotala[i].style.position="absolute";
		
		
	}
	stocbannere.lista=listatotala;
	stocbannere.lastx=listatotala.length-1;
	stocbannere.lmargini=marginile;
	
	if(stocbannere.lista[stocbannere.lastx].offsetLeft>1000){
	
	movebannere();
	}
}

function stivabannere(){
	this.currentx=0;
	this.lastx=null;
	
	this.curentchild=null;
	this.lista= new Array();
	this.lmargini=new Array();


}
stocbannere= new stivabannere();

function movebannere(){
		valoarealeft=stocbannere.curentchild.style.marginLeft;
		
		
		
		valoareamleft=valoarealeft.substr(0,valoarealeft.length-2);
		
		
		if(valoareamleft < (-1)*stocbannere.curentchild.offsetWidth){
			
			nouamargine=stocbannere.lmargini[stocbannere.lastx]+stocbannere.lista[stocbannere.lastx].offsetWidth;
		
			stocbannere.curentchild.style.margin="0px "+nouamargine+"px";
			stocbannere.lmargini[stocbannere.currentx]=nouamargine;
			
			stocbannere.lastx=stocbannere.currentx;
			
			stocbannere.currentx++;
			
			
			
			if(stocbannere.currentx>stocbannere.lista.length-1){
				stocbannere.currentx=0;
				stocbannere.lastx=stocbannere.lista.length-1;
				
			}
			stocbannere.curentchild=stocbannere.lista[stocbannere.currentx];
		
		}


	for(i=0;i<stocbannere.lista.length;i++){
		stocbannere.lista[i].style.margin="0px "+(stocbannere.lmargini[i]--)+"px"
	}
	
	
setTimeout('movebannere()',1);
}
		 function playthissong(str){
			flashul=document.getElementById('flashplayer');
			flashul.playsong('morefiles/'+str);
		 
		 }
         


