/* 首页脚本 */

window.onerror = checkError;    
function checkError(){   
	arglen = arguments.length;   
    var errorMsg = "参数个数：" + arglen + "个";   
    for(var i=0;i<arglen;i++){   
    	errorMsg += "\n参数" + (i+1) + "：" + arguments[i];   
    }   
//    alert(errorMsg);   
    window.onerror = null;   
    return true;   
}   

String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }

function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

//AJAX脚本控制
function getHTMLText(elementId,url){
	var options={
		method:"get",
		asynchronous:true
	};
	var request=new Ajax.Updater(elementId,url,options);
}


function getDateFromServiceText(newsId){
	var options={method:"get",asynchronous:true,
		onSuccess:function(transport,json){		
			var returnData=transport.responseText;
				    $('count').innerText = returnData;
				},
				onFailure:function(transport,json){
					alert("AJAX调用错误"+transport.responseText);
				}
			};
			var request=new Ajax.Request("../indexservice.do?action=addCount&search_nid="+newsId,options);
}

function gwshow(n,path){ 
	for(var i=1;i<=2;i++){ 
		var curC=document.getElementById("ajtab"+i);
		var curB=document.getElementById("ajnav"+i); 
		if(n==i){ 
			curC.style.display="block";
			curB.style.color="#fff";
			curB.style.width="77px";
			curB.style.background="url("+path+"/images/l_aj01.gif) no-repeat left bottom";			 
		}else{ 
			curC.style.display="none"; 
			curB.style.color="#000";
			curB.style.width="79px";
			curB.style.background="url("+path+"/images/l_aj02.gif) no-repeat left bottom";	
		} 
	} 
}
function gw2show(n){ 
	for(var i=1;i<=2;i++){ 
		var curC=document.getElementById("aj2tab"+i);
		if(n==i){ 
			curC.style.display="block";
		}else{ 
			curC.style.display="none"; 
		} 
	} 
}

