jQuery.noConflict();jQuery(document).ready(function($){
//Do stuff once DOM loads

	//Facebox for contact page
	$('li.page-item-9 a').attr({ 
          rel: "facebox"
		  });
	$('a[rel*=facebox]').facebox();

	//Social networks stuff
	$('.socnetcontent').hide();
	
	function randnum (){
		var max = $('div.socnetcontent').length; //how many are there?
		var i = Math.random(); //set a random between 0 and 1
		var randnum = Math.floor(i * max); //Generate the random index number, between 0 and # of images - 1
		return randnum;
	}	

	var showthis = randnum ();

	$(".socnetcontent:eq("+showthis+")").show();
	
		$('.socneticon').click(function(){
		var thispos = $('.socneticon').index(this); //Set index of clicked toggle
		if( $(".socnetcontent:eq("+thispos+")").is(':hidden') ) {
			$('.socnetcontent:visible').slideUp(250);
			$(".socnetcontent:eq("+thispos+")").slideDown(250);
		}
	});
		
	//About Us page tabs
		// When a link is clicked
		$("a.tab").click(function () {
			
			// switch all tabs off
			$(".active").removeClass("active");
			
			// switch this tab on
			$(this).addClass("active");
			
			// slide all elements with the class 'content' up
			$(".tabcontent").hide();
			
			// Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.
			var content_show = $(this).attr("rel");
			$("#"+content_show).show();
		  
		});



	
/*
	$('div.bna p').hide();
	$('div.bna h2').css({'cursor' : 'pointer'}).append(' +/-').click(function(){
		$(this).next().toggle();
	});
*/ 

//Do stuff once whole page loads
	$(window).load(function() {

		//Home Slideshow
		$('#pics').cycle({ 
			fx:    'fade', 
			timeout:       6000,
			speed:  1500 
		 });
		
	});

}); // end doc ready

