var $jg = jQuery.noConflict();

function popingout(){
	//alert("here");						   		   
	//When you click on a link with class of poplight and the href starts with a # 
	
	var popID = "popup1"; //Get Popup Name
	var popURL = "#?w=550"; //Get Popup href to define size
		 
				
	//Pull Query & Variables from href URL
	var query= popURL.split('?');
	var dim= query[1].split('&');
	var popWidth = dim[0].split('=')[1]; //Gets the first query string value

	//Fade in the Popup and add close button
	$jg('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('');
		
	//Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css
	var popMargTop = ($jg('#' + popID).height() + 80) / 2;
	var popMargLeft = ($jg('#' + popID).width() + 80) / 2;
		
	//Apply Margin to Popup
	$jg('#' + popID).css({ 
		'margin-top' : -popMargTop,
		'margin-left' : -popMargLeft
	});
		
	//Fade in Background
	$jg('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
	$jg('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 
		
	return false;
}

function popingout_second(){
	//alert("here");						   		   
	//When you click on a link with class of poplight and the href starts with a # 
	
	var popID = "popup2"; //Get Popup Name
	var popURL = "#?w=550"; //Get Popup href to define size
		 
				
	//Pull Query & Variables from href URL
	var query= popURL.split('?');
	var dim= query[1].split('&');
	var popWidth = dim[0].split('=')[1]; //Gets the first query string value

	//Fade in the Popup and add close button
	$jg('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('');
		
	//Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css
	var popMargTop = ($jg('#' + popID).height() + 80) / 2;
	var popMargLeft = ($jg('#' + popID).width() + 80) / 2;
		
	//Apply Margin to Popup
	$jg('#' + popID).css({ 
		'margin-top' : -popMargTop,
		'margin-left' : -popMargLeft
	});
		
	//Fade in Background
	$jg('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
	$jg('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 
		
	return false;
}

