jQuery.noConflict();

jQuery(document).ready(function($) {
    
    $("li.navItem").hover(function(){	
		var name = $(this).attr("name");		
		$("li.navItem").css("zIndex", "1");
		$(this).css("zIndex", "9999");		
        $("ul#" + name + "ItemContainer").css("display", "block");
       }, function()
	{
        var name = $(this).attr("name");
        $("ul#" + name + "ItemContainer").css("display", "none");
        $(this).css("zIndex", "1");
    });
    
    $(".x").click(function(){
        $(".StateClickContainer").css("display", "none");
        $(".MemberPopup").css("display", "none");
    });
});

function getObj(id) {
	if(document.all) {
		return document.all[id];
	} else if(document.getElementById) {
		return document.getElementById(id);
	} else if(document.layers) {
		return document.layers[id];
	} else {
		alert('This browser doesn\'t support "document.all", "document.layers", or "document.getElementById".');
		return null;
	}
} 

/*ie6 png fix*/
var arVersion;
var version;

if(navigator.appName.indexOf("Microsoft")!= -1){
    //alert("windows");
    arVersion = navigator.appVersion.split("MSIE");
    version = parseFloat(arVersion[1]);
}

function SetShadowPNG(myImage, container) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var height = myImage.height
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width + "; height:" + height + " !important;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
       strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\">";      
       strNewHTML += "</span>";
	   getObj(container).innerHTML = strNewHTML;
    }
}

/*drop menu for archive*/
function toggleMenu(name)
{
	var obj = getObj('menu_' + name);
	var pic = getObj('arrow_' + name);

    if(obj.style.display == 'block')
	{
		obj.style.display = 'none';
		pic.setAttribute("src", "media/images/arrow_closed.gif");
	}
	else
	{
		obj.style.display = 'block';
		pic.setAttribute("src", "media/images/arrow.gif");
	}
}

var display = "";
function subOptions(elem){
	var list = getObj("current_feature_subitem_box");
	var parent = getObj("contextP");
	
	if(display == ""){
		parent.style.borderBottom = "none";
		parent.setAttribute("class", "current_feature_itemContext1");
		list.style.display = "block";
		display = "shown";
	}else{
		parent.style.borderBottom = "1px solid #BEBB90";
		parent.setAttribute("class", "current_feature_itemContext");
		list.style.display = "none";
		display = "";
	}
}

function setBack(){
	display = "";
	/*var parent = getObj("contextP");
	parent.style.borderBottom = "1px solid #BEBB90";
	parent.setAttribute("class", "current_feature_itemContext");*/
}
