function OtherNaClass(json){
	var _self = this;
	this.data = json;
	var len = this.data.length - 1;
	this.curDom = this.data[len].show;
	var n;
	this.init = function(){
		for(var i=0; i<len ;i++){
			$(this.data[i].el).onclick = function(evt){_self.curClick(evt);};
			$(this.data[i].el).setAttribute('curNum',i);
		}
		$(this.data[this.curDom].el).className = 'naOtItemCur';
		$(this.data[this.curDom].sel).style.display = '';
		$(this.data[this.curDom].cImg).src = 'images/rssBut.png';
	}
	this.curClick = function(evt){
		if(Base.getSrcDom(evt).tagName.toLowerCase() == 'a'){
			return;	
		}
		$(this.data[this.curDom].el).className = 'naOtItem';
		$(this.data[this.curDom].sel).style.display = 'none';
		$(this.data[this.curDom].cImg).src = 'images/rssRight.png';
		if(!!Base.getSrcDom(evt).getAttribute('curNum') || Base.getSrcDom(evt).getAttribute('curNum') == 0){
			n = Base.getSrcDom(evt).getAttribute('curNum');
		}
		else
		{
			n = Base.getSrcDom(evt).parentNode.getAttribute('curNum');	
		}
		$(this.data[n].el).className = 'naOtItemCur';
		$(this.data[n].sel).style.display = '';
		$(this.data[n].cImg).src = 'images/rssBut.png';
		this.curDom = n;
	}
	this.init();
}
function naClass(json){
	var _self = this;
	this.data = json;
	var len = this.data.length - 1;
	this.curDom = this.data[len].show;
	var n;
	this.init = function(){
		for(var i=0; i<len ;i++){
			$(this.data[i].el).onclick = function(evt){_self.curClick(evt);};
			$(this.data[i].el).setAttribute('curNum',i);
		}
		if(this.curDom == 0){
			$(this.data[this.curDom].el).className = 'navItemTopCur';
			$(this.data[this.curDom].sel).style.display = '';
			$(this.data[this.curDom].cImg).src = 'images/rssBut.png';
			return;
		}
		$(this.data[this.curDom].el).className = 'navItemCur borT';
		$(this.data[this.curDom].sel).style.display = '';
		$(this.data[this.curDom].cImg).src = 'images/rssBut.png';
	}
	this.curClick = function(evt){
		if(Base.getSrcDom(evt).tagName.toLowerCase() == 'a'){
			return;	
		}
		if(this.curDom == 0){
			$(this.data[this.curDom].el).className = 'navItemTop';
		}
		else{
			$(this.data[this.curDom].el).className = 'navItem borT';
		}
		$(this.data[this.curDom].sel).style.display = 'none';
		$(this.data[this.curDom].cImg).src = 'images/rssRight.png';
		if(!!Base.getSrcDom(evt).getAttribute('curNum') || Base.getSrcDom(evt).getAttribute('curNum') == 0){
			n = Base.getSrcDom(evt).getAttribute('curNum');
		}
		else{
			n = Base.getSrcDom(evt).parentNode.getAttribute('curNum')	
		}
		this.curDom = n;
		if(n == 0){
			$(this.data[n].el).className = 'navItemTopCur';
			$(this.data[n].sel).style.display = '';
			$(this.data[n].cImg).src = 'images/rssBut.png';
			return;
		}
		$(this.data[n].el).className = 'navItemCur borT';
		$(this.data[n].sel).style.display = '';
		$(this.data[n].cImg).src = 'images/rssBut.png';
	}
	this.init();
}

var Furom = {
	winOpen:function(url){
		window.open(url,'_blank');
	},
	winSelOpen:function(url){
		window.open(url,'_self');
	},
	butTrue:function(){
		if($('checkDom').checked == true){
			$('nextTemp').disabled = false;
			return;
		}
		$('nextTemp').disabled = true;
	},
	baseShow:function(dom){
		if($(dom).style.display==''){
			$(dom).style.display='none';
			$(dom+'_img').src = 'images/rssRight.png';
			return;
		}
		$(dom).style.display='';
		$(dom+'_img').src = 'images/rssBut.png';
	},
	loginShow:function(a,b){
		$(a).style.display = 'none';
		$(b).style.display = '';
	},
	actShow:function(id1,id2,dom1,dom2,s,n){
		$(id1).className = 'navTit active';
		$(id2).className = 'navTit';
		$('actInImg').src = s;
		$('actInImg').alt = n;
		$(dom1).style.display = '';
		$(dom2).style.display = 'none';
		$('navTopTir').innerHTML = n;
	},
	registershow:function(dom0,dom1,dom2){
		$(dom0).style.display = '';
		$(dom1).style.display = 'none';
		$(dom2).style.display = 'none';
	},
	martetShow:function(n){
		if(n==0){
			$('caseShow').style.display = 'none';
			$('market_Show0').style.display='';
			$('market_Show1').style.display='';
			$('market_Show2').style.display='';
			$('navInsideCon').style.display = 'none';
			$('countIn').className = 'navTit active';
			$('countOut').className = 'navTit';
			$('actInImg').src='images/marketImg.jpg';
			$('actInImg').alt='T4F';
			$('caseChange').style.display='none';
			$('navTopTirCase').style.display='none';
			$('navTopTir').style.display='';
		}
		if(n==1){
			$('caseShow').style.display = '';
			$('market_Show0').style.display='none';
			$('market_Show1').style.display='none';
			$('market_Show2').style.display='none';
			//$('navInsideCon').style.display = '';
			$('countIn').className = 'navTit';
			$('countOut').className = 'navTit active';
			$('actInImg').src='images/caseImg.jpg';
			$('actInImg').alt='商业故事';
			$('caseChange').style.display='';
			$('navTopTir').style.display='none';
			$('navTopTirCase').style.display='';
		}
	},
	caseShow:function(id,dom,tit){
		$($('navInsideCon').getAttribute('curNav')).className = 'navInCon';
		$(id).className = 'navInCon naBg';
		$('navInsideCon').setAttribute('curNav',id);
		$($('caseShow').getAttribute('curShow')).style.display = 'none';
		$(dom).style.display = '';
		$('caseShow').setAttribute('curShow',dom);
		$('navTopTirCase').innerHTML = tit;
	},
	threeNavOver:function(node,dom,type){
		$(dom).style.display = '';
		if(Base.domRealPos($(node))[0] < parseInt(Base.getWindowView().w /2)){
			$(dom).style.left =  Base.domRealPos($(node))[0] + Base.getDomWH(node).w -10 + 'px';
			
		}
		else{
			$(dom).style.left = Base.domRealPos($(node))[0] - Base.getDomWH(node).w + 4 + 'px';
		}
		if(type){
			$(dom).style.top = parseInt((Base.getView().h - Base.getDomWH(dom).h) /2 + Base.getScroll().t)  + 'px';
		}
		else{
			$(dom).style.top = Base.domRealPos($(node))[1] -40 + 'px';
		}
		$(node).style.background = 'url(images/listBg.gif) repeat-x';
	},
	threeNavOut:function(node,dom){
		$(dom).style.display = 'none';
		$(node).style.background = '';
	},
	checkEmail:function(str){
		var isemail=(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/);
		if(str == ''){
			alert('请输入您的电子邮箱!');
			return;
		}
		if(str.length>25){
			alert('您输入的邮箱长度太长!');
			return;
		}
		if (!isemail.test(str))
		{
			 alert("您输入的不是邮箱");
		  	 return;
		}
	},
	registerStr:'',		//注册字符串
	regJudge:function(){
		this.checkMain();
		if( this.registerStr== ''){
			Furom.registershow('step2','step1','step3');	//下一步，注册成功
		}
		else{
			alert(this.registerStr);	
		}
	},
	getCountry:function(){
		if($('countrySel').options[$('countrySel').selectedIndex].value == null || $('countrySel').options[$('countrySel').selectedIndex].value == 'null'){
			this.registerStr = '请选择您所在的国家!';
			return;
		}
		if($('countrySel').options[$('countrySel').selectedIndex].value == 'CN'){
			$('provinceText').style.display ='none';	
			$('cityText').style.display ='none';
			$('provinceDom').style.display ='';
			$('cityDom').style.display ='';
			for(var i=0;i<cityArr.length;i++){
				if(i==0){
					$('provinceDom').options[i]=new Option(cityArr[0].cp,null);
					continue;
				}
				$('provinceDom').options[i]=new Option(cityArr[i].cp,i);	
			}
			$('provinceDom').onchange = function(){Furom.cpOnChange($('provinceDom').options[$('provinceDom').selectedIndex].value)};
		}
		else{
			$('provinceText').style.display ='';	
			$('cityText').style.display ='';
			$('provinceDom').style.display ='none';
			$('cityDom').style.display ='none';
		}
	},
	cpOnChange:function(n){
		$('cityDom').options.length = 0;
		for(var i=0; i<cityArr[n].cy.length; i++){
			$('cityDom').options[i] = new Option(cityArr[n].cy[i],cityArr[n].cy[i]);	
		}
		//$('cityDom').onchange = function(){alert($('cityDom').options[$('cityDom').selectedIndex].value)};
	},
	checkMain:function(){
		if($('userName').value == ''){
			this.registerStr = '用户名不能为空!';
			return;
		}
		//email验证...
		Furom.checkEmail($('emailText').value);	
		if($('emailText').value != $('checkEmail').value){
			this.registerStr = '两次输入的邮箱不同!';
			return;
		}
		//email验证...
		//密码验证...
		if($('passText').value == ''){
			this.registerStr = '请输入密码!';
			return;
		}
		if($('passText').value.length < 6){
			this.registerStr = '密码至少6位，不要与姓名和用户名相同!';
			return;
		}
		if($('checkPass').value != $('passText').value){
			this.registerStr = '确认密码和第一次输入的不同!';
			return;
		}
		//密码验证...
		if($('nameText').value == ''){		//姓名验证
			this.registerStr = '请输入您的姓名!';
			return;
		}
		if($('ageText').value == ''){		//年龄验证
			this.registerStr = '请输入您的年龄!';
			return;
		}
		if($('sexSel').options[$('sexSel').selectedIndex].value == null || $('sexSel').options[$('sexSel').selectedIndex].value == 'null'){		//姓别验证
			this.registerStr = '请选择您的性别!';
			return;
		}
		
		if($('provinceText').value == ''&& $('provinceText').style.display != 'none'){		//省份验证
			this.registerStr = '请输入您所在省份';
			return;
		}
		if($('cityText').value == '' &&  $('cityText').style.display != 'none'){		//城市验证
			this.registerStr = '请输入您所在的城市!';
			return;
		}
		
		if($('provinceDom').style.display != 'none'){
			if($('provinceDom').options[$('provinceDom').selectedIndex].value == null || $('provinceDom').options[$('provinceDom').selectedIndex].value == 'null')
			{
				this.registerStr = '请输入您所在省份!';
				return;
			}
		}
		
		if($('addressText').value == ''){		//地址验证
			this.registerStr = '请输入您的地址!';
			return;
		}
		if($('postText').value == ''){		//城市验证
			this.registerStr = '请输入您的邮政编码!';
			return;
		}
		if($('telText').value == ''){		//电话验证
			this.registerStr = '请输入您的电话!';
			return;
		}
		if($('mobileText').value == ''){		//手机验证
			this.registerStr = '请输入您的手机!';
			return;
		}
		if($('comMainSer').options[$('comMainSer').selectedIndex].value == null || $('comMainSer').options[$('comMainSer').selectedIndex].value == 'null'){		//公司业务验证
			this.registerStr = '请选择您所在公司的主要业务!';
			return;
		}
		if($('myJob').options[$('myJob').selectedIndex].value == null || $('myJob').options[$('myJob').selectedIndex].value == 'null'){		//工作验证
			this.registerStr = '请选择您的工作!';
			return;
		}
		if($('compText').value == ''){		//公司名称验证
			this.registerStr = '请输入您公司的名称!';
			return;
		}
		if($('prodText').options[$('prodText').selectedIndex].value == null || $('prodText').options[$('prodText').selectedIndex].value == 'null' ){		//公司产品验证
			this.registerStr = '请选择您公司的产品!';
			return;
		}
		if($('learText').options[$('learText').selectedIndex].value == null || $('learText').options[$('learText').selectedIndex].value == 'null' ){		//学术领域验证
			this.registerStr = '请选择您的学术领域!';
			return;
		}
		if($('schoolText').value == ''){		//毕业院校验证
			this.registerStr = '请输入您的毕业院校!';
			return;
		}
		this.registerStr = '';
	}
}

