$(document).ready(function() 
{
	
	
	$("a[rel='photogallery']").colorbox(
		{
			maxWidth: '1100px',
			maxHeight: '1100px',
			current: '{current} / {total}',
			onOpen: function() { $('#lastVideo').hide(0); $('#banner-3').hide(0); },
			onClosed: function() { $('#lastVideo').show(0); $('#banner-3').show(0); }
		}
	);
	$("a[rel='articleImage']").colorbox( 
		{ 
			maxWidth:'1100px',
			maxHeight:'1100px',
			onOpen: function() { $('#lastVideo').hide(0); $('#banner-3').hide(0); },
			onClosed: function() { $('#lastVideo').show(0); $('#banner-3').show(0); } }
	);
	
	$("#share").bookmark( {
						 	sites: ['facebook', 'myspace', 'twitthis', 'digg', 'delicious', 'yahoo', 'bookmarkit', 'orkut', 'windows', 'yahoobuzz', 'google']
						  } );
	
	$("div.scrollable").scrollable( { size: 1, clickable: false } );
	
	myMenu = new SDMenu("my_menu");
	myMenu.init();
		
	// video size
	setYouTubeVideoSize( "#lastVideo", 240 );
	setYouTubeVideoSize( ".videogallery-video", 550 );		

});

function setYouTubeVideoSize( selector, width ) // selector - outter html tag
{
	var vWidth =  $( selector + " object" ).attr( "width" );
	var vHeight = $( selector + " object" ).attr( "height" );
	
	var vRatio = width / vWidth;
	vHeight = vHeight * vRatio;
	vWidth = width;
		
	$( selector + " object" ).attr( "width", vWidth );
	$( selector + " object embed" ).attr( "width", vWidth );
	
	$( selector + " object" ).attr( "height", vHeight );
	$( selector + " object embed" ).attr( "height", vHeight );
}

function setYouTubeVideoSizeEx( selector, width, height ) // selector - outter html tag
{
	var vWidth = width;
	var vHeight = height;	
		
	$( selector + " object" ).attr( "width", vWidth );
	$( selector + " object embed" ).attr( "width", vWidth );
	
	$( selector + " object" ).attr( "height", vHeight );
	$( selector + " object embed" ).attr( "height", vHeight );
}
