	/*function resizeMeniuOrizontal(){
		var copii;
		var lungime;
		var maxim;
		var i;

		copii=document.getElementById('dropMeniu').childNodes;
		lungime=copii.length;
		maxim=0;

		for(i=0;i<lungime;i++){
			if(maxim<copii[i].clientHeight){
				maxim=copii[i].clientHeight;
			}
		}
		document.getElementById('meniuMareOrizontalId').style.height=maxim+"px";

		for(i=0;i<lungime;i++){
			copii[i].style.height=maxim+"px";
			}
		}*/


	function afisareProduse() {
					var x;
						var lungime;
						var curent;
						var pelinie;
						var marime;
						var maxim;
						var copii;
						var i;




						if(document.getElementById('listaProduse')){
							x=document.getElementById("Produse").offsetWidth;
							copii=document.getElementById('listaProduse').childNodes;
							lungime=document.getElementById('listaProduse').childNodes.length;
							if(copii[0]){
								curent=copii[0].childNodes[0].clientWidth;

							pelinie=Math.floor(x/curent);
							marime=Math.floor((x-pelinie*curent)/pelinie/2);
							//alert('Latime: '+x+', cu '+pelinie+' pelinie, si marimea: '+marime);
							//alert("pentru "+x+" avem pelinie: "+pelinie+", marime: "+marime);
							for(i=0;i<lungime;i++) {
								copii.item(i).style.paddingLeft=marime+"px";
								copii.item(i).style.paddingRight=marime+"px";

								if((i+1)%pelinie===0){
									copii.item(i).style.background = 'none';
								}
								else{
									copii.item(i).style.background = 'transparent url(grafica/separatorProduse.jpg) no-repeat scroll 100% 50%';
								}
							}

							//calculez inaltimea maxima, si o si setez
							maxim=0;
								for(i=0;i<lungime;i++){
									if(document.getElementById("produs"+i))
									if(document.getElementById("produs"+i).clientHeight > maxim)
									{
										maxim=document.getElementById("produs"+i).clientHeight;
									}
								}

								for(i=0;i<lungime;i++){
									if(document.getElementById("produs"+i)){
									   document.getElementById("produs"+i).style.height = maxim+'px'; //mereu scad 1px in plus
									}
									copii.item(i).style.height = copii.item(i).childNodes[0].clientHeight+'px';
									//copii.item(i).childNodes[0].style.height = maxim+'px';

								}
							}
						}

						else if(document.getElementById('listaProducatori')){
							x=document.getElementById("Produse").offsetWidth;
							copii=document.getElementById('listaProducatori').childNodes;
							lungime=document.getElementById('listaProducatori').childNodes.length;
							curent=copii[0].childNodes[0].clientWidth;
							pelinie=Math.floor(x/curent);
							marime=Math.floor((x-pelinie*curent)/pelinie/2);
							//alert('Latime: '+x+', cu '+pelinie+' pelinie, si marimea: '+marime);
							//alert("pentru "+x+" avem pelinie: "+pelinie+", marime: "+marime);
							for(i=0;i<lungime;i++) {
								copii.item(i).style.paddingLeft=marime+"px";
								copii.item(i).style.paddingRight=marime+"px";

								if((i+1)%pelinie===0){
									copii.item(i).style.background = 'none';
								}
								else{
									copii.item(i).style.background = 'transparent url(grafica/separatorProduse.jpg) no-repeat scroll 100% 50%';
								}
							}

							//calculez inaltimea maxima, si o si setez
							maxim=0;
								for(i=0;i<lungime;i++){
									if(copii.item(i).clientHeight > maxim)
									{
										maxim=copii.item(i).clientHeight;
									}
								}

								for(i=0;i<lungime;i++){
									copii.item(i).style.height = copii.item(i).childNodes[0].clientHeight+'px';
									//copii.item(i).childNodes[0].style.height = maxim+'px';

								}
						}
		}


	function doResize()
			{
				if(document.getElementById("meniuMareOrizontalId")){
					var x;
					var lungime=0;
					var curent;
					var pelinie;
					var marime;
					var maxim;
					var copii;
					var i;

					x = document.getElementById("meniuMareOrizontalId").clientWidth;
					copii=document.getElementById('dropMeniu').childNodes.length;

					for(i=0;i<copii;i++){
						lungime+=document.getElementById('dropMeniu').childNodes[i].clientWidth;
					}

					x=(x-lungime)/2;
					x=Math.max(0,x);
					document.getElementById("meniuMareOrizontalId").style.paddingLeft=x+"px";
					}

					afisareProduse();
					/*resizeMeniuOrizontal();*/
			}


	java = function(){
		doResize();
		sfHover();
		proHint();
		};

	window.onresize=doResize;


	sfHover = function() {
		if(document.getElementById("dropCos").getElementsByTagName("LI")){
			var sfEls = document.getElementById("dropCos").getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+="sfhover";
				};
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp("sfhover\\b"), "");
				};
			}
		}

		if(document.getElementById("dropMeniu").getElementsByTagName("LI")){
				sfEls = document.getElementById("dropMeniu").getElementsByTagName("LI");
				for (var i=0; i<sfEls.length; i++) {
					sfEls[i].onmouseover=function() {
						this.className+="sfhover";
						};
					sfEls[i].onmouseout=function() {
						this.className=this.className.replace(new RegExp("sfhover\\b"), "");
						};
				}
		}
	};

//generator popup

popitup = function(url,nume,latime,inaltime){
	leftPadding=(screen.width-latime)/2;
	topPadding=(screen.height-inaltime)/2;
	//if(!scrol)scrol=0;
	//alert(url+" "+name+" "+width+" "+height+" "+leftPadding+" "+topPadding);
	day = new Date();
	id = day.getTime();
	window.open(url, id, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+latime+',height='+inaltime+',left = ' + leftPadding + ',top = ' + topPadding);
	//window.open(url,name, "'toolbar=0,scrollbars=1,statusbar=1,menubar=0,resizable=0,width="+width+",height="+height+",left="+leftPadding+",top="+topPadding+"'");

	};

	/*var rezSel=0;

	window.onmouseup = function(){
		if(!document.getElementById('cuvinteCheie').isFocused){
			document.getElementById('rezultat').style.display='none';
		}
	};

	goDown = function(event){
		var curent;
		if(event.keyCode==40){
			if(rezSel!==0){
				document.getElementById("rezultat").childNodes.item(rezSel).className='rez';
				rezSel++;
				if(document.getElementById("rezultat").childNodes.item(rezSel).id=='inchide'){
					rezSel=1;
					}
			} else {
				rezSel=1;
				}
				document.getElementById("rezultat").childNodes.item(rezSel).className='rezSel';
		}else if(event.keyCode==38){
			if(rezSel>1){
				document.getElementById("rezultat").childNodes.item(rezSel).className='rez';
				rezSel--;

			} else {
				document.getElementById("rezultat").childNodes.item(1).className='rez';
				rezSel=document.getElementById("rezultat").childNodes.length-2;

				}
			if(document.getElementById("rezultat").childNodes.item(rezSel).id!=='sugestii'){
				document.getElementById("rezultat").childNodes.item(rezSel).className='rezSel';
			}
		} else if(event.keyCode<33 || event.keyCode>42){
			if(document.getElementById("rezultat").childNodes.item(rezSel)){
			    document.getElementById("rezultat").childNodes.item(rezSel).className="rez";
			}
			rezSel=0;
			}
		if(rezSel!==0){document.getElementById("cuvinteCheie").value=document.getElementById("rezultat").childNodes.item(rezSel).getElementsByTagName("a").item(0).innerHTML;}
	};*/

proHint = function(){
	if(document.getElementById("formularInregistrare")){
		//input
		var obiecte = document.getElementById("formularInregistrare").getElementsByTagName("input");
		for (var i=0; i<obiecte.length; i++) {
			if(obiecte[i].type=="text" || obiecte[i].type=="password" || obiecte[i].type=="file"){
				obiecte[i].onfocus = function(){
					if(this.parentNode.getElementsByTagName("em"))
						this.parentNode.getElementsByTagName("em")[0].style.display="block";
					}
					
				obiecte[i].onblur = function(){
					if(this.parentNode.getElementsByTagName("em"))
						this.parentNode.getElementsByTagName("em")[0].style.display="";
					}
			}
			}
		//Textarea
		var obiecte2 = document.getElementById("formularInregistrare").getElementsByTagName("textarea");
		for (var i=0; i<obiecte2.length; i++) {
			obiecte2[i].onfocus = function(){
				if(this.parentNode.getElementsByTagName("em"))
					this.parentNode.getElementsByTagName("em")[0].style.display="block";
				}
					
			obiecte2[i].onblur = function(){
				if(this.parentNode.getElementsByTagName("em"))
					this.parentNode.getElementsByTagName("em")[0].style.display="";
				}
		}
		}
		
	}
	
	proComplete = function(){
		if(document.getElementById("cuvinteCheie"))
			document.getElementById("cuvinteCheie").setAttribute("autocomplete","off");
			
		if(document.getElementsByTagName("form")) {
			x=document.getElementsByTagName("form");
			for(i=0;i<x.length;i++)
				x[i].setAttribute("autocomplete","off");
		}
		}