jQuery(document).ready(function() 
{
	$('body').find('a').filter('[@rel=prettyPhoto]')
	{
		jQuery("a[rel^='prettyPhoto']").prettyPhoto
		({    
			callback: function() {window.location.reload(true);},
			animationSpeed: 'normal', 		/* fast/slow/normal */
			padding: 40, 					/* padding for each side of the picture */
			opacity: 0.35, 					/* Value betwee 0 and 1 */
			showTitle: false, 				/* true/false */
			allowresize: false, 			/* true/false */
			counter_separator_label: ' of ', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'dark_rounded' ,			/* light_rounded / dark_rounded / light_square / dark_square */
			 markup:''
			
		});
	};
//	jQuery('a.prettyPhoto').click(function(){
//	if(jQuery('object').is(':visible'))
//		{
//		jQuery('object').css('visibility','hidden');
//		}
//	});
	
});

jQuery(document).ready(function()
	{
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
		if(is_chrome)
		{
			jQuery('a.prettyPhoto').click(function()
			{
				if(jQuery('object').is(':visible'))
					{
					jQuery('object').css('visibility','hidden');
					}
					
				jQuery("a.pp_close").click(function()
					{
					if(jQuery('object').is(':hidden'))
						{
						setTimeout(function() { jQuery('object').css('visibility','visible'); }, 500);
						
//						jQuery('object').delay(3000).queue(function()
//						{
//						jQuery('object').css('visibility','visible');
//						});
						}
					});
					
					jQuery(".pp_overlay").click(function()
										{
										if(jQuery('object').is(':hidden'))
											{
											setTimeout(function() { jQuery('object').css('visibility','visible'); }, 500);
											}
										});
			
				});
		}
		
		
			if(jQuery.browser.msie && jQuery.browser.version <=9)
			{
				jQuery('a.prettyPhoto').click(function()
				{
					if(jQuery('embed').is(':visible'))
						{
						jQuery('embed').css('visibility','hidden');
						}
						
					jQuery("a.pp_close").click(function()
						{
						if(jQuery('embed').is(':hidden'))
							{
							setTimeout(function() { jQuery('embed').css('visibility','visible'); }, 500);
							}
						});
						
						jQuery(".pp_overlay").click(function()
											{
											if(jQuery('embed').is(':hidden'))
												{
												setTimeout(function() { jQuery('embed').css('visibility','visible'); }, 500);
												}
											});
				
					});
			}
	
	});
	
	
	
