function GetAjaxStr(strurl)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.open("Get",strurl,false);
	xmlhttp.send();
	var strret=unescape(xmlhttp.ResponseText);
	return strret;
}
function send_Pricerequest(url,obj) 
  {
	http_Pricerequest = false;
	
	if(window.XMLHttpRequest) 
	{ 
		http_Pricerequest = new XMLHttpRequest();
		if (http_Pricerequest.overrideMimeType) 
		{
			http_Pricerequest.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) 
	{ 
		try 
		{
			http_Pricerequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				http_Pricerequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) 
			{}
		}
	}
	if (!http_Pricerequest) 
	{ 
		return false;
	}
		http_Pricerequest.onreadystatechange = obj;

		http_Pricerequest.open("GET", url, true);
		http_Pricerequest.setRequestHeader("Content-Type","text/html");    
        http_Pricerequest.setRequestHeader("Content-Type","GBK");   
		http_Pricerequest.send(null);
}
  

function getLogin()
{
	send_Pricerequest("/admin/user.asp?timestamp=" + new Date().getTime(),ShowResultP);	
}

function ShowResultP()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			
            if(rText=="")
			{
				document.getElementById("userinfo").innerHTML =  "";
			}
			else
			{

				document.getElementById("userinfo").innerHTML =  rText;
			}
		}	
	}
	else
	{

	}
}

function GetUnit(id,count,getid)
{
	document.getElementById("unitlist1").innerHTML =  "<p align=center>载入中...</p>";
	for (i=1;i<=count;i++)
	{
	  document.getElementById("td"+i).className="unittitle1";
	}
	document.getElementById("td"+getid).className="unittitle";
	send_Pricerequest("/Dealer/getDealer.asp?id="+id+"&timestamp=" + new Date().getTime(),ShowUnit1);
   
}

function GetUnit1(id,count,getid)
{
	document.getElementById("unitlist2").innerHTML =  "<p align=center>载入中...</p>";
	for (i=1;i<=count;i++)
	{
	  document.getElementById("tdd"+i).className="unittitle1";
	}
	document.getElementById("tdd"+getid).className="unittitle";
	send_Pricerequest("/Dealer/getDealer.asp?id="+id+"&s=0&timestamp=" + new Date().getTime(),ShowUnit2);

}

function ShowNewsunit(top,id,getid)
{
	document.getElementById("NewsList1").innerHTML =  "<p align=center>载入中...</p>";
	send_Pricerequest("/Dealer/getnew.asp?top="+top+"&id="+id+"&t="+getid+"&timestamp=" + new Date().getTime(),GetNew);

}

function GetNew()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			
            if(rText=="")
			{
				document.getElementById("NewsList1").innerHTML =  "";
			}
			else
			{

				document.getElementById("NewsList1").innerHTML =  rText;
			}
		}	
	}
	else
	{
		
	}
}

function ShowUnit1()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			
            if(rText=="")
			{
				document.getElementById("unitlist1").innerHTML =  "";
			}
			else
			{

				document.getElementById("unitlist1").innerHTML =  rText;
			}
		}	
	}
	else
	{
		
	}
}

function ShowUnit2()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			
            if(rText=="")
			{
				document.getElementById("unitlist2").innerHTML =  "";
			}
			else
			{

				document.getElementById("unitlist2").innerHTML =  rText;
			}
		}	
	}
	else
	{
		
	}
}

function tp(c,id,agentid)
{
	send_Pricerequest("/Dealer/tp.asp?c="+c+"&id="+id+"&agentid="+agentid+"&timestamp=" + new Date().getTime(),ShowTp);	
}
function ShowTp()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
            if (rText=="0")
            {
              alert("对不起，一天内只能投票100次。");
            }
			else
			{
			  alert("投票成功");
			   document.getElementById("tpdiv").innerHTML =  rText;
			}
           
		}	
	}
	else
	{
		
	}
}

function px(id)
{
	send_Pricerequest("/News/px.asp?id="+id+"&timestamp=" + new Date().getTime(),ShowPx);	
}
function ShowPx()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			 if (rText=="0")
            {
              alert("对不起，一天内只能投票100次。");
            }
			else
			{
            alert("评选成功");
            document.getElementById("tpdiv").innerHTML =  rText;
			}
		}	
	}
	else
	{
		
	}
}

function Ft(id)
{
    document.getElementById("FtText").innerHTML =  "<p align=center><br><br>载入中...</p>"
	send_Pricerequest("/News/ajax.asp?id="+id+"&timestamp=" + new Date().getTime(),ShowFt);	
}
function ShowFt()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			
            if(rText=="")
			{
				document.getElementById("FtText").innerHTML =  "";
			}
			else
			{

				document.getElementById("FtText").innerHTML =  rText;
			}
		}	
	}
	else
	{
		
	}
}

function Smrb(id)
{
    document.getElementById("smrbstr").innerHTML =  "<p align=center><br><br>载入中...</p>"
	send_Pricerequest("/News/qczk.asp?id="+id+"&timestamp=" + new Date().getTime(),ShowSmrb);	
}
function ShowSmrb()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");
			
            if(rText=="")
			{
				document.getElementById("smrbstr").innerHTML =  "";
			}
			else
			{

				document.getElementById("smrbstr").innerHTML =  rText;
			}
		}	
	}
	else
	{
		
	}
}

function activedDate(id)
{

	send_Pricerequest("/admin/activedDate.asp?id="+id+"&timestamp=" + new Date().getTime(),ShowactivedDate);	
}
function ShowactivedDate()
{
  	  
	var rText="";
	
	if (http_Pricerequest.readyState == 4) 
	{
		if (http_Pricerequest.status == 200) 
		{
			rText=http_Pricerequest.responseText.replace(/^\s*/,"");

            if(rText=="")
			{
				
			}
			else
			{
                
				if(rText=="1")
				  window.location.href='/Dealer/Error.asp';
			}
		}	
	}
	else
	{
		
	}
}