
$j = jQuery.noConflict();
$j(document).ready(function() {
	
	$j('a.login-button').click(function() {
		
		$url = $j(this).attr('href');
		
		$j('body').css('overflow', 'hidden');
		$j('body').prepend('<div class="floatingDivClose" style="position:absolute; z-index:9100; left:50%; top:20%; margin:-8px 0 0 258px; cursor:pointer; display:none"><img src="/Style%20Library/Images/closebox.png" alt="" border="0" /></div>');
		$j('body').prepend('<div class="floatingDiv" style="position:absolute; z-index:9000; left:20%; width:60%; top:50%; display:none; border:solid 5px #333; background:#fff; padding:2px"><iframe src="'+$url+'" width="100%" height="100%" border="0" frameborder="no" style="width:100%; height:100%; border-style:none; display:none"></iframe></div>');
		$j('body').prepend('<div class="transArea" style="position:absolute; z-index:8000; left:0; top:0; bottom:0; right:0; background:#000">&nbsp;</div>');
		$j('body .floatingDivClose').click(function() { closeLoginPopup(); });
		$j('body .transArea').click(function() { closeLoginPopup(); });
		$j('body .transArea').css('opacity', 0);
		$j('body .transArea').fadeTo('fast',0.5, function (){
			
			$j('.floatingDiv').show();
			$j('.floatingDiv').css('left', '50%');
			$j('.floatingDiv').css('width', 50);
			$j('.floatingDiv').animate({ marginLeft:"-260px", width:"520px" }, 150);
			$j('.floatingDiv').animate({ top:"20%", height:"300px" }, 150, function() {
				$j('.floatingDivClose').show();
				$j('.floatingDiv iframe').show();
			});
			
		});
		
		return false;
	});
	
});

function closeLoginPopup() {
	$j('.floatingDivClose').remove();
	$j('.floatingDiv').remove();
	$j('.transArea').remove();
	$j('body').css('overflow', 'inherit');
}

