$(document).ready(function(){
	resize();
	xhover();
	kantSmall();
});
$(window).resize(function(){
	resize();
});
function resize ()
{
	if ($('#auth').size())
	{
		$('#auth').css('top', Math.ceil($(window).height()/2-$('#auth').height()/2));
		$('#auth').css('left', Math.ceil($(window).width()/2-$('#auth').width()/2));
		$('#auth-shadow').css('top', $('#auth').offset().top+$('#auth').height()+1);
		$('#auth-shadow').css('left', $('#auth').offset().left-53);
	}
}
function xhover ()
{
	$('.xhover').mouseover(function(){
		$(this).addClass('hover');
		$(this).mouseout(function(){
			$(this).removeClass('hover');
		});
	});
}
function kantSmall ()
{
	$('.kant-small').prepend($('<span class="kant-1"></span><span class="kant-2"></span><span class="kant-3"></span><span class="kant-4"></span>'));
}
function goLocation (url)
{
	window.location=url;
}
function popup(url, width, height, param)
{
	if(!width){width=400;}
	if(!height){height=200;}
	
	top=Math.ceil($(window).height()/2-Math.ceil(height/2));
	left=Math.ceil($(window).width()/2-Math.ceil(width/2));
	if (url.indexOf('?')!=-1)
	{
		param='&'+param+'&_small';
	}
	else
	{
		param='?'+param+'&_small';
	}
	return window.open(url+param, 'popup_'+Math.random(), 'top='+top+', left='+left+', width='+width+', height='+height);
}