if(navigator.userAgent.toLowerCase().indexOf('msie') > -1)
{
	window.isIE = true;
	window.version = parseInt("0"+navigator.userAgent.substr(30,1), 10);
	window.language = navigator.userLanguage.toLowerCase();
	var HTMLElement = new Function();
	var HTMLFormElement = new Function();
	var HTMLButtonElement = new Function();
	var HTMLDivElement = new Function();
	var HTMLIFrameElement = new Function();
	var HTMLImageElement = new Function();
	var HTMLInputElement = new Function();
	var HTMLLabelElement = new Function();
	var HTMLObjectElement = new Function();
	var HTMLSelectElement = new Function();
	var HTMLTableElement = new Function();
	var HTMLTableSectionElement = new Function();
	var HTMLTableRowElement = new Function();
	var HTMLTableCellElement = new Function();
	var HTMLSpanElement = new Function();
	var HTMLTextAreaElement = new Function();
	var HTMLUnknownElement = new Function();
	document.execCommand("BackgroundImageCache", false, true);
}
else
{
	window.isIE = false;
	window.language = navigator.language.toLowerCase();
	function SearchEvent()
	{
		var func=SearchEvent.caller;
		while(func!=null)
		{
			var arg=func.arguments[0];
			if(arg)
			{
				if(String(arg.constructor).indexOf('Event') > -1)
				{
					return arg;
				}
			}
			func=func.caller;
		}
		return null;
	};
	var attachEvent = document.attachEvent = function(eventName,handler)
	{
		window.addEventListener(eventName.substring(2),handler,true);
	};
	var detachEvent = document.detachEvent = function(eventName,handler)
	{
		window.removeEventListener(eventName.substring(2),handler,true)
	};
	window.constructor.prototype.__defineGetter__
	(
		"event",
		function()
		{
			return SearchEvent()
		}
	);
	HTMLUnknownElement.prototype.__defineSetter__
	(
		"src",
		function(value)
		{
			this.load(value);
			return value
		}
	);
	HTMLUnknownElement.prototype.__defineGetter__
	(
		"src",
		function()
		{
			return this.Dom.documentURI
		}
	);
	HTMLUnknownElement.prototype.__defineGetter__
	(
		"XMLDocument",
		function()
		{
			if(this.Dom)
			{
				return this.Dom;
			}
			else
			{
				var src = this.getAttribute("src") || "";
				if(src != "")
				{
					this.load(src)
				}
				else
				{
					var xml = this.innerHTML;
					if(xml.replace(/\s/g,"") != "")
					{
						
						this.loadXML('<?xml version="1.0" ?>' + xml)
					}
					else
					{
						this.loadXML('<?xml version="1.0" ?><root />')
					}
				}
				return this.Dom
			}
		}
	);
	HTMLUnknownElement.prototype.__defineGetter__
	(
		"documentElement",
		function()
		{
			return this.XMLDocument.documentElement
		}
	);
	HTMLUnknownElement.prototype.load = function(src)
	{
		if(!this.Dom)
		{
			this.Dom = document.implementation.createDocument('','',null);
		}
		this.Dom.async = (this.async != false);
		return this.Dom.load(src)
	};
	HTMLUnknownElement.prototype.loadXML = function(xml)
	{
		if(!this.Dom)
		{
			this.Dom = document.implementation.createDocument('','',null)
		}
		return this.Dom.loadXML(xml)
	};
	HTMLElement.prototype.__defineGetter__
	(
		"all",
		function()
		{
			var all = this.getElementsByTagName("*");
			var node = this;
			all.tags = function(sTagName){
				return node.getElementsByTagName(sTagName)
			};
			return all
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"parentElement",
		function()
		{
			if(this.parentNode == this.ownerDocument){
				return null
			}
			return this.parentNode
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"children",
		function()
		{
			var tmp=[];
			var j=0;
			var n;
			for(var i=0;i<this.childNodes.length;i++)
			{
				n=this.childNodes[i];
				if(n.nodeType==1)
				{
					tmp[j++]=n;
					if(n.name)
					{
						if(!tmp[n.name])
						{
							tmp[n.name]=n;
							continue
						}
						else if(tmp[n.name].constructor != Array)
						{
							tmp[n.name] = [tmp[n.name]];
						}
						tmp[n.name].push(n)
					}
					if(n.id)
					{
						if(!tmp[n.id])
						{
							tmp[n.id]=n
						}
						else if(n.id == n.name)
						{
							tmp[n.id]=tmp[n.name]
						}
					}
				}
			}
			return tmp
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"runtimeStyle",
		function()
		{
			return this.style;
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"currentStyle",
		function()
		{
			return this.ownerDocument.defaultView.getComputedStyle(this,null)
		}
	);
	HTMLElement.prototype.__defineSetter__
	(
		"outerHTML",
		function(value)
		{
			var r=this.ownerDocument.createRange();
			r.setStartBefore(this);
			var df=r.createContextualFragment(value);
			this.parentNode.replaceChild(df,this);
			return value
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"outerHTML",
		function()
		{
			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+">"
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"canHaveChildren",
		function()
		{
			switch(this.tagName.toLowerCase()){
				case "area":
				case "base":
				case "basefont":
				case "col":
				case "frame":
				case "hr":
				case "img":
				case "br":
				case "input":
				case "isindex":
				case "link":
				case "meta":
				case "param":
				return false;
			}
			return true
		}
	);
	HTMLElement.prototype.__defineSetter__
	(
		"innerText",
		function (value) 
		{
			this.innerHTML = "";
			var sText = String(value);
			var textS = sText.split("\n");
			var hCount = textS.length - 1;
			for(var i=0; i <= hCount ; i++)
			{
				var txtNode = null;
				var retNode = null;
				if(textS[i].length)
				{
					txtNode = document.createTextNode(textS[i])
				}
				if(i < hCount)
				{
					retNode = document.createElement("BR")
				}
				if(txtNode)
				{
					this.appendChild(txtNode)
				}
				if(retNode)
				{
					this.appendChild(retNode)
				}
			}
			this.innerHTML = this.innerHTML.replace(/\s*$/g,"").replace(/\s/g,"&nbsp;");
			return value
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"innerText",
		function () 
		{
			var innerText = "";
			var childS = this.childNodes;
			for(var i=0; i < childS.length ; i++)
			{
				if(childS[i].nodeType==1)
				{
					innerText += childS[i].tagName=="BR" ? '\n' : childS[i].innerText
				}
				else if(childS[i].nodeType==3)
				{
					innerText += childS[i].nodeValue
				}
			}
			return innerText;
		}
	);
	HTMLElement.prototype.__defineSetter__
	(
		"outerText",
		function(value)
		{
			var parsedText = document.createTextNode(value);
			this.outerHTML = parsedText;
			return parsedText
		}
	);
	HTMLElement.prototype.__defineGetter__
	(
		"outerText",
		function()
		{
			var r=this.createRange();
			r.selectNodeContents(this);
			return r.toString()
		}
	);
	HTMLElement.prototype.createRange = function(){
		return this.ownerDocument.createRange()
	};
	
	HTMLElement.prototype.createTextRange = function(txtStr){
		return this.ownerDocument.createTextRange(txtStr)
	};
	HTMLElement.prototype.attachEvent = function(eventName,handler)
	{
		this.addEventListener(eventName.substring(2),handler,true)
	};
	HTMLElement.prototype.detachEvent = function(eventName,handler)
	{
		this.removeEventListener(eventName.substring(2),handler,true)
	};
	HTMLElement.prototype.contains = function(ele)
	{
		do
		{
			if(ele==this)
			{
				return true
			}
		}while(ele = ele.parentNode);
		return false
	};
	HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode)
	{
		switch(where)
		{
			case "beforeBegin":
				this.parentNode.insertBefore(parsedNode,this);
				break;
			case "afterBegin":
				this.insertBefore(parsedNode,this.firstChild);
				break;
			case "beforeEnd":
				this.appendChild(parsedNode);
				break;
			case "afterEnd":
				if(this.nextSibling)
				{
					this.parentNode.insertBefore(parsedNode,this.nextSibling)
				}
				else
				{
					this.parentNode.appendChild(parsedNode)
				}
                		break;
		}
	};
	HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr)
	{
		var r=this.ownerDocument.createRange();
		r.setStartBefore(this);
		var parsedHTML = r.createContextualFragment(htmlStr);
		this.insertAdjacentElement(where,parsedHTML)
	};
	HTMLElement.prototype.insertAdjacentText = function(where,txtStr)
	{
		var parsedText=document.createTextNode(txtStr);
		this.insertAdjacentElement(where,parsedText)
	};
	/*
	Event.prototype.__defineGetter__
	(
		"button",
		function()
		{
			return this.button + 1
		}
	);*/
	Event.prototype.__defineGetter__
	(
		"x",
		function()
		{
			return this.pageX
		}
	);
	Event.prototype.__defineGetter__
	(
		"y",
		function()
		{
			return this.pageY
		}
	);
	Event.prototype.__defineGetter__
	(
		"keyCode",
		function()
		{
			return this.which
		}
	);
	Event.prototype.__defineSetter__
	(
		"keyCode",
		function(value)
		{
			this.which = value;
	        	return value
		}
	);
	Event.prototype.__defineSetter__
	(
		"returnValue",
		function(value)
		{
	        	if(!value){
	        		this.preventDefault()
	        	}
	        	return value
	        }
	);
	Event.prototype.__defineSetter__
	(
		"cancelBubble",
		function(value)
		{
	        	if(value){
	        		this.stopPropagation()
	        	}
	        	return value
	        }
	);
	/*
	Event.prototype.__defineGetter__
	(
		"srcElement",
		function()
		{
			var node=this.target;
			while(node.nodeType!=1){
				node=node.parentNode
			}
			return node
	        }
	);*/
	Event.prototype.__defineGetter__
	(
		"fromElement",
		function()
		{
			var node;
			if(this.type=="mouseover"){
				node=this.relatedTarget
			}
			else if(this.type=="mouseout"){
				node=this.target
			}
			if(!node){
				return
			}
			while(node.nodeType!=1){
				node=node.parentNode
			}
			return node
	        }
	);
	Event.prototype.__defineGetter__
	(
		"toElement",
		function()
		{
			var node;
			if(this.type=="mouseout"){
				node=this.relatedTarget
			}
			else if(this.type=="mouseover"){
				node=this.target
			}
			if(!node){
				return null
			}
			while(node.nodeType!=1){
				node=node.parentNode
			}
			return node
		}
	);
	Event.prototype.__defineGetter__
	(
		"offsetX",
		function()
		{
			return this.layerX
		}
	);
	Event.prototype.__defineGetter__
	(
		"offsetY",
		function()
		{
			return this.layerY
		}
	);
	Error.prototype.__defineGetter__
	(
		"number",
		function()
		{
			return this.result
		}
	);
	Error.prototype.__defineGetter__
	(
		"description",
		function()
		{
			return this.message
		}
	);
	XMLDocument.prototype.__defineGetter__
	(
		"xml",
		function()
		{
			return (new XMLSerializer).serializeToString(this)
		}
	);
	Element.prototype.__defineGetter__
	(
		"xml",
		function()
		{
			return (new XMLSerializer).serializeToString(this)
		}
	);
	DocumentFragment.prototype.__defineGetter__
	(
		"innerHTML",
		function()
		{
			return (new XMLSerializer).serializeToString(this)
		}
	);
	Node.prototype.__defineGetter__
	(
		"text",
		function()
		{
			return this.textContent
		}
	);
	Node.prototype.__defineSetter__
	(
		"text",
		function(value)
		{
			this.textContent = value;
			return value
		}
	);
	Node.prototype.__defineGetter__
	(
		"value",
		function()
		{
			return this.nodeValue
		}
	);
	Node.prototype.__defineSetter__
	(
		"value",
		function(value)
		{
			this.nodeValue = value;
			return value
		}
	);
	XMLDocument.prototype.loadXML = function(xml)
	{
		var childNodes = this.childNodes;
		for (var i = childNodes.length - 1; i >= 0; i--)
		{
			this.removeChild(childNodes[i])
		}
		var dp = new DOMParser();
		var newDOM = dp.parseFromString(xml, "text/xml");
		var newElt = this.importNode(newDOM.documentElement, true);
		this.appendChild(newElt)
	};
	XMLDocument.prototype.selectNodes = function(xPath,xNode)
	{
		if(!xNode)
		{
			xNode = this
		}
		
		var oNSResolver = this.createNSResolver(this.documentElement);
		var aItems = this.evaluate(xPath, xNode, oNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
		var aResult = [];
		for( var i = 0; i < aItems.snapshotLength; i++)
		{
			aResult[i] =  aItems.snapshotItem(i)
		}
		return aResult
	};
	XMLDocument.prototype.selectSingleNode = function(xPath, xNode)
	{
		if( !xNode )
		{
			xNode = this.documentElement
		}
		var xItems = this.selectNodes(xPath, xNode);
		if( xItems.length > 0 )
		{
			return xItems[0]
		}
		else
		{
			return null
		}
	};
	XMLDocument.prototype.transformNode = function(xslDom)
	{
		var xslProc = new XSLTProcessor();
		xslProc.importStylesheet(xslDom);
		var fragment = xslProc.transformToFragment(this, document);
		return fragment.innerHTML
	};
	Element.prototype.selectNodes = function(xPath)
	{
		if(this.XMLDocument)
		{
			return this.XMLDocument.selectNodes(xPath)
		}
		return this.ownerDocument.selectNodes(xPath, this)
	};
	Element.prototype.selectSingleNode = function(xPath)
	{
		if(this.XMLDocument)
		{
			return this.XMLDocument.selectSingleNode(xPath)
		}
		return this.ownerDocument.selectSingleNode(xPath, this)
	};
	if(GeckoActiveXObject)
	{
		var ActiveXObject = function(GUID){
			return new window.GeckoActiveXObject(GUID)
		}
	}
}
window.setStatus = function(str){
	window.status = str;
	return true
}
if(!Array.prototype.push){
	Array.prototype.push = function(o){
		this[this.length] = o
	}
}
if(!Function.prototype.apply){
	Function.prototype.apply = function(object, parameters){
		var parameterStrings = new Array();
		if (!object)
		{
			object = window
		}
		if (!parameters)
		{
			parameters = new Array()
		}
		for (var i = 0; i < parameters.length; i++)
		{
			parameterStrings[i] = 'parameters[' + i + ']'
		}
		object.__apply = this;
		var result = eval('object.__apply(' + parameterStrings.join(', ') + ')');
		object.__apply = null;
		return result
	}
}
Function.prototype.bind = function(object){
	var __method = this;
	return function(){
		__method.apply(object, arguments)
	}
}
String.generateGuid = function(){
	var hex = new Array('0','1','2','3','4','5','6','7','8', '9','a','b','c','d','e','f');
	var Guid = "";

	for (count = 0; count < 32; count++)
	{
		if ((count == 8) || (count == 12) || (count == 16) || (count == 20))
		{
			Guid += '-'
		}
		Guid += hex[Math.floor(Math.random() * 16)]
	}
	
	return Guid;
}
String.prototype.parseHTML = function(){
	return this.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")
}
String.prototype.parseText = function(){
	var txt = this.replace(/<br[^>]*>/igm, "\n");
	txt = txt.replace(/<[^>]*>/igm, " ");
	txt = txt.replace(/&nbsp;/igm, " ");
	txt = txt.replace(/&amp;/igm, "&");
	return txt.trim();
}
String.prototype.trim = function(chr){
	return this.trimLeft(chr).trimRight(chr)
}
String.prototype.trimLeft = function(chr)
{
	var reg = /^\s*/g;
	if(chr)
	{
		reg = new RegExp("^" + chr + "*","g")
	}
	return this.replace(reg,"")
}
String.prototype.trimRight = function(chr)
{
	var reg = /\s*$/g;
	if(chr)
	{
		reg = new RegExp(chr + "*$","g")
	}
	return this.replace(reg, "")
}
String.prototype.endsWith = function(s)
{
	return (this.length >= s.length) && (this.substr(this.length - s.length) == s)
}
String.prototype.startsWith = function(s)
{
	return (this.length >= s.length) && (this.substr(0, s.length) == s);
}
String.format = function(s)
{
	for(var i=1; i<arguments.length; i++){
		s = s.replace("{" + (i -1) + "}", arguments[i])
	}
	return s
}
String.prototype.format = function()
{
	var s = this;
	for(var i=0; i<arguments.length; i++){
		s = s.replace("{" + i + "}", arguments[i])
	}
	return s
}
String.prototype.toObject = function(){
	var o = {};
	var items = this.replace(/&amp;/gi,"__amp;").split('&');
	for(var i = 0;i < items.length;i++)
	{
		var item = items[i].replace(/__amp;/gi,"&amp;").split('=');
		if(item[0] != "")
		{
			o[item[0]] = item[1] || ""
		}
	}
	return o
}
String.prototype.toInt = function(){
	try {
		return eval("0x" + this)
	}
	catch(ex){
		return 0
	}
}
String.prototype.toArray = function(){
	return this.split('');
}
Array.prototype.indexOf = function(value){
	for(var i = 0;i < this.length;i++){
		if(this[i] == value){
			return i
		}
	}
	return -1
}
Array.prototype.removeAt = function(index){
	this.splice(index,1);
}
Array.prototype.remove = function(value){
	var index = this.indexOf(value);
	if(index > -1) {
		this.removeAt(index);
	}
}
Array.prototype.max = function(){
	var max = 0;
	for(var i = 0; i < this.length;i++){
		if(max < this[i]){
			max = this[i]
		}
	}
	return max
}
Array.max = function(arr){return arr.max()};
Array.prototype.min = function(){
	var min = 0;
	for(var i = 0; i < this.length;i++){
		if(min > this[i]){
			min = this[i]
		}
	}
	return min
}
Array.min = function(arr){return arr.min()};
Object.prototype.toQueryString = function(){
	var o = [];
	for(var item in this){
		if(["string","number","boolean","date"].indexOf(typeof(this[item])) > -1 ){
			o.push(item + "=" + this[item])
		}
	}
	return o.join('&')
}
Date.timediff = 0;
Date.getServerDateTime = function(){
	var dt = new Date();
	dt.setSeconds(dt.getSeconds() + Date.timediff);
	return dt
}
Date.prototype.format = function(format)
{
	var o = {
		"M+" : this.getMonth()+1,
		"d+" : this.getDate(),
		"h+" : this.getHours(),
		"m+" : this.getMinutes(),
		"s+" : this.getSeconds(),
		"q+" : Math.floor((this.getMonth()+3)/3),
		"S" : this.getMilliseconds()
	};
	if(/(y+)/.test(format))
	{
		format=format.replace(RegExp.$1,(this.getFullYear().toString()).substr(4 - RegExp.$1.length))
	}
	for(var k in o)
	{
		if(new RegExp("("+ k +")").test(format))
		{
			format = format.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length))
		}
	}
	return format
}
var XmlDocument = function(xml)
{
	var dom = document.createElement("xml");
	if(xml)
	{
		dom.loadXML(xml);
	}
	else
	{
		dom.loadXML('<?xml version="1.0" encoding="utf-8" ?><root />');
	}
	return dom.XMLDocument || dom;
};
var IFrameXmlHttp = new Function();
IFrameXmlHttp.prototype = {
	onreadystatechange: null,
	headers: [],
	method: "POST",
	url: null,
	async: true,
	iframe: null,
	status: 0,
	readyState: 0,
	responseText: null,
	responseXML: null,
	responseContentType:null,
	statusText: null,
	getResponseHeader: function(key) {
		if(key.toLowerCase() == "CONTENT-TYPE")
		{
			return "text/xml";
		}
		return null;
	},
	statechange: function() {
		if(this.iframe.readyState == "complete" || !this.iframe.readyState)
		{
			this.status = 200;
			this.readyState = 4;
			var doc = this.iframe.contentWindow.document;
			
			if(window.isIE && doc.mimeType == "XML Document" || doc.toString() == "[object XMLDocument]")
			{
				this.responseContentType = "text/xml";
				this.responseText = window.isIE ? (doc.XMLDocument.xml) : (new XMLSerializer).serializeToString(doc);
				this.responseXML = window.isIE ? doc.XMLDocument : XmlDocument(this.responseText);
			}
			else
			{
				this.responseContentType = "text/html";
				this.responseText = doc.body.innerHTML;
			}
			this.iframe.onload = this.iframe.onreadystatechange = null;
			document.body.removeChild(this.iframe);
			this.iframe = null;
		}
		else
		{
			switch(this.iframe.readyState)
			{
				case "uninitialized" :
					this.readyState = 0;
					break;
				case "loading" :
					this.readyState = 1;
					break;
				case "loaded" :
					this.readyState = 2;
					break;
				case "interactive" :
					this.readyState = 3;
					break;
			}
		}
		if(this.onreadystatechange)
		{
			this.onreadystatechange();
		}
	},
	open: function(method, url, async) {
		this.iframe = document.createElement('iframe');
		with(this.iframe.style){
			position = 'absolute';
			visibility = 'hidden';
		}
		document.body.appendChild(this.iframe);
		this.iframe.src = "about:blank";
		
		this.iframe.contentWindow.document.write("<html><body></body></html>");

		this.method = method;
		this.url = url;
		this.async = async
	},
	setRequestHeader: function(name, value) {
		for(var i=0; i<this.headers.length; i++) {
			if(this.headers[i].name == name) {
				this.headers[i].value = value;
				return
			}
		}
		this.headers.push({"name":name,"value":value})
	},
	addInput: function(doc, form, name, value) {
		var ele;

		var tag =  value.indexOf("\n") >= 0 ? "textarea" : "input";
		
		if(window.isIE) {
			ele = doc.createElement('<' + tag + ' name="' + name.trimLeft("amp;") + '" />')
		}
		else {
			ele = doc.createElement(tag);
			ele.setAttribute("name", name.trimLeft("amp;"))
		}
  
		ele.value = value;
		form.appendChild(ele);
	},
	addInputArr:  function(doc, form, dominoPara)
	{
		if(!dominoPara)
			return;
			
		var paras = dominoPara.split("&");
		for(var i=0;i<paras.length;i++)
		{
			if(paras[i].indexOf("=") != -1)
			{
				var _input = paras[i].split("=");
				this.addInput(doc, form, _input[0], decodeURIComponent(_input[1]))
			}
		}
	},
	send: function(data) {
		if(this.iframe == null) {
			throw new Error("Create IFrame XMLHTTP Request Object Faild!");
			return;
		}
	
		var doc = this.iframe.contentWindow.document;
		var form = doc.createElement("form");
		
		doc.body.appendChild(form);
		
		form.setAttribute("action", this.url);
		form.setAttribute("method", this.method);
		
		for(var i=0; i<this.headers.length; i++) {

			switch(this.headers[i].name.toLowerCase()) {
				case "content-length":
				case "accept-encoding":
					break;

				case "content-type":
					form.setAttribute("enctype", this.headers[i].value);
					break;
					
				default:
					this.addInput(doc, form, this.headers[i].name, this.headers[i].value);
					break;
			}
		}

		this.addInputArr(doc, form, data);

		form.submit();
		
		this.iframe.onload = this.iframe.onreadystatechange = this.statechange.bind(this);
	},
	abort: function(){
		this.iframe.src = "about:blank";
	}
}
var HTTPRequest = function(async,peaceful,cache)
{
	this.async = (async != false);
	this.peaceful = (peaceful == true);
	this.cache = (cache != false);
	this.processor = null;
	this.aborted = true;
	if(window.XMLHttpRequest)
	{
		this.processor = new XMLHttpRequest();
		return;
	}
	else
	{
		var clsids = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP.2.6","Msxml2.XMLHTTP","Microsoft.XMLHTTP.1.0","Microsoft.XMLHTTP.1","Microsoft.XMLHTTP"];
		for(var i=0; i<clsids.length; i++)
		{
			try
			{
				this.processor = new ActiveXObject(clsids[i]);
				return;
			}
			catch(ex)
			{
			}
		}
	}
	this.processor = new IFrameXmlHttp();
	throw new Error("浏览器不支持XMLHttpRequest?");
}
HTTPRequest.prototype = {
	send: function(bstrUrl,object,callback) {
		var method = object ? "POST" : "GET";
		this.processor.open(method,bstrUrl,this.async);
	
		if(method == "POST")
		{
			this.processor.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded")
		}
		else if(!this.cache)
		{
			this.processor.setRequestHeader("No-Cache","1");
			this.processor.setRequestHeader("Pragma","no-cache");
			this.processor.setRequestHeader("Cache-Control","no-cache");
			this.processor.setRequestHeader("Expire","0");
			this.processor.setRequestHeader("Last-Modified","Wed, 1 Jan 1997 00:00:00 GMT");
			this.processor.setRequestHeader("If-Modified-Since","-1")
		}
		this.aborted = false;
		this.processor.send(object);
		this.callback = callback;
		if(this.async)
		{
			this.processor.onreadystatechange = this.statechange.bind(this);
			if(!this.peaceful) {
				window.setStatus("正在传输数据...")
			}
			if(this.cache && window.isIE)
			{
				try
				{
					if(this.processor.status == 200 || this.processor.status == 0)
					{
						this.statechange();
					}
				}
				catch(e){}
			}
		}
		else
		{
			this.statechange();
		}
	},
	abort: function() {
		if(!this.aborted)
		{
			this.aborted = true;
			this.processor.abort();
		}
	},
	statechange: function() {
		if( this.aborted ) {
			if(!this.peaceful) {
				window.setStatus("已撤?")
			}
			return
		}
		if(!this.peaceful) {
			window.setStatus(window.status + ".")
		}
		if(this.processor.readyState == 4)
		{
			this.aborted = true;
			if(this.processor.status == 200 || this.processor.status == 0)
			{
				switch(this.processor.getResponseHeader("Active"))
				{
					case "alert":
						alert(this.getText());
						break;
					case "eval":
						eval(this.getText());
						break;
					default:
						if(!this.peaceful) {
							window.setStatus("正在处理...");
						}
						if(this.callback != null)
						{
							if(typeof(this.callback) == "function")
							{
								this.callback(this);
							}
							else if(this.CallBack != "")
							{
								eval(this.callback);
							}
						}
						break;
				}
				if(!this.peaceful)
				{
					window.setStatus("完毕?");
				}
			}
			else
			{
				if(!this.peaceful) {
					window.setStatus(this.processor.statusText);
				}
			}
		}
	},
	getXML: function() {
		if(this.processor.getResponseHeader("CONTENT-TYPE").toLowerCase().startsWith("text/xml")) {
			return this.processor.responseXML
		}
		else {
			try
			{
				return XmlDocument(this.getText());
			}
			catch(e)
			{
				return null;
			}
		}
	},
	getText: function() {
		return this.processor.responseText;
	}
}
var Validator = {
	Account: /^([a-z0-9])+[a-z0-9-_]*([a-z0-9])+$/i,
	Require: /.+/,
	Domain: /^[A-Za-z0-9\-]+$/,
	Email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
	Phone: /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/,
	Mobile: /^(\+86)?((13)|(15))\d{9}$/,
	Url: /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/,
	IdCard: /^\d{15}(\d{2}[A-Za-z0-9])?$/,
	Currency: /^\d+(\.\d+)?$/,
	Number: /^\d+$/,
	Zip: /^\d{6}$/,
	QQ: /^[1-9]\d{4,8}$/,
	Integer: /^[-\+]?\d+$/,
	Double: /^[-\+]?\d+(\.\d+)?$/,
	English: /^[A-Za-z]+$/,
	ASCII: /^[\x10-\x80]+$/,
	Chinese: /^[\u0391-\uFFE5]+$/,
	UnSafe: /^(([A-Z]*|[a-z]*|\d*|[-_\~!@#\$%\^&\*\.\(\)\[\]\{\}<>\?\\\/\'\"]*)|.{0,5})$|\s/,
	IsSafe: function(str){return !this.UnSafe.test(str);},
	SafeString: "this.IsSafe(value)",
	Limit: "this.limit(value, getAttribute('min'), getAttribute('max'))",
	Date: "this.IsDate(value, getAttribute('min'), getAttribute('format'))",
	Repeat: "value == form.elements[getAttribute('to')].value",
	Range: "parseInt(getAttribute('min')) <= parseInt(value) && parseInt(value) <= parseInt(getAttribute('max'))",
	Compare: "this.compare(value,getAttribute('operator'),getAttribute('to'))",
	Custom: "this.Exec(value, getAttribute('regexp'))",
	Group: "this.MustChecked(form.elements[getAttribute('name')], getAttribute('min'), getAttribute('max'))",
	ErrorItem: [document.forms[0]],
	ErrorMessage: ["以下原因导致提交失败：\t\t\t\t"],
	Validate: function(theForm, mode)
	{
		var obj = theForm || event.srcElement;
		var count = obj.elements.length;
		this.ErrorMessage.length = 1;
		this.ErrorItem.length = 1;
		this.ErrorItem[0] = obj;
		for(var i=0;i<count;i++)
		{
			with(obj.elements[i])
			{
				if(tagName != "FIELDSET") {
					var _dataType = getAttribute("dataType");
					this.ClearState(obj.elements[i]);
					if(_dataType != "Repeat" && _dataType != "Range" && !this.limit(value,getAttribute('min'), getAttribute('max')))
					{
						this.AddError(i, getAttribute("msg"));
					}
					else
					{
						switch(_dataType){
							case null:break;
							case "Date" :
							case "Repeat" :
							case "Range" :
							case "Compare" :
							case "Custom" :
							case "Group" : 
							case "SafeString" :
							if(!eval(this[_dataType]))
							{
								this.AddError(i, getAttribute("msg"))
							}
							break;
							default :
							if(value.length > 0 && !this[_dataType].test(value))
							{
								this.AddError(i, getAttribute("msg"))
							}
							break;
						}
					}
				}
			}
		}
		if(this.ErrorMessage.length > 1)
		{
			mode = mode || 1;
			var errCount = this.ErrorItem.length;
			switch(mode)
			{
				case 1 :
					alert(this.ErrorMessage.join("\n"));
					this.focus();
					break;
				case 2 :
					for(var i=1;i<errCount;i++)
					{
						this.ErrorItem[i].style.color = "red"
					}
				case 3 :
					for(var i=1;i<errCount;i++)
					{
						try
						{
							var span = document.createElement("SPAN");
							span.id = "__ErrorMessagePanel";
							span.style.color = "red";
							this.ErrorItem[i].parentNode.appendChild(span);
							span.innerHTML = this.ErrorMessage[i].replace(/\d+:/,"*")
						}
						catch(e)
						{
							alert(e.description)
						}
					}
					this.focus();
					break;
				default :
					alert(this.ErrorMessage.join("\n"));
					break;
			}
			return false
		}
		return true
	},
	focus: function() {
		for(var i = 1;i < this.ErrorItem.length;i++) {
			try {
				this.ErrorItem[i].focus();
				return;
			}
			catch(e) {
			}
		}
	},
	limit: function(str,min, max)
	{
		var len= str.replace(/[^\x00-\xff]/g,"**").length;
		min = min || 0;
		max = max || Number.MAX_VALUE;
		return min <= len && len <= max
	},
	ClearState: function(elem)
	{
		with(elem){
			if(style.color == "red")
			{
				style.color = ""
			}
			var lastNode = parentNode.childNodes[parentNode.childNodes.length-1];
			if(lastNode.id == "__ErrorMessagePanel")
			{
				parentNode.removeChild(lastNode)
			}
		}
	},
	AddError: function(index, str)
	{
		this.ErrorItem[this.ErrorItem.length] = this.ErrorItem[0].elements[index];
		this.ErrorMessage[this.ErrorMessage.length] = this.ErrorMessage.length + ":" + str
	},
	Exec: function(op, reg){
		if(typeof(reg) == "string")
		{
			reg = new RegExp(reg)
		}
		return reg.test(op)
	},
	compare: function(op1,operator,op2)
	{
		switch (operator)
		{
			case "NotEqual":
				return (op1 != op2);
			case "GreaterThan":
				return (op1 > op2);
			case "GreaterThanEqual":
				return (op1 >= op2);
			case "LessThan":
				return (op1 < op2);
			case "LessThanEqual":
				return (op1 <= op2);
			default:
				return (op1 == op2); 
		}
	},
	MustChecked: function(groups, min, max)
	{
		if(!groups.length) {
			return groups.checked;
		}
		var hasChecked = 0;
		min = min || 1;
		max = max || groups.length;
		for(var i=groups.length-1;i>=0;i--)
		{
			if(groups[i].checked)
			{
				hasChecked++
			}
		}
		return min <= hasChecked && hasChecked <= max
	},
	IsDate: function(op, formatString)
	{
		formatString = formatString || "ymd";
		var m, year, month, day;
		switch(formatString)
		{
			case "ymd" :
				m = op.match(new RegExp("^((\\d{4})|(\\d{2}))([-./])(\\d{1,2})\\4(\\d{1,2})$"));
				if(m == null)
				{
					return false
				}
				day = m[6];
				month = m[5]*1;
				year = (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10));
				break;
			case "dmy" :
				m = op.match(new RegExp("^(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))$"));
				if(m == null )
				{
					return false
				}
				day = m[1];
				month = m[3]*1;
				year = (m[5].length == 4) ? m[5] : GetFullYear(parseInt(m[6], 10));
				break;
			default :
				break;
		}
		if(!parseInt(month))
		{
			return false
		}
		month = month==0 ? 12:month;
		var date = new Date(year, month - 1, day);
		return (typeof(date) == "object" && year == date.getFullYear() && month == (date.getMonth() + 1) && day == date.getDate());
		function GetFullYear(y){return ((y<30 ? "20" : "19") + y)|0;}
	}
}
var ScriptLoader = {};
ScriptLoader.isLoading = false ;
ScriptLoader.queue = new Array();
ScriptLoader.Load = function(src,handler)
{
	var queue = new Object();
	queue.src = src;
	queue.handler = handler;
	this.queue.push(queue);
	if (!this.isLoading)
	{
		this.CheckQueue()
	}
}
ScriptLoader.CheckQueue = function() 
{
	if ( this.queue.length > 0 )
	{
		this.isLoading = true ;
		this.LoadFile(this.queue.shift())
	}
	else
	{
		this.isLoading = false
	}
}
ScriptLoader.LoadFile = function( queue ) 
{
	var e ;
	if ( queue.src.lastIndexOf('.css') > 0 )
	{
		e = document.createElement('link');
		e.rel = "stylesheet";
		e.type = "text/css";
		if(!window.isIE)
		{
			setTimeout(function(){
				ScriptLoader.CheckQueue();
				if(this.handler) {
					this.handler()
				}
			}.bind(e),1);
		}
	}
	else
	{
		e = document.createElement( "script" );
		e.type = "text/javascript";
		e.handler = queue.handler;
	}
	e.onload = e.onreadystatechange = function() {
		if (!this.readyState || this.readyState == "complete" || this.readyState == 'loaded' )
		{
			if(this.handler) {
				this.handler()
			}
			ScriptLoader.CheckQueue()
		}
	};
	e.href = e.src = queue.src;
	document.getElementsByTagName("head")[0].appendChild( e );
}
var Timer = function(method,delay,loop){
	if(typeof(method) == "string")
	{
		this.method = function(){
			eval(method);
		}
	}
	else if(typeof(method) == "function"){
		this.method = method;
	}
	else{
		return;
	}
	this.method();
	delay = delay || 100;
	loop = (loop || 0) - 1;
	if(loop != 0)
	{	this.loop = loop;
		this.timer = window.setInterval(function(){
			if(this.loop != 0){
				if(!this.paused){
					this.loop--;
					this.loop = Math.max(this.loop,-1);
					this.method();
				}
			}
			else
			{
				window.clearInterval(this.timer);
			}
		}.bind(this),delay);
	}
}
Timer.prototype.pause = function(){
	this.paused = true;
}
Timer.prototype.resume = function(){
	this.paused = false;
}
Timer.prototype.abort = function(){
	this.loop = 0;
}
var Request = {
	Count: 0,
	Initialize: function() {
		this.QueryString = this;
		var queryString = location.href;
		if(queryString.indexOf('?') == -1)
		{
			queryString = queryString.replace(/#/g,'?anchor=')
		}
		else
		{
			queryString = queryString.replace(/#/g,'&anchor=')
		}
		queryString = queryString.split('?');
		if(queryString.length > 1)
		{
			this.QueryString = queryString[1].toObject();
			for(var item in this.QueryString)
			{
				this[item] = decodeURIComponent(this.QueryString[item])
			}
		}
	}
}
Request.Initialize();
var Cookie = {
	set: function(name, value, expires, path, domain, secure) {
		document.cookie = name + "=" + escape(value) +
			((expires) ? "; expires=" + expires.toGMTString() : "") +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			((secure) ? "; secure" : "");
	},
	get: function(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		} else {
			begin += 2;
		}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) {
			end = dc.length;
		}
		return unescape(dc.substring(begin + prefix.length, end));
	},
	remove:function(name)
	{
		var expires=new Date();
		var names = name.split('|');
		for(var i = 0;i < names.length;i++)
		{
			this.set(names[i],"",expires);
		}
	},
	clear:function()
	{
		if(document.cookie=="") return;
		var arr=document.cookie.split("; ");
		if(arr.length)
		{
			var ar;
			for(var i=0;i<arr.length;i++)
			{
				ar=arr[i].split("=");
				if(ar.length)
				{
					this.remove(ar[0]);
				}
			}
		}
	}
}
HTMLElement.prototype.getType = function() {
	switch(this.tagName) {
		case "BUTTON": return HTMLButtonElement;
		case "DIV": return HTMLDivElement;
		case "FORM": return HTMLFormElement;
		case "IFRAME": return HTMLIFrameElement;
		case "IMG": return HTMLImageElement;
		case "INPUT": return HTMLInputElement;
		case "LABEL": return HTMLLabelElement;
		case "OBJECT": return HTMLObjectElement;
		case "SELECT": return HTMLSelectElement;
		case "TABLE": return HTMLTableElement;
		case "THEAD":
		case "TBODY":
		case "TFOOT": return HTMLTableSectionElement;
		case "TR": return HTMLTableRowElement;
		case "TD": return HTMLTableCellElement;
		case "SPAN": return HTMLSpanElement;
		case "TEXTAREA": return HTMLTextAreaElement;
		default: return HTMLUnknownElement;
	}
}
HTMLElement.prototype.getPosition = function() {
	var e = this;
	var pos = {x:0,y:0};
	pos.x = e.offsetLeft;
	pos.y = e.offsetTop;
	while (e = e.offsetParent)
	{
		pos.x += e.offsetLeft;
		pos.y += e.offsetTop;
		if(e.tagName != "HTML"){
			pos.x -= e.scrollLeft;
			pos.y -= e.scrollTop;
		}
	}
	return pos
}
HTMLElement.prototype.bindTrackOf = function(container, mode, callback) {
	this.mode = mode.toLowerCase();
	this.callback = callback;
	this.draging = false;
	this.container = container;
	this.position = {mouse:{x:0,y:0},offset:{top:0,left:0}};
	this.onmousedown = function(){
		this.draging = true;
		this.position.mouse.x = event.x;
		this.position.mouse.y = event.y;
		with(this.position)
		{
			offset.left = this.offsetLeft;
			offset.top = this.offsetTop;
		}
		return event.returnValue = !(event.cancelBubble = true);
	}
	document.attachEvent("onmouseup",function(){
		this.draging = false;
	}.bind(this));
	document.attachEvent("onmousemove",function(){
		if(this.draging)
		{
			if(mode == "horizontal") {
				var w = this.container.offsetWidth - this.offsetWidth;
				var x = Math.min(Math.max(this.position.offset.left + event.x - this.position.mouse.x, 0), w);
				this.style.left = x + "px";
				if(this.callback) {
					this.callback(parseInt(x / w * 100));
				}
			}
			else {
				var h = this.container.offsetHeight - this.offsetHeight;
				var y = Math.min(Math.max(this.position.offset.top + event.y - this.position.mouse.y, 0), h);
				this.style.top = y + "px";
				if(this.callback) {
					this.callback(parseInt(y / h * 100));
				}
			}
			return event.returnValue = !(event.cancelBubble = true);
		}
	}.bind(this));
}
HTMLElement.prototype.bindDragTo = function(target) {
	this.target = target || this;
	this.draging = false;
	this.position = {mouse:{x:0,y:0},offset:{top:0,left:0}};
	this.onselect = function(){return false};
	this.onmousedown = function(){
		this.draging = true;
		with(this.position)
		{
			mouse.x = event.x;
			mouse.y = event.y;
			offset.left = this.target.offsetLeft;
			offset.top = this.target.offsetTop;
		}
	}
	document.attachEvent("onmouseup",function(){
		this.draging = false;
	}.bind(this));
	document.attachEvent("onmousemove",function(){
		if(this.draging)
		{
			with(this.position)
			{
				this.target.style.top = Math.max(offset.top + event.y - mouse.y , 0) + "px";
				this.target.style.left = Math.max(offset.left + event.x - mouse.x, 0) + "px";
			}
			return event.returnValue = !(event.cancelBubble = true);
		}
	}.bind(this));
}
HTMLElement.prototype.hasClassName = function(className) {
	return this.className.split(/\s+/).indexOf(className) > -1;
}
HTMLElement.prototype.appendClassName = function(className) {
	var cns = this.className.split(/\s+/);
	if(cns.indexOf(className) < 0) {
		cns.push(className);
		this.className = cns.join(' ');
	}
}
HTMLElement.prototype.removeClassName = function(className) {
	var cns = this.className.split(/\s+/);
	cns.remove(className);
	this.className = cns.join(' ');
}
HTMLSelectElement.prototype.repair = function() {
	if(!window.isIE || window.version > 6) {
		this.update = function(){};
		return;
	}
	this.boxHeight = 0;
	var tctn = document.createElement("table");
	this.insertAdjacentElement("beforeBegin", tctn);
	
	with(tctn) {
		border = 0;
		cellPadding = 0;
		cellSpacing = 0;
		style.cssText = 'vertical-align:text-bottom;display:inline;border-collapse:collapse;margin:0px 4px 0px 0px;padding:0px;font:"Times New Roman" 12px;cursor:default;color:#000';
	}
	var ctn = document.createElement("div");
	
	tctn.insertRow().insertCell().appendChild(ctn);
	ctn.style.cssText = "text-align:left;height:22px;padding:0px;margin:0px;overflow-y:hidden";
	
	var vs = document.createElement("div");
	vs.style.cssText = "height:18px;padding:0px;margin:0px;overflow-y:hidden;border:2px inset buttonhighlight;background-color:#fff";
	vs.appendChild(this.buttonBox = document.createElement("div"));
	with(this.buttonBox) {
		setAttribute("UNSELECTABLE", "on");
		style.cssText = "display:inline;float:right;padding:0px;margin:0px;font-family:webdings;line-height:13px;border:2px outset buttonhighlight;background-color:buttonface;color:#000;width:13px;text-align:center;font-size:12px;height:14px;";
		innerHTML = "6";
	}
	vs.appendChild(this.showBox = document.createElement("div"));
	with(this.showBox) {
		setAttribute("UNSELECTABLE", "on");
		style.cssText = "float:left;text-align:left;margin:2px 0px 0px 1px;padding:0px";
	}
	this.onfocus = function() {
		with(vs.style) {
			color = "#fff";
			backgroundColor = "activecaption";
		}
	}
	this.onblur = function() {
		with(vs.style) {
			color = "#000";
			backgroundColor = "#fff";
		}
	}
	ctn.appendChild(vs);
	
	var sctn = document.createElement("div");
	sctn.appendChild(this);
	sctn.style.cssText = "height:0px;padding:0px;margin:0px;overflow-y:hidden";
	ctn.appendChild(sctn);

	ctn.appendChild(this.optionBox = document.createElement("div"));
	
	this.optionBox.lastOn = null;
	this.optionBox.style.cssText = "position:absolute;padding:0px;margin:0px;overflow-y:auto;border:1px solid #333;background-color:#fff;visibility:hidden";
	this.optionBox.select = function(option) {
		this.optionBox.style.visibility="hidden";
		this.selectedIndex = option.index;
		this.showBox.innerText = this.options[this.selectedIndex].text;
		if(this.onchange) {
			this.onchange();
		}
 		this.focus();
	}.bind(this);
	this.update = function() {
		this.optionBox.innerHTML = "";
		for(var i = 0;i < this.options.length;i++) {
			var option = document.createElement("a");
			this.optionBox.appendChild(option);
			option.index = i;
			option.style.cssText = "white-space:nowrap;display:block;padding:0px 20px 0px 1px;margin:0px;text-align:left;border:1px dashed #fff";
			option.innerHTML = this.options[i].text;
			(option.mapping = this.options[i]).mapping = option;
			
			option.onmouseover = function (){
				if(this.parentNode.lastOn != null) {
					with(this.parentNode.lastOn) {
						if(mapping.style.color) {
							style.color = mapping.style.color;
						}
						else {
							style.color = "#000";
						}
						style.backgroundColor = "#fff";
					}
				}
				this.parentNode.lastOn = this;
				with(this.style) {
					color = "#fff";
					backgroundColor = "activecaption";
				}
				this.focus();
			};
			option.onclick = function() {
				this.parentNode.select(this);
				return event.returnValue = !(event.cancelBubble = true);
			}
		}
		this.optionBox.style.height = 'auto';
		this.optionBox.style.height = this.optionBox.offsetHeight > 180 ? '180px' : 'auto';
		if(this.selectedIndex >= 0) {
			this.showBox.innerText = this.options[this.selectedIndex].text;
		}
	};
	this.update();
	this.show = function() {
		if(this.boxHeight <= 100) {
			this.optionBox.style.clip="rect(auto auto "+this.boxHeight+"% auto)";
			this.boxHeight += 20;
		}
	}
	this.timer = new Timer(this.show.bind(this),1);
	vs.onmousedown = function() {
 		this.buttonBox.style.borderStyle="inset";
	 	with(this.optionBox.style) {
	 		if(visibility != "visible") {
				if(this.optionBox.lastOn != null) {
					with(this.optionBox.lastOn.style) {
						color = "#000";
						backgroundColor = "#fff";
					}
				}
	 			clip="rect(auto auto 0% auto)";
		 		this.boxHeight = 0;
	 			visibility = "visible";
	 			for(var i = 0;i < this.options.length;i++) {
	 				with(this.options[i]) {
	 					if(style.color) {
	 						mapping.style.color = style.color;
	 					}
	 				}
	 			}
	 			if(this.selectedIndex >= 0) {
	 				with(this.optionBox) {
	 					lastOn = this.options[this.selectedIndex].mapping;
	 					scrollTop = lastOn.offsetTop;
						lastOn.style.color = "#fff";
						lastOn.style.backgroundColor = "activecaption";
						lastOn.focus();
	 				}
	 			}
	 		}
		 	else {
 				this.focus();
	 			visibility = "hidden";
		 	}
		}
	}.bind(this);
	document.attachEvent("onmouseup", function() {
		this.buttonBox.style.borderStyle="outset";
	}.bind(this));
	document.attachEvent("onmousedown", function() {
		if(!this.optionBox.parentNode.contains(event.srcElement)) {
			this.optionBox.style.visibility="hidden";
			this.onblur();
		}
	}.bind(this));
}
HTMLSelectElement.prototype.fill = function(source,query,textField,valueField,callback)
{
	var httpRequest = new HTTPRequest();
	httpRequest.send(
		source,
		query,
		function(r) {
			var nodes = r.getXML().documentElement.firstChild.childNodes;
			this.options.length = nodes.length;
			for(var i = 0 ; i < nodes.length ; i++)
			{
				this.options[i].text = nodes[i].getAttribute(textField);
				this.options[i].value = nodes[i].getAttribute(valueField)
			}
			this.selectedIndex = 0;
			if(this.onchange) {
				this.onchange();
			}
			if(this.update) {
				this.update();
			}
			if(callback)
			{
				callback(r)
			}
		}.bind(this)
	)
}
HTMLFormElement.prototype.getData = function() {
	if(!Validator.Validate(this))
	{
		return null
	}
	var el,result = [];
	for (var i=0;i< this.elements.length;i++)
	{
		el = this.elements[i];
		if(el.disabled || !el.name)
		{
			continue;
		}
		switch(el.type)
		{
			case "file":
			case "reset":
			case "etc":
			case "submit":
			case "button":
				break;
			case "radio":
			case "checkbox":
				if (el.checked)
				{
					result.push(el.name+"="+encodeURIComponent(el.value))
				}
				break;
			case "select-multiple":
				var optionItem;
				for(var j=0;j<el.options.length;j++)
				{
					optionItem = el.options[j];
					if (optionItem.selected)
					{
						result.push(el.name+"="+encodeURIComponent(optionItem.value))
					}
				}
				break;
			case "textarea":
				try {
					el.editor.Update();
				} catch(e) {}
			default: 
				if(el.name)
				{
					result.push(el.name+"="+encodeURIComponent(el.value))
				}
				break;
		}
	}
	return result.join('&')
}
HTMLFormElement.prototype.post = function(callback) {
	var query = this.getData();
	if(query != null)
	{
		var httpRequest = new HTTPRequest();
		httpRequest.send(this.action,query,callback)
	}
	else if(typeof(this.onValidateFail) == "function"){
		this.onValidateFail();
	}
	else {
		var validateEvent = this.getAttribute("onvalidatefail");
		if(validateEvent != null) {
			eval(validateEvent);
		}
	}
	return query
}

function $id(id)
{
	return document.getElementById(id)
}
function $(source)
{
	if(typeof(source) == "string"){
		source = $id(source)
	}
	if(!source){
		return null
	}
	if(window.isIE && !source.expand)
	{
		for(var item in HTMLElement.prototype) {
			source[item] = HTMLElement.prototype[item]
		}
		var prototype = source.getType().prototype;
		for(var item in prototype)
		{
			source[item] = prototype[item]
		}
		source.expand = true
	}
	return source
}
window.onerror = function() {
//	var func=window.onerror.caller;
//	var re = /(function\s+)([^\{]*)(\{)([\w\W]*)/mgi;
//	var re2 = /(function\s?[^\{]*)(\{)([\w\W]*)/gi;
//	var stack = [];
//	while(func!=null)
//	{
//		stack.push(func.toString().replace(re,"$2").replace(re2,"$1"));
//		func = func.caller;
//	}
//	var query = [];
//	query.push(arguments[1]);
//	query.push(arguments[2]);
//	query.push(stack.reverse().join("->").replace(/\s/gi,""));
//	query.push(arguments[0]);
//	query.push(navigator.userAgent);
//	query.push(navigator.cookieEnabled + "\r\n");
//	var httpRequest = new HTTPRequest(true,true);
//	httpRequest.send("/elog.aspx",query.join("\t"));
}