
function load_init()
{
	var page=1;
	GetResult(1,"province");
	in_list(page);
	in_news();
}

function in_list(page)
{
document.getElementById("list").innerHTML =template;
if (ZoneID==1){
	var url="/httpreq/search.asp?action=search&maxpage=15&MaxTop=0&order=3&desc=0&skin=0&page="+escape(page)+"&province="+escape(AreaID);
}else if(ZoneID==0){
	var url="/httpreq/search.asp?action=search&maxpage=15&MaxTop=0&order=3&desc=0&skin=0&page="+escape(page)+"&County="+escape(AreaID);
	}else{
	var url="/httpreq/search.asp?action=search&maxpage=15&MaxTop=0&order=3&desc=0&skin=0&page="+escape(page)+"&city="+escape(AreaID);
		}
var ajaxobj=new AJAXRequest;
ajaxobj.method="POST"; 
ajaxobj.url=url;
//order:order by
//desc:0-desc,1-asc
ajaxobj.callback=function(xmlobj) {
var response = xmlobj.responseText.split("$$");
if (response[0]!='0'){
set_innerHTML('list',response[0]);
if (response[2]!=0){
	var pagediv=PageList(page,8,response[1],response[2],'in_list');
	document.getElementById("list_page").innerHTML =pagediv;
	}
}else{set_innerHTML('list',response[1])}
}
ajaxobj.send();
}

function GetResult(pid,selectid)
{
var ajaxobj=new AJAXRequest;
ajaxobj.method="POST"; 
ajaxobj.url="/reg.asp?action=getpost&pid="+pid+"&elementID="+selectid+"";
ajaxobj.callback=function(xmlobj) {
var response = xmlobj.responseText.split("$$");
BuildSel(response[0],document.getElementById(response[1]));
}
ajaxobj.send();
}

function BuildSel(str,sel)
{
//先清空原来的数据.
sel.options.length=0;
var arrstr = new Array();
arrstr = str.split(",");
sel.options.add(new Option( "---请选择---","")); 
if(str.length>0) 
{
for(var i=0;i<arrstr.length;i++)
{
//分割字符串
var subarrstr=new Array;
var myEle = document.createElement("OPTION") ;
subarrstr=arrstr[i].split("|");
//生成下级菜单
myEle.value = subarrstr[0];
myEle.text = subarrstr[1];
sel.options.add(myEle); 
}
sel.options[0].selected=true
}
}
function in_news(){
	if (ZoneID==1){
		var url="/httpreq/search.asp?action=in_list&maxpage=8&MaxTop=8&skin=2&order=0&desc=0&province="+escape(AreaID);}
	else if(ZoneID==0){
		var url="/httpreq/search.asp?action=in_list&maxpage=8&MaxTop=8&skin=2&order=0&desc=0&County="+escape(AreaID);}
	else{
		var url="/httpreq/search.asp?action=in_list&maxpage=8&MaxTop=8&skin=2&order=0&desc=0&city="+escape(AreaID);
		}
var ajaxobj=new AJAXRequest;
ajaxobj.method="POST"; 
ajaxobj.url=url;
ajaxobj.callback=function(xmlobj) {
var response = xmlobj.responseText.split("$$");
set_innerHTML('isnew',response[0]);
}
ajaxobj.send();
}