//////////////////全局变量/////////////////////////////////////
//命名空间
$namespace('brand.spu3c.portal');
//页面初始化
brand.spu3c.portal.init=function(){
	//导航分类初始化
	this.initNav();
	//排行榜list动作绑定
	this.initItemList();
	//tab切换
	this.initTabChange();
	
}
////////////////////功能实现区域代码////////////////////
//导航分类初始化
brand.spu3c.portal.initNav=function(){
	$$('#mainNav li').hover(function(){
		$$(this).addClass('current');
		$$(this).find('ul').show();
	},function(){
		$$(this).removeClass('current');
		$$(this).find('ul').hide();
	});
}
//排行榜list动作绑定
brand.spu3c.portal.initItemList=function(){
	
	$$('#hotSale li,#hotSearch li').mouseover(function(){
		$$(this).parent().find('li.current').removeClass('current');
		$$(this).addClass('current');
	});
}
//tab切换
brand.spu3c.portal.initTabChange=function(){
	$$('#specialSale li').mouseover(function(){
		$$('#specialSale li.current').removeClass('current');
		$$(this).addClass('current');
		$$('[tag="specialSaleContent"]').hide();
		var index=$$(this).attr('index');
		$$('#specialSaleContent'+index).show();
		return false;
	});
	$$('#hotItems li').mouseover(function(){
		$$('#hotItems li.current').removeClass('current');
		$$(this).addClass('current');
		$$('[tag="hotItemContent"]').hide();
		var index=$$(this).attr('index');
		$$('#hotItemContent'+index).show();
		return false;
	});
}

/*********** Begin Core Function ***********/
function $namespace(str){
	var arr=str.split(',');
	for(var i=0;i<arr.length;i++){
		// 将命名空间切成N部分, 比如mini、common等
		arr[i]=arr[i].split(".");
		str= "";
		var strEval= "";		
		for (var j = 0; j < arr[i].length; j++){
			if (j!= 0){str += "."};
			str += arr[i][j];
			// 依次创建构造命名空间对象（假如不存在的话）的语句
			// 比如先创建mini，然后创建mini.common依次下去
			strEval += "if (typeof(" + str + ") == 'undefined'){" + str + " = {}};";
		};
		if(strEval != ""){eval(strEval)};
	}
};
/***********  End Core Function  ***********/
window["brand.spu2c.portal.js"]=true;/*  |xGv00|5bac686aec7cf9cc7f8ffc2da9798f72 */
