$(document).ready(function(){


        /* gallery page */
       	$("#paginate div").quickpaginate({ perpage: 9, showcounter: true, pager : $(".paginate_counter") });
       	$(".toggle span.entry").quickpaginate({ perpage: 9, showcounter: true, pager : $(".paginate_counter") });

		$('a.blank').click(function(){
			window.open(this.href);
			return false;
		});

        /* Events page */
        /*$(".toggle div.hidden").hide();*/

        $(".toggle h2 a, .toggle h2").click(function () {
            //$(".toggle div").slideToggle(1000); // close all divs that are open
          //  var rel = $(this).attr("rel");
        //    $(rel).slideToggle(1000);
            $(this).next(".toggle_container").slideToggle("slow");
            return false;
        });

    	//Switch the "Open" and "Close" state per click
    	$("h2.trigger").toggle(function(){
    		$(this).addClass("active");
    		}, function () {
    		$(this).removeClass("active");
    	});

        // highlight
        $(".toggle span.entry h2").mouseover(function(){
			$(this).addClass("over");
		});
		$(".toggle span.entry h2").mouseout(function(){
			$(this).removeClass("over");
		});



		$('a.author').click(function(){
			window.open(this.href);
			return false;
		});

	   //this is for the slider on the home page
        $(".gallery_pic img").hover(
                function () {
                    $(this).css("border","4px solid #ff6633");
                },
                function () {
                    $(this).css("border","4px solid #CCCCCC");
                }
        );


    	//email validation
        $("#contact_form").validate();

        // advertisement sidebar slideshow
     /*   $('#advertisement').cycle({
            fx:     'scrollRight',
            timeout: 6000,
            easeIn:  'bounceout',
            delay:  -2000
        });*/
        // events
        $('#primary .entry .entry span').show();


  			$('.homepics').innerfade({
				animationtype: 'fade',
				speed: 2000,
				timeout: 5000,
				type: 'random',
				containerheight: '1.25em'
			});

			$("#tree").treeview({
				collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				persist: "location"
				//toggle: function() {
					//console.log(this + " has been toggled");
				//}

			});

	$('.blurtext').focus(function() {
		if($(this).attr('value') == $(this).attr('title')) {
			$(this).attr('value', '');
		}
	});

	$('.blurtext').blur(function() {
		if($(this).attr('value') == '') {
			$(this).attr('value', $(this).attr('title'));
		}
	});

});// end of document load

_uacct = "UA-2257992-9";
urchinTracker();