var timeOn;
function showmenu(sub){
resetTimer();
	closeAll();

	document.getElementById(sub).style.display='block';
	return false;
}
var stocbannere= new stivabannere();
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';
}

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] && 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();


}


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);
		 
		 }
var varhome=1;		 
function changetohome(v){
	if(v!=varhome) {
		document.getElementById('cristina'+v).style.display='block';
		document.getElementById('cristina'+varhome).style.display='none';

		}
	varhome=v;

}
function fadeEffectTwo(El,In,Tmp,Fac){
		this.IE = document.all?true:false;
		this.Timp=Tmp;
		this.Factor=Fac;
		var thisObj=this;
		this.sens=1;
		this.numarul=0;
		this.stop=0;
		this.mm=null;
		this.Elmunu=document.getElementById(El);
		//this.Elmdoi=document.getElementById(In);
		this.Elmunus=this.Elmunu.style;
		//this.Elmdois=this.Elmdoi.style;
		this.changeOnOtherElement= null;
		this.changeOnOtherElementS= null;
		
		this.Elmunu.onmouseover=function(){clearTimeout(this.mm);  thisObj.sens=1 ;thisObj.Schimba()};
		this.Elmunu.onmouseout=function(){clearTimeout(this.mm); thisObj.sens=(-1); thisObj.Schimba()};
	
	this.Schimba=function(){
		var thisObj=this;
		if(this.IE){
			//this.Elmunus.filter="alpha(opacity="+((100-this.numarul)/100)+")";
			this.Elmunus.filter="alpha(opacity="+(this.numarul)+")";
				if(this.changeOnOtherElementS!=null){
				this.changeOnOtherElementS.filter="alpha(opacity="+(this.numarul)+")";
			}
			//this.Elmdois.filter="alpha(opacity="+((100-this.numarul)/100)+")";
		} else {
			//this.Elmunus.opacity=(100-this.numarul)/100;
			this.Elmunus.opacity=((this.numarul))/100;
			if(this.changeOnOtherElementS!=null){
				this.changeOnOtherElementS.opacity=((this.numarul))/100;
			}
			//this.Elmdois.opacity=(100-this.numarul)/100;
		}
		this.numarul+=this.Factor*(this.sens);
		if(this.numarul<=100 && this.numarul>=0){
			this.mm=setTimeout(function(){thisObj.Schimba()},this.Tmp);
		} else {
			this.numarul=this.numarul>100?100:this.numarul<0?0:this.numarul;
		}
	}
	this.AnotherElement=function(id){
		this.changeOnOtherElement=document.getElementById(id);
		this.changeOnOtherElementS=this.changeOnOtherElement.style;
	
	}
}

