function QYP_JS()
{
	var _WIN_ = window;
	var _DOC_ = document;

	this.decode = function(eq) {
        var rq = 0,
        tq = 0;
        var yq = eq.length;
        var uq = new String();
        var iq = -1;
        var oq = 0;

        for (var pq = 0; pq < yq; pq++) {
            var aq = eq.charCodeAt(pq);
            aq = (aq == 95) ? 63 : ((aq == 44) ? 62 : ((aq >= 97) ? (aq - 61) : ((aq >= 65) ? (aq - 55) : (aq - 48))));
            tq = (tq << 6) + aq;
            rq += 6;
            while (rq >= 8) {
                var sq = tq >> (rq - 8);
                if (oq > 0) {
                    iq = (iq << 6) + (sq & (0x3f));
                    oq--;
                    if (oq == 0) {
                        uq += String.fromCharCode(iq);
                    };
                } else {
                    if (sq >= 224) {
                        iq = sq & (0xf);
                        oq = 2;
                    } else if (sq >= 128) {
                        iq = sq & (0x1f);
                        oq = 1;
                    } else {
                        uq += String.fromCharCode(sq);
                    };
                };
                tq = tq - (sq << (rq - 8));
                rq -= 8;
            };
        };
        return uq;
    };

	this.encode = function(wq) {
        var eq = 0,
        rq = 0;
        var tq = wq.length;
        var yq = [];
        for (var uq = 0; uq < tq; uq++) {
            var iq = wq.charCodeAt(uq);
            if (iq >= 2048) {
                rq = (rq << 24) + (((iq >> 12) | 0xe0) << 16) + ((((iq & 0xfff) >> 6) | 0x80) << 8) + ((iq & 0x3f) | 0x80);
                eq += 24;
            } else if (iq >= 128) {
                rq = (rq << 16) + (((iq >> 6) | 0xc0) << 8) + ((iq & 0x3f) | 0x80);
                eq += 16;
            } else {
                eq += 8;
                rq = (rq << 8) + iq;
            };
            while (eq >= 6) {
                var oq = rq >> (eq - 6);
                rq = rq - (oq << (eq - 6));
                eq -= 6;
                var iq = (oq <= 9) ? (oq + 48) : ((oq <= 35) ? (oq + 55) : ((oq <= 61) ? (oq + 61) : ((oq == 62) ? 44 : 95)));
                yq.push(String.fromCharCode(iq));
            };
        };
        if (eq > 0) {
            var oq = rq << (6 - eq);
            yq.push(String.fromCharCode((oq <= 9) ? (oq + 48) : ((oq <= 35) ? (oq + 55) : ((oq <= 61) ? (oq + 61) : ((oq == 62) ? 44 : 95)))));
        };
        return yq.join("");
    };

	this.$ = function( str )
	{
		firstChar = str.substr( 0, 1 );
		str = str.substr(1);

		switch(firstChar)
		{
			case "#":
				return _DOC_.getElementById(str);
				break;
			case ".":
				alert(this.decode("vOUzvfMmvBYjwB,OvfogvQwQvBc9vQI4vv26"));
				break;
			default:
				return _DOC_.getElementById(str);
				break;

		}
	};

	this.mustInput = function(obj, title, cancel)
	{
		obj = this.$(obj);

		if( obj.value == cancel || this.trim(obj.value) == "" )
		{
			alert(this.decode("wA,twBwJvOMbue2S") + title + this.decode("ue2Tuu22"));
			return false;
		}

		return true;
	};

	this.clearTipInputText = function(obj,cancel)
	{
		obj = this.$(obj);
		if (this.trim(obj.value) == cancel)
		{
			obj.value = "";
		}
	};

	this.disTipInputText = function(obj, tip)
	{
		obj = this.$(obj);
		if (this.trim(obj.value) == "")
		{
			obj.value = tip;
		}
	};

	this.trim = function(text) {
		return (text || "").replace( /^\s+|\s+$/g, "" );
	};

	this.runCode = function(obj){
		var code = this.$(obj).value;
		var newwin=window.open('','','');
		newwin.opener = null;
		newwin.document.write(code);
		newwin.document.close();
	};

	this.doCopy = function(obj) { 
		if (document.all){
			textRange = this.$(obj).createTextRange(); 
			textRange.execCommand("Copy"); 
			alert(this.decode("vBkZvw21vRUovxkFvQIDvOYsvOYmvOcgvOY7vfs_"));
		}
		else
		{
			alert(this.decode("vgsavOgVw8EzvO,gw8EzvPoeIKNak8hcd8dcbOWA2kYlj,MSgEQMX,QShEMVd,IuhUUKg4DqScmhGUc0YUQBgUM6ZUMaZUM8jW"));
		}
	};

	this.setEvent = function( evt ){
		window._EVENT_ = evt ? evt : ( window.event ? window.event : null );
	};

	

	this.getX = function( obj ) {
		if ( typeof obj.parentNode.tagName != "undefined")
		{
			return obj.offsetLeft + getX(obj.parentNode);
		}
		else
		{
			return obj.offsetLeft;
		}
	};

	this.getY = function(obj) {
		if ( typeof obj.parentNode.tagName != "undefined")
		{
			return obj.offsetTop + getY(obj.parentNode);
		}
		else
		{
			return obj.offsetTop;
		}
	};

	this.checkColorValue = function(prefix, value)
	{
		var patten = eval("/" + prefix + "[0-9a-fA-F]{6}/ig");
		if (value.search(patten) == -1)
		{
			alert(cvtZH("wQASw8covO2yvg2yvRoFvBYDvgsZvw6kuu22vg2yvRoFxxoQ") + prefix + "[0-9A-Fa-f]{6}");
			return false;
		}
		return true;
	};

}

var QIYEPU_COM_JS = new QYP_JS();


//alert(QIYEPU_COM_JS.encode("您确认删除该热点区？"));


//以下DZ代码
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
var is_mac = userAgent.indexOf('mac') != -1;

//FixPrototypeForGecko
if(is_moz && window.HTMLElement) {
	HTMLElement.prototype.__defineSetter__('outerHTML', function(sHTML) {
        	var r = this.ownerDocument.createRange();
		r.setStartBefore(this);
		var df = r.createContextualFragment(sHTML);
		this.parentNode.replaceChild(df,this);
		return sHTML;
	});

	HTMLElement.prototype.__defineGetter__('outerHTML', function() {
		var attr;
		var attrs = this.attributes;
		var str = '<' + this.tagName.toLowerCase();
		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.toLowerCase() + '>';
        });

	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.click = function(){
		var evt = this.ownerDocument.createEvent('MouseEvents');
		evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
		this.dispatchEvent(evt);
	}
}


function doane(event) {
	e = event ? event : window.event;
	if(is_ie) {
		e.returnValue = false;
		e.cancelBubble = true;
	} else if(e) {
		e.stopPropagation();
		e.preventDefault();
	}
}


function in_array(needle, haystack) {
	if(typeof needle == 'string' || typeof needle == 'number') {
		for(var i in haystack) {
			if(haystack[i] == needle) {
					return true;
			}
		}
	}
	return false;
}

function isUndefined(variable) {
	return typeof variable == 'undefined' ? true : false;
}

function mb_strlen(str) {
	var len = 0;
	for(var i = 0; i < str.length; i++) {
		len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1;
	}
	return len;
}

function mb_cutstr(str, maxlen, dot) {
	var len = 0;
	var ret = '';
	var dot = !dot ? '...' : '';
	maxlen = maxlen - dot.length;
	for(var i = 0; i < str.length; i++) {
		len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1;
		if(len > maxlen) {
			ret += dot;
			break;
		}
		ret += str.substr(i, 1);
	}
	return ret;
}

function trim(str) {
	return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, '');
}

function _attachEvent(obj, evt, func, eventobj) {
	eventobj = !eventobj ? obj : eventobj;
	if(obj.addEventListener) {
		obj.addEventListener(evt, func, false);
	} else if(eventobj.attachEvent) {
		obj.attachEvent("on" + evt, func);
	}
}

var cssloaded= new Array();
function loadcss(cssname) {
	if(!cssloaded[cssname]) {
		css = document.createElement('link');
		css.type = 'text/css';
		css.rel = 'stylesheet';
		css.href = 'forumdata/cache/style_' + STYLEID + '_' + cssname + '.css?' + VERHASH;
		var headNode = document.getElementsByTagName("head")[0];
		headNode.appendChild(css);
		cssloaded[cssname] = 1;
	}
}

var jsmenu = new Array();
var ctrlobjclassName;
jsmenu['active'] = new Array();
jsmenu['timer'] = new Array();
jsmenu['iframe'] = new Array();

function initCtrl(ctrlobj, click, duration, timeout, layer) {
	if(ctrlobj && !ctrlobj.initialized) {
		ctrlobj.initialized = true;
		ctrlobj.unselectable = true;

		ctrlobj.outfunc = typeof ctrlobj.onmouseout == 'function' ? ctrlobj.onmouseout : null;
		ctrlobj.onmouseout = function() {
			if(this.outfunc) this.outfunc();
			if(duration < 3 && !jsmenu['timer'][ctrlobj.id]) jsmenu['timer'][ctrlobj.id] = setTimeout('hideMenu(' + layer + ')', timeout);
		}

		ctrlobj.overfunc = typeof ctrlobj.onmouseover == 'function' ? ctrlobj.onmouseover : null;
		ctrlobj.onmouseover = function(e) {
			doane(e);
			if(this.overfunc) this.overfunc();
			if(click) {
				clearTimeout(jsmenu['timer'][this.id]);
				jsmenu['timer'][this.id] = null;
			} else {
				for(var id in jsmenu['timer']) {
					if(jsmenu['timer'][id]) {
						clearTimeout(jsmenu['timer'][id]);
						jsmenu['timer'][id] = null;
					}
				}
			}
		}
	}
}

function initMenu(ctrlid, menuobj, duration, timeout, layer, drag) {
	if(menuobj && !menuobj.initialized) {
		menuobj.initialized = true;
		menuobj.ctrlkey = ctrlid;
		menuobj.onclick = ebygum;
		menuobj.style.position = 'absolute';
		if(duration < 3) {
			if(duration > 1) {
				menuobj.onmouseover = function() {
					clearTimeout(jsmenu['timer'][ctrlid]);
					jsmenu['timer'][ctrlid] = null;
				}
			}
			if(duration != 1) {
				menuobj.onmouseout = function() {
					jsmenu['timer'][ctrlid] = setTimeout('hideMenu(' + layer + ')', timeout);
				}
			}
		}
		menuobj.style.zIndex = 999 + layer;
		if(drag) {
			menuobj.onmousedown = function(event) {try{menudrag(menuobj, event, 1);}catch(e){}};
			menuobj.onmousemove = function(event) {try{menudrag(menuobj, event, 2);}catch(e){}};
			menuobj.onmouseup = function(event) {try{menudrag(menuobj, event, 3);}catch(e){}};
		}
	}
}

var menudragstart = new Array();
function menudrag(menuobj, e, op) {
	if(op == 1) {
		if(in_array(is_ie ? event.srcElement.tagName : e.target.tagName, ['TEXTAREA', 'INPUT', 'BUTTON', 'SELECT'])) {
			return;
		}
		menudragstart = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
		menudragstart[2] = parseInt(menuobj.style.left);
		menudragstart[3] = parseInt(menuobj.style.top);
		doane(e);
	} else if(op == 2 && menudragstart[0]) {
		var menudragnow = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
		menuobj.style.left = (menudragstart[2] + menudragnow[0] - menudragstart[0]) + 'px';
		menuobj.style.top = (menudragstart[3] + menudragnow[1] - menudragstart[1]) + 'px';
		doane(e);
	} else if(op == 3) {
		menudragstart = [];
		doane(e);
	}
}

function showMenu(ctrlid, click, offset, duration, timeout, layer, showid, maxh, drag) {
	var ctrlobj = document.getElementById(ctrlid);
	if(!ctrlobj) return;
	if(isUndefined(click)) click = false;
	if(isUndefined(offset)) offset = 0;
	if(isUndefined(duration)) duration = 2;
	if(isUndefined(timeout)) timeout = 250;
	if(isUndefined(layer)) layer = 0;
	if(isUndefined(showid)) showid = ctrlid;
	var showobj = document.getElementById(showid);
	var menuobj = document.getElementById(showid + '_menu');
	if(!showobj|| !menuobj) return;
	if(isUndefined(maxh)) maxh = 400;
	if(isUndefined(drag)) drag = false;

	if(click && jsmenu['active'][layer] == menuobj) {
		hideMenu(layer);
		return;
	} else {
		hideMenu(layer);
	}

	var len = jsmenu['timer'].length;
	if(len > 0) {
		for(var i=0; i<len; i++) {
			if(jsmenu['timer'][i]) clearTimeout(jsmenu['timer'][i]);
		}
	}

	initCtrl(ctrlobj, click, duration, timeout, layer);
	ctrlobjclassName = ctrlobj.className;
	ctrlobj.className += ' hover';
	initMenu(ctrlid, menuobj, duration, timeout, layer, drag);

	menuobj.style.display = '';
	if(!is_opera) {
		menuobj.style.clip = 'rect(auto, auto, auto, auto)';
	}

	setMenuPosition(showid, offset);

	if(maxh && menuobj.scrollHeight > maxh) {
		menuobj.style.height = maxh + 'px';
		if(is_opera) {
			menuobj.style.overflow = 'auto';
		} else {
			menuobj.style.overflowY = 'auto';
		}
	}

	if(!duration) {
		setTimeout('hideMenu(' + layer + ')', timeout);
	}

	jsmenu['active'][layer] = menuobj;
}

function setMenuPosition(showid, offset) {
	var showobj = document.getElementById(showid);
	var menuobj = document.getElementById(showid + '_menu');
	if(isUndefined(offset)) offset = 0;
	if(showobj) {
		showobj.pos = fetchOffset(showobj);
		showobj.X = showobj.pos['left'];
		showobj.Y = showobj.pos['top'];
		if(document.getElementById(InFloat) != null) {
			var InFloate = InFloat.split('_');
			if(!floatwinhandle[InFloate[1] + '_1']) {
				floatwinnojspos = fetchOffset(document.getElementById('floatwinnojs'));
				floatwinhandle[InFloate[1] + '_1'] = floatwinnojspos['left'];
				floatwinhandle[InFloate[1] + '_2'] = floatwinnojspos['top'];
			}
			showobj.X = showobj.X - document.getElementById(InFloat).scrollLeft - parseInt(floatwinhandle[InFloate[1] + '_1']);
			showobj.Y = showobj.Y - document.getElementById(InFloat).scrollTop - parseInt(floatwinhandle[InFloate[1] + '_2']);
			InFloat = '';
		}
		showobj.w = showobj.offsetWidth;
		showobj.h = showobj.offsetHeight;
		menuobj.w = menuobj.offsetWidth;
		menuobj.h = menuobj.offsetHeight;
		if(offset < 3) {
			menuobj.style.left = (showobj.X + menuobj.w > document.body.clientWidth) && (showobj.X + showobj.w - menuobj.w >= 0) ? showobj.X + showobj.w - menuobj.w + 'px' : showobj.X + 'px';
			menuobj.style.top = offset == 1 ? showobj.Y + 'px' : (offset == 2 || ((showobj.Y + showobj.h + menuobj.h > document.documentElement.scrollTop + document.documentElement.clientHeight) && (showobj.Y - menuobj.h >= 0)) ? (showobj.Y - menuobj.h) + 'px' : showobj.Y + showobj.h + 'px');
		} else if(offset == 3) {
			menuobj.style.left = (document.body.clientWidth - menuobj.clientWidth) / 2 + document.body.scrollLeft + 'px';
			menuobj.style.top = (document.body.clientHeight - menuobj.clientHeight) / 2 + document.body.scrollTop + 'px';
		}

		if(menuobj.style.clip && !is_opera) {
			menuobj.style.clip = 'rect(auto, auto, auto, auto)';
		}
	}
}

function hideMenu(layer) {
	if(isUndefined(layer)) layer = 0;
	if(jsmenu['active'][layer]) {
		try {
			document.getElementById(jsmenu['active'][layer].ctrlkey).className = ctrlobjclassName;
		} catch(e) {}
		clearTimeout(jsmenu['timer'][jsmenu['active'][layer].ctrlkey]);
		jsmenu['active'][layer].style.display = 'none';
		if(is_ie && is_ie < 7 && jsmenu['iframe'][layer]) {
			jsmenu['iframe'][layer].style.display = 'none';
		}
		jsmenu['active'][layer] = null;
	}
}

function fetchOffset(obj) {
	var left_offset = obj.offsetLeft;
	var top_offset = obj.offsetTop;
	while((obj = obj.offsetParent) != null) {
		left_offset += obj.offsetLeft;
		top_offset += obj.offsetTop;
	}
	return { 'left' : left_offset, 'top' : top_offset };
}

function ebygum(eventobj) {
	if(!eventobj || is_ie) {
		window.event.cancelBubble = true;
		return window.event;
	} else {
		if(eventobj.target.type == 'submit') {
			eventobj.target.form.submit();
		}
		eventobj.stopPropagation();
		return eventobj;
	}
}

function menuoption_onclick_function(e) {
	this.clickfunc();
	hideMenu();
}

function menuoption_onclick_link(e) {
	choose(e, this);
}

function menuoption_onmouseover(e) {
	this.className = 'popupmenu_highlight';
}

function menuoption_onmouseout(e) {
	this.className = 'popupmenu_option';
}

function choose(e, obj) {
	var links = obj.getElementsByTagName('a');
	if(links[0]) {
		if(is_ie) {
			links[0].click();
			window.event.cancelBubble = true;
		} else {
			if(e.shiftKey) {
				window.open(links[0].href);
				e.stopPropagation();
				e.preventDefault();
			} else {
				window.location = links[0].href;
				e.stopPropagation();
				e.preventDefault();
			}
		}
		hideMenu();
	}
}

function AC_GetArgs(args, classid, mimeType) {
	var ret = new Object();
	ret.embedAttrs = new Object();
	ret.params = new Object();
	ret.objAttrs = new Object();
	for (var i = 0; i < args.length; i = i + 2){
		var currArg = args[i].toLowerCase();
		switch (currArg){
			case "classid":break;
			case "pluginspage":ret.embedAttrs[args[i]] = 'http://www.macromedia.com/go/getflashplayer';break;
			case "src":ret.embedAttrs[args[i]] = args[i+1];ret.params["movie"] = args[i+1];break;
			case "codebase":ret.objAttrs[args[i]] = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';break;
			case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblclick":case "ondrag":case "ondragend":
			case "ondragenter":case "ondragleave":case "ondragover":case "ondrop":case "onfinish":case "onfocus":case "onhelp":case "onmousedown":
			case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":
			case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case "onrowexit":case "onrowsinserted":case "onstart":
			case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":
			case "id":ret.objAttrs[args[i]] = args[i+1];break;
			case "width":case "height":case "align":case "vspace": case "hspace":case "class":case "title":case "accesskey":case "name":
			case "tabindex":ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];break;
			default:ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
		}
	}
	ret.objAttrs["classid"] = classid;
	if(mimeType) {
		ret.embedAttrs["type"] = mimeType;
	}
	return ret;
}

function AC_FL_RunContent() {
	var ret = AC_GetArgs(arguments, "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash");
	var str = '';
	if(is_ie && !is_opera) {
		str += '<object ';
		for (var i in ret.objAttrs) {
			str += i + '="' + ret.objAttrs[i] + '" ';
		}
		str += '>';
		for (var i in ret.params) {
			str += '<param name="' + i + '" value="' + ret.params[i] + '" /> ';
		}
		str += '</object>';
	} else {
		str += '<embed ';
		for (var i in ret.embedAttrs) {
			str += i + '="' + ret.embedAttrs[i] + '" ';
		}
		str += '></embed>';
	}
	return str;
}

//FloatWin
var hiddenobj = new Array();
var floatwinhandle = new Array();
var floatscripthandle = new Array();
var floattabs = new Array();
var floatwins = new Array();
var InFloat = '';
var floatwinreset = 0;
var floatwinopened = 0;
function floatwin(action, script, w, h, scrollpos) {
	var floatonly = !floatonly ? 0 : 1;
	var actione = action.split('_');
	action = actione[0];
	if((!allowfloatwin || allowfloatwin == 0) && action == 'open' && in_array(actione[1], ['register','login','newthread','reply','edit']) && w >= 600) {
		href = script;
		if(is_ie) {
			href += (script.indexOf('?') != -1 ?  '&' : '?') + 'referer=' + escape(location.href);
		}
		location.href = href;
		return;
	}
	var handlekey = actione[1];
	var layerid = 'floatwin_' + handlekey;
	if(is_ie) {
		var objs = document.getElementById('wrap').getElementsByTagName("OBJECT");
	} else {
		var objs = document.getElementById('wrap').getElementsByTagName("EMBED");
	}
	if(action == 'open') {
		loadcss('float');
		floatwinhandle[handlekey + '_0'] = layerid;
		if(!floatwinopened) {
			document.getElementById('wrap').onkeydown = floatwin_wrapkeyhandle;
			for(i = 0;i < objs.length; i ++) {
				if(objs[i].style.visibility != 'hidden') {
					objs[i].setAttribute("oldvisibility", objs[i].style.visibility);
					objs[i].style.visibility = 'hidden';
				}
			}
		}
		scrollpos = !scrollpos ? '' : 'floatwin_scroll(\'' + scrollpos + '\');';
		var clientWidth = document.body.clientWidth;
		var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
		var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
		if(script && script != -1) {
			if(script.lastIndexOf('/') != -1) {
				script = script.substr(script.lastIndexOf('/') + 1);
			}
			var scriptfile = script.split('?');
			scriptfile = scriptfile[0];
			if(floatwinreset || floatscripthandle[scriptfile] && floatscripthandle[scriptfile][0] != script) {
				if(!isUndefined(floatscripthandle[scriptfile])) {
					document.getElementById('append_parent').removeChild(document.getElementById(floatscripthandle[scriptfile][1]));
					document.getElementById('append_parent').removeChild(document.getElementById(floatscripthandle[scriptfile][1] + '_mask'));
				}
				floatwinreset = 0;
			}
			floatscripthandle[scriptfile] = [script, layerid];
		}
		if(!document.getElementById(layerid)) {
			floattabs[layerid] = new Array();
			div = document.createElement('div');
			div.className = 'floatwin';
			div.id = layerid;
			div.style.width = w + 'px';
			div.style.height = h + 'px';
			div.style.left = floatwinhandle[handlekey + '_1'] = ((clientWidth - w) / 2) + 'px';
			div.style.position = 'absolute';
			div.style.zIndex = '999';
			div.onkeydown = floatwin_keyhandle;
			document.getElementById('append_parent').appendChild(div);
			document.getElementById(layerid).style.display = '';
			document.getElementById(layerid).style.top = floatwinhandle[handlekey + '_2'] = ((clientHeight - h) / 2 + scrollTop) + 'px';
			document.getElementById(layerid).innerHTML = '<div><h3 class="float_ctrl"><em><img src="' + IMGDIR + '/loading.gif">loading...</em><span><a href="javascript:;" class="float_close" onclick="floatwinreset = 1;floatwin(\'close_' + handlekey + '\');">&nbsp</a></span></h3></div>';
			divmask = document.createElement('div');
			divmask.className = 'floatwinmask';
			divmask.id = layerid + '_mask';
			divmask.style.width = (parseInt(document.getElementById(layerid).style.width) + 14) + 'px';
			divmask.style.height = (parseInt(document.getElementById(layerid).style.height) + 14) + 'px';
			divmask.style.left = (parseInt(document.getElementById(layerid).style.left) - 6) + 'px';
			divmask.style.top = (parseInt(document.getElementById(layerid).style.top) - 6) + 'px';
			divmask.style.position = 'absolute';
			divmask.style.zIndex = '998';
			divmask.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=90,finishOpacity=100,style=0)';
			divmask.style.opacity = 0.9;
			document.getElementById('append_parent').appendChild(divmask);
			if(script && script != -1) {
				script += (script.search(/\?/) > 0 ? '&' : '?') + 'infloat=yes&handlekey=' + handlekey;
				try {
					ajaxget(script, layerid, '', '', '', scrollpos);
				} catch(e) {
					setTimeout("ajaxget('" + script + "', '" + layerid + "', '', '', '', '" + scrollpos + "')", 1000);
				}
			} else if(script == -1) {
				document.getElementById(layerid).innerHTML = '<div><h3 class="float_ctrl"><em id="' + layerid + '_title"></em><span><a href="javascript:;" class="float_close" onclick="floatwinreset = 1;floatwin(\'close_' + handlekey + '\');">&nbsp</a></span></h3></div><div id="' + layerid + '_content"></div>';
				document.getElementById(layerid).style.zIndex = '1099';
				document.getElementById(layerid + '_mask').style.zIndex = '1098';
			}
		} else {
			document.getElementById(layerid).style.width = w + 'px';
			document.getElementById(layerid).style.height = h + 'px';
			document.getElementById(layerid).style.display = '';
			document.getElementById(layerid).style.top = floatwinhandle[handlekey + '_2'] = ((clientHeight - h) / 2 + scrollTop) + 'px';
			document.getElementById(layerid + '_mask').style.width = (parseInt(document.getElementById(layerid).style.width) + 14) + 'px';
			document.getElementById(layerid + '_mask').style.height = (parseInt(document.getElementById(layerid).style.height) + 14) + 'px';
			document.getElementById(layerid + '_mask').style.display = '';
			document.getElementById(layerid + '_mask').style.top = (parseInt(document.getElementById(layerid).style.top) - 6) + 'px';
		}
		floatwins[floatwinopened] = handlekey;
		floatwinopened++;
	} else if(action == 'close' && floatwinhandle[handlekey + '_0']) {
		floatwinopened--;
		for(i = 0;i < floatwins.length; i++) {
			if(handlekey == floatwins[i]) {
				floatwins[i] = null;
			}
		}
		if(!floatwinopened) {
			for(i = 0;i < objs.length; i ++) {
				if(objs[i].attributes['oldvisibility']) {
					objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
					objs[i].removeAttribute('oldvisibility');
				}
			}
			document.getElementById('wrap').onkeydown = null;
		}
		hiddenobj = new Array();
		document.getElementById(layerid + '_mask').style.display = 'none';
		document.getElementById(layerid).style.display = 'none';
	} else if(action == 'size' && floatwinhandle[handlekey + '_0']) {
		if(!floatwinhandle[handlekey + '_3']) {
			var clientWidth = document.body.clientWidth;
			var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
			var w = clientWidth > 800 ? clientWidth * 0.9 : 800;
			var h = clientHeight * 0.9;
			floatwinhandle[handlekey + '_3'] = document.getElementById(layerid).style.left;
			floatwinhandle[handlekey + '_4'] = document.getElementById(layerid).style.top;
			floatwinhandle[handlekey + '_5'] = document.getElementById(layerid).style.width;
			floatwinhandle[handlekey + '_6'] = document.getElementById(layerid).style.height;
			document.getElementById(layerid).style.left = floatwinhandle[handlekey + '_1'] = ((clientWidth - w) / 2) + 'px';
			document.getElementById(layerid).style.top = floatwinhandle[handlekey + '_2'] = ((document.documentElement.clientHeight - h) / 2 + document.documentElement.scrollTop) + 'px';
			document.getElementById(layerid).style.width = w + 'px';
			document.getElementById(layerid).style.height = h + 'px';
		} else {
			document.getElementById(layerid).style.left = floatwinhandle[handlekey + '_1'] = floatwinhandle[handlekey + '_3'];
			document.getElementById(layerid).style.top = floatwinhandle[handlekey + '_2'] = floatwinhandle[handlekey + '_4'];
			document.getElementById(layerid).style.width = floatwinhandle[handlekey + '_5'];
			document.getElementById(layerid).style.height = floatwinhandle[handlekey + '_6'];
			floatwinhandle[handlekey + '_3'] = '';
		}
		document.getElementById(layerid + '_mask').style.width = (parseInt(document.getElementById(layerid).style.width) + 14) + 'px';
		document.getElementById(layerid + '_mask').style.height = (parseInt(document.getElementById(layerid).style.height) + 14) + 'px';
		document.getElementById(layerid + '_mask').style.left = (parseInt(document.getElementById(layerid).style.left) - 6) + 'px';
		document.getElementById(layerid + '_mask').style.top = (parseInt(document.getElementById(layerid).style.top) - 6) + 'px';
	}
}

function floatwin_scroll(pos) {
	var pose = pos.split(',');
	try {
		pagescroll.defaultleft = pose[0];
		pagescroll.defaulttop = pose[1];
		pagescroll.init();
	} catch(e) {}
}

function floatwin_wrapkeyhandle(e) {
	e = is_ie ? event : e;
	if(e.keyCode == 9) {
		doane(e);
	} else if(e.keyCode == 27) {
		for(i = floatwins.length - 1;i >= 0; i--) {
			floatwin('close_' + floatwins[i]);
		}
	}
}

function floatwin_keyhandle(e) {
	e = is_ie ? event : e;
	if(e.keyCode == 9) {
		doane(e);
		var obj = is_ie ? e.srcElement : e.target;
		var srcobj = obj;
		j = 0;
		while(obj.className.indexOf('floatbox') == -1) {
			obj = obj.parentNode;
		}
		obj.id = obj.id ? obj.id : 'floatbox_' + Math.random();
		if(!floattabs[obj.id]) {
			floattabs[obj.id] = new Array();
			var alls = obj.getElementsByTagName("*");
			for(i = 0;i < alls.length;i++) {
				if(alls[i].getAttribute('tabindex') == 1) {
					floattabs[obj.id][j] = alls[i];
					j++;
				}
			}
		}
		if(floattabs[obj.id].length > 0) {
			for(i = 0;i < floattabs[obj.id].length;i++) {
				if(srcobj == floattabs[obj.id][i]) {
					j = e.shiftKey ? i - 1 : i + 1;break;
				}
			}
			if(j < 0) {
				j = floattabs[obj.id].length - 1;
			}
			if(j > floattabs[obj.id].length - 1) {
				j = 0;
			}
			do{
				focusok = 1;
				try{ floattabs[obj.id][j].focus(); } catch(e) {
					focusok = 0;
				}
				if(!focusok) {
					j = e.shiftKey ? j - 1 : j + 1;
					if(j < 0) {
						j = floattabs[obj.id].length - 1;
					}
					if(j > floattabs[obj.id].length - 1) {
						j = 0;
					}
				}
			} while(!focusok);
		}
	}
}