var jQ = jQuery.noConflict();

jQ(document).ready(function(){
  // ie 6 png fix
  jQ(document).pngFix();

  jQ("dd:not(dd.open)").hide();
  
  jQ("#accordion a").each( function(iter){
  	
	// iteration index value.
	var currAHref = jQ(this).attr('href');
	jQ(this).parent().next().find("img").wrap('<a href="'+currAHref+'"></a>');
  });
  
  jQ("dt a").hover(function(){
  
     if (jQ("dd:not:visible").get()[0] !== jQ(this).parent().next().get()[0]) {		
     
	jQ("dd:visible").slideUp("slow");
	jQ(this).parent().next().slideDown("def");
	
	//bind hyperlink to image
	//var currAHref = jQ(this).attr('href');
	//jQ(this).parent().parent().find("dd").bind("click", function(){
		//location = jQ(this).attr('label');
	//	location = currAHref;
		//alert(window.location);
	//});
	//jQ(this).parent().parent().find("img").wrap('<a href="'+currAHref+'"></a>');
     }
     
  });

  //mouseover images
  jQ("#images .csc-textpic-image img").hover(function(){
     
     jQ(this).fadeTo(150, 1.0); // This sets the opacity to 100% on hover
     var str = jQ(this).parent().siblings().text();

     jQ(".imgContainer").append('<img src="fileadmin/wellness/imgs/'+str+'" />');     
     jQ(".imgContainer").before('<div class="loaderBG"> </div><div class="loader"><img src="fileadmin/wellness/imgs/ajax-loader.gif"/> </div>');
  
  },function(){
     jQ(this).fadeTo(150, 0.6); // This sets the opacity back to 60% on mouseout
     jQ("#imagesLarge").empty();
     jQ("#imagesLarge").append('<div class="imgContainer"> </div>');
  });
  
});
