	var pozaVeche = -1;
	var isSliding = 0;
	var stopSliding = 0;
	
	try {
	  document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
	
	function initPage() {
		puneContinut('despre');
		document.getElementById("a-meniu1").hideFocus = true;
		document.getElementById("a-meniu2").hideFocus = true;
		document.getElementById("a-meniu3").hideFocus = true;
		document.getElementById("a-meniu4").hideFocus = true;
	}
	
	function trimite() {
		if (document.getElementById('formaContact').nume.value=="") {
			alert('Numele este obligatoriu');
			document.getElementById('formaContact').nume.focus();
			return;
		}
		if (document.getElementById('formaContact').telefon.value=="") {
			alert('Numarul de telefon este obligatoriu');
			document.getElementById('formaContact').telefon.focus();
			return;
		}
		if (document.getElementById('formaContact').email.value=="") {
			alert('Adresa de e-mail este obligatorie');
			document.getElementById('formaContact').email.focus();
			return;
		}
		alert("Mesajul dumneavoastra a fost trimis. Vi se va raspunde in cel mai scurt timp posibil. Va multumim.");
		document.getElementById("formaContact").submit();
	}
	
	function schimbaPoza() {
		do {
			var max = 21;
			var path = "imagini/";
			var tt = 1 + Math.floor(max * Math.random());
		}
		while (pozaVeche == tt);
		pozaVeche = tt;
		document.getElementById("div-poza-schimbatoare").innerHTML = '<img src="' + path + tt + '.jpg" class="imagine-div" alt="" onclick="javascript:schimbaPoza();">';
	}
	
	function puneContinut(idCont) {	
		if (isSliding) stopSliding = 1;
		document.getElementById('first').innerHTML = document.getElementById(idCont).innerHTML;
		document.getElementById(idCont + '-continut').style.display = "block";
		//document.getElementById('first').style.top = "0px";
		//alert(document.getElementById(idCont + '-continut').offsetHeight);
		//document.getElementById('first').style.top = document.getElementById(idCont + '-continut').offsetHeight-50 + "px";		
		
		/*slide(
			ID ELEMENT HTML,
			LIMITA INF INTERVAL FUNCTIE (VALOARE CURENTA), 
			LIMITA SUP INTERVAL FUNCTIE, 
			PARAM INVERSARE INTERVAL, 
			CONSTANTA PRODUS FUNCTIE, 
			PASUL DE SCADERE, 
			INTERVALUL DE SCADERE
		*/
		isSliding = 1;
		document.getElementById('first').style.top = "450px";
		//document.getElementById('first').focus();
		slide('first', 0.148, 1, 539, 536, 0.01, 1);
	}
	
	function elastic(pos) {
	    if (pos < (1/2.75)) {
	        return (7.5625*pos*pos);
	    } else if (pos < (2/2.75)) {
	        return (7.5625*(pos-=(1.5/2.75))*pos + .75);
	    } else if (pos < (2.5/2.75)) {
	        return (7.5625*(pos-=(2.25/2.75))*pos + .9375);
	    } else {
	        return (7.5625*(pos-=(2.625/2.75))*pos + .984375);
	    }
	}
	
	function slide(elemId,val_curenta,lim_sup,const_invers,const_produs,pas,interval) {
		//document.getElementById("log").innerHTML =  isSliding  + "<br>" + document.getElementById("log").innerHTML;
		if (stopSliding) {
			isSliding = 0;
			stopSliding = 0;
			return;
		}
		document.getElementById(elemId).style.top = const_invers - (Math.round((elastic(val_curenta)*const_produs))) + "px";
		//document.getElementById("log").innerHTML =  document.getElementById(elemId).style.top  + "<br>" + document.getElementById("log").innerHTML;
		if (val_curenta < lim_sup) {
			setTimeout("slide('" + elemId + "'," + (val_curenta + pas) + "," + lim_sup + "," + const_invers + "," + const_produs + "," + pas + "," + interval + ")", interval);
		}
		else {
			isSliding = 0;
		}
	};
