$(function(){

	$('#footNavigationArea > ul > li:last').css('border', 'none');
	$('#footNavigationArea > ul > li:first').css('padding-top', '6px');
	$('ul.subnav').find('li:last a').css('border', 'none');
	$('.teamslide ul li:last').css('border', 'none');
	//$('.indexContentAreaWrap, #indexContentArea').fadeTo(0, .85	);
	$('.servicetree ul:first').css('margin-top', '15px')
/*	$('#headerArea').wrapInner('<div class="headcenter">');
	$('.headcenter').css({'width': '90%', 'margin':'0px auto'})*/
	
	var windowheight = $(window).height();
	var windowidth = $(window).width();
		if(windowidth < 1024){
			$('#logo').css('margin-left', '0px');
			$('.caption').css('margin-right', '70px');
		}

		if(windowheight > 760){
					$('.indexContentAreaWrap').css('margin-top', (windowheight - $('.indexContentAreaWrap').height()- 150)/2 +'px' );
					/*$('.teamxContentAreaWrap').css('margin-top', (windowheight - $('.teamxContentAreaWrap').height()- 150)/2 +'px' );*/
					$('.aboutContentAreaWrap').css('margin-top', (windowheight - $('.aboutContentAreaWrap').height()- 150)/2 +'px' );
					
		}
		else{
			$('.indexContentAreaWrap, .indexContentAreaWrap, .aboutContentAreaWrap').css('margin-top', '10px' );
		}
	
		
	$(window).resize(function(){
			//location.reload();

			var windowheight = $(window).height();
			if(windowheight > 760){
				$('.indexContentAreaWrap').css('margin-top', (windowheight - $('.indexContentAreaWrap').height()- 150)/2 +'px' );
				/*$('.teamxContentAreaWrap').css('margin-top', (windowheight - $('.teamxContentAreaWrap').height()- 150)/2 +'px' );*/
				$('.aboutContentAreaWrap').css('margin-top', (windowheight - $('.aboutContentAreaWrap').height()- 150)/2 +'px' );
			}
			else{
				$('.indexContentAreaWrap, .indexContentAreaWrap, .aboutContentAreaWrap').css('margin-top', '10px' );
			}

	})
	$('#showHideFootNav').click(function(){
		if($('#footNavigationArea').hasClass('up')){
			$('#footNavigationArea').removeClass('up');
			$(this).removeClass('showed');
			$('#footNavigationArea').animate({'bottom':'-116px'}, 600)
		}
		else{
			$('#footNavigationArea').addClass('up');
			$(this).addClass('showed');
			$('#footNavigationArea').animate({'bottom':'36px'}, 600)	
		}
		
	})
	var navwidth = windowidth - 200 +'px';

	$('#footNavigationArea > ul > li').hoverIntent(function(){
		$(this).children('ul').animate({'width':navwidth}, 500);
	}, function(){
		$(this).children('ul').animate({'width':'10px'}, 300);
	})
	
	/*if($(".teamslide").length > 0){
		$(".teamslide").easySlider();
	}*/
	
	$('.viewport').height((windowheight - 260)+'px');
	var scrollwhellHeight = (windowheight - 250)+'px';
	$('#serviceContentArea, #teamContentArea').height((windowheight - 160)+'px');
	
	if($(".serviceContent").length > 0){
		$('.serviceContent').tinyscrollbar();
		$('.tradingScroll').tinyscrollbar();
		$('.tradingScroll').hide();
	}
	
	if($(".teamslideArea").length > 0){
		$('.teamslideArea').tinyscrollbar();
	}
	
	

	$('#fullBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.exeTeam, .resTeam, .tradingTeam, .saleTeam, .investTeam').hide();
			$('.fullTeam').show();
			$('.teamslideArea').tinyscrollbar_update(0)
		}
	})
	$('#exeBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$(' .resTeam, .tradingTeam, .saleTeam, .investTeam, .fullTeam').hide();
			$('.exeTeam').show();
			$('.teamslideArea').tinyscrollbar_update(0)
		}
	})
	$('#resBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.exeTeam, .tradingTeam, .saleTeam, .investTeam, .fullTeam').hide();
			$('.resTeam').show();
			$('.teamslideArea').tinyscrollbar_update(0)
		}
	})
	$('#tradBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.exeTeam, .resTeam, .saleTeam, .investTeam, .fullTeam').hide();
			$('.tradingTeam').show();
			$('.teamslideArea').tinyscrollbar_update(0)
		}
	})
	$('#salesBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.exeTeam, .resTeam, .tradingTeam, .investTeam, .fullTeam').hide();
			$('.saleTeam').show();
			$('.teamslideArea').tinyscrollbar_update(0)
		}
	})
	
	$('#investBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.exeTeam, .resTeam, .tradingTeam, .saleTeam, .fullTeam').hide();
			$('.investTeam').show();
			$('.teamslideArea').tinyscrollbar_update(0)
		}
	})
	
	$('#resButs').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.tradingContent, .salesArea').hide();
			$('.serviceContent').show();
			$('.serviceContent').tinyscrollbar_update(0)
		}
	})
	$('#invBank').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.salesArea, .serviceContent').hide();
			$('.tradingContent').show();
			$('.tradingContent').tinyscrollbar_update(0)
		}
	})
	$('#salButs').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.tradingContent, .serviceContent').hide();
			$('.salesArea').show();
		}
	})
	
	$('#conGenBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.mediaContact,.careerOpprtunities').hide();
			$('.generalContact').show();
		}
	})
	
	$('#conSalBut').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.generalContact,.mediaContact').hide();
			$('.careerOpprtunities').show();
		}
	})
	$('#media').click(function(e){
		e.preventDefault()
		if($(this).hasClass('selected')){
			return
		}
		else{
			$('.teamTypesNav a').removeClass('selected');
			$(this).addClass('selected');
			$('.generalContact,.careerOpprtunities').hide();
			$('.mediaContact').show();
		}
	})
	$('embed').attr('wmode', 'transparent')

	
})





