$j = jQuery.noConflict();

function closeLB() {
	jQuery('#PopUpLightBox').empty();
	jQuery('#PopUpLightBoxBG').empty();
	jQuery('#PopUpLightBox').hide();
	jQuery('#PopUpLightBoxBG').hide();
}

function closeLBWithEffects(){
	var speed	=	2;
	setTimeout("RealCloseLBWithEffects()", 1000);
}
function RealCloseLBWithEffects(){
	var speed	=	"slow";
	jQuery('#PopUpLightBox').hide(speed);
	jQuery('#PopUpLightBoxBG').hide(speed);
}

function openLB() {
	jQuery('#PopUpLightBox').hide();
	jQuery('#PopUpLightBoxBG').hide();
	//jQuery('#PopUpLightBox').center();
	//jQuery('#PopUpLightBoxBG').center();
	jQuery('#PopUpLightBox').show();
	jQuery('#PopUpLightBoxBG').show();
	centerPopup('PopUpLightBox',0,0);
	centerPopup('PopUpLightBoxBG',0,0);
}
function showLbLoader() {jQuery('#lb_loader').show();}
function hideLbLoader() {jQuery('#lb_loader').hide();}


function centerPopup(element,xMargin,yMargin) {
	if(xMargin == null)xMargin=0;
	if(yMargin == null)yMargin=0;
	
	var height=document.getElementById(element).offsetHeight;//hauteur de l'�l�ment � positionner
	var width=document.getElementById(element).offsetWidth;//largeur de l'�l�ment � positionner
		
	var pHeight=document.documentElement.clientHeight;//Hauteur de l'�l�ment parent
	var pWidth=document.documentElement.clientWidth;//Largeur de l'�l�ment parent
	
	var sTop=document.documentElement.scrollTop;//Hauteur de d�filement de l'�l�ment parent
	var sLeft=document.documentElement.scrollLeft;//Longueur de d�filement de l'�l�ment parent
	
	if(sTop == 0 || sTop == null){
			sTop = document.body.scrollTop;
			sLeft=document.body.scrollLeft;
	}
	
	//alert('pHeight= '+pHeight+' & sTop= '+sTop+' & height= '+height+' ');
	var posY=(pHeight-height)/2+sTop+yMargin-100;//Calcul de la position en Y
	var posX=(pWidth-width)/2+sLeft+xMargin;//Calcul de la position en X
	
	document.getElementById(element).style.top=posY+"px";
	document.getElementById(element).style.left=posX+"px";
}
function callSimplePopUp(url,title,width,height) {
	var t = window.open(url,'AW','height='+height+',width='+width+',top=100,left=100');
	return false;
}
