﻿function dr(v){document.write(v);}function i(o){return document.getElementById(o);}function t(o,n){return o.getElementsByTagName(n);}function gee(){return window.event;}function ae(o,n,h){if(o.addEventListener)o.addEventListener(n,h,false);else if(o.attachEvent)o.attachEvent("on"+n,h);}function de(o,n,h){if(o.removeEventListener)o.removeEventListener(n,h,false);else if(o.detachEvent)o.detachEvent("on"+n,h);}function sep(e){if(window.event){e=window.event;e.returnValue=false;e.cancelBubble=true;return;}e.preventDefault();e.stopPropagation();}



function d(t,a)
{
    var f=document.forms["f"];
    if(!f)
    {
        f=document.f
    }
    if(!f.onsubmit||(f.onsubmit()!=false))
    {
        f.__eventtarget.value=t;
        f.__eventargument.value=a;
        f.submit()
    }
}



function mesaj()
{
    var asc=i("asc4");
    if(asc)
    {
        var s=i("asch4").style;
        var h=i("cs_hdus4");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
	  
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; border: none;\"><strong></strong></span> ";
        var b=a+"<img src=\"imagini/add_mes.gif\" style=\"border: none; margin: 0 0 0 0;\" />";
        a+="<img src=\"imagini/add_mes_minus.gif\" style=\"border: none; margin: 0 0 0 0;\" />";
        
        var sw=i("ascs4");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}




function subiect()
{
    var asc=i("asc5");
    if(asc)
    {
        var s=i("asch5").style;
        var h=i("cs_hdus5");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
	  
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; border: none;\"><strong></strong></span> ";
        var b=a+"<img src=\"imagini/add_sub.gif\" style=\"border: none; margin: 0 0 0 0;\" />";
        a+="<img src=\"imagini/add_sub_minus.gif\" style=\"border: none; margin: 0 0 0 0;\" />";
        
        var sw=i("ascs5");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}








function constructii()
{
    var asc=i("asc");
    if(asc)
    {
        var s=i("asch").style;
        var h=i("cs_hdus");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
	  
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Masini si utilaje constructii</strong></span> ";
        var b=a+"<img src=\"imagini/desc1.gif\" style=\"border: none; margin: -9px 0 0 12px;\" />";
        a+="<img src=\"imagini/asc1.gif\" style=\"border: none; margin: 2px 0 0 12px;\" />";
        
        var sw=i("ascs");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}



function constructii_a()
{
    var asc=i("asc");
    if(asc)
    {
        var s=i("asch").style;
        var h=i("cs_hdus");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
	  
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Construction equipment</strong></span> ";
        var b=a+"<img src=\"imagini/desc1.gif\" style=\"border: none; margin: -9px 0 0 15px;\" />";
        a+="<img src=\"imagini/asc1.gif\" style=\"border: none; margin: 2px 0 0 15px;\" />";
        
        var sw=i("ascs");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}



function agricol()
{
    var asc=i("asc1");
    if(asc)
    {
        var s=i("asch1").style;
        var h=i("cs_hdus1");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Masini si utilaje agricole</strong></span> ";
        var b=a+"<img src=\"imagini/desc2.gif\" style=\"border: none; margin: -7px 0 0 25px;\" />";
        a+="<img src=\"imagini/asc2.gif\" style=\"border: none; margin: 2px 0 0 25px;\" />";
        
        var sw=i("ascs1");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}


function agricol_a()
{
    var asc=i("asc1");
    if(asc)
    {
        var s=i("asch1").style;
        var h=i("cs_hdus1");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Farm equipment</strong></span> ";
        var b=a+"<img src=\"imagini/desc2.gif\" style=\"border: none; margin: -7px 0 0 61px;\" />";
        a+="<img src=\"imagini/asc2.gif\" style=\"border: none; margin: 2px 0 0 61px;\" />";
        
        var sw=i("ascs1");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}



function scule()
{
    var asc=i("asc2");
    if(asc)
    {
        var s=i("asch2").style;
        var h=i("cs_hdus2");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Scule si unelte constructii</strong></span> ";
         var b=a+"<img src=\"imagini/desc3.gif\" style=\"border: none; margin: -7px 0 0 17px;\" />";
        a+="<img src=\"imagini/asc3.gif\" style=\"border: none; margin: 2px 0 0 17px;\" />";
        
        var sw=i("ascs2");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}



function scule_a()
{
    var asc=i("asc2");
    if(asc)
    {
        var s=i("asch2").style;
        var h=i("cs_hdus2");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Hand tools</strong></span> ";
         var b=a+"<img src=\"imagini/desc3.gif\" style=\"border: none; margin: -7px 0 0 98px;\" />";
        a+="<img src=\"imagini/asc3.gif\" style=\"border: none; margin: 2px 0 0 98px;\" />";
        
        var sw=i("ascs2");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}




function materiale()
{
    var asc=i("asc3");
    if(asc)
    {
        var s=i("asch3").style;
        var h=i("cs_hdus3");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; padding-left: 15px;\"><strong>Informatii utile constructii</strong></span> ";
         var b=a+"<img src=\"imagini/desc4.gif\" style=\"border: none; margin: -7px 0 0 18px;\" />";
        a+="<img src=\"imagini/asc4.gif\" style=\"border: none; margin: 2px 0 0 18px;\" />";
        
        var sw=i("ascs3");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}




function formular_cauta()
{
    var asc=i("asc4");
    if(asc)
    {
        var s=i("asch4").style;
        var h=i("cs_hdus4");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; float: left; cursor: hand; padding-top: 5px;\"><strong><u>Cautare avansata</u></strong></span> ";
         var b=a+"";
        a+="";
        
        var sw=i("ascs4");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}


function formular_cauta_a()
{
    var asc=i("asc4");
    if(asc)
    {
        var s=i("asch4").style;
        var h=i("cs_hdus4");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a="<span style=\" color: #000099; float: left; cursor: hand; padding-top: 5px;\"><strong><u>Advanced Search</u></strong></span> ";
         var b=a+"";
        a+="";
        
        var sw=i("ascs4");
        sw.style.display="block";	
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(asc,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
   
}




function change_clapeta(curent,total,id)
{
	for(i=1;i<=total;i++)
	{
		if($(id+'_clp_'+i).className=="item item_first item_act" || $(id+'_clp_'+i).className=="item item_act") //for up and down
			curent_now = i;
		if(i==1)
			$(id+'_clp_'+i).className="item item_first";
		else
			$(id+'_clp_'+i).className="item";
		$(id+'_cnt_'+i).style.display="none";
	}
	if(curent=='up' && curent_now<total) curent = curent_now+1;
	else if(curent=='up' && curent_now==total) curent=total;
	else if(curent=='down' && curent_now>1) curent = curent_now-1;
	else if(curent=='down' && curent_now==1) curent = 1;
	if(curent==1)
		$(id+'_clp_'+curent).className="item item_first item_act";
	else
		$(id+'_clp_'+curent).className="item item_act";
	$(id+'_cnt_'+curent).style.display="";
}
var ChangeClapetaEv = Class.create();
ChangeClapetaEv.prototype = {
	initialize: function(total,id,curent,evt) {
		this.total = total;
		this.id = id;
		this.curent = curent;
		this.evt = evt;
		if(this.evt=='mouseover')
			this.create_mouseover();
		else if(this.evt=='click')
			this.create_click();
	},
	create_mouseover: function() {
		Event.observe($(this.id+'_clp_'+this.curent),'mouseover',function() {
			this.to = setTimeout('change_clapeta('+this.curent+','+this.total+',"'+this.id+'")',250);
		}.bind(this));
		Event.observe($(this.id+'_clp_'+this.curent),'mouseout',function() {
			clearTimeout(this.to);
		}.bind(this));
	},
	create_click: function() {
		Event.observe($(this.id+'_clp_'+this.curent),'click',function() {
			change_clapeta(this.curent,this.total,this.id);
			var a = 1;
		}.bind(this));
	}
}
function change_clapeta_ev(curent,total,id,evt)
{
	if(curent!=0) change_clapeta(curent,total,id);
	for(i=1;i<=total;i++)
	{
		new ChangeClapetaEv(total,id,i,evt);
	}
	if($(id+'_clp_down')) new ChangeClapetaEv(total,id,'down',evt);
	if($(id+'_clp_up')) new ChangeClapetaEv(total,id,'up',evt);
}




