// JavaScript Document

var ajax = function(page,div,effect){
	
	var div = '#' + div;
	
	//alert(jQuery(div).html());
	jQuery(div).css("opacity", "0.5");
	//jQuery(div).html('<div align="center"><img src="../images/loader.gif" align="middle" border="0" /></div><br />'+jQuery(div).html());
 	jQuery.ajax({ 
	   type: "POST", 
	   url: page,
	   cache: false,
	   success: function(data){ 
 	    jQuery(div).css('display','none');
		if (effect == 'fade')
		 {
		   jQuery(div).html(data).fadeIn('slow');
		 }
		else if (effect == 'slide')
		{
			jQuery(div).html(data).slideDown('slow');
		}
		else if (effect == 'show')
		{
			jQuery(div).html(data).show('slow');
		}
		else if (effect == 'none')
		{
			jQuery(div).html(data);
			jQuery(div).css('display','block');
		}
		
		jQuery(div).css("opacity", "15");	
		
		//lightwindowInit();
		
		$(function() {
	    $('#container a').lightBox();
        });
		
	   
	   } ,
	   error: function (){
		 alert("Sorry!\n\nAn Error Occured! While fatching data from server.\nDetails: \n\nURL: "+page+"\nDIV: "+div+"\nEFFECT: "+effect);
	   }
	   
  });

//alert(jQuery(div).css);
//jQuery(div).css("display", "none");

}
	
