// Determine browser and version.
function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    
   
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }

}

function addBehavior()
{
	document.all.tags("BODY")[0].addBehavior("includes/js/hover.htc");

}
var browser = new Browser();


// Global object to hold drag information.
//var dragObj = new Object();
//dragObj.zIndex = 0;
//

function addLoadEvent(func) {
  //setup onload function
    if(typeof window.addEventListener != 'undefined')
    {
            //.. gecko, safari, konqueror and standard
            window.addEventListener('load', func, false);
    }
    else if(typeof document.addEventListener != 'undefined')
    {
            //.. opera 7
            document.addEventListener('load', func, false);
    }
    else if(typeof window.attachEvent != 'undefined')
    {
            //.. win/ie
            window.attachEvent('onload', func);
    }

    //** remove this condition to degrade older browsers
    else
    {
            //.. mac/ie5 and anything else that gets this far

            //if there's an existing onload function
            if(typeof window.onload == 'function')
            {
                    //store it
                    var existing = onload;

                    //add new onload handler
                    window.onload = function()
                    {
                            //call existing onload function
                            existing();

                            //call generic onload function
                            func();
                    };
            }
            else
            {
                    //setup onload function
                    window.onload = func;
            }
    }
}

function matchHeight()
	{

     var divs,contDivs,maxHeight,divHeight,d;

     // get all <div> elements in the document

     divs=document.getElementsByTagName('div');

     contDivs=[];

     // initialize maximum height value

     maxHeight=0;

     // iterate over all <div> elements in the document

     for(var i=0;i<divs.length;i++){

          // make collection with <div> elements with class attribute 'container'

          if(/\bcontainer\b/.test(divs[i].className)){

                d=divs[i];

                contDivs[contDivs.length]=d;

                // determine height for <div> element

                if(d.offsetHeight){

                     divHeight=d.offsetHeight;

                }

                else if(d.style.pixelHeight){

                     divHeight=d.style.pixelHeight;

                }

                // calculate maximum height
                maxHeight=Math.max(maxHeight,divHeight);
          }

     }

	if ( maxHeight < document.body.offsetHeight )
		maxHeight = document.body.offsetHeight;
		
     // assign maximum height value to all of container <div> elements
		try
		{
			 for(var i=0;i<contDivs.length;i++){

				  contDivs[i].style.height=maxHeight+"px";


			 }
		}
		catch(  ex )
		{
			//alert( ex );
		}


} 
