$(document).ready(function(){
	resize();
	$('body').find('a.active.oneStr').click(function(){
		return false;
	});
	$('body').find('.left .oneStr').click(function(){
		if($(this).hasClass('active')) {
			return false;	
		} else {
			var box_id = $(this).attr('id');
			$('body').find('.left .oneStr.active').removeClass('active');
			$(this).addClass('active');
			$box = $('body').find('.right .box');
			$box.removeClass('hidden').removeClass('actual');
			$box.each(function(){
				if($(this).hasClass(box_id)){
					$(this).addClass('actual')
				} else {
					$(this).addClass('hidden')	
				};
			});
			$('.right .hidden').animate({
				opacity: 0
			},300,function(){
				$(this).slideUp();
				$('.right .actual').slideDown(function(){
					$('.right .actual').animate({
						opacity:1
					},300);
				});
			});
		}
		return false;
	});
}) 

var tm; 
window.onresize = function(e) {
	clearTimeout(tm);
	tm = setTimeout(resize, 200);
}

var w, h, ml;
function resize() {
	w=(window.innerWidth)?window.innerWidth: 
		 ((document.all)?document.body.offsetWidth:null); 
	h=(window.innerHeight)?window.innerHeight: 
	     ((document.all)?document.body.offsetHeight:null);
	
	if (w < 978){
		$(".center").css("marginLeft", "0");
		$(".center").css("left", "0");
		$(".slider").css("width", "906px");
		$(".leftRight").css("width", "964px");
		$(".bodyBox").css("width", "950px");
	} else {
		$(".center").css("marginLeft", "-475px");
		$(".center").css("left", "50%");
		$(".slider").css("width", "906px");
		$(".leftRight").css("width", "978px");
		$(".bodyBox").css("width", "100%");
	}

}

function closeVideo() {
	$(".videoLayer").css("display", "none");
}

function showVideo() {
	var mTop = $(window).height()/2-180;
	//alert(mTop);
	$(".videoLayer").css("display", "block");
	$(".videoBox").css("top", mTop+"px");
}


