/* content.js */

$(document).ready(function(){


	/* Scroll Panes */
	$('.scroll-pane').jScrollPane();
	
	/* Drop Down Button (Community Login) */
	$(".button").hover(function(){$(this).children('.button_dd').fadeIn('fast');},function(){$(this).children('.button_dd').fadeOut('fast');});     
	
});



// Scrolls page to top
function scrollToTop() {
	$.scrollTo( '#wrapper', 800); 
}







// IE6 functions

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') 
    {
        window.onload = func;
    } 
    else 
    {
        window.onload = function() 
        {
            oldonload();
            func();
        };
    }
}


// cache css bg images for IE6
if ( document.all )
{  
    try {
      document.execCommand("BackgroundImageCache", false, true);
    } catch(err) {}
}

// IE hover and Z-index fix for main navigation
startList = function() {
    if (document.all&&document.getElementById) {
        zCount = 100;
       if (document.getElementById("nav") !== null) {
           navRoot = document.getElementById("nav");
           for (i=0; i<navRoot.childNodes.length; i++) {
             node = navRoot.childNodes[i];
             if (node.nodeName=="LI") {
                zCount--;
                node.onmouseover=function() {
                    this.className+=" over";
                }; 
                node.onmouseout=function() {
                    this.className=this.className.replace(" over", "");
                }; 
             }
           }
       }
	   

    }
}; 

addLoadEvent(startList);
