$(document).ready(function() {
	
  $("a[rel^='lightbox']").colorbox();
  
  //Carousel image thumbnails
  $("ul[rel^='carousel']").jcarousel();
  
  
  $('#send_this').click(function(){ 
    
    var url = "/externewindows/recommend.php3?mylang=de&page=" + $(this).attr('rel');
    $.colorbox({href:url, iframe:true, height:500, width:500})
        
  });
  
  // for openx ads layering themeselves on top
  // of the lgihtbox gallery

  $("embed").attr("wmode", "opaque").wrap('<div>');
  
  // For IE
 // $("object").css('z-index', '0');
 //$("object").append('<param name="wmode" value="transparent" ></param> ');
  //$("object").wrap('<div>');
}); 


function display_yt_vid(youtube_id)
{

	$.getJSON('http://gdata.youtube.com/feeds/api/videos/' + youtube_id + '?v=2&alt=jsonc&callback=?', function(yt) {
		if(yt)
		{
			// Calculate dimensions
			var width = 450;
			var height = ((3/4) * width) + 25;
			
			// console.log(yt.data);
			
			// Check widescreen
			if(yt.data.aspectRatio && yt.data.aspectRatio == 'widescreen') height = ((9/16) * width) + 25;

			// Append Div
			$('#boat_video').append('<object ' +
			'	type="application/x-shockwave-flash"  ' +
			'	data="http://www.youtube.com/v/' + yt.data.id + '?rel=0"  ' +
			'	width="'+width+'"  ' +
			'	height="'+height+'"> ' +
			'<param name="wmode" value="transparent" /> ' +
			'<param name="movie" value="http://www.youtube.com/v/' + yt.data.id + '?rel=0" /> ' +
			' </object>'); 
		}
		
	});
	
}



