//投票
function clicknum(id){
	var url="/company/clicknum.html";
	$j.post(url,{id:id},function(xml){
		alert(xml); 
	});
}
//产品点击
function clickpro(id){
	var url="/product/clicknum.html";
	$j.post(url,{id:id},function(xml){});
}
//供应点击
function clickbiz(id){
	var url="/gongying/clicknum.html";
	$j.post(url,{id:id},function(xml){});
}
//新闻点击
function clicknew(id){
	var url="/news/clicknum.html";
	$j.post(url,{id:id},function(xml){});
}
//公司点击
function clickcom(id){
	var url="/index/clickcom.html";
	$j.post(url,{id:id},function(xml){});
}
//展会点击
function clickexh(id){
	var url="/index/clickexh.html";
	$j.post(url,{id:id},function(xml){});
}
//视频点击
function clickvid(id){
	var url="/video/clicknum.html";
	$j.post(url,{id:id},function(xml){});
}
//友情连接
function clickbra(id){
	var url="/index/clickbra.html";
	$j.post(url,{id:id},function(xml){});
}
//广告点击
function clickbra(id){
	var url="/index/clickadv.html";
	$j.post(url,{id:id},function(xml){});
}
checkload=function(){
var mname=getCookie("UNAME");
if(mname!=""&&mname!="null"){
	str="<label style='display: block;float:left;width: 56px;'>用户名：</label><span style='display:block;float:left;overflow: hidden;height: 20px;width: 102px;' title='"+mname+"'>"+mname+"</span><a href='/bizroom/index.jsp' style='color:#123f8f;margin:0 10px 0 3px;' target='_blank'>进入商务中心</a><a style='color:#123f8f;' href='/member/out.jsp'>退出</a>";
	$j("#srh_form").html(str);
}
}

function clearvalue(){
	var mname=document.getElementById("uname");
	if(mname!=null){
	var pwd=document.getElementById("pwd");
	mname.onfocus = function () {
		mname.style.color = "#404040";
		if (mname.value == "用户名") {			
			mname.value = "";
		}
	}
	mname.onblur = function () {
		if (mname.value == "") {
			mname.style.color = "#404040";
			mname.value = "用户名";
		}
	}
	pwd.onfocus = function () {
		pwd.style.color = "#404040";
		if (pwd.value == "******") {			
			pwd.value = "";
		}
	}
	pwd.onblur = function () {
		if (pwd.value == "") {
			pwd.style.color = "#404040";
			pwd.value = "******";
		}
	}

	}
}
//主菜单的显隐
var oldt=null;
var oid=0;
function initSort(){
	$j.each($j("#prosort").find('div'),function(i,n){
		oid=oid+1;
		$j(n).find('a[@class=clisj]').attr("href","javascript:;");
		$j(n).find('a[@class=clisj]').bind("click", function(){
			openSort($j(n).find('h3').find('label'));
		});
		var txt="<div class='showAll' style='display:none;'><h3>"+$j(n).find('h3').html()+"</h3><span>"+$j(n).find('span').html()+"</span></div>";
			$j(n).find('h3').html(txt+"<label name='lid"+oid+"'>"+$j(n).find('h3').html()+"</label>");
		$j(n).find('h3').find('label').bind("mouseover", function(){
			openSort(this);
		});
	});
}
function openSort(t){
	var ndis=$j(t).parent().find('div').css("display");
	$j(t).parent().find('div').css("display",ndis=="none"?"block":"none");
	if($j(oldt).attr("name")!=$j(t).attr("name")){$j(oldt).parent().find('div').css("display","none");}
	oldt=t;
}
function changeid(num){
	var flag=document.getElementById("ywflag");
	var nav=$j("#yw"+num);
	var navcon=$j("#ywcon"+num);
	var fav=$j("#yw"+flag.value);
	var favcon=$j("#ywcon"+flag.value);
	var def=$j("#defaultcon");
	if(num!=flag.value){
	def.hide();
    nav.css("border-bottom","none");
    navcon.show();
    fav.removeAttr("style");
    favcon.hide();
    flag.value=num;
    }
    
}
//热门商机
function hotsj(id){
	var zb=$j("#zb");  
	var cjjgyw=$j("#cjjgyw");  
	var tz=$j("#tz");  
	var dl=$j("#dl"); 
	var zbcon=$j("#zbcon");  
	var cjjgywcon=$j("#cjjgywcon");  
	var tzcon=$j("#tzcon");  
	var dlcon=$j("#dlcon"); 
	switch(id){
	  case 1:zb.css({"border-bottom":"1px solid #fff","background":"#fff","font-weight":"bold","padding":"3px 7px 0 7px"});
	         cjjgyw.removeAttr("style");tz.removeAttr("style");dl.removeAttr("style");
	         zbcon.show();cjjgywcon.hide();tzcon.hide();dlcon.hide();
	         $j("#hfg").val(1);
	         break;
	  case 2:cjjgyw.css({"border-bottom":"1px solid #fff","background":"#fff","font-weight":"bold","padding":"3px 5px 0 5px"});
	         zb.removeAttr("style");tz.removeAttr("style");dl.removeAttr("style");
	         zbcon.hide();cjjgywcon.show();tzcon.hide();dlcon.hide();
	         $j("#hfg").val(2);
	         break;
	  case 3:tz.css({"border-bottom":"1px solid #fff","background":"#fff","font-weight":"bold","padding":"3px 7px 0 7px"});
	         cjjgyw.removeAttr("style");zb.removeAttr("style");dl.removeAttr("style");
	         zbcon.hide();cjjgywcon.hide();tzcon.show();dlcon.hide();
	         $j("#hfg").val(3);
	         break;
	  case 4:dl.css({"border-bottom":"1px solid #fff","background":"#fff","font-weight":"bold","padding":"3px 7px 0 7px"});
	         cjjgyw.removeAttr("style");tz.removeAttr("style");zb.removeAttr("style");
	         zbcon.hide();cjjgywcon.hide();tzcon.hide();dlcon.show();
	         $j("#hfg").val(4);
	         break;
	}
}
function provide(id){
	var zxgy=$j("#zxgy"); 
	var zxqg=$j("#zxqg"); 
	var zxgycon=$j("#zxgycon"); 
	var zxqgcon=$j("#zxqgcon"); 
	switch(id){
	  case 1:zxgy.css({"border-bottom":"1px solid #fff","background":"#fff","font-weight":"bold","padding":"3px 7px 0 7px"});
	         zxqg.removeAttr("style");
	         zxgycon.show();zxqgcon.hide();
	         $j("#pfg").val(1);
	         break;
	  case 2:zxqg.css({"border-bottom":"1px solid #fff","background":"#fff","font-weight":"bold","padding":"3px 7px 0 7px"});
	         zxgy.removeAttr("style");
	         zxgycon.hide();zxqgcon.show();
	         $j("#pfg").val(2);
	         break
	}
}
//搜搜
function gqso(){
 var id=$j("#pfg").val();
 var i=parseInt(id);
 switch(i){
 case 1:window.open("/index/gongying/gyso.htm");break;
 case 2:window.open("/index/buy/index.htm");break;
 }
}
function sjso(){
var id=$j("#hfg").val();
var i=parseInt(id);
  switch(i){
  case 1:window.open("/index/business/zbso.htm");break;
  case 2:window.open("/index/business/cjso.htm");break;
  case 3:window.open("/index/business/tzso.htm");break;
  case 4:window.open("/index/business/dlso.htm");break;
  }
	}
//nav
function navmenu(num){
	var flag=document.getElementById("navflag");
	var nav=$j("#nav"+num);
	var fav=$j("#nav"+flag.value);
	if(num!=flag.value){nav.slideDown();fav.slideUp();}
	   flag.value=num;
}
function getYzm(){
    var yzm = $Id("yzm"); 
    yzm.src="/code/code.html?t="+new Date().getTime();   
}
function getsyYzm(){
    var yzm = $Id("codes"); 
    yzm.src="/bcode/code.html?t="+new Date().getTime();   
}
function clogin(){
	$j("#lbtn").attr("disabled","disabled");
	    var mname = $Id("uname").value;
	    if(trims(mname)=="用户名" || trims(mname)=="请输入用户名"){
	      	alert("请输入登录用户名！");
			$Id("uname").focus(); 
			$j("#lbtn").removeAttr("disabled");return false;
		}
	    var pwd = $Id("pwd").value; 
	    if(trims(pwd)=="******"){
	    	alert("请输入登录密码！");
			$Id("pwd").focus(); 
			$j("#lbtn").removeAttr("disabled");
			return false;
	    }
	    var yzm = $Id("yzm").value;
	    if(trims(yzm)==""){
	      	alert("请输入验证码！");
			$Id("yzm").focus(); 
			$j("#lbtn").removeAttr("disabled");
			return false;
	    }
	    if(yzm.length<4){
	      	alert("验证码错误！");
			$Id("yzm").focus(); 
			$j("#lbtn").removeAttr("disabled");
			return false;
	    }
	login.login(yzm,mname,pwd,function(xml){
	getsyYzm();
	$Id("yzm").value="";
	if(xml=="yzm_err"){
		alert("验证码错误!");
		$Id("yzm").focus(); 
	}else if(xml=="m_err"){
		alert("用户名或密码错误，请重新输入!");
	    $Id("uname").focus(); 
    }else if(xml=="login_dsh"){
		alert("您的账户尚在审核中,请进入注册所填邮箱，点击系统所发验证邮件进行账户审核...");
		$Id("pwd").value="";
	}else if(xml=="login_btg"){
		alert("您的账户审核未通过，不能登陆！");
		$Id("pwd").value="";
	}else if(xml=="ok"){
		lName();
		var mname=getCookie("UNAME");
		if(mname!=""&&mname!="null"){
			str="<label style='display: block;float:left;width: 56px;'>用户名：</label><span style='display:block;float:left;overflow: hidden;height: 20px;width: 102px;' title='"+mname+"'>"+mname+"</span><a href='/bizroom/index.jsp' style='color:#123f8f;margin:0 10px 0 3px;' target='_blank'>进入商务中心</a><a style='color:#123f8f;' href='/member/out.jsp'>退出</a>";
			$j("#srh_form").html(str);
		}
		window.open("/bizroom");
	}else{
		alert("登录失败，请重试。。");
	}
	$j("#lbtn").removeAttr("disabled");
	});
	return false;
	}
//明星企业样式
function showmxqy(id){
 var qy=$j("#qy"+id);
 $j(qy).css("background","#e9f2ff");
}
function hidemxqy(id){
 var qy=$j("#qy"+id);
 $j(qy).css("background","#fff");
}
