// Folders4U common behaviours
// Handles mouse over events on navigator items
// (c) 2006 Scantech Lithographic Ltd 
// Author: Mike Alexander

// folders4u common functions
document.f4uCommon = new function()
{
  // navigator mouse-over handler. Changes the background colour
  this.doNavOver = function()
  {
    this.style.background = "url(http://www.folders4u.co.uk/styles/images/nav_bgs2.gif) no-repeat right bottom";  
  };		

  // navigator mouse-out handler. Restores the background colour
  this.doNavOut = function ()
  {
    this.style.background = "url(http://www.folders4u.co.uk/styles/images/nav_bgs2.gif) no-repeat left bottom";  
  };
  // attach navigator mouse overs
  this.init = function()
  {
    obj = document.getElementById("navlist");  // get navigator list
    var txt = "";
    for (n = 0; n < obj.childNodes.length; n++)  // get child elements
    {
      li = obj.childNodes[n];  
	  if ((li.tagName == "LI") && (li.id != "sel"))  // only apply to LI tag elements
	  {	  
	    li.onmouseover=document.f4uCommon.doNavOver;  // add behaviour
	    li.onmouseout=document.f4uCommon.doNavOut;    // add behaviour    
	  }
    }	  
  };
}


// debugging: show properties of an object
function showProps(obj)
{
  var txt = "";
  for(prop in obj)
  {
    txt = txt + " | " + prop;
  }
  alert(txt);
}

// show facebook links
function showfacebook(vis){
  var dis = (vis==1)? "block" : "none";
  var ldis = (vis==1)? "none" : "block";
  document.getElementById("facebookshow").style.display=ldis;
  document.getElementById("facebookcontent").style.display=dis;  
  document.getElementById("facebookhide").style.display=dis;    
}

function closeinfo(){
    var divs = document.getElementsByTagName("DIV");
	for (var i=0; i<divs.length; i++){
	  if (divs[i].className=="introbox") divs[i].style.display="none";
	}

  var listing = document.getElementById("listing");
  if (!listing) return; // only on index pages!	
  var opena = document.getElementById("filterlink");
  if (opena) opena.style.top=(listing.offsetTop+15)+"px";	
}

//-->
