if(!window.jQuery) alert('File: loginbox.js\nError: jQuery required');
else { ;(function($){
				  
	var shadowSize = 8;
	
	var $box = false;
	var $boxLink = false;
	var $container = false;
			
	function init() {
		
		$box = $('#login-box');
		$boxLink = $('#login-box-link');
		if($box.length < 1) return;
		if($boxLink.length < 1) return;
		$container = $boxLink.parent();
		
		$container.append($box);
		
		boxLeft = $boxLink.position().left + $boxLink.width() - $box.width() + 20;
		boxTop  = $boxLink.position().top + $boxLink.height() + 7;
		
		$box.css({
			'display'  : 'none',
			'position' : 'absolute',
			'left'     : boxLeft+'px',
			'top'      : boxTop+'px'
		});
		$('*', $box).css('position','relative');
		
		$boxLink.click( toggle );
		$box.blur( hide );
		
		$('input[type=reset]',$box).click( hide );
		
		// auto shows when there is an error
		$('#login-box').has('.login-error').slideToggle();
	}
	
	function toggle() {
		$box.slideToggle();
		return false;
	}
	
	function hide() {
		$box.slideUp();
	}
	
	$(init);
	
})(jQuery); }


