var $j = jQuery.noConflict();$j('document').ready(function() {      $j('.album_section:first').css('height', '520px').addClass("currently_viewing");                                                                                                                      	// Albums Page		$j(".open_album").hover(function() {		parent_element = $(this).parent().parent();				$j(".album_section").not(parent_element).animate({ // All album_sections except current one lower opacity			"opacity" : ".5"		}, { queue:false, duration: 300 });			}, function() {				$j(".album_section").not(parent_element).animate({			"opacity" : "1"		}, { queue:false, duration:300 });				return false;	});		// H3 closes current section, so hovering over it changes the cursor to a pointer	$j(".album_section h3").hover(function() {				$j(this).css({			"cursor" : "pointer"		});			}, function() {				$j(this).css({			"cursor" : "auto"		});	});		$j(".open_album").click(function() {				// Get height of album_info to know what height to animate album_section to		element_height = $j(this).parent().parent().children(".album_info").height();				//alert (element_height);				$j(this).hide();				// currently_viewing class is added to open elements to close them when another album is opened		$j(".currently_viewing").animate({			"height" : "100px"		}, { queue:false, duration: 300});				$j(".currently_viewing").children("li").children(".open_album").show();				$j(".currently_viewing").removeClass("currently_viewing");				$j(this).parent().parent().animate({			"height" : element_height + 120 + "px"		}, { queue:false, duration: 300 });				$j(this).parent().parent().addClass("currently_viewing");				return false;	});		//Onload expand the first Album				/*if ( $('.album_section').length ) 		{ 	element_heights = $j(this).parent().parent().children(".album_info").height();	alert (element_heights); 		}*/					;		$j(".album_section h3").click(function() {				$j(this).parent().parent().animate({				"height" : "100px"			}, { queue:false, duration: 300 });					// Once the album is closed, the open_album element is reapplied		$j(this).parent().parent().children("li").children(".open_album").show();	});		// SLIDING DROPDOWNS				$j("#nav ul li").each(function() {					var $sublist = $j(this).find('ul:first');				$j(this).hover(function() {				$j(this).addClass('hover');			$sublist.stop().css( {height:"auto", overflow:"hidden", display:"none"} ).slideDown(400, function() {				$j(this).css( {height:"auto", overflow:"visible"} );			});			},		function() {				$j(this).removeClass('hover');			$sublist.stop().slideUp(400, function()	{					$j(this).css( {display:"none", overflow:"hidden"} );			});		});		});	// CUFON - FONT REPLACEMENT		Cufon.replace('h1', {		textShadow: 'rgba(255,255,255,1) 0px 1px 0px'	});			// CSS ENCHACEMENTS 		$j('#main .latest .post:odd').after('<br class="clear" />');	$j('#main .next ol li:odd').after('<br class="clear" />');	$j('ul li div.comment').after('<br class="clear" />');			// TABS WIDGET 		$j(function() {		var contentWrapper = $j('#sidebar .tabs .wrap .tab');		// only show the first item, hide the rest		contentWrapper.hide().filter(':first').show();				$j('.tabs ul.tabs-nav li a').click(function () {				    // check if this item doesn't have class "current"		    // if it has class "current" it must not execute the script again		    if (this.className.indexOf('current') == -1){		    	contentWrapper.hide();		    	contentWrapper.filter(this.hash).fadeIn();		    	$j('.tabs ul.tabs-nav li a').removeClass('current');		    	$j(this).addClass('current');		    }		    return false;		});	});			// SLIDER (by CSS-Tricks http://css-tricks.com/examples/FeaturedContentSlider/ )		$j("#featwrap").fadeIn('slow');			$j(function(){	    	    $j("#main-photo-slider").codaSlider();	    	    $navthumb = $j(".nav-thumb");	    $crosslink = $j(".cross-link");	    	    $navthumb	    .click(function() {	    	var $this = $j(this);	    	theInterval($this.parent().attr('href').slice(1) - 1);	    	return false;	    });	    	    theInterval();	});			//-------------------------------------------------//		youtube playlist jquery plugin//		Created by dan@geckonm.com//		www.geckonewmedia.com////		v1.1 - updated to allow fullscreen //			 - thanks Ashraf for the request//-------------------------------------------------$j.fn.ytplaylist = function(options) {   // default settings  var options = jQuery.extend( {    holderId: 'ytvideo',	playerHeight: '300',	playerWidth: '450',	addThumbs: false,	thumbSize: 'small',	showInline: false,	autoPlay: true,	showRelated: true,	allowFullScreen: false  },options);   return this.each(function() {							   		var selector = $j(this);				var autoPlay = "";		var showRelated = "&rel=0";		var fullScreen = "";		if(options.autoPlay) autoPlay = "&autoplay=1"; 		if(options.showRelated) showRelated = "&rel=1"; 		if(options.allowFullScreen) fullScreen = "&fs=1"; 				//throw a youtube player in		function play(id)		{		   var html  = '';			   html += '<object height="'+options.playerHeight+'" width="'+options.playerWidth+'">';		   html += '<param name="movie" value="http://www.youtube.com/v/'+id+autoPlay+showRelated+fullScreen+'"> </param>';		   html += '<param name="wmode" value="transparent"> </param>';		   if(options.allowFullScreen) { 		   		html += '<param name="allowfullscreen" value="true"> </param>'; 		   }		   html += '<embed src="http://www.youtube.com/v/'+id+autoPlay+showRelated+fullScreen+'"';		   if(options.allowFullScreen) { 		   		html += ' allowfullscreen="true" '; 		   	}		   html += 'type="application/x-shockwave-flash" wmode="transparent"  height="'+options.playerHeight+'" width="'+options.playerWidth+'"></embed>';		   html += '</object>';					   return html;		   		};						//grab a youtube id from a (clean, no querystring) url (thanks to http://jquery-howto.blogspot.com/2009/05/jyoutube-jquery-youtube-thumbnail.html)		function youtubeid(url) {			var ytid = url.match("[\\?&]v=([^&#]*)");			ytid = ytid[1];			return ytid;		};						//load inital video		var firstVid = selector.children("li:first-child").addClass("currentvideo").children("a").attr("href");		$j("#"+options.holderId+"").html(play(youtubeid(firstVid)));				//load video on request		selector.children("li").children("a").click(function() {						if(options.showInline) {				$j("li.currentvideo").removeClass("currentvideo");				$j(this).parent("li").addClass("currentvideo").html(play(youtubeid($j(this).attr("href"))));			}			else {				$j("#"+options.holderId+"").html(play(youtubeid($j(this).attr("href"))));				$j(this).parent().parent("ul").find("li.currentvideo").removeClass("currentvideo");				$j(this).parent("li").addClass("currentvideo");			}															 									return false;		});				//do we want thumbs with that?		if(options.addThumbs) {						selector.children().each(function(i){											  				var replacedText = $j(this).text();								if(options.thumbSize == 'small') {					var thumbUrl = "http://img.youtube.com/vi/"+youtubeid($j(this).children("a").attr("href"))+"/2.jpg";				}				else {					var thumbUrl = "http://img.youtube.com/vi/"+youtubeid($j(this).children("a").attr("href"))+"/0.jpg";				}												$j(this).children("a").empty().html("<img src='"+thumbUrl+"' alt='"+replacedText+"' />"+replacedText).attr("title", replacedText);							});						}					     }); };$j(function() {						$j("ul.demo2").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo2', showRelated: false, playerWidth: '550', playerHeight: '350',});		});		}); //end document.ready
