function $(id) {return document.getElementById(id);}

function SearchView()
{
	var seachURL;
	var word1;
	var sel1;
	var sel2;
	var cs='';
	seachURL="CompanyList.aspx";
	word1=$("SeachWord1").value;
	sel1=$("Seachhy1").options[$("Seachhy1").options.selectedIndex].value;
	sel2=$("Seachcs1").options[$("Seachcs1").options.selectedIndex].value;
	
//	if(word1 ==''||sel1==''||sel2=='')
//	{			
//		alert("搜索关键字不能为空!");
//	}
//	else
//	{		
	    if(word1!='')
	        cs="?word="+$("SeachWord1").value;
	    
	    seachURL+=cs;
	    
		if(sel1!='')
		{
		    if(cs!='')
			    cs="&industry="+sel1;
			else
			    cs="?industry="+sel1;
			seachURL+=cs;
		}		
			
		if(sel2!='')
		{
		    if(cs!='')
		        cs="&area="+sel2;
		    else
		        cs="?area="+sel2;
		         
		    seachURL+=cs;
		}
			
		
		window.open(encodeURI(seachURL),'_blank');
//	}
}

function getCookie(){//获取指定名称的cookie的值 
  var name="7c4a8d09ca3762af61e59520943dc26494f8941b";
  var firstCharPos,lastCharPos;
    var theBigCookie = document.cookie;
    firstCharPos = theBigCookie.indexOf(name);
    if(firstCharPos != -1)
    {//skip 'name' and '='.
    firstCharPos +=name.length + 1;
    //Find the end of the value string (i.e. the next';').
    lastCharPos = theBigCookie.indexOf(';', firstCharPos);
    if(lastCharPos == -1) lastCharPos = theBigCookie.length;
    //Return thevalue.
    return theBigCookie.substring(firstCharPos, lastCharPos);
    }
    else
    { return false;}
}

function GetTopItem()
{
	var un=getCookie();
	var h="";	
	if(!un){
	h+='<a href="login.aspx" class="a1">登录</a> <span>｜</span>';
	h+='<a href="regist.aspx" class="a2">注册</a> <span>｜</span>';
	}else{
	h+='<a class="a2">欢迎:'+un+'&nbsp;&nbsp;</a>';
	h+='<a href="LoginOut.aspx" >退出</a> <span>｜</span>';
	}
	$("dl").innerHTML= h;
}

function check()
{    
    //event.returnValue = true;
    var ck=$("h1").value;
    var t1=$("Text1").value;
    var t2=$("Text2").value;
    if(t1==""||t2==""){
        alert("请输入完整信息！");
        event.returnValue = false;
    }
    else
    {
        $("h1").value=1;
    }
    if(ck==1){       
            alert("请不要重复提交！");
            event.returnValue = false;
    }
    //$("h1").value=1;
}
function regcheck()
{
    var ck=$("h1").value;
    var un=$("uname").value;
    var up1=$("upsw1").value;
    var up2=$("upsw2").value;
    var ut=$("utel").value;
    var ue=$("umail").value;
    var s1=$("s1").value;
    var ad1=$("ad1").value;
    
    if(s1=="省份"){       
            alert("请选择所在地区!");
            event.returnValue = false;
    }
    
    if(un!=""&&up1!=""&&up2!=""&&ut!=""&&ue!=""&&s1!=""&&ad1!="")
        $("h1").value=1;
    
    if(ck==1){       
            alert("请不要重复注册！");
            event.returnValue = false;
    }
}

function jhcheck()
{
    var ck=$("h1").value;
    var cn=$("cardnum1").value;
    var xm=$("trname").value;
    if(cn!=""&&xm!="")
        $("h1").value=1;
    if(ck==1){       
            alert("请不要重复提交！");
            event.returnValue = false;
    }
}

function jhsbcheck()
{
    var ck=$("h2").value;
    var cn=$("cardnum1").value;
    var xm=$("trname").value;
    var jhm=$("jhtext").value;
    var yzm=$("textcode").value;
    
    if(cn!=""&&xm!=""&&jhm!=""&&yzm!="")
        $("h2").value=1;
    if(ck==1){       
            alert("请不要重复提交！");
            event.returnValue = false;
    }
}

function jhdkcheck()
{    
    //event.returnValue = true;
    var ck=$("h1").value;
    var tx1=$("card1").value;
    var tx2=$("card2").value;
    var t1=$("card1").value.length;
    var t2=$("card2").value.length;
    
    if($("ck1").checked)
    {
        if(t1<15||t1>19){                       
            alert("您输入的卡号位数不正确！");
            event.returnValue = false;
        }
        else
        {
            if(tx1!=tx2){alert("两次输入的卡号不一致！");event.returnValue = false;} 
            else{$("h1").value=1;}            
        }
        if(ck==1){       
            alert("请不要重复提交！");
            event.returnValue = false;
        }
    }
    else
    {
        alert("提交绑定信息前请同意承诺书！");
        event.returnValue = false;
    }
}

function jhdk(n)
{
    if(n==1)
    {
        $("dk1").style.display="";
    }
    else
    {
        $("dk1").style.display="none";
    }
}
//防重复发送短信
function fdx()
{
    var ck=$("h1").value;
    
    if(ck==1){       
            alert("休息一下，请不要重复发送！");
            event.returnValue = false;
    }
    $("h1").value="1";
}
//计算等价的金币
function isjb()
{
	$('isjb').innerHTML=Div($('Text1').value,10);
}
//整除
function Div(exp1, exp2)
{
    var n1 = Math.round(exp1); //四舍五入
    var n2 = Math.round(exp2); //四舍五入
    
    var rslt = n1 / n2; //除
    
    if (rslt >= 0)
    {
        rslt = Math.floor(rslt); //返回值为小于等于其数值参数的最大整数值。
    }
    else
    {
        rslt = Math.ceil(rslt); //返回值为大于等于其数字参数的最小整数。
    }
    
    return rslt;
}
//财富卡申请防重复提交
function cfksubmit()
{
    var ck=$("h1").value;
    var n=$("trname").value;
    var t=$("sj").value;
    
    if(ck==1){       
            alert("休息一下，请不要重复提交！");
            event.returnValue = false;
    }
    if(n!=""&&t!="")
		$("h1").value="1";
}
//贴标申请防重复提交
function tbsubmit()
{
    var ck=$("h1").value;
    var n=$("trname").value;
    var t=$("sj").value;
    var k=$("kh").value;
    
    if(ck==1){       
            alert("休息一下，请不要重复提交！");
            event.returnValue = false;
    }
    if(n!=""&&t!=""&&k!="")
		$("h1").value="1";
}