
//showprice tip
	function showTip(id)
	{
		document.getElementById('cena'+id).style.display='';
	}
	function hideTip(id)
	{
		document.getElementById('cena'+id).style.display='none';
	}

//open window
	function MM_openBrWindow(theURL,winName,features)
	{
	  window.open(theURL,winName,features);
	}
	
//menu open close item

	function open1(which,wh){
		closeAll(which,wh);
		if(document.getElementById("sub"+which).style.display == 'none'){
			document.getElementById("sub"+which).style.display='';
			document.getElementById("subpic"+which).src = document.getElementById("subpic"+which).src.replace("-closed","-open");
			}
		else{
		document.getElementById("sub"+which).style.display='none';
		document.getElementById("subpic"+which).src = document.getElementById("subpic"+which).src.replace("-open","-closed");
		}
	}
	/*function closeAll(which){
		var subm = document.getElementsByTagName("div");
		for(var i = 0;i < subm.length;i++){
			if(subm[i].className.match('submenu') && !subm[i].id.match("sub"+which)){
				subm[i].style.display='none';
   			}
		}
		//picture closing, unsucessfull
		var found = false;
		var subm = document.getElementsByTagName("img");
		for(var i = 0;i < subm.length;i++){
			if(subm[i].className.match('sub_but1') && !subm[i].className.match("sub_but1"+which)){
				subm[i].src = subm[i].src.replace("-open","-closed");
				found = true;
   			}
   			else if(found)
   			    continue;
		}
	}*/
	
	
	function closeAll(which){
			$$('div.submenu').each(function(e){
				if(!e.id.match("sub"+which))
					e.style.display='none';
			});
			$$('img.sub_but1').each(function(e){
				if(!e.id.match("sub_but1"+which)){
					e.src = e.src.replace("-open","-closed");
					found = true;
				}
			});
	}
	
	
///projekt
function dispImage(id,image,hideorshow){
    if(hideorshow){
      $('img'+id).src = 'http://www.rico.si/template/show_img.php?s=0&pic='+ image;
      $('img_holder'+id).style.display = '';
    }
    else
      $('img_holder'+id).style.display = 'none';
}

function aj_req(id,proj,image){
    if(image.active != true){
      var myAjax = new Ajax('http://www.rico.si/template/project_get.php?&id='+proj, {
          method: 'get',
          update:  'hidden_holder',
          evalScripts: true,
          onComplete:function(){
              image.src = "template/images/loader.gif";
              image.active = true;
              var myFx = new Fx.Style('overholder'+id, 'height',{
                                                      transition:Fx.Transitions.Quart.easeInOut,
                                                      onComplete:function(){
                                                          $('overholder'+id).style.display = '';
                                                          $('overholder'+id).lines = lines;
                                                          $('overholder'+id).setHTML($('hidden_holder').innerHTML);
                                                          image.src = "template/images/arrow_in.png";
                                                      }
                                                  }).start(0,lines);
          }}).request();
    }
    else{
        image.src = "template/images/arrow_out.png";
        image.active = false;
        $('overholder'+id).empty();
            var myFx = new Fx.Style('overholder'+id, 'height',{
                transition:Fx.Transitions.Quart.easeInOut,
                onComplete:function(){

                  }
                  }).start($('overholder'+id).lines,0);
    }
}

function add_project(cat_code,item){
	window.location = "template/script_prints.php?stroj="+cat_code;
	item.onclick = null;
	item.style.cursor = 'wait';
}

function change_lang(newlang,langs){
		loc = window.location.href;
		for(var ln = 0;ln < langs.length;ln++)
		loc = loc.replace('/o-'+langs[ln],'');
		window.location = loc+'/o-'+newlang;
}
	
	
	
	



