function toggleBorder( targetId , border){
target = document.all( targetId );
  if(border=='on') {
       target.style.border='1px solid #FFFFFF';
       target.style.padding='2px 8px 2px 8px;'
  } else {
       target.style.border='0px solid #FFFFFF';
  }

}
function branchSwitch(catId,branch) {
  //var msie = (document.all)? true : false;
  //if (msie) {
     var currElement = document.getElementById(branch);
     var currE = document.getElementById(catId);
     if (currElement.style.display == 'none')
     {
        currElement.style.display = 'block';
        currE.className="catON"; 
     }
     else
     {
        currElement.style.display = 'none';
        currE.className="catOFF"; 
     }
     return false;
  //} else return true;
}  
function menuCatOver(catId,branch) {
     var currElement = document.getElementById(branch);
     var currE = document.getElementById(catId);
     if (currElement.style.display == 'none')
     {
        currE.className="catOFFhover"; 
     }
     return false;
}  
function menuCatOut(catId,branch) {
     var currElement = document.getElementById(branch);
     var currE = document.getElementById(catId);
     if (currElement.style.display == 'none')
     {
        currE.className="catOFF"; 
     }
     return false;
}  

function catSwitch(partid,id,class_name)
{
	var subs = $$('.'+class_name);
	for(var i=0;i<subs.length;i++) {
	        if (subs[i].id==id) {
                        if(Element.visible(subs[i])) Effect.BlindUp(subs[i] ) ;
                        else Effect.BlindDown(subs[i] ) ;
	        } else {
	                Effect.BlindUp(subs[i] ) ;
		    
	        }
	}
        var parts = $$('.'+'catOFFhover');
        for(var i=0;i<parts.length;i++) {
              if (parts[i].id!=partid) {
                      parts[i].className="catOFF"; 
              } 
        }
}              

function menuMainOver(mId,mhId) {

     var currHoverElement = document.getElementById(mhId);
     var currElement = document.getElementById(mId);
     currHoverElement.style.display = "block";
     currElement.style.display = "none";
     return false;
  
}  
function menuMainOut(mId,mhId) {
     var currHoverElement = document.getElementById(mhId);
     var currElement = document.getElementById(mId);
     currHoverElement.style.display = "none";
     currElement.style.display = "block";
     return false;
}  

function OpenImagePopup(imgPath, title, alt) {
    var win = window.open('','preview',
    'width=50,height=50,left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
    
    var winDoc = win.document;
    if (title == undefined) title = 'My Image, Click to Close';
    if (alt   == undefined) alt   = 'My Image, Click to Close';
    var content = '<html><head><title>' + title + '</title>' +
    			  '<style>body{overflow: hidden;margin:0;}img{border:0;}</style>' +
    			  '</head><body><a href="javascript:self.close()">' +
    			  '<img alt="' + alt + '" id="image" src="' + imgPath + '" /></a></body></html>'
    win.document.write(content);
    
    winDoc.body.onload = function() {
    	var obj = winDoc.getElementById('image');
    	var w = obj.width, h = obj.height;
    	var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
    	
    	var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
    	var top =  (self.opera ? iHeight : screen.availHeight)/2 - h/2;
    	win.resizeTo(w+12, h+82);
    	win.moveTo(left, top);
    }
    
    win.onload = winDoc.body.onload; // special for Mozilla
    
    // !!! Very important statement: popup onload won't execute without it!
    win.document.close();
    win.focus();
}    

function SetBasketEnable()
{
	document.getElementById('mini_basket_td').className = 'bg_basket';
	document.getElementById('order_but').style.display = 'block';

}

function SetBasketDisable()
{

	document.getElementById('mini_basket_td').className = 'bg_basket_0';
	document.getElementById('order_but').style.display = 'none';
}



