﻿<!-- Copyright 2003, Sandeep Gangadharan -->
<!-- For more free scripts go to http://www.sivamdesign.com/scripts/ -->

var place = 40;   // change the # 80 to adjust the placement of the menu from the top of the page. The greater
                  // number the lower will the menu be placed.

var bCollapsed = false;
var iWidth = 138;

//if(document.all)
//    iWidth = 138;
                  
(document.getElementById && !document.all) ? dom = true : dom = false;

function moveIt() {        
    if(!bCollapsed)
        return;
    
    var spText = document.getElementById("spText");    
    spText.innerHTML = "";
    
    var outerTBL = document.getElementById("outerTBL");
    outerTBL.style.borderWidth = "1px";

    if (dom) {document.getElementById('linksBox').style.left = parseInt(document.getElementById('linksBox').style.left) + iWidth + "px";}
    if (document.all) {document.all["linksBox"].style.pixelLeft = parseInt(document.all["linksBox"].style.pixelLeft) + iWidth;}
    
    bCollapsed = false;
    
    //deleteCookie("NarrowSearch");
}

function backIn() {                        
    var spText = document.getElementById("spText");    
    spText.innerHTML = "<img src='" + imageURL + "/btnExpandSearch.gif' border='0'>";
    
    var outerTBL = document.getElementById("outerTBL");
    outerTBL.style.borderWidth = "0px";

    if (dom) {document.getElementById('linksBox').style.left = parseInt(document.getElementById('linksBox').style.left) - iWidth + "px";}
    if (document.all) {document.all["linksBox"].style.pixelLeft = parseInt(document.all["linksBox"].style.pixelLeft) - iWidth;};

    bCollapsed = true;    
    setCookie("NarrowSearch","true");
}

function typeStart() {
  if (dom || document.all) {
     document.write('<div id="linksBox" style="position:absolute; top:' + place + 'px; left:' + (true ? '-138' : '0') + 'px; visibility:visible;">') }
   // document.write('<div id="linksBox" style="position:absolute; top:' + place + 'px; left:' + (getCookie("NarrowSearch") ? '-138' : '0') + 'px; visibility:visible;">') }
}

function typeEnd() { if (dom || document.all) { document.write('</div>') } }

var beep = false;

function placeIt() {        

    if (dom) 
        document.getElementById("linksBox").style.top = window.pageYOffset + place + "px";

    if (document.all) 
        document.all["linksBox"].style.top = document.body.scrollTop + place + "px";
    
    window.setTimeout("placeIt()", 10); 
}

function miniNarrow()
{
    backIn();
}

function NS_F_StartIt() {    
    placeIt();            
    //if(getCookie("NarrowSearch"))
    if(true)
    {
        var spText = document.getElementById("spText");    
        spText.innerHTML = "<img src='" + imageURL + "/btnExpandSearch.gif' border='0'>";
        
        var outerTBL = document.getElementById("outerTBL");
        outerTBL.style.borderWidth = "0px";
        bCollapsed = true;
    }
    NS_f_OtherOnLoad();        
}

function xContains (container, containee) {
  var isParent = false;
  do {
    if ((isParent = container == containee))
      break;
    if(containee)
	    containee = containee.parentNode;

  }
  while (containee != null);
  return isParent;
}

function triggerMouseArea(e,el)
{
	var rel = (window.event) ? e.toElement : e.relatedTarget;
	return !(xContains(el,rel));
}


NS_f_OtherOnLoad = (window.onload) ? window.onload :  new Function;
window.onload = function(){setTimeout("NS_F_StartIt()",10)};
