/*ehm脚本库ehmbase zowell 2009211*/
window["undefined"]=window["undefined"];
Object.prototype.toString =function(){if(typeof this.constructor=="function") {return get_func_name_f(this);}};
function get_func_name_f(func_f)
{/* shawl.qiu code, return string, func: none */
  var r_ = /^function\s+([^()]+)[\s\S]*/;    
  var result_s = func_f.constructor.toString().replace(r_, "$1");
  return result_s;
}/* function get_func_fname_f(func_f) */
/*  
    版本：2009-2-10 
    作用：扩展function 的 method 方法，实现Function的扩展方法，
	并且使其能够在链式调用中使用
必填参数：name, fn
*/
Function.prototype.method = function(name, fn) { this.prototype[name] = fn; return this;};
Number.prototype.NaN0=function(){return isNaN(this)?0:this;};
/*Array.prototype.each=function(f){for(var i=0;i<this.length;i++)f(this[i],i,this)};
Array.prototype.remove=function(ob){
	for(var i=0;i<this.length;i++){
		if(this[i]==ob){
			var st=(i==0)?[]:this.slice(0,i);
			var ed=(i>=this.length)?[]:this.slice(i+1);
			var ss=st.concat(ed);
			return ss;
			}
		}
	return this;
	};

Array.prototype.insert=function(i,ob){
		i=i-1;
	if (i<0)i=0;
	if (i>this.length)i=this.length;
	var st=(i==0)?[]:this.slice(0,i);
		st.push(ob);
	var ed=(i>=this.length)?[]:this.slice(i);
	return st.concat(ed);
	};*/
	
String.prototype.trim = function(){	return this.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g, "");};
String.prototype.format = function()
{
	if (arguments.length == 0) return this;
	for (var s = this, i = 0; i < arguments.length; i++)
		s = s.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]);
	return s;
};
String.prototype.left = function(i)
{
	if (this.length > i) return this.substr(0,i)+"...";	
	return this;
};
/*内存优化*/
var purge= function (d) {    var a = d.attributes, i, l, n;    if (a) { l = a.length;for (i = 0; i < l; i += 1) {n = (parseInt(HW.IEV)>7)?a.getNamedItem("name"):a[i].name;if (typeof d[n] === 'function') {d[n] = null;} }}a = d.childNodes;if (a) {l = a.length;for (i = 0; i < l; i += 1) { purge(d.childNodes[i]);}}};
function gc(){CollectGarbage();}

/*日志显示*/
var EHM={
	randData:(new Date()).valueOf(),
	rootPath:"/scripts/",
	isRoot:(function(){ 
		var loc=location;
		var ro=loc.href.replace(loc.hostname,"").replace(/http\:|\/|index.*?\.ml|\#hwtop|\#|shtml|html|\./gi,"");
		return (ro.trim().length==0);})(),
	isClass:(function(){var loc=location;var l=loc.href.replace(loc.hostname,"").replace(/http\:\/\/|index.*?\.ml|index|\#hwtop|\#|shtml|html|\./gi,"");var a=l.split("\/");return (l.indexOf("pd")>=0 && (!a[2]||a[2]==""))})(),
	isMode:(function(){
					 var a=["membercenter","memberscore","search","sytk","gywm","lxwm","liuyan","subsite"];
					 for(var i=0;i<a.length;i++){
						 if(location.href.indexOf(a[i])>=0)							{return true;}  }
					 return false;
					 })(),
	Import:function(url){
var sE=document.getElementsByTagName("script");
if(url.indexOf(EHM.rootPath)<0 && url.indexOf("jsp")<0 && url.indexOf("php")<0){url=EHM.rootPath+url;}

if(url.indexOf("?")<0){url+="?"+EHM.randData;}else{url+="&"+EHM.randData;}		

if(sE && sE.length>0){for(var i=0,len=sE.length;i<len;i++){if(sE[i].src===url)return;}}
try{document.write("<scr"+"ipt type='text/javascript' src='"+url+"'></scr"+"ipt>");}catch(e){																										var script = document.createElement("script");
script.src = tmps[x];	script.type = "text/javascript";document.getElementsByTagName("head")[0].appendChild(script);	
}
return EHM;
},
	addCss:function (str){
	try{document.write("<style type='text/css'>"+str+"</style>");}catch(e){																							
	var style = document.createElement("style");
	style.innerHTML = str;	script.type = "text/css";	
	document.getElementsByTagName("head")[0].appendChild(script);																									}
	},
	ImportCss:function (url){
	if(url.indexOf(EHM.rootPath)<0){url=EHM.rootPath+url;}
	try{document.write("<link href=\""+url+"\" rel=\"stylesheet\" type=\"text/css\" />");}catch(e){																							
	var links = document.createElement("link");
	links.href = str;	links.rel = "stylesheet";	links.type = "text/css";
	document.getElementsByTagName("head")[0].appendChild(script);																									}
	},
	extend:function(subClass, superClass) {/* Extend function. */
	  var F = function() {};
	  F.prototype = superClass.prototype;
	  subClass.prototype = new F();
	  subClass.prototype.constructor = subClass;
	  subClass.superclass = superClass.prototype;
	  if(superClass.prototype.constructor == Object.prototype.constructor) {
		superClass.prototype.constructor = superClass;
  }
},
using:function(p){ 
	p = p.split(/\s*\.\s*/g); 
	var m = window, d; 
	p.each(function(n){ 
	if(d) d += '.' + n; 
	  else d = n; 
	if(!m[n]) m[n] = { $name : d }; 
	m = m[n]; 
	}); 
	return m; 
	},
SuperFunction:{
	getFixID:function(/*String Boolean Number Object*/Str){
		if(isNaN(Str)) {return 0;}
		else{return parseInt(Str);}
		},
	escapeAt:function(s){return s.replace(/&/gi,"---");},
	unescapeAt:function(s){return s.replace(/---/gi,"&");},
	isEmail:function(str){
       var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
       return reg.test(str);
}
	}	
	};
var Interface = function(name, methods) {/*Interface Constructor.*/
    if(arguments.length != 2) {
        throw new Error("Interface constructor called with " + arguments.length
          + "arguments, but expected exactly 2.");
    }
    
    this.name = name;
    this.methods = [];
    for(var i = 0, len = methods.length; i < len; i++) {
        if(typeof methods[i] !== 'string') {
            throw new Error("Interface constructor expects method names to be " 
              + "passed in as a string.");
        }
        this.methods.push(methods[i]);        
    }    
};    

/*Static class method.*/ 

Interface.ensureImplements = function(object) {
    if(arguments.length < 2) {
        throw new Error("Function Interface.ensureImplements called with " + 
          arguments.length  + "arguments, but expected at least 2.");
    }

    for(var i = 1, len = arguments.length; i < len; i++) {
        var interface = arguments[i];
        if(interface.constructor !== Interface) {
            throw new Error("Function Interface.ensureImplements expects arguments "   
              + "two and above to be instances of Interface.");
        }
        
        for(var j = 0, methodsLen = interface.methods.length; j < methodsLen; j++) {
            var method = interface.methods[j];
            if(!object.prototype[method] || typeof object.prototype[method] !== 'function') {
                throw new Error("Function Interface.ensureImplements: object '" +
                arguments[0] + "' does not implement the " + interface.name 
                 + " interface. Method " + method + " was not found.");
            }
        }
    } 
};

EHM.Import("EHM/HWPackage.js")//.Import("EHM/Ajax/Ajax.js").Import("EHM/data/DataStore.js");
/*
 - 加载相关类库 zowell@2009313

EHM.Import("EHM/util/cookie/cookie.js").Import("EHM/struts/Manager.js").Import("/webAjax/chklogin.jsp").Import("EHM/util/event/DragDrop.js").Import("EHM/util/event/event.js").Import("EHM/Toolkit/HWElements.js").Import("EHM/data/DataStore.js");
if (EHM.isRoot){
	EHM.Import("EHM/struts/ModeLoad.js").Import("EHM/HUIWEN/defaultSet.js").Import("EHM/Toolkit/Imglib.js").Import("EHM/Toolkit/Favorites.js");
	}
if (EHM.isClass){
	EHM.Import("EHM/struts/ClassLoad.js");
	}

EHM.Import("EHM/Rss/Rss.js").Import("EHM/Toolkit/Weather.js").Import("EHM/Toolkit/chklogin.js");


EHM.Import("EHM/HUIWEN/search.js");


if (!EHM.isRoot&&!EHM.isClass&&!EHM.isMode){EHM.Import("EHM/HUIWEN/channel/page_meiti.js");}
*//*列表页*//* 搜索 */
