/*process firefox event Edit by tobject 2007-5-11*/
function isIE(){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	if (browser=="Netscape"){
		return false;
	}
	if (browser=="Microsoft Internet Explorer"){
		return true;
	}
	return null;
}

function FixPrototypeForGecko()
{
	HTMLElement.prototype.__defineGetter__("children",element_prototype_get_children);
	HTMLElement.prototype.__defineGetter__("runtimeStyle",element_prototype_get_runtimeStyle);
	HTMLElement.prototype.__defineGetter__("parentElement",element_prototype_get_parentElement);
	HTMLElement.prototype.__defineSetter__("outerHTML",element_prototype_set_outerHTML);
	HTMLElement.prototype.__defineGetter__("outerHTML",element_prototype_get_outerHTML);
	HTMLElement.prototype.__defineGetter__("canHaveChildren",element_prototype_get_canHaveChildren);
	window.constructor.prototype.__defineGetter__("event",window_prototype_get_event);
	Event.prototype.__defineGetter__("srcElement",event_prototype_get_srcElement);
	//Event.prototype.__defineGetter__("cancelBubble",event_prototype_get_cancelBubble);
}
function element_prototype_get_canHaveChildren() {   
  return !/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(this.tagName.toLowerCase());   
}

function element_prototype_get_runtimeStyle()
{
      //return style instead...
      return this.style;
}
function element_prototype_get_children(){
	var returnValue = new Object(); 
	var number = 0; 
	for (var i=0; i<this.childNodes.length; i++) { 
		if (this.childNodes[i].nodeType == 1) { 
			returnValue[number] = this.childNodes[i]; 
			number++; 
		} 
	} 
	returnValue.length = number; 
	return returnValue; 
}
function window_prototype_get_event()
{
      return SearchEvent();
}
function event_prototype_get_srcElement()
{
      return this.target;
}
//function event_prototype_get_cancelBubble()
//{
//      return this.stopPropagation();
//}
function element_prototype_get_parentElement(){
	if(this.parentNode==this.ownerDocument){
		return null;
	}
	return this.parentNode;
}
function element_prototype_set_outerHTML(sHTML){
	var r=this.ownerDocument.createRange();
	r.setStartBefore(this);
	var df=r.createContextualFragment(sHTML);
	this.parentNode.replaceChild(df,this);
	return sHTML;
}
function element_prototype_get_outerHTML(){
	var attr;
	var attrs=this.attributes;
	var str="<"+this.tagName;
	for(var i=0;i<attrs.length;i++){
		attr=attrs[i];
		if(attr.specified){
			str+=" "+attr.name+'="'+attr.value+'"';
		}
	}
	if(!this.canHaveChildren){
		return str+">";
	}
	return str+">"+this.innerHTML+"</"+this.tagName+">";
}

function SearchEvent()
{
      //IE
      if(document.all)
          return window.event;
        
      func=SearchEvent.caller;
      while(func!=null)
      {
          var arg0=func.arguments[0];
          if(arg0)
          {
              if(arg0.constructor==Event || arg0.constructor == MouseEvent)
                  return arg0;
          }
          func=func.caller;
      }
      return null;
}
function getText(oNode)
{
	if (isIE())
	{
		return oNode.text;
	}
	else
	{
		return oNode.textContent;
	}
}
//获取地址栏数据 - 过程开始
Request = {
	QueryString : function(item){
		var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
		return svalue ? svalue[1] : svalue;
	}
}
//获取地址栏数据 - 过程结束
