(function ($) {
		   
  // Use jQuery with the shortcut:
  //console.log($.browser);
  $(document).ready(function() {  
							 
  	//var text = jQuery("h1").text();
	//alert(text);
	
	 
	// Hide all the paragraphs. 
	//jQuery("p").hide(); 
	// Fade them into visibility. 
	//jQuery("p").fadeIn("slow"); 
	
		// Drupal behavior to attach our AJAX click handler to links with
		// the .our-links class.
		/*
		Drupal.behaviors.OurModule = function(context) {
		  //$('a.our-links:not(.our-module-processed)', context)
		  $('.linklist a.our-links:not(.our-module-processed)', context)
		  .addClass('our-module-processed').each(function() {
			$(this).click(function(e){
			
			  // Remove the default click handler.
			  e.preventDefault();
		
			  // Get the URL of the clicked link.
			  var toLoad = $(this).attr('href');
			
			  // Now load the content
			  xhr = $.ajax({
				url: toLoad,
				success: function(data) {
				  
				  // Inject the new content into <div id="our-div"></div>
				  $('.field-name-field-sidebar').html($('#our-new-content', data));
				  
				  // Call attachBehaviors to ensure that any behavious in the
				  // injected content are fired.
				  Drupal.attachBehaviors(context);
				}
			  });
		
			});
		  });
		}
		*/
		
		// THIS WORKS
		//jQuery("#main .linklist li").hide();
		
		if ($('.view-case-studies .linklist a').is('.active')) {
			//it has active class already
		} else {
			// would need to make sure individual case study not linked to already -- check url var?
			//$('.linklist li:first a').addClass("active");
		}
		
		function loadcs(url) {
		  
		  $('#casestudybox').load('http://www.tricore.com/cspull.php?nid=' + url);
		  
		}
		
		jQuery('.view-case-studies .linklist a').click( function (e) {
																  
			//alert($(this).attr('href'));
			targeturl = $(this).attr('href');
			e.preventDefault();
			$('.linklist a').removeClass("active");
			$(this).addClass("active");
			loadcs(targeturl);
			
		});
		
		//jQuery('#casestudybox').load('http://tricore.t1media.com/about/?ajax=1');
		
	
  
	});
  
}(jQuery));;

