    function showhide2(id,img){
        el = document.getElementById(id);
        img = document.getElementById(img);
        if (el.style.display=="none") { el.style.display="block";img.src='/images/menum.gif';}
        else {el.style.display="none";img.src='/images/menup.gif';};
    }

        function showhide(id){
        el = document.getElementById(id);        
        if (el.style.display=="none") { el.style.display="block";}
        else {el.style.display="none";};
    }

 function filtreaza_producator(filtru_select) {
     document.location = filtru_select.options[filtru_select.selectedIndex].value;
 }
    function kaka()
      {
        showhide('step1');
          setTimeout("showhide('step1')", 500)
      }

    function informatii_suplimentare(url, popUpWidth, popUpHeight) {
	var popUpTop = (screen.height - popUpHeight) / 2;
	var popUpLeft = (screen.width - popUpWidth) / 2;
	window.open(url, 'anunta', 'top='+popUpTop+',left='+popUpLeft+',height='+popUpHeight+',width='+popUpWidth+',scrollbars=no');
}


        var timeout = 1;
		var offset = 155/2;
		var wait = 5000;

		var imagini = new Array();
		var fixLeft = new Array();
		var imgLeft = new Array();
        var imagini2 = new Array();
		var fixLeft2 = new Array();
		var imgLeft2 = new Array();
        var imgWidth = 620;
		var imgHeight=243;
        var imgWidth2 = 620;
		var imgHeight2=243;

        function init() {
            var scrollingDiv = document.getElementById('scrollingDiv');
            imagini = scrollingDiv.getElementsByTagName("img");
			//imgWidth = imagini[0].width;
			//imgHeight=imagini[0].height
			imgWidth = 620;
			imgHeight = 243;
			for (var i = 0; i < imagini.length; i++) {
				fixLeft[i] = imgWidth * i;
				imgLeft[i] = fixLeft[i];
				imagini[i].style.left = imgLeft[i] + "px";
                imagini[i].style.top = 0 + "px";
				imagini[i].style.display = "block";
            }
			window.setTimeout("myScroll()", wait);
		}
    function init2() {
            var scrollingDiv = document.getElementById('scrollingDiv2');
            imagini2 = scrollingDiv.getElementsByTagName("img");
			//imgWidth = imagini[0].width;
			//imgHeight=imagini[0].height
			imgWidth2 = 620;
			imgHeight2 = 486;
			for (var i = 0; i < imagini2.length; i++) {
				fixLeft2[i] = imgWidth2 * i;
				imgLeft2[i] = fixLeft2[i];
				imagini2[i].style.left = imgLeft2[i] + "px";
                imagini2[i].style.top = 0 + "px";
				imagini2[i].style.display = "block";
            }
			window.setTimeout("myScroll2()", wait);
		}

        function myScroll() {
			var interval = timeout;
			for (var i = 0; i < imagini.length; i++) {
				imgLeft[i] -= offset;
				imagini[i].style.left = imgLeft[i] +"px";
				if (imgLeft[i] < (-1) * imgWidth) {
                    imgLeft[i] = fixLeft[imagini.length - 1];
				}
				if (imgLeft[i] == 0) {
					interval = wait;
				}
			}
			window.setTimeout("myScroll()", interval);
		}

    function myScroll2() {
			var interval = timeout;
			for (var i = 0; i < imagini2.length; i++) {
				imgLeft2[i] -= offset;
				imagini2[i].style.left = imgLeft2[i] +"px";
				if (imgLeft2[i] < (-1) * imgWidth2) {
                    imgLeft2[i] = fixLeft2[imagini2.length - 1];
				}
				if (imgLeft2[i] == 0) {
					interval = wait;
				}
			}
			window.setTimeout("myScroll2()", interval);
		}















  /*
 * Artcore Suggest Script
 * (c) www.artcore.ro
*/


var searchEngineUrl="/preturi/mici/ajax_search.html";
var overBgColor="lightskyblue";
var numberOfHints=6;
var maxStrLen=50;
var searchForm="searchForm";


    var artcoreSuggestCanRun=1;
    var xmlHttp;
    var suggestionsDiv;
    var searchTxt;
    var oldSearchRequest="";
    var selectedHint=-1;
    var hintsIds="rezultat";
    var sageataSus=38;
    var sageataJos=40;
    var rezultate=new Array();
    var rezultTrun=new Array();
    var canUpdate=0; //sa faca update fara sa mai ia date de pe server, deocamdata disabled

    // Init Artcore Suggest
    function initArtcoreSuggest()
    {
        ajaxFunction();
        if (artcoreSuggestCanRun==1)
        {
            suggestionsDiv=document.getElementById("sDiv");
            searchTxt=window.document.getElementById("ce");
            searchForm=window.document.getElementById("searchForm");
            window.setInterval("showHint()",400);
        }
    }

    // Artcore Suggest Kernel ;)
    function ajaxFunction()
    {
        try {
            xmlHttp=new XMLHttpRequest();
        }
        catch (e) {
            try {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e) {
                try {
                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e) {
                    artcoreSuggestCanRun=0;
                    return;
                }
            }
        }
        xmlHttp.onreadystatechange=function()
        {
                    updateSuggestions();
        }
    }

    function updateSuggestions()
    {
        if ((xmlHttp.readyState==4) || canUpdate==1)
        {
            var txt=xmlHttp.responseText;
            var tmp="";
            var contor=0;
            rezultate=txt.split("\n");
            numberOfHints=rezultate.length;
            if (numberOfHints<3) //se pare ca la cautare se returneaza 2 \n-uri          TEO_WARNING
            {
                artcoreSuggestCanRun=1;//au venit datele, deci pot face alte cereri
                suggestionsDiv.style.display="none";
                return; // cautarea nu a intors rezultat
            }

            truncateHints();
            while (contor<numberOfHints)
            {
                tmp+="<div title=\" " + removeBold(rezultate[contor]) + "\" id=\"rezultat" + contor + "\" class=\"rezultat\" onclick=\"hintOnClick(" + contor +")\" onmouseout=\"outHints()\" onmouseover=\"hintMouseOver("+contor+")\">";
                //tmp+=rezultate[contor];
                tmp+=rezultTrun[contor];
                tmp+="</div>";
                contor++;
            }
            suggestionsDiv.innerHTML=tmp;
            var ctrlDiv="<div style=\"font-family:verdana;font-size:10px;text-align:right\">";
            ctrlDiv+="<a style=\"color:blue;\" href=\"javascript:searchForm.submit()\" title=\"Afiseaza toate rezultatele\">Toate rezultatele</a> | ";
            ctrlDiv+="<a style=\"color:blue;\" href=\"javascript:hideHints()\" title=\"Ascunde 'Artcore Suggest' (ESC)\">Ascunde</a> | ";
            ctrlDiv+="<a style=\"color:blue;\" href=\"javascript:disableHints()\" title=\"Opreste 'Artcore Suggest'\">Opreste</a>";
            suggestionsDiv.innerHTML+=ctrlDiv;
            suggestionsDiv.style.display="block";
            artcoreSuggestCanRun=1;//au venit datele, deci pot face alte cereri
        }
    }

    function showHint()
    {
        var str=searchTxt.value;
        if (artcoreSuggestCanRun==0) {
            return;
        }
        if (str==oldSearchRequest) {
            return;
        }
        if (str.length==0) {
            suggestionsDiv.innerHTML="";
            suggestionsDiv.style.display="none";
            oldSearchRequest="";
            return;
        }
        if (refineResults(str))	{     // don't worry, refine-ul e disabled ;)
            canUpdate=1;
            updateSuggestions();
            oldSearchRequest=str;
            return;
        }
        else {
            canUpdate=0;
        }
        artcoreSuggestCanRun=0;//pana nu vin datele, sa nu faca alte cereri
        ajaxFunction();
        var url=searchEngineUrl+"";
        url+="?q="+str;
        url+="&sid="+Math.random();
        try
        {
            xmlHttp.open("GET",url,true);
            xmlHttp.send(null);
            url="";
            oldSearchRequest=str;

        }
        catch (e){alert(e);}
    }




    // Hide/Disable Hints
    function hideHints()
    {
        suggestionsDiv.style.display="none";
    }

    function disableHints()
    {
        suggestionsDiv.style.display="none";
        artcoreSuggestCanRun=0;
    }





    // Change colors for hints
    function hintMouseOver(e)
    {
        var x=document.getElementById(hintsIds+e);
        x.style.backgroundColor=overBgColor+"";
        x.style.color="white";
        selectedHint=e;
    }
    function hintMouseOut(e)
    {
        try {
            var x=document.getElementById(hintsIds+e);
            x.style.backgroundColor="white";
            x.style.color="lightseagreen";
        }
        catch(E){alert(e+"\n"+E);}
    }

    function outHints()
    {
        for (var i=0;i<numberOfHints;i++)
        {
            try {
                var x=document.getElementById(hintsIds+i);
                x.style.backgroundColor="white";
                x.style.color="lightseagreen";
        }
        catch(E){}
        }
    }

    function hintOnClick(e)
    {
        artcoreSuggestCanRun=0;
        searchTxt.value=removeBold(rezultate[e]);
        hideHints();
        searchTxt.focus();
        var range=searchTxt.createTextRange();
        range.move('character',searchTxt.value.length);
        range.select();
    //	range.move();
    }

    function removeBold(t)
    {
        var rezultat="";
        for (var i=0;i<t.length;i++)
        {
            if (t.charAt(i)=='<')
            {
                if (t.charAt(i+1).toUpperCase()=='B')
                {
                    i+=2;
                }
                if (t.charAt(i+1).toUpperCase()=='/')
                {
                    i+=3;
                }
            }
            else
                rezultat+=t.charAt(i);
        }
        return rezultat;
    }

    function selectAHint(e)
    {
        var keynum;
        if (window.event)// IE
        {
            keynum=e.keyCode;
        }
        else if (e.which) // Firefox, Opera
        {
            keynum=e.which;
        }

        outHints();

        if (keynum==sageataJos)
        {
            artcoreSuggestCanRun=0; // trebuie sa selecteze din rezultate ;)
            selectedHint++;
            var max=numberOfHints-3;// i know, dar daca pun -1, am un bug, asa merge perfect! :-??   TEO_WARNING
            if (selectedHint>max)
                selectedHint=max;
            searchTxt.value=removeBold(rezultate[selectedHint]);
            hintMouseOver(selectedHint);
            return;
        }
        if (keynum==sageataSus)
        {
            artcoreSuggestCanRun=0; // trebuie sa selecteze din rezultate ;)
            selectedHint--;
            if (selectedHint<0)
                selectedHint=0;

            searchTxt.value=removeBold(rezultate[selectedHint]);
            hintMouseOver(selectedHint);
            return;
        }
        //a apasat ESC?
        if (keynum==27)
        {
            hideHints();
            return;
        }
        // a apasat o alta tasta, deci face cautare, nu selectare din rezultate
        artcoreSuggestCanRun=1;
        selectedHint=-1;
    }

    function truncateHints()
    {
        for (var i=0;i<rezultate.length;i++)
        {
            if (rezultate[i].length<=maxStrLen)
            {
                rezultTrun[i]=rezultate[i];
            }
            else
            {
                rezultTrun[i]=rezultate[i].substring(0,maxStrLen) + " ...";
            }
        }
    }

    function refineResults(e) //disabled
    {
    //	var tmp=new Array();
    //	var t="";
    //	var j=0;
    //	for (var i=0;i<rezultate.length;i++) {
    //		t=removeBold(rezultate[i]).substring(0,e.length);
    //		if (t==e) {
    //			tmp[j]=rezultate[i];
    //			j++;
    //		}
    //	}
    //	if (j>0) {
    //		rezultate = tmp;
    //		return true;
    //	}
    //	else {
            return false;
    //	}

    }
