
/*
$(document).ready(function(){
  var hideDelay = 500;    
  var currentID;  
  var hideTimer = null;  
  
  // One instance that's reused to show info for the current person  
	var container = $('<div id="popupContainer"><div id="popupBG">' 
		+ '<div id="popupTop"></div>'  
		+ '<div id="popupContent"></div>'  
		+ '</div></div>');  
  
  $('body').append(container);  
});
*/

var myAjax = function(settings) {
  $.ajax($.extend({}, settings, {
    complete: function (xhr, status) {
      if (settings.complete) {
        settings.complete(xhr, status);
      }

      // Avoid IE memory leak
      xhr.onreadystatechange = null; 
      xhr.abort = null;
    }
  }));
};

$('body').ajaxComplete(function(e, xhr, settings) {
  // Avoid IE memory leak
  xhr.onreadystatechange = null; 
  xhr.abort = null;
});

function showPop(id){
	
	$(document).ready(function(){
		//alert(id);
  		
		if (id > 12){
			id = id - 13;
		}
		
	  var pageID = '/popup_home.php?pop_id=' + id;  
  
      myAjax({  
          type: 'GET',  
          url: pageID,  
          success: function(data)  
          {  
			  $('#popupContent').html(data);  
          }
      });  
     $('#popupContainer').css('display', 'block');  
		var docHeight = $(document).height();
		var winHeight = $(window).height();
		var scrollHeight = 400;

  $('#popupClose').live('click', function()  
	{
         $('#popupContainer').css('display', 'none');  
		  $('#popupContent').html('&nbsp;');  
		  restartFlash();
	});

}); 

}


