////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Element im Browserfenster zentrieren

jQuery.fn.extend({
	center: function() {
	if (self.pageYOffset)													{y = self.pageYOffset;}
	else if (document.documentElement && document.documentElement.scrollTop){y = document.documentElement.scrollTop;}
	else if (document.body) 												{y = document.body.scrollTop;}
	xpos 	= ($(window).width()-$(this).width())/2;
	ypos 	= (($(window).height()-$(this).height())/2) + y;
	$(this).css({top:ypos+'px',left:xpos+'px'});
	return $(this);
	}
});

$(function(){
	
	$('#navTable a,#toolTable a').focus(function(){
    	$(this).children().css('backgroundPosition','0px -18px');
 	});
	
	$('#navTable a,#toolTable a').blur(function(){ 
    	$(this).children().css('backgroundPosition','left 0px');
 	});
	$("#navTable a,#toolTable a:not(.lit)").hover(
		function () {
        	$(this).children().css('backgroundPosition','0px -18px');
      	}, 
      	function () {
        	$(this).children().css('backgroundPosition','left 0px');
      	}
    );
});

function checkLogin(){
	var email_regex = /^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,4})$/;
	if (document.login.name.value=="")
			{alert("Please enter your Username");return;}
	if (document.login.pass.value=="")
			{alert("Please enter your Password.");return;}
	document.login.submit();
}	
