/*common scripts*/
$(window).load(function(){// console.log('load');
	var iFooterHeight = $('#seoFooter').outerHeight();
			
	$('#seoFooter')
	.css({
		'position' : 'absolute',
		'top' : $(window).height()-26,
		'height' : 25,
		'overflow' : 'hidden',
		'z-index' : -1
	})
	.addClass('close');
	$('#seoFooter a.sitemap')
	.toggle(
		function(){
			$('#seoFooter')
			.removeClass('close')
			.addClass('open')
			.css({
				'z-index' : 10
			})
			.animate({
				'height' : iFooterHeight
			},500);
		},
		function(){
			$('#seoFooter')
			.removeClass('open')
			.addClass('close')
			.animate({
				'height' : 25
			},500,function(){
				$('#seoFooter')
				.css({
					'z-index' : -1
				});
			});
		}
	);
	$('#seoFooter a:not(.sitemap)').click(function(e){
		e.stopPropagation();
	});

	$('#introContainer.withLogo,#splashContainer')
	.css({
		'position' : 'absolute',
		'top' : '50%',
		'left' : '50%'
	});
	
	$('#introContainer.withLogo')
	.css({
		'margin-top' : -($('#introContainer.withLogo').outerHeight()/2 + 10),
		'margin-left' : -($('#introContainer.withLogo').outerWidth()/2)
	});

	$('#splashContainer')
	.css({
		'margin-top' : -($('#splashContainer').outerHeight()/2 + 30),
		'margin-left' : -($('#splashContainer').outerWidth()/2)
	});
})
.resize(function(){// console.log('resize');
	$('#seoFooter')
	.css({
		'top' : $(window).height()-26
	});
});
$(document)
.click(function(){// console.log('click');
	if($('#seoFooter').hasClass('open')){
		$('#seoFooter a').click();
	}
});
$(function(){// console.log('ready');
	if($('.lb').length){
		$('.lb').fancybox();
	}
	if($('#topmenu').length){
		$('#topmenu').find('li').hover(function(){
			$(this).removeClass('sfout').addClass('sfhover');
		},
		function(){
			$(this).removeClass('sfhover').addClass('sfout');
		});
	}
	$('#leftfootermenu a.sitemap').click(function(e){
		e.stopPropagation();
		e.preventDefault();
		$('#seoFooter a.sitemap').click();
	});
	$('a[href="#zoomMore"]').click(function(e){
		e.preventDefault();
		changeSize(1);
	});
	$('a[href="#zoomLess"]').click(function(e){
		e.preventDefault();
		changeSize(-1);
	});
	changeSize();
});

var size = (getCookie("size"))?parseInt(getCookie("size")):3;
var aSize = new Array('9px','10px','11px','12px','13px','14px','15px');
function changeSize(n){
	if(n==undefined) n = 0;
	size += n;
	if(size<0) size = 0;
	if(size>6) size = 6;
	$('body').css({
		'font-size' : aSize[size]
	});
	setCookie("size",size);
}

