var curImageID = null; //defines initial selected button

function show_hint(hintID, imageID)
    {
        var browser = navigator.appName;
        
        if (browser == "Netscape")
        {
            if (navigator.appVersion >= "5")
            {
                if (curImageID != imageID)
                {
                    document.getElementById(imageID).style.visibility = "visible";
                }
                document.getElementById(hintID).style.visibility = "visible";
            }
            else
            {
                if (curImageID != imageID)
                {
                    document.layers[imageID].visibility = "visible"
                }
                document.layers[hintID].visibility = "visible"
            }
        }
        else
        {
            if (curImageID != imageID)
            {
                document.all[imageID].style.visibility = "visible"
            }
            document.all[hintID].style.visibility = "visible"        
        }
    }


function hide_hint(hintID, imageID)
    {
        var browser = navigator.appName;
        
        if (browser == "Netscape")
        {
            if (navigator.appVersion >= "5")
            {
                if (curImageID != imageID)
                {
                    document.getElementById(imageID).style.visibility = "hidden";
                }
                document.getElementById(hintID).style.visibility = "hidden";
            }
            else
            {
                if (curImageID != imageID)
                {
                    document.layers[imageID].visibility = "hidden"
                }
                document.layers[hintID].visibility = "hidden"
            }
        }
        
        else
        {
            if (curImageID != imageID)
            {
                document.all[imageID].style.visibility = "hidden"
            }
            document.all[hintID].style.visibility = "hidden"
        }
    }


    var p_window = null

    function newWindow(URL,x,y) 
    {
       var options="width=" + x + "," + "height=" + y + "," + ",location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,";
       if (p_window == null || p_window.closed) 
         p_window = window.open(URL,null,options)
       else
         p_window.focus();	    	
    }


    function rollOnBut(object)
    {
        object.className="buthilight";
    }

    function rollOffBut(object)
    {
        object.className="EGButton";
    }

    function rollOnTab(t)
    {
            a = document.all[t + '_Left'];
            if (a)
            {
			    a.className = "hilight";
            }
            a = document.all[t + '_Middle'];
            if (a)
            {
			    a.className = "hilight";
            }
            a = document.all[t + '_Right'];
            if (a)
            {
			    a.className = "hilight";
            }
    }

    function rollOffTab(t)
    {
            a = document.all[t + '_Left'];
            if (a)
            {
			    a.className = "";
            }
            a = document.all[t+ '_Middle'];
            if (a)
            {
			    a.className = "tabUnselected";
            }
            a = document.all[t + '_Right'];
            if (a)
            {
			    a.className = "";
            }
    }


    function populateVal(_val1, _val2)
    {
        _field = getParameter(window.parent.location.search,"browse");
        window.parent.opener.document.getElementById(_field).value = unescape(_val1);
        window.parent.self.close();
    }
    

    function getParameter ( queryString, parameterName )
    {
        var parameterName = parameterName + "=";
        if ( queryString.length > 0 )
        {
            begin = queryString.indexOf ( parameterName );
            if ( begin != -1 )
             {
             begin += parameterName.length;
	          end = queryString.indexOf ( "&" , begin );
	          if ( end == -1 )
                end = queryString.length
	          return unescape ( queryString.substring ( begin, end ) );
	         }
	     return "null";
	     }
    }


   // Function : disableTextField,enableTextField
   // Used in : adminattrproperties.xsl, adminconfigdetail.xsl, PhotoDetail.xsl

   function skip () { this.blur(); }
   function disableTextField (field)
   {
     if (document.all || document.getElementById) 
       field.disabled = true;
     else {
       field.oldOnFocus = field.onfocus;
       field.onfocus = skip;
     }
   }
   function enableTextField (field)
   {
     if (document.all || document.getElementById)
       field.disabled = false;
     else {
       field.onfocus = field.oldOnFocus;
     }
   }


function startSearching(text, textColor, bgColor, themePath)
{
  var imgLoc;
  if (document.layers)
    imgLoc = "top: 0px; left: 299px;";
  else
  if (navigator.userAgent.toLowerCase().indexOf("msie 5.0") !=-1)
    imgLoc = "top: 0px; right: -16px;";
  else
    imgLoc = "top: 0px; right: 0px;";

  parent.nav.document.open();
  parent.nav.document.writeln('<html><head><style type= \"text/css\">body { font-family: \"Trebuchet MS\", Arial, Helvetica, Geneva, Swiss, SunSans-Regular; font-weight: bold; font-size: .7em; color:' + textColor +'; background-color:' + bgColor + '} .imgLoc { position: absolute; z-index: 0; ' + imgLoc + ' visibility: visable }</style></head><body>');
  parent.nav.document.writeln('<div class=\"imgLoc\"><img border=\"0\" width=\"4\" height=\"4\" src=\"' + themePath + 'tab_right.gif\"></div>');
  parent.nav.document.writeln('<div><p>' + text + '</p></div></body></html>');
  parent.nav.document.close();
}




