	$(document).ready(function() {	
		$('li.mmLi').hoverIntent(
			function() { $('.submenu', this).slideDown('fast'); },					   
			function() { $('.submenu', this).slideUp('fast'); }
		);
		$('li.mmLi').hover(
			function() { $(this).addClass('hover'); },					   
			function() { $(this).removeClass('hover'); }					   
		);
		
		$('.submenu ul').each(function() {
    		$('li:first', this).addClass('first');
  		});

		$('.pastHolder .row').each(function() {
    		$('.issue:first', this).addClass('first');
  		});
  		
  		$('.toc li').each(function(index) {
  			$(this).prepend('<span class="number"></span>');
    		$('.number', this).text(index+1);
  		});

		$(".youtube").click(function() {
			$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'titlePosition'	: 'outside',
			'width'			: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
			});
			return false;
		});
		
		$('img').supersleight({shim: 'images/clear.gif'});	

		function adsize() { 
			
			var $bwidth = $(window).width();

		  	if ($bwidth < 1350) { 
		  		$('#nopageflip').css({ 'right': '0' });
		  	//	$('#topSection .rightColumn').css({ 'position':'absolute', 'right':'180px' });
		  		$('#wrapperInside').css({ 'width': $bwidth });
		  		$('#wrapperOutside').css({ 'width': $bwidth });
		  	} 
		  	
		  	if ($bwidth < 1020) { 
		  		$('#nopageflip').css({ 'right': ''+(($bwidth-1020))+'px' });
		  	//	$('#topSection .rightColumn').css({ 'position':'absolute', 'right':'180px' });
		  		$('#wrapperInside').css({ 'width': '1020px' });
		  		$('#wrapperOutside').css({ 'width': '1020px' });
		  	} 

		  	if ($bwidth > 1021) { 
		  		$('#nopageflip').css({ 'right': '0' });
		  	//	$('#topSection .rightColumn').css({ 'position':'absolute', 'right':'180px' });
		  		$('#wrapperInside').css({ 'width': $bwidth });
		  		$('#wrapperOutside').css({ 'width': $bwidth });
		  	}
		  	
		  	if ($bwidth > 1351) { 
		  		$('#nopageflip').css({ 'right': '0' });
		  	//	$('#topSection .rightColumn').css({ 'position':'relative', 'right': '0' });
		  		$('#wrapperInside').css({ 'width': $bwidth });
		  		$('#wrapperOutside').css({ 'width': $bwidth });
		  	} 

		};
	  	
	  	adsize();
		
		$(window).resize(function() {
	  		adsize();
		});

		
	});

