function voted1(infoid)
{
  // alert('投票已经结束,谢谢!');
 //  return;
 var xh = GetAjaxObject2();

 var url = "";
 if (infoid.indexOf(',') >= 0)
     url = "/expo/common/checkboxVote.aspx?InfoID=" + infoid;
 else
     url = "/expo/common/vote.aspx?InfoID=" + infoid;
    xh.open("POST",url,true)
    
    xh.onreadystatechange=function(){
        if(xh.readyState!=4)
            return
        var v
    v=window.event?xh.responseText:gb2utf8(xh.responseBody)
    //alert(v);
 if(v=="a") 
 {
        location="Index.aspx";
 }
 else if(v.indexOf("b") !=-1)
  {
     
    try
     {
         window.showModalDialog('/expo/common/Fail.htm','','dialogHeight:130px;dialogWidth=300px;edge:Raised;center:Yes;help:no;resizable:no;status:no;');
     }
     catch(e)
     {
        alert('对不起,一天只能投一票!');
      }
   }
else
 {
     alert('你已成功投票,谢谢!');
     //window.open('/expo/2009brand/Active.aspx','','dialogHeight:230px;dialogWidth=450px;edge:Raised;center:Yes;help:no;resizable:no;status:no;');
      /*try
      {
       window.showModalDialog('Succeed.htm','','dialogHeight:110px;dialogWidth=258px;edge:Raised;center:Yes;help:no;resizable:no;status:no;');
       }
       catch 
       {
          //alert('你已成功投票,谢谢!');
       }*/
       document.getElementById("VoteCount" + infoid).innerHTML=v; 
       }
    }
    xh.send(null);
}

function LoadVoteCount(infoid)
{
 var xh = GetAjaxObject();
 var url="/expo/common/vote.aspx?IsLoad=1&InfoID="+infoid;
 //var url="http://www.jieju.cn/expo/2010jmt/vote.aspx?IsLoad=1&InfoID="+infoid;
    xh.open("POST",url,true)
    if(window.Event)
        xh.overrideMimeType("text/xml;charset=gb2312")
    xh.onreadystatechange=function(){
        if(xh.readyState!=4)
            return
        var v
  v=window.event?xh.responseText:gb2utf8(xh.responseBody)
       document.getElementById("VoteCount" + infoid).innerText=v; 
    
    }
    xh.send(null);
}

function LoadViewCount(infoid)
{
 
 var xh = GetAjaxObject();
 var url="/expo/common/vote.aspx?CompanyID=60"+infoid;
 //var url="http://www.jieju.cn/expo/2010jmt/vote.aspx?CompanyID=60"+infoid;
    xh.open("POST",url,true)
    if(window.Event)
        xh.overrideMimeType("text/xml;charset=gb2312")
    xh.onreadystatechange=function(){
        if(xh.readyState!=4)
            return
        var v
  v=window.event?xh.responseText:gb2utf8(xh.responseBody)
 
       document.getElementById("ViewCount" + infoid).innerText=v; 
    }
    xh.send(null);
}

function GetAjaxObject()
{
    var xh;
    try
	{
		   xh = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
	    try
		{
		    xh = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			 xh=null;
		}
	}
	return xh;
}
var gb2utf8=function(data){
        var glbEncode=[],t,i,j,len
        gb2utf8_data=data
        execScript("gb2utf8_data = MidB(gb2utf8_data, 1)+' '", "vbscript")
        t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2")
        t=t.split("@")
        i=0
        len=t.length
        while(++i<len){
            j=t[i].substring(0,4)
            if(!glbEncode[j]) {
                gb2utf8_char = eval("0x"+j)
                execScript("gb2utf8_char=Chr(gb2utf8_char)","vbscript")
                glbEncode[j]=escape(gb2utf8_char).substring(1,6)
            }
            t[i]=glbEncode[j]+t[i].substring(4)
        }
        gb2utf8_data=gb2utf8_char=null
        return unescape(t.join("%")).slice(0,-1)
}

function GetAjaxObject2()
{
    var xmlhttp;
    if (window.XMLHttpRequest) {   
        //针对FireFox，Mozillar，Opera，Safari，IE7，IE8   
       xmlhttp = new XMLHttpRequest();   
      //针对某些特定版本的mozillar浏览器的BUG进行修正   
       if (xmlhttp.overrideMimeType) {   
          xmlhttp.overrideMimeType("text/xml;charset=gb2312")   
       }   
    }
    else if (window.ActiveXObject) {   
        //针对IE6，IE5.5，IE5   
       //两个可以用于创建XMLHTTPRequest对象的控件名称，保存在一个js的数组中   
       //排在前面的版本较新   
       var activexName = ["MSXML2.XMLHTTP","Microsoft.XMLHTTP"];   
       for (var i = 0; i < activexName.length; i++) {   
            try{   
               //取出一个控件名进行创建，如果创建成功就终止循环   
                //如果创建失败，回抛出异常，然后可以继续循环，继续尝试创建   
               xmlhttp = new ActiveXObject(activexName[i]);   
               break;   
            } catch(e){}   
       }   
    }   
    //确认XMLHTtpRequest对象创建成功   
    if (!xmlhttp) {   
        alert("XMLHttpRequest对象创建失败!!");   
        xmlhttp=null;   
    }
    return xmlhttp;
}
