document.title = "东风HONDA";

//显示文章
var showArchive=function(id,catid,href){
	/*href=href?href:"/public/showArchive.jsp";
	href+="?id="+id;
	if(catid)
		href+="&catid="+catid;*/
	//修改为静态链接
	href=href?href:"/public/showArchive_jsp";
	if(catid)
		href+="_catid_"+catid;
	href+="_id_"+id;
	href+=".html";
	window.open(href);
};

//分页
var page=function(){}

page.first=function(){
	this.gotoPage(1);
};

page.last=function(){
	this.gotoPage(parseInt(document.pageForm.totalpage.value));
};

page.next=function(){
	this.gotoPage(parseInt(document.pageForm.pageno.value)+1);
};

page.nextList=function(){
	this.gotoPage(parseInt(document.pageForm.pageno.value)+parseInt(document.pageForm.pagelistsize.value));
};

page.prev=function(){
	this.gotoPage(parseInt(document.pageForm.pageno.value)-1);
};

page.prevList=function(){
	this.gotoPage(parseInt(document.pageForm.pageno.value)-parseInt(document.pageForm.pagelistsize.value));
};

page.gotoPage=function(v){
	if (isJSP()) {
		var form=document.pageForm;
		var pageno=form.pageno.value;
		var totalpage=form.totalpage.value;
		if(v<1)
			v=1;
		else if(v>totalpage)
			v=totalpage;
		if(v==form.pageno.value)
			return;
		form.pageno.value=v;
		form.submit();
	} else {
		location.href=getPageLink(v);
	}
	
};
function isJSP() {
	if (window.location.href.indexOf(".jsp") != -1 || window.location.href.indexOf("/search/") != -1) {
		return true;
	}else {
		return false;
	}
}
function getPageLink(num) {
	var pageStr="pageno";
	var linkStr="";
	var curLink = location.href;
	var linkBody = curLink.substring(0,curLink.lastIndexOf("."));
	var linkEleArray = linkBody.split("_");
	for (var i=0;i<linkEleArray.length;i++) {
		if (linkEleArray[i]==pageStr) {
			if (num == 1) {
				linkEleArray.splice(i,2);
				break;
			} else {
				linkEleArray[i+1]=num;
			}
		}
		linkStr+=linkEleArray[i]+"_";
	}
	if (num>1 && linkStr.indexOf(pageStr)<0) {
		linkStr+=pageStr+"_"+num;
	} else {
		linkStr=linkStr.substring(0,linkStr.length-1);
	}
	
	linkStr+=".html";
	return linkStr;
}

function openGame(l,w,h){
	//window.open(l,'game','width=' + w + ',height=' + h + ',scrollbars=0 resizable=0');
	//var link=isJSP() ? "/carsclub2007/public/opwin.jsp?catid="+catid+"&id="+id : "/carsclub2007/public/opwin_jsp_catid_"+catid+"_id_"+id+".html";
	var nw=window.open("/carsclub2007/public/opgame.jsp?catid=687|696|734&url="+l+"&width="+w+"&height="+h);
	nw.focus();
}