/* function use to toggle between the advance search options in the header */
function FilterToggle(obj)
{
	var oDiv = $("#"+obj);	
	var oDiv1 = document.getElementById("filterLabel");		
	
	if(oDiv) {
		if(oDiv.css("display")=="none")	{
			oDiv.show();
			oDiv1.innerHTML = "<a href=\"#\" onclick=\"FilterToggle('advancefilter');\">Hide advanced filters</a>";
		}
		else {
			oDiv.hide();	
			oDiv1.innerHTML = "<a href=\"#\" onclick=\"FilterToggle('advancefilter');\">Show advanced filters</a>";		
		}	
	}
}	

/* function use in the homepage for changing the main display content */
function setMenu(obj)
{
	var totalItems = 5;
	for (var i=1;i<totalItems+1;i++) {
		$("#item"+i).removeClass('active');		
		$("#item"+i+"_content").hide();
	}
	$("#"+obj).addClass('active');
	$("#"+obj+"_content").show();
}


/* function use in the homepage for changing the main display content */
function highlightMenu(obj)
{
	var totalItems = 7;
	for (var i=1;i<totalItems+1;i++) {
		$("#m_item"+i).removeClass('active');
	}
	$("#"+obj).addClass('active');
}

/* function use in the getting started page */
function getStartedToggle (obj,caller)
{
	$("#colcontainer1").hide();
	$("#colcontainer2").hide();
	$("#option1").removeClass('bold');
	$("#option2").removeClass('bold');
	$("#"+obj).show();
	$("#"+obj).equalHeights(true);
	$("#"+caller).addClass('bold');

}

$(document).ready(function(){
		$("#ArticleList").accordion({autoHeight: false});
		$("#colcontainer1").equalHeights(true);	
		$("#colcontainer2").equalHeights(true);	
		$("#dropmenu ul").css({display: "none"}); // Opera Fix
		$("#dropmenu li").hover(function(){
				$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(225);
				},function(){
				$(this).find('ul:first').css({visibility: "hidden"});
				});
	});

/* funtion to append a pdf icon to all pdf links */
//  $(document).ready(function(){
	//$("a[href$='.pdf']").addClass("pdf").attr("target", "_blank");
	//$("a[href$='.pdf']").after("<a href='http://get.adobe.com/reader/' target='_blank'><img src='img/pdf.png' class='pdf' alt='Click here to download Acrobat Reader' title='Click here to download Acrobat Reader' /></a>").attr("target", "_blank");
	//$("a[href$='.pdf']").after("<img src='/img/icon_pdf.gif' class='pdf' alt='PDF Document' title='PDF Document' />").attr("target", "_blank");	
	
// });

/* funtion to append a zip icon to all pdf links */
// $(document).ready(function(){
// $("a[href$='.zip']").after("<img src='/img/icon_zip.gif' class='pdf' alt='ZIP file' title='ZIP file' />").attr("target", "_blank");	
	
// });