	var isSliding = 0;
	var stopSliding = 0;
	var max = 370;
	
	try {
	  document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
	
	function addLoadEvent(func) {
	    var oldonload = window.onload;
	    if (typeof window.onload != 'function') {
	        window.onload = func;
	    } else {
	        window.onload = function() {
	            if (oldonload) {
	                oldonload();
	            }
	            func();
	        }
	    }
	}
	
	function initPage(idcont) {
		setTimeout("puneContinut('" + idcont + "')", 3000);
	}
	
	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 = max + "px";
		//document.getElementById('first').focus();
		//slide('first', 0.148, 1, 539, 536, 0.01, 1);
		
		//slide('first', max, 0, 0, 0, -4, 1);
		slide('first', max, 0, 0, 0, -10, 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 = val_curenta + "px"; //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;
		}
	};
