


$(window).load(function(){

	if ($('body').attr('rel') != '')
	{
		var thisrel=$('body').attr('rel');
		if ((thisrel != 'reload')||(thisrel != 'member')) {
			var menutag=$('#m'+thisrel);
			var menuid=menutag.parent().attr('id');
			menutag.attr('rel','yes');
			menutag.removeClass().addClass('currentM');
			if (menuid=='mainMenu'){
				if(menutag.prev()){menutag.prev().addClass('noBgimgM');}
			}
		} else if (thisrel == 'reload'){
			$('#mAuction').attr('rel','yes');
			$('#mAuction').removeClass().addClass('currentM');
		}
	}
	// 顶部导航-我的拍鞋
	$('div.topNavSub').hover(function(){
		if ($(this).is('#siteMap')) {$('#iTakeShoes').removeClass('iTakeShoes');}
		$(this).find('ul').fadeIn();
		$(this).addClass('current');
	},function(){
		if ($(this).is('#siteMap')) {$('#iTakeShoes').addClass('iTakeShoes');}
		$(this).removeClass('current');
		$(this).find('ul').hide();
	});
	$('#iTakeShoes a').click(function(){
		if ($('#js_loginStatus').attr('rel')!='yes'){
			$('#jsOpenLogin').click();
			return false;
		}
	});
	 
	// 菜单鼠标移动效果
	effect.menu($('#mainMenu li'));
	effect.menu($('#subMenu li'));
	// 鞋类别选择效果
	
	 
	
	 
  //导航菜单
  $.ajax({
	url:'/templates/top/menuLoaderNew.htm?t=' + ( new Date() ).getTime().toString(),
	type: 'GET',
	dataType: 'html',
	cache:true,
	timeout: 80000,
	error: function(){
	},
	success: function(data){
		$('<div></div>').appendTo(document.body).css('display','none').html(data);
		$('#mMales div').html($('#jMales').html());
		$('#mFemale div').html($('#jFemale').html());
		$('#mSports div').html($('#jSports').html());
		$('#mKids div').html($('#jKids').html());
		$('#mOutdoor div').html($('#jOutdoor').html());
	}
  });
	$('#waiIsLongin').click(function(){
		refreshUser();
	});
});


 

 
 
//获取页面实际大小
function getPageSize(){
	var xScroll,yScroll;
	if (window.innerHeight && window.scrollMaxY){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		sScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth,windowHeight;
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	var pageWidth,pageHeight
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}
	if(xScroll < windowWidth) {
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

var effect = new Object;
effect.setTimeout;
	effect.menu = function(element){
		element.hover(function(){
			var $this=$(this);
			$this.addClass('current');
			$this.find('.menuSub').hide();
			if ($this.find('.menuSub').text()!='' )
			effect.setTimeout=setTimeout(function(){$this.find('.menuSub').fadeIn(200); },100);


			var menuid=$this.parent().attr('id');
			if (menuid=='mainMenu'){
				if($this.prev()){$this.prev().addClass('noBgimg');}
			}
		},function(){
			clearTimeout(effect.setTimeout);
			$(this).removeClass('current');
			$(this).find('.menuSub').hide();
			
			var menuid=$(this).parent().attr('id');
			if (menuid=='mainMenu'){
				if($(this).prev()){$(this).prev().removeClass('noBgimg');}
			}
			
		});
	}

function changenewslook(num)
{
	for (var i = 0; i < 7; i++)
	{
		document.getElementById("newslook"+i).style.display = 'none';
	}
	document.getElementById("newslook"+num).style.display = '';
}

 
 
