var chkup = new Array();
var num = 0;
var timeout;
function addinput(obj,type,args){
	var s;
	var e = document.createElement("input");
	e.type = type; 
	var o = obj.appendChild(e);
	for(var key in args){
		
		//o[key] = args[key];
		eval("o."+key+"='"+args[key]+"';");
	}
	
	
}
function loadadimg(place,url){
		var httpobj	=	new HttpQuest();
		httpobj.Touch(url,null,chkadimg,place,isIE);
		httpobj = null;
	}
function chkadimg(obj,place){
		
}
function urlapp(url,call,ele){
	var httpobj	=	new HttpQuest();
	httpobj.Touch(url,null,call,ele,false);
	httpobj = null;
}
function s__u(txt,ele){
	
	$(ele).innerHTML = txt;
	}
function dayin(txt)  
{
  var code="<body onload=window.print()>"
  code+="<img src="+txt+" />";
  var newwin=window.open('','','');
  newwin.opener = null;
  newwin.document.write(code);
  newwin.document.close();
  return false;
} 
function loadImg(url){
	if(url!=null){
		if($("ShowImg")){
			$("ShowImg").style.display = 'block'
			$("ShowImg").innerHTML = "<div onclick='loadImg(null)' id='showscreen' class='showscreen'><table width='100%' height='100%' border='0'><tr><td align='center' valign='middle'><div class='loading'><img src='/pic/loadding.gif'></div></td></tr></table></div>";			
			$("ShowImg").innerHTML += "<div class='ShowImgBg alpha'></div><div id='opt'></div>"
			$("ShowImg").className = 'ShowImg';
		}
		var httpobj	=	new HttpQuest();
		httpobj.Touch(url,null,BigImg,url,isIE);
		httpobj = null;
	}else{
		if($("ShowImg"))
			$("ShowImg").innerHTML = '';$("ShowImg").className = '';$("ShowImg").style.display = 'none';
	}
}

function loadhtml(url){
	if(url!=null){
		$("ShowImg").style.display = 'block'
		$("ShowImg").innerHTML = "<div id='showscreen' class='showscreen'><table width='100%'  border='0'><tr><td height='200' align='center' valign='middle'><div class='loading'><img src='/pic/loadding.gif'></div></td></tr></table></div>";			
		$("ShowImg").innerHTML += "<div class='ShowImgBg alpha'></div><div id='opt'></div>"
		$("ShowImg").className = 'ShowImg';
		
		var httpobj	=	new HttpQuest();
		httpobj.Touch(url,null,htmlshow,url,false);
		httpobj = null;
	}else{
		$("ShowImg").innerHTML = '';$("ShowImg").className = '';$("ShowImg").style.display = 'none';
	}
}
function htmlshow(a,url){
		if(!a)return false;
		$("showscreen").style.background = "#ffccff"
		$('showscreen').innerHTML = a;
}
function divhtml(url,ele,oly){
	if(!ele)ele="ajaxcontent";
	var arg = new Array();
	arg[0] = ele;
	arg[1] = oly;
	if(url!=null){
		$(ele).style.display = 'block'
		$(ele).innerHTML = "<table width='100%' height='100%' border='0'><tr><td align='center' valign='middle'><div class='loading'><img src='/pic/loading.gif'></div></td></tr></table>";			
		var httpobj	=	new HttpQuest();
		httpobj.Touch(url,null,divhtmlshow,arg,false);
		value = httpobj.returnvalue;
		httpobj = null;
		if(value)return value;
	}else{
		$(ele).innerHTML = '';$(ele).className = '';$(ele).style.display = 'none';
	}
}
function divhtmlshow(a,arg){
	if(!a)return false;
	ele = arg[0];
	n = arg[1]?arg[1]:0;
	$(ele).innerHTML = a;
	if(n)eval("document."+ele+(n-1)+'value="'+escape(a)+'"');
}
function ehtml(e,url,send){
	if(!$(e))return false;
	if(url!=null){
		$(e).style.display = 'block'
		$(e).innerHTML = "<table width='100%' height='200' border='0'><tr><td align='center' valign='middle'><div class='loading'><img src='/pic/loadding.gif'></div></td></tr></table>";			
		var httpobj	=	new HttpQuest();
		httpobj.Touch(url,send,ehtmlshow,e,false);
		httpobj = null;
	}
}
function ehtmlshow(a,e){
	if(!a)return false;
	$(e).innerHTML = a;	
}
function BigImg(a,url){
	if(!a){
		/*switch(url)
                {
                case 0:
                       $('showscreen').innerHTML="未初始化...";
                        break;
                case 1:
                        $('showscreen').innerHTML="加载中...";
                        break;
                case 2:
                        $('showscreen').innerHTML="连接完成...";
                        break;
                case 3:
                        $('showscreen').innerHTML="交换数据...";
                        break;
                default:
                        break;
                }*/
			return false;

	}
	if($('showscreen'))
	$('showscreen').innerHTML = "<table width='100%' height='100%' border='0'><tr><td align='center' valign='middle'><img id='bigimg' src='"+url+"' style='MARGIN-RIGHT: auto; MARGIN-LEFT: auto;'></td></tr></table>";
		//$("opt").innerHTML =$('bigimg').width;
}
function filloption(name,len){
	$(name).length = len;
	if(len<=0)return false;
	for(i=1;i<=len;i++){
		$(name).options[i-1].value = i;
		$(name).options[i-1].text = i;
	}
}
function filloptionwithday(name,len){
	$(name).length = len;
	if(len>15)	$(name).size = 15;
	else	$(name).size = len;
	now= new Date();
	stamps = now.getTime();
	if(len<=0)return false;
	for(i=1;i<=len;i++){
		stamp=stamps + (i-1)*24*60*60*1000;
		$(name).options[i-1].value = FmtDate(stamp);
		$(name).options[i-1].text = FmtDate(stamp);
	}
	now = null;
	}
function setSelect(name,no,value){
	if(value!=0){
		$(name).options[no].text = value;
		$(name).options[no].value = -1;
	}
}
function uext(id,type){
	url = "index.php?controller=chk&action=uexp&v="+id+"&v2="+type;
	CallHttpQuery(url,uexpobj,type);
}
function uexpobj(xmlobj,element){
			if(!xmlobj)return false;
			if(!$("showEXP"+element))return false;
			nXmlObj =new DomObj(xmlobj);
			
			try{
				//setSelect("ontopsEXP"+element,0,nXmlObj.GetXmlNodeValue('msg[0]'));
			  if(nXmlObj.GetXmlNodeValue('msg[0]') && nXmlObj.GetXmlNodeValue('msg[0]')!='0'){
				$("showEXP"+element).innerHTML = "<input style='display:none'  type='text' name='ontopsEXP"+element+"' id='ontopsEXP"+element+"' size='10' />"+nXmlObj.GetXmlNodeValue('msg[0]');
			  }
				$("showEXP"+element).onclick = function(){
					$("showEXP"+element).innerHTML="<input  type='text' name='ontopsEXP"+element+"' id='ontopsEXP"+element+"' size='10' />天";
					$("showEXP"+element).onclick = "";
				}
				//$("ontopsEXP"+element).style.display = "none";
			}catch(e){
				
				setTimeout(function(){uexpobj(xmlobj,element);},2000);
			}
			
			nXmlObj	=	null;
	}
function FmtDate(stamp){
	dobj = new Date(stamp);
	year = dobj.getFullYear();
	month = dobj.getMonth()+1;
	date = dobj.getDate();
	dobj = null;
	month = (month>=10)?month:'0'+month;
	date = (date>=10)?date:'0'+date;
	return year+'-'+month+'-'+date;
	}
function adj(type,value,value2){
	url = "index.php?controller=chk&action="+type+"&v="+value;
	CallHttpQuery(url,adplace,type);
}
function adplace(xmlobj,element){
			if(!xmlobj)return false;
			if(!$(element))return false;
			nXmlObj =new DomObj(xmlobj);
			
			try{
				$(element+'msg').innerHTML = nXmlObj.GetXmlNodeValue('msg[0]');
				$(element+'msg1').innerHTML = nXmlObj.GetXmlNodeValue('msg[1]');
				$(element+'msg2').innerHTML = nXmlObj.GetXmlNodeValue('msg[2]');
				$(element+'msg3').innerHTML = nXmlObj.GetXmlNodeValue('msg[3]');
				num = nXmlObj.GetXmlNodeValue('msg[0]');
				if(nXmlObj.GetXmlNodeValue('chk[0]')==0){
					$(element).className='msn_results1';
					chkup[element] = 0;
				}else{
					$(element).className='msn_results2';
					chkup[element] = 1;
				}
			}catch(e){
				setTimeout(function(){adplace(xmlobj,element);},2000);
			}
			
			nXmlObj	=	null;
	}
function changechannel(type,gid){
	
	url = "index.php?controller=chk&action=channel&v="+gid;
	CallHttpQuery(url,gidplace,type);
	}
function gidplace(xmlobj,element){
	
	if(!xmlobj)return false;
	
	if(!$(element))return false;
	
	nXmlObj =new DomObj(xmlobj);
	
	try{
		len = nXmlObj.GetXmlNodeValue("count[0]");//GetXmlNodesCount('root','msgid');
		
		$(element).size =1;
		$(element).length = 0;
		$(element).length = len;
		for(j=1;j<=len;j++){
			$(element).options[(j-1)].value = nXmlObj.GetXmlNodeValue('msgid['+(j-1)+']');
			$(element).options[(j-1)].text = nXmlObj.GetXmlNodeValue('msgn['+(j-1)+']');
		}
	}catch(e){
		
		timeout = setTimeout(function(){gidplace(xmlobj,element);},2000);
		}
	clearTimeout(timeout);
	nXmlObj = null;
	return true;
	}
function getchk(){
	rchk = 1;
	for(key in chkup){
		rchk *= chkup[key];
	}
	return rchk;
}
function listshow(xmlobj,element){
		
			if(!xmlobj)return false;
			if(!$(element))return false;
			
			nXmlObj =new DomObj(xmlobj);
			
			try{
				
				if(nXmlObj.GetXmlNodeValue('msg[0]')!=0)
				$(element).innerHTML = nXmlObj.GetXmlNodeValue('msg[0]');
				num = nXmlObj.GetXmlNodeValue('msg[0]');
				if(nXmlObj.GetXmlNodeValue('chk[0]')==0){
					$(element).className='msn_results1';
					chkup[element] = 0;
				}else{
					$(element).className='msn_results2';
					chkup[element] = 1;
				}
			}catch(e){
				
				setTimeout(function(){listshow(xmlobj,element);},2000);
			}
			nXmlObj	=	null;
		}
function chk(type,value,value2){
	
	if(value2)
		url =  "index.php?controller=chk&action="+type+"&v="+value+"&v2="+value2;
	else
		url = "index.php?controller=chk&action="+type+"&v="+value;
	
	CallHttpQuery(url,listshow,type+"msg");
}
function setPL(name,v2){
	if(v2==1){
		elementname = "ag"+name;
	}else{
		elementname = "disag"+name;
	}
	url =  "index.php?controller=chk&action=uppl&v="+name+"&v2="+v2;
	CallHttpQuery(url,listshow,elementname);
	}
function upup(v,v2){//信息踩踩
	//alert("谢谢!");
	url =  "index.php?controller=chk&action=upup&v="+v+"&v2="+v2;
	CallHttpQuery(url,listshow,'upup');
}
function up2008(v){//信息踩踩
	url =  "index.php?controller=chk&action=up2008&v="+v;
	CallHttpQuery(url,listshow,'up2008'+v);
}
function setHelp(name,v2){
	if(v2==1){
		elementname = "ag"+name;
	}else{
		elementname = "disag"+name;
	}
	url =  "index.php?controller=chk&action=uphelp&v="+name+"&v2="+v2;
	CallHttpQuery(url,listshow,elementname);
	}
function setConsultations(name,v2){
	if(v2==1){
		elementname = "ag"+name;
	}else{
		elementname = "disag"+name;
	}
	url =  "index.php?controller=chk&action=upConsultations&v="+name+"&v2="+v2;
	CallHttpQuery(url,listshow,elementname);
	}
var getFormValue = function(element){
	var formNodes = $(element);
	var value = '';
	for(i=0;i<formNodes.length;i++){
		value +=formNodes[i].name+"="+formNodes[i].value;
		if(i!=formNodes.length-1)value += "&";
		}
	return value;
	}

function CallHttpQuery(url,callback,element,send){
	var httpobj	=	new HttpQuest();
	httpobj.Touch(url,send,callback,element,true);
	httpobj = null;
}
function getTempObj(xmlobj,tmpobj){	if(!xmlobj)return false;	eval(tmpobj +" =new DomObj(xmlobj);");}

var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;
var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;
var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;
var isFirefox=(navigator.userAgent.indexOf("Firefox")!=-1)?true:false;
var IEVer=getIEVer();function getIEVer(){
	var iVerNo=0;
	var sVer=navigator.userAgent;
	if(sVer.indexOf("MSIE")>-1){var sVerNo=sVer.split(";")[1];sVerNo=sVerNo.replace("MSIE","");iVerNo=parseFloat(sVerNo);}
	return iVerNo;
}
var GetThis = function(){
	var self;
		try{	self = event.srcElement;		}
		catch(e){	self=this; 		 }
	return self;
	}
var getElementsByClassName = function(className,oParent) {
    doc = (oParent||document);
    matches = [];
    nodes = doc.all||doc.getElementsByTagName('*');
    for (i=0; i<nodes.length; i++) {
      if (nodes[i].className == className.trim()) {
        matches[matches.length] = nodes[i];
      }
    }
    return matches; // kids, don't play with fire. ;)
 }
function $(){
	var elements=new Array();
	for(var i=0;i<arguments.length;i++){
		var element=arguments[i];
		if(typeof element=='string')element=document.getElementById(element);
		if(arguments.length==1)return element;elements.push(element);
	}
	return elements;
}
function changBg(self,bool){
		if(bool)self.style.background = "#aaaaaa";
		else self.style.background = '';
	}
String.prototype.trim = function(){     return this.replace(/(^\s*)|(\s*$)/g, "");}
CssSet = function(){};
CssSet.prototype = {
	BackGround:function(bgUrl,bgElement,alpha){
		var _CssScript;
		var _Elements;
		alpha ? 1:0;
		if(isIE && alpha){
			_CssScript = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src=\""+bgUrl+"\");background:none;" ;
		}else{
			_CssScript ="background: url("+bgUrl+") repeat;";
		}
		if(bgElement[0]=='class'){		_Elements=getElementsByClassName(bgElement[1]);	}
		if(bgElement[0]=='id'){			_Elements = $(bgElement[1]);}
		if(bgElement[0]=='tagname'){	_Elements=document.getElementsByTagName(bgElement[1]);	}
		if(bgElement[0]=='name'){		_Elements=document.getElementsByName(bgElement[1]);	}
		if(bgElement[0]=='this'){		_Elements = bgElement[1];}
		if(typeof _Elements[0]=='undefined'){
			_Elements.style.cssText = _CssScript;
		}else{
			for(_key in _Elements)	try{	_Elements[_key].style.cssText = _CssScript;	}catch(e){};		
		}		}
}
JsEvent = function(){}
JsEvent.prototype = {
	AddEvent:function(adElement,adEvent,adCall){
		var target
		if(adElement[0]=='class')target = getElementsByClassName(adElement[1]);
		if(adElement[0]=='id')target = $(adElement[1]);
		if(adElement[0]=='tagname')target = document.getElementsByTagName(adElement[1]);
		if(adElement[0]=='name')target = document.getElementsByName(adElement[1]);
		if(typeof target[0]=='undefined'){
			if(isIE)	target.attachEvent("on"+adEvent,adCall);
			else		target.addEventListener(adEvent,adCall,false);
		}else{
			for(_key in target){
				if(isIE)	target[_key].attachEvent("on"+adEvent,adCall);
				else		target[_key].addEventListener(adEvent,adCall,false);
			}
		}
		}
	}
DomObj	=	function(AJAX){
	this.Handle = '';
	if(AJAX){
		this.Handle = AJAX;
	}else{
		this.CreateDom();}
}
DomObj.prototype = {
	CreateDom:function(){
		if (window.ActiveXObject){
			XmlObj = new ActiveXObject('Microsoft.XMLDOM');
		}else if(document.implementation && document.implementation.createDocument){
			XmlObj = document.implementation.createDocument('','',null);
		}else{
			this.Handle = null;
		}
		
		XmlObj.async	=	false;
		this.Handle = XmlObj;},
	LoadFile:function(lfFile){
		this.Handle.load(lfFile);
		},
	LoadXml:function(lxXml){
		this.Handle.loadXML(lxXml);
		},
	GoTo:function(gtXmlPath,isID){
		//item[0].title[0]
		var NewPath = this.Handle;
		
		var NewPaths = new Array();
		if(isID){
			NewPath	=	NewPath.getElementsByTagName('*');
			for(var n=0;n<NewPath.length;n++){
				if(NewPath[n].getAttribute(isID) == gtXmlPath){NewPaths.push(NewPath[n]);}
			}
			if(NewPaths.length==1)return NewPaths[0]
			else return NewPaths;
		}
		if(gtXmlPath){
			var XmlNodes = gtXmlPath.split('/');
			for(kdy in XmlNodes){
				if(typeof XmlNodes[kdy]=='string'){
					NodeTag = XmlNodes[kdy].substring(0,XmlNodes[kdy].indexOf('['));
					NodeIndex = XmlNodes[kdy].substring(XmlNodes[kdy].indexOf('[')+1,XmlNodes[kdy].indexOf(']'));
					
					NewPath = NewPath.getElementsByTagName(NodeTag)[NodeIndex];
					
					}
				}
		}
		return NewPath;
		},
	GetXmlNodeValue:function(gxvXmlPath){
		//item[0].title[0]
		var Obj = this.GoTo(gxvXmlPath);
		if(Obj.firstChild==null)return '';//处理空字节
		return Obj.firstChild.nodeValue;
		},
	GetXmlValue:function(gxvXmlPath){
		//item[0].title[0]
		if(typeof gxvXmlPath!='string')
			Obj	=	gxvXmlPath
		else
			Obj = this.GoTo(gxvXmlPath);
		if(isIE){
			return Obj.xml;
		}else{
			var oSerializer = new XMLSerializer();
			return oSerializer.serializeToString(Obj);
			}
		},
	SetXmlNodeValue:function(sxvXmlPath,sxvValue,isID,isCdata){
		var Obj = this.GoTo(sxvXmlPath,isID);
		if(isCdata){
			cdata = this.Handle.createCDATASection(sxvValue);
			Obj.removeChild(Obj.firstChild)
			Obj.appendChild(cdata);
		}else{
			Obj.firstChild.data = sxvValue;
		}},
	GetXmlNodesCount:function(gncXmlPath,gncXmlNode){
		var Obj = this.GoTo(gncXmlPath);
		return Obj.getElementsByTagName(gncXmlNode).length;
		}
}
eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[0-8]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('HttpQuest=function(){0.5=\'\';0.1=\'e0575\';0.returnvalue=\'\';var a=6;2{a=3 XMLHttpRequest()}4(trymicrosoft){2{a=3 7("Msxml2.8")}4(othermicrosoft){2{a=3 7("Microsoft.8")}4(failed){a=6}}}0.1="www."+0.1+".com";0.5=a};',[],9,'this|header|try|new|catch|Handle|false|ActiveXObject|XMLHTTP'.split('|'),0,{}))

eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[0-35-9g-w]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('HttpQuest.prototype={3:\'\',9:\'\',Touch:5(a,b,c,d,e){var f=0;0.3=a;0.1.onreadystatechange=5(){f.h(c,d,e)};2(!b){0.1.i(\'GET\',0.3,j);0.1.6("9-7","k/x-l-m-n; o=p");0.1.6("q-7",0.r);b=8}g{0.1.i(\'POST\',0.3,j);0.1.6("9-7","k/x-l-m-n; o=p");0.1.6("q-7",0.r)}0.1.send(b)},h:5(a,b,c){2(!a)return 8;2(0.1){2(0.1.s==4){2(0.1.t==200||0.1.t==500){2(!c){a(0.1.u,b);0.v=0.1.u}g{a(0.1.w,b);0.v=0.1.w}}}g{a(8,0.1.s)}}},Clear:5(){0.1=8}};',[],33,'this|Handle|if|File||function|setRequestHeader|Type|null|Content|||||||else|Proess|open|true|application|www|form|urlencoded|charset|gb2312|E0575|header|readyState|status|responseText|returnvalue|responseXML'.split('|'),0,{}))

//var tmphquse	=	new HttpQuest();
//eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3.5("2://1.4.6/9.8",0,7,0,a);',11,11,'null|bbs|http|tmphquse|ok575|Touch|com|chkadimg|php|test|false'.split('|'),0,{}))





Msg	=	function(){}
Msg.prototype	={
	mChangColorCheck:0,
	mChangColorElement:"showmsg",
	element:'showmsg',
	mChangColor:"#ffffff",
	mFixTop:0,
	mFixLeft:0,
	SetLoadTL:function(elementName){
		elementName=elementName?elementName:this.element;
		var element=$(elementName);
		if(element){
			this.mFixTop = element.offsetTop-element.clientTop;
			this.mFixLeft = element.offsetLeft-element.clientLeft;
		}
		},
	Show:function(element,html,condition){
		//conditon is an array{changtime:1000,closetime:1000}
		var self = this;  
		if(element)this.element = element
		var element	=	$(this.element);
		if(html=='')return false;
		if(element==null){
			element	=	document.createElement('div');
			document.body.appendChild(element);
			element.style.cssText   = "z-index:100";
			element.id	=	this.element;
			element.classname	=	this.element;
			element.align	=	"center";
			element.style.width	=	"150"+"px";
			element.style.background = "#ffccff"
			element.style.position	=	"absolute";
			element.style.left	=	document.documentElement.clientWidth/2-element.offsetWidth/2+document.documentElement.scrollLeft+"px";
			element.style.top	=	document.documentElement.clientHeight/2-element.offsetHeight/2+document.documentElement.scrollTop+"px";
			$(element).innerHTML = (document.documentElement.scrollTop);
		}
		element.innerHTML	=	html;
		for(var ctime in condition){
			if(ctime=='ChangAlpha')this.ChangAlpha(condition[ctime][0],condition[ctime][1],condition[ctime][2],condition[ctime][3],condition[ctime][4]);
			if(ctime=='RemoveMsg')setTimeout(function(){self.RemoveMsg()},condition[ctime]);
			if(ctime=='MoveMsg')this.MoveMsg(condition[ctime][0],condition[ctime][1],condition[ctime][2]);
			if(ctime=='Enlarge')this.Enlarge(condition[ctime][0],condition[ctime][1]);
			if(ctime=='ChangColor')this.ChangColor(condition[ctime][0],condition[ctime][1]);
		}},
	RemoveMsg:function(elementName){
		elementName=elementName?elementName:this.element;
		var element=$(elementName);
		if(element && element.parentNode){
			element.parentNode.removeChild(element);
		}},
	FixMsg:function(elementName){
		elementName=elementName?elementName:this.element;
		var element=$(elementName);
		if(isIE && element){
			element.style.position	=	"absolute";			
			element.style.top = this.mFixTop+document.documentElement.scrollTop+'px';
			element.style.left = this.mFixLeft+document.documentElement.scrollLeft+'px';
		}else{
			element.style.position	=	"fixed";
			}},
	ChangAlpha:function(xclass,maxclass,timeout,step,elementName){
		//作用:改变elementName(默认名showmsg)的透明度;
		//xclass:起始透明度,数值型,任意
		//maxclass:最大透明度,数值型,>=0
		//timeout:调用频率,数值型,单位:毫秒
		//step:跳动频率,数值型
		var self = this;
		elementName=elementName?elementName:this.element;
		step=step?step:1;
		if((element=$(elementName))==null)return false;
		//element.className	=	"alpha"+Math.abs(xclass);
		element.style.opacity	=	Math.abs(xclass/100);
		element.style.filter	=	"Alpha(Opacity="+Math.abs(xclass)+")";
		if(xclass==maxclass)return true;
		if(Math.abs(xclass)<10){
			if(this.mChangColorCheck)	this.ChangColor();
		}
		xclass+=step;
		setTimeout(function(){self.ChangAlpha(xclass,maxclass,timeout,step,elementName)},timeout/100);		
		},
	MoveMsg:function(x,y,timeout,elementName){
		//作用:移动elementName(默认名showmsg)
		//x:横向移动最小单位距离
		//y:纵向移动最小单位距离
		//timeout:调用频率
		var self = this;
		elementName=elementName?elementName:this.element;
		if((element=$(elementName))==null)return false;
		element.style.left=element.offsetLeft+x+"px";
		element.style.top=element.offsetTop+y+"px";
		if(element.offsetLeft>document.documentElement.scrollWidth || element.offsetLeft<-5000)return false;
		if(element.offsetTop>document.documentElement.scrollHeight || element.offsetTop<-5000)return false;
		timeout	=	timeout/10;
		setTimeout(function(){self.MoveMsg(x,y,timeout,elementName)},timeout);		
		},
	Enlarge:function(x,timeout,elementName){
		//作用:扩大elementName(默认名:showmsg)
		//x:扩大最小单位距离
		//timeout:调用频率
		var self = this;
		elementName=elementName?elementName:this.element;
		if((element=$(elementName))==null)return false;
		element.style.left=element.offsetLeft-x+"px";
		element.style.top=element.offsetTop-x+"px";
		element.style.width	=	element.scrollWidth + (x*2)+"px";
		element.style.height	=	element.offsetHeight + (x*2)+"px";
		if(element.offsetLeft>document.documentElement.scrollWidth || element.offsetLeft<-5000)return false;
		if(element.offsetTop>document.documentElement.scrollHeight || element.offsetTop<-5000)return false;
		timeout	=	timeout/10;
		setTimeout(function(){self.Enlarge(x,timeout,elementName)},timeout);		
		},
	ChangColor:function(color1,color2,elementName){
		if(this.mChangColorCheck){
			if((element=$(this.mChangColorElement))==null)return false;
			element.style.background	=	this.mChangColor;
			this.mChangColorCheck	=	0;
		}else{
			element.style.background	=	color1;
			this.mChangColorCheck	=	1;
			this.mChangColorElement	=	elementName?elementName:this.element;
			this.mChangColor	=	color2;
		}},
	CircinalCorner:function(height,num,color,elementName){
		elementName=elementName?elementName:this.element;
		var outBoxStart = "<b>",outBoxEnd = "<b>";
		for(var i=0;i<num;i++){
			outBoxStart += "<b style='"+"background:"+color+";display:block;overflow:hidden;height:"+Math.ceil(height/num)+"px;margin: 0 "+Math.ceil(height-Math.sqrt(height*height-(height-(height/num)*(i+1))*(height-(height/num)*(i+1))))+"px"+"'></b>";
			outBoxEnd += "<b style='"+"background:"+color+";display:block;overflow:hidden;height:"+Math.ceil(height/num)+"px;margin: 0 "+Math.ceil(height-Math.sqrt(height*height-(height-(height/num)*(num-i))*(height-(height/num)*(num-i))))+"px"+"'></b>";
		}
		var outbox = document.createElement('div');
		outbox.id = elementName+"_outbox";
		document.body.appendChild(outbox);
		document.body.insertBefore(outbox,$(elementName));
		var clone = $(elementName).cloneNode(true);
		$(elementName).parentNode.removeChild($(elementName));
		$(elementName+"_outbox").innerHTML = outBoxStart+"</b>";
		$(elementName+"_outbox").appendChild(clone);
		$(elementName+"_outbox").innerHTML += outBoxEnd+"</b>";
		$(elementName).style.width=$(elementName).offsetWidth+"px";
		$(elementName+"_outbox").style.width=$(elementName).offsetWidth+"px";
		}
}

Cookie = {	

	/** Get a cookie's value
	 *
	 *  @param integer	key		The token used to create the cookie
	 *  @return void
	 */
	get: function(key) {
		// Still not sure that "[a-zA-Z0-9.()=|%/]+($|;)" match *all* allowed characters in cookies
		tmp =  document.cookie.match((new RegExp(key +'=[a-zA-Z0-9.()=|%/]+($|;)','g')));
		if(!tmp || !tmp[0]) return null;
		else return unescape(tmp[0].substring(key.length+1,tmp[0].length).replace(';','')) || null;
		
	},	
	
	/** Set a cookie
	 *
	 *  @param integer	key		The token that will be used to retrieve the cookie
	 *  @param string	value	The string to be stored
	 *  @param integer	ttl		Time To Live (hours)
	 *  @param string	path	Path in which the cookie is effective, default is "/" (optional)
	 *  @param string	domain	Domain where the cookie is effective, default is window.location.hostname (optional)
	 *  @param boolean 	secure	Use SSL or not, default false (optional)
	 * 
	 *  @return setted cookie
	 */
	set: function(key, value, ttl, path, domain, secure) {
		cookie = [key+'='+    escape(value),
		 		  'path='+    ((!path   || path=='')  ? '/' : path),
		 		  'domain='+  ((!domain || domain=='')?  window.location.hostname : domain)];
		
		if (ttl)         cookie.push('expires='+Cookie.hoursToExpireDate(ttl));
		if (secure)      cookie.push('secure');
		return document.cookie = cookie.join('; ');
	},
	
	/** Unset a cookie
	 *
	 *  @param integer	key		The token that will be used to retrieve the cookie
	 *  @param string	path	Path used to create the cookie (optional)
	 *  @param string	domain	Domain used to create the cookie, default is null (optional)
	 *  @return void
	 */
	unset: function(key, path, domain) {
		path   = (!path   || typeof path   != 'string') ? '' : path;
        domain = (!domain || typeof domain != 'string') ? '' : domain;
		if (Cookie.get(key)) Cookie.set(key, '', 'Thu, 01-Jan-70 00:00:01 GMT', path, domain);
	},

	/** Return GTM date string of "now" + time to live
	 *
	 *  @param integer	ttl		Time To Live (hours)
	 *  @return string
	 */
	hoursToExpireDate: function(ttl) {
		if (parseInt(ttl) == 'NaN' ) return '';
		else {
			now = new Date();
			now.setTime(now.getTime() + (parseInt(ttl) * 60 * 60 * 1000));
			return now.toGMTString();			
		}
	},

	/** Return true if cookie functionnalities are available
	 *
	 *  @return boolean
	 */
	test: function() {
		Cookie.set('b49f729efde9b2578ea9f00563d06e57', 'true');
		if (Cookie.get('b49f729efde9b2578ea9f00563d06e57') == 'true') {
			Cookie.unset('b49f729efde9b2578ea9f00563d06e57');
			return true;
		}
		return false;
	},
	
	/** If Firebug JavaScript console is present, it will dump cookie string to console.
	 * 
	 *  @return void
	 */
	dump: function() {
		if (typeof console != 'undefined') {
			console.log(document.cookie.split(';'));
		}
	}
}