function showLoginSpotlight(url) {
	var cw = $('cart_widget'), f = $('darkfade');
	var ws = window.getSize().scrollSize;
	f.style.width = ws.x+"px";
	f.style.height = ws.y+"px";

	cw.oldz = Number(cw.style.zIndex);
	cw.style.zIndex = 9000;
	if(!f.onclick)
		f.onclick = hideLoginSpotlight;

	window.scrollTo(0, 0);
	var blur = new Fx.Styles(f, {duration:500, onComplete: function(){
	    $('login_hints').style.display = 'block';
	}});
	if(url)
		document.forms['malinaLogin'].elements['return'].value = url.toString();
	blur.start({opacity:[0,.8]});
}


function hideLoginSpotlight()
{
	var f = $('darkfade');
	var sharp = new Fx.Styles(f, {duration:500, onComplete: function(){
		$('cart_widget').style.zIndex = $('cart_widget').oldz;
	    $('login_hints').style.display = 'none';
	}});
	sharp.start({opacity:[.8,0]});

}

window.addEvent('domready', function(){
	if($('darkfade')) {
		document.addEvent('keydown', function(e){
			e = new Event(e);
			if (e.code == 27)
				if($('darkfade').style.visibility!='hidden')
					hideLoginSpotlight();
		});

		window.addEvent('resize', function(){
			var f = $('darkfade');
			var ws = window.getSize().scrollSize;
			f.style.width = ws.x+"px";
			f.style.height = ws.y+"px";
		})
	}
})

