
function show_hide_part(part_name){
  if (document.all){
    if(document.all[part_name].style.display == 'none'){
      document.all[part_name].style.display = '';
    } else {
      document.all[part_name].style.display = 'none';
    }
    return false;
  }else if (document.getElementById){
    if(document.getElementById(part_name).style.display == 'none'){
      document.getElementById(part_name).style.display = 'block';
    }else{
      document.getElementById(part_name).style.display = 'none';
    }
    return false;
  }
}


  function OpenWin(myURL, w, h) {
   window.open( myURL, "",  
     "resizable=1, width="+w+", height="+h+", top="+(screen.height-h)/2+", left="+(screen.width-w)/2+", titlebar=no, scrollbars=yes, location=no, directories=no, status=no, menubar=no, toolbar=no"); 
  
   }	
   
   
  function textCounter(field, maxlimit) {
	if (field.value.length > maxlimit){
		field.value = field.value.substring(0, maxlimit);
		alert("You have reached the maximum limit.")
	}
  }



///// DISABLE RIGHT-CLICK /////////////

function right(e) {
var msg = "Zcafe 2004 - כל הזכויות שמורות ל";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);
return false;
}
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
else return true;
}

function trap() 
  {
  /*
  
  if(document.images)
    {
    for(i=0;i<document.images.length;i++)
      {
      document.images[i].onmousedown = right;
      document.images[i].onmouseup = right;
      }
    }
    
    */
    
  }





///////// TOOLTIP /////////////


var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}



var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo


if(ie){
Ex = "event.x"
Ey = "event.y"

topColor = "#000000"
subColor = "#ffffcc"
}

if(ns){
Ex = "e.pageX"
Ey = "e.pageY"
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=overhere

topColor = "#808080"
subColor = "#C0C0C0"
}

function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))}
if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))}
eval(doc + layerName + sty + ".left = " + (eval(FromLeft) - 110))
}

function ReplaceContent(layerName){

if(ie){document.all[layerName].innerHTML = ContentInfo}


if(ns){

with(document.layers[layerName].document) 
{ 
   open(); 
   write(ContentInfo); 
   close(); 
}

}


}

function Activate(){initialize=1}
function deActivate(){initialize=0}


function overhere(e){
if(initialize){

MoveToolTip("ToolTip", Ey, Ex, e)
eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
}

else{
MoveToolTip("ToolTip", 0, 0)
eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
}


}

function EnterContent(layerName, TContent, w){

ContentInfo = '<table border="1" bordercolor="#cccccc" width="'+w+'" cellspacing="0" cellpadding="5" style="border-collapse: collapse">'+






'<tr><td width="100%" bgcolor='+subColor+'>'+

'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+

'<tr><td width="100%" align="right">'+

'<font class="tooltipcontent">'+TContent+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>';


ReplaceContent(layerName)

}