// Shopping cart related javascript

$(document).ready(function () {

$('.buy_image_form').submit(function() {
									 
	var url = $(this).attr('action');
	var print_size = $(this).find('input[name=print_size]:checked').val();
	
     Shadowbox.open({
          content : url + '?print_size=' + print_size + '&modal=true',
          height : 600,
          width : 800,
		  player: "iframe",

     });

     return false; 
});
//////////////////////////////////////////////////////////////////////////////////
// Add overlay on submit order click
//////////////////////////////////////////////////////////////////////////////////
$('#submit_order').submit(function() {
								   
		$('body').append('<div id="mask"></div>');
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set height and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight, 'opacity':0.8});
		
		
		
		
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
		
		//Set the popup window to center
		$('body').append('<div id="window_content"></div>');
		$('#window_content').css('top',  winH/2 + 100);
		$('#window_content').css('left', winW/2-$('#window_content').width()/2);
		
		$('#window_content').css('background-color', '#454545');
		
		$('#window_content').html('<h3>Processing...</h3>');
		//transition effect		
		$('#mask').fadeIn(200);					  
		$("#window_content").fadeIn(600);
		
});
//////////////////////////////////////////////////////////////////////////////////
});//end doc ready
