$(document).ready(function(){



}); 


  /*****************************************************************************
   *
   * IMage popup
   *  
   ****************************************************************************/
  $.ImagePopup= {
	
    show: function(img) {
	sifr_hide();

	// Hide objects that are always on top
  	$("object").css("visibility","hidden");
  	$("embed").css("visibility","hidden");
      	$("select").css("visibility","hidden");

	
	// Create background
	var background = $('<div/>');
	$(background).attr('class', 'ImagePopupBackground');
	$(background).css("opacity","0");
	$(background).animate({'opacity' : '.7'}, 300);


	var height=$(document).height();
	if (height<$(window).height()) {
		var height=$(window).height();	
	}

	$(background).css(
		{
		'width' : $(document).width(),
		'height' : height

		});

	$('body').append(background);

	// Create image 

	var newImage = $('<img/>');
	var width = $('body').width();
	$(newImage).attr('src',img);
	$(newImage).attr('class', 'ImagePopupImg').css(
		{
	
		});
	


	$('body').append(newImage);
	

	// Wait for image to load
 
	$(newImage).css('visibility','hidden');
	$(newImage).load(function () {
		
		$(newImage).css('visibility','visible');
		var top=$(newImage).vCenter();

		
		
 		$(this).css("left",$(document).width()/2-$(this).width()/2);

		$(this).css({'opacity' : '.1'});
		$(this).animate({'opacity' : '1'}, 300, function() {

			$(this).bind('click', function() {

 				sifr_show();


				$(this).fadeOut(400, function() {
					$(this).remove();
					$("object").css("visibility","visible");
		  			$("embed").css("visibility","visible");
		      			$("select").css("visibility","visible");

				});
				$('.ImagePopupBackground').fadeOut(400, function() {
					$(this).remove();
				});
			});
		});
	});
    }

  }



    




  