var $j = jQuery.noConflict();

$j(function(){
		//just some regular style sheets. change them as you see fit
		var styling =".linkcategory{cursor:pointer; font-weight:bold; font-size: 1.1em; margin-top: 7px; padding-left: 10px;}" +
					  ".downloads{display:block; font-size: 1em; padding:0; line-height:1.2em; margin:0;}" +
					  ".opened{color:#921403; padding-bottom: 5px;}" +
					  ".closed{color:#251B6C; margin-right: 15px; padding-bottom: 5px; border-bottom: 1px dotted #7b7b7b;}";		
		//attach style to the page
		var style = document.createElement("style");
        style.type = "text/css";
        try {
            style.appendChild( document.createTextNode(styling) );
        } catch (e) {
            if ( style.styleSheet ) {
                style.styleSheet.cssText = styling;
            }
        }
        document.body.appendChild( style );
		//style all questions as closed
		$j(".linkcategory").addClass("closed"); 
		//make sure first question is styled as open
	        $j(".linkcategory:first").removeClass("closed").addClass("opened"); 
		$j(".downloads").hide(); //hide answers
		$j(".downloads:first").show(); //show first answer
		//question click
		$j(".linkcategory").click(function() {
			$j(".downloads").slideUp("fast");
			$j(".linkcategory").removeClass("opened").addClass("closed");
	
			if ($j(this).next(".downloads").is(":hidden")) {
				$j(this).next(".downloads").slideDown("fast");
				$j(this).removeClass("closed").addClass("opened");
			} 			   
		});
});
