// function of Dulux


$(document).ready(function(){
	//***************************************** IE7 z-index fix *****************************************
	var zIndexNumber = 10000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});

	//***************************************** check browser *****************************************
	/*if ($.browser.msie) {
		$('.shadow').css({top:'-8px',left:'-8px'});
	}*/
	var userAgent = navigator.userAgent.toLowerCase();
	$.browser.chrome = /webkit/.test(navigator.userAgent.toLowerCase());
	
	function resizeWrapper(e) {
		$('.wrapper').css({height:$(window).height()-100});
		
		var bg_h = $('.back-ground').height();
		var bg_w = $('.back-ground').width();
		
		var wrap_h = $('.wrapper').height();
		var wrap_w = $('.wrapper').width();
		var win_h = $(window).height();
		var win_w = $(window).width();	
		var new_h = wrap_w * bg_h / bg_w ;
		//$('.wrapper').css({height:win_h-100});
		$('.back-ground').css({width:wrap_w});
		//update backgorund height
		//$('.back-ground').css({top:(wrap_h/2) - (bg_h/2), height:new_h});
		$('.back-ground').css({top:(wrap_h/2) - (new_h/2), height:new_h});
	
		$('.txt-box').css({top:(win_h-100)/2-($('.txt-box').height())/2-50,left:win_w/2-10});
		
		
	
	}
	
	resizeWrapper(null);
	$(window).bind("resize", resizeWrapper);
	

});
