// JavaScript Document

// PNG hack
document.write('<!--[if lte IE 6]><style type="text/css">.hack-png{visibility:hidden}</style><![endif]-->');var PNGHack=function(o){var p='http://pnghack.googlepages.com/spacer.gif';var q=function(f,g,h){if(h.checkIE&&!navigator.userAgent.match(h.checkIE))return;if(!f)f={};var d=f.scope||document;var j=(!f.elm&&g!=2)?d.all:d.getElementsByTagName(f.elm);var k=f.src||'src';var l=new RegExp((f.ext)?'\\w+.'+f.ext.toUpperCase():'\.PNG$');var m=function(a,b){var c=a.style;if(!a.pngsrc)h.elements.push(a);a.pngsrc=a.getAttribute(b);c.width=a.clientWidth;c.height=a.clientHeight;c.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.pngsrc+"',sizingMethod='scale')";if(h.remotehost==true)o=p;else if(h.remotehost!=false){var d=function(){a.setAttribute(b,p);};var e=function(){if(a.readyState=='complete'){a.detachEvent('onerror',d);a.detachEvent('onreadystatechange',e);}};a.attachEvent('onerror',d);a.attachEvent('onreadystatechange',e);}a.setAttribute(b,o||'images/spacer.gif');if(a.className.match(/\bhack-png\b/))var x=setTimeout(function(){a.className=a.className.replace(/hack-png/g,'');clearTimeout(x);		},300);};if(g==2){m(f.elm,k);return;}for(var i=0;i<j.length;++i){var n=j[i].getAttribute(k)||'';if(g==0&&j[i].className.match(/\bhack-png\b/)||(g==1&&n.toUpperCase().match(l)))m(j[i],k);}};return{hackClass:function(a){q(a,0,this);},hackExtension:function(a){q(a,1,this);},hackElement:function(a){q(a,2,this);},elements:[],checkIE:'MSIE 5\.5|MSIE 6',remotehost:null};};


// Navigation Hover Menu
var linkEnabled = false;

		   
$(document).ready(function () {


	
	$("ul.links").fadeTo(0, 0);
	$("ul.links").hide();

	
	/*$("li.menu").hover(
	    function () {
			var index = $("li.menu").index(this);	
			$("ul.links").eq(index).fadeTo("slow", 0.7);
			$("li.menu > a").eq(index).addClass("classHover");
		},
		function () {
			var index = $("li.menu").index(this);
			$("ul.links").eq(index).fadeTo(0, 0);
			$("li.menu > a").eq(index).removeClass("classHover");
		}
		);*/
	$("li.menu > a").mouseenter(
		    function () {
			var index = $("li.menu > a").index(this);	
			$("ul.links").eq(index).show();
			$("ul.links").eq(index).fadeTo(350, 0.8);
			$("ul.links > li > a").css("cursor", "pointer");
			$("li.menu > a").eq(index).addClass("classHover");
			linkEnabled = true;
		});

	$("li.menu").mouseleave(
		    function () {
			var index = $("li.menu").index(this);
			$("ul.links").eq(index).fadeTo(0, 0);
			$("ul.links").eq(index).hide();
			$("ul.links > li > a").css("cursor", "default");
			$("li.menu > a").eq(index).removeClass("classHover");
			linkEnabled = false;
		});

	
});

function checkLinkEnabled() {return linkEnabled;}







//Accordion jQuery

ddaccordion.init({
	headerclass: "toggler", //Shared CSS class name of headers group
	contentclass: "element", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [""], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["", "togglerOpen"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(expandedindices){ //custom code to run when headers have initalized
		// do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})






