function init(){
	checkBrowser();
	$(window).bind('resize', function() {
		initPage();
	});
	initPage();	
	
	$('.txt').focus(function(){			 
		$(this).addClass('txt-focus');
	});
	$('.txt').blur(function(){
		$(this).removeClass('txt-focus');
	});	
	
	$('.btn').mouseover(function(){
		$(this).addClass('btn-hover');
	});
	$('.btn').mouseout(function(){
		$(this).removeClass('btn-hover');
	});	
	
	$('.box').mouseover(function(){
		$(this).addClass('box-hover');
	});
	$('.box').mouseout(function(){
		$(this).removeClass('box-hover');
	});		
	
	$('#top-menu').lavaLamp({fx: 'swing', speed: 333});
	
	$('#dien .item, #nien .item').mouseover(function(){
		$(this).addClass('item-hover');
	});
	$('#dien .item, #nien .item').mouseout(function(){
		$(this).removeClass('item-hover');
	});			
	
}
function checkBrowser(){
	if ($.browser.safari){
		var userAgent = navigator.userAgent.toLowerCase(); 
		if(userAgent.indexOf('chrome') == -1){
			$('body').addClass("safari");
		}
	}
	if ($.browser.msie){
		$('body').addClass("ie"+$.browser.version.split('.')[0]);
	}	
}
function initPage(){
	var width = $(window).width();
	var pageSize = 1029;
	var margins = width - pageSize;
	
	if(margins > 0){
		$('#left-bg').width(margins/2 +27);
		$('#left-bg').css({'left': -margins/2});
		$('#right-bg').width(margins/2 +27);
		$('#right-bg').css({'right': -margins/2});		
	}
	else{
		$('#left-bg').width(27);
		$('#left-bg').css({'left': 0});
		$('#right-bg').width(27);
		$('#right-bg').css({'right': -0});			
	}
}