function changeHeight(a){var b=document.getElementById('banner');if(typeof(b)!='undefined'){b.style.height=parseInt(a)+'px'}}$(function(){$("div#banner").each(function(){swfobject.embedSWF("../header.swf","flash","100%","100%","8.0.0","",{headerxmlfile:"../library/header.xml"},{wmode:"transparent"})});var j="../images/triangle_right.gif";var k="../images/triangle_down.gif";$("div#left_column a.accordion").each(function(){var a;var b;var c;var d;var e='down';var f='right';var g=$(this);var h='JQ-open';var i='JQ-folded';g.removeAttr('href').css({'cursor':'s-resize'});b=$(this).parent();if(b.is('li')){a=$(this).siblings().filter('ul').hide().addClass(i)}else if(b.is('h2')){a=b.parent().siblings('ul.menu').hide().addClass(i)}g.click(function(){a.each(function(){if($(this).hasClass(i)){$(this).removeClass(i).addClass(h).slideDown();g.css({'cursor':'n-resize'});if(b.is('li')){g.css({'background-image':'url('+k+')'})}else if(b.is('h2')){d=g.children('img');c=d.attr('src').replace(f,e);d.attr('src',c)}}else if($(this).hasClass(h)){$(this).removeClass(h).addClass(i).slideUp();g.css({'cursor':'s-resize'});if(b.is('li')){g.css({'background-image':'url('+j+')'})}else if(b.is('h2')){d=g.children('img');c=d.attr('src').replace(e,f);d.attr('src',c)}}})})})});

// hide email addresses from spambots
$(document).ready(function(){
	$('a.email').each(function(){
		$(this).attr("href", "mailto:" + $(this).html().replace("(at)","@").replace("(dot)",".")); 
		$(this).html($(this).html().replace("(at)","@").replace("(dot)","."));
	});
});

function showHide(element_id) {
	if (document.getElementById && document.getElementById(element_id) && document.getElementById(element_id).style) {
		var menu  = document.getElementById(element_id);
		var arrow = document.getElementById(element_id + '_arrow');
		if (menu.style.display == "block") {
			menu.style.display = "none";
			if (arrow.src) { arrow.src = arrow.src.replace("down","right"); }
		}
		else {
			menu.style.display = "block";
			if (arrow.src) { arrow.src = arrow.src.replace("right","down"); }
		}
	}
}

function mailpage() {
	mail_str = "mailto:?subject=Check out " + escape(document.title);
	mail_str += "&body=I thought you might be interested in " + escape(document.title);
	mail_str += ". You can view it here, " + location.href;
	location.href = mail_str;
}

//toggle show/hide - AFS section

$(document).ready(function(){
		
		//Hide (Collapse) the toggle containers on load
		$(".toggle_container").hide(); 

		//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
		$("h2.trigger").click(function(){
			$(this).next().slideToggle("slow", function() {

			});
				return false; //Prevent the browser jump to the link anchor
			});
		//switches + to -
		$('a.toggler').click(function() {
			var $this = $(this).find('span');
			$this.text($this.text() == '+' ? '-' : '+');
		});
	});


// search filter - Panam 


(function ($) {
  // custom css expression for a case-insensitive contains()
  jQuery.expr[':'].Contains = function(a,i,m){
      return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
  };

  function listFilter(list) { // list is an unordered list

    $('#filterinput')
      .change( function () {
        var filter = $('#filterinput').val();
	//remove category filters
	$('#content ul li').show();
	$('#content ul div').show();
        if(filter != '') {
          // this finds all links in a list that contain the input,
          // and hide the ones not containing the input while showing the ones that do
          $(list).find("a:not(:Contains(" + filter + "))").parent().slideUp();
          $(list).find("a:Contains(" + filter + ")").parent().slideDown();
        } else {
          $(list).find("li").slideDown();
        }
	$('#content div').hide();
        return false;
      })
    .keyup( function () {
        // fire the above change event after every letter
        $(this).change();
    });
  }

  //ondomready
  $(function () {
    listFilter($("#list"));
  });
}(jQuery));



