/*
extern variable
_uu_base	"https://istar.uudynamics.net"
_uu_root	"/verisoft@uud.com/_/r/000000"
_uu_web_root	"/_P_HTTP/mail.uudynamics.com"
*/
var __uu_base64_echar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var __uu_base64_dchar = new Array(
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
	52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
	-1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
	15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
	-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
	41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);

function __base64_encode(str) {
	var out, i, len;
	var c1, c2, c3;
	
	len = str.length;
	i = 0;
	out = "";
	while(i < len) {
		c1 = str.charCodeAt(i++) & 0xff;
		if(i == len) {
			out += __uu_base64_echar.charAt(c1 >> 2);
			out += __uu_base64_echar.charAt((c1 & 0x3) << 4);
			out += "==";
			break;
		}
		c2 = str.charCodeAt(i++);
		if(i == len) {
			out += __uu_base64_echar.charAt(c1 >> 2);
			out += __uu_base64_echar.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
			out += __uu_base64_echar.charAt((c2 & 0xF) << 2);
			out += "=";
			break;
		}
		c3 = str.charCodeAt(i++);
		out += __uu_base64_echar.charAt(c1 >> 2);
		out += __uu_base64_echar.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
		out += __uu_base64_echar.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
		out += __uu_base64_echar.charAt(c3 & 0x3F);
	}
	return out;
}

function __base64_decode(str)
{ 
	var c1, c2, c3, c4;
	var i, len, out;

	len = str.length;
	i = 0;
	out = "";
	while(i < len) {
		/* c1 */
		do {
			c1 = __uu_base64_dchar[str.charCodeAt(i++) & 0xff];
		} while(i < len && c1 == -1);

		if(c1 == -1)
		   break;

		/* c2 */
		do {
			c2 = __uu_base64_dchar[str.charCodeAt(i++) & 0xff];
		} while(i < len && c2 == -1);

		if(c2 == -1)
			break;
		out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));

		/* c3 */
		do {
			c3 = str.charCodeAt(i++) & 0xff;
			if(c3 == 61)
				return out;
			c3 = __uu_base64_dchar[c3];
		} while(i < len && c3 == -1);

		if(c3 == -1)
			break;
		out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));

		/* c4 */
		do {
			c4 = str.charCodeAt(i++) & 0xff;
			if(c4 == 61)
				return out;
			c4 = __uu_base64_dchar[c4];
		} while(i < len && c4 == -1);

		if(c4 == -1)
			break;
		out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
	}
	return out;
}

function get_client_agent()
{
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf("opera") > -1)
		return "opera";
	if (agent.indexOf("konqueror") > -1)
		return "konqueror";
	if (agent.indexOf("safari") > -1)
		return "safari";
	if (agent.indexOf("msie") > -1)
		return "ie";
	else
		return "mozilla";
}

function __UU_debug(msg)
{
	var _dbg_win = window.open("#", "__debug_window_");
	_dbg_win.document.write(msg);
	_dbg_win.document.write("\r\n******************************************************\r\n");	
/*	var _dbg_box = top.window.document.getElementById("__uu_debug_box__");
	if (_dbg_box == null) {
		_dbg_box = top.window.document.createElement("textarea");
		_dbg_box.id = "__uu_debug_box__";
		_dbg_box.rows = 50;
		_dbg_box.cols = 100;
		top.window.document.body.appendChild(_dbg_box);
	}
	_dbg_box.value += "\r\n" + msg;*/
}

function __UU_rewrite_url(_url)
{
	var chips = _url.match(/(\s*)/);
	var trim_url = _url.substring(chips[0].length);
	chips = trim_url.match(/^(\/|https?:\/\/)/i);
	if (!chips)
		return _url;

	var re_url = '';
	if (chips[0] == "http://")
		re_url = _uu_base + _uu_root + "/_P_HTTP/" + trim_url.substring(chips[0].length);
	else if (chips[0] == "https://")
		re_url += _uu_base + _uu_root + "/_P_HTTPS/" + trim_url.substring(chips[0].length);
	else
		re_url = _uu_root + _uu_web_root + trim_url;
	
	return re_url;
}

function __UU_recover_url(_url)
{
	var re_url;
	if (_url.indexOf(_uu_base) == 0) {
		re_url = _url.substring(_uu_base.length); 
		if (re_url.indexOf(_uu_root) != 0)
			return _url;

		re_url = re_url.substring(_uu_root.length);
		if (re_url.indexOf("/_P_HTTPS/") == 0)
			return "https://" + re_url.substring("/_P_HTTPS/".length);
		else if (re_url.indexOf("/_P_HTTP/") == 0)
			return "http://" + re_url.substring("/_P_HTTP/".length);
		else
			return _url;
	} else if (_url.indexOf(_uu_root) == 0) {
		re_url = _url.substring(_uu_root.length);
		if (re_url.indexOf(_uu_web_root) == 0)
			return re_url.substring(_uu_web_root.length);
		else
			return _url;
	} else
		return _url;
}

var _JS_PROPERTY = 0;
var _JS_FUNCTION = 1;
var _JS_DEPEND = 1;
var _JS_UNDEPEND = 2;
var _JS_BOTH = 3;
var _JS_RDONLY = 1;
var _JS_WRONLY = 2;
var _JS_RDWR = 3;

var __js_rewrite_t = {
	/*location, link's property*/
	host:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_host, __write_host],
	hostname:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_hostname, __write_host],
	href:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_url, __write_url],
	pathname:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_pathname, __write_pathname],
	port:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_port, __write_default],
	protocol:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_protocol, __write_default],
	/*location's function*/
	assign:		[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_assign],
	replace:	[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_replace],
	
	/*frame, iframe's property*/
	src:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_url, __write_url],
	/*document's property*/
	cookie:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_cookie, __write_cookie],
	location:	[_JS_BOTH, _JS_WRONLY, _JS_PROPERTY, __read_location, __write_location],
	referrer:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_url, __write_url],
	URL:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_url, __write_url],
	/*document's function*/
	write:		[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_write],
	writeln:	[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_writeln],

	/*window's function*/
	open:		[_JS_BOTH, _JS_RDONLY, _JS_FUNCTION, __func_open],
	load:		[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_load],
	eval:		[_JS_BOTH, _JS_RDONLY, _JS_FUNCTION, __func_eval],
	setTimeout:	[_JS_BOTH, _JS_RDONLY, _JS_FUNCTION, __func_setTimeout],
	//loadXML:	[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_loadXML],

	/*css function*/
	content:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_css],
	background:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_css],
	backgroundImage:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_css],
	listStyleImage:		[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_css],
	
	/*windows function*/
	addBehavior:	[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_addBehavior],
	showModalDialog:		[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_showModalDialog],
	showModelessDialog:		[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_showModelessDialog],
	insertAdjacentHTML:		[_JS_DEPEND, _JS_RDONLY, _JS_FUNCTION, __func_insertAdjacentHTML],
	
	/*element's property*/
	innerHTML:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_html],
	innerText:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_html],
	outerText:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_html],
	outerHTML:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_default, __write_html],
	
	action:	[_JS_DEPEND, _JS_RDWR, _JS_PROPERTY, __read_url, __write_url]
};

function __read_host(pname, obj)
{
	if (__obj_test("href", obj, 'string') == false)
		return obj.host;

	var _regs = obj.href.match(/\/_P_HTTPS?\/([^\/]+)\//);
	if (_regs==undefined || _regs[1]==undefined)
		return obj.host;
	else
		return _regs[1];
}

function __write_host(pname, selfinc, obj, ctx)
{
	if (__obj_test("href", obj, 'string') == false)
		return (selfinc) ? obj[pname]+=ctx : obj[pname]=ctx;

	var _regs = obj.href.match(/(\/_P_HTTPS?\/)([^\/]+)(.*)/);
	if (_regs==undefined || _regs[1]==undefined || regs[2]==undefined)
		return (selfinc) ? obj[pname]+=ctx : obj[pname]=ctx;

	var _url = obj.href.substring(0, _regs.index) + _regs[1];
	var _host = (selfinc) ? (_regs[2]+ctx) : ctx;
	obj.href = _url + _host + _regs[3];

	return _host;
}

function __read_hostname(pname, obj)
{
	if (__obj_test("href", obj, 'string') == false)
		return obj.hostname;

	var _regs = obj.href.match(/\/_P_HTTPS?\/([^\/]+)\//);
	if (_regs==undefined || _regs[1]==undefined)
		return obj.hostname;
	else {
		var _pidx = _regs[1].indexOf(':')
		return (_pidx == -1) ? _regs[1] : _regs[1].substring(0, _pidx);
	}
}

function __read_protocol(pname, obj)
{
	if (__obj_test("href", obj, 'string') == false)
		return obj.protocol;

	var _regs = obj.href.match(/\/(_P_HTTPS?)\//);
	if (_regs==undefined || _regs[1]==undefined)
		return obj.protocol;
	else
		return (_regs[1] == "_P_HTTP") ? "http:" : "https:";
}

function __read_port(pname, obj)
{
	if (__obj_test("href", obj, 'string') == false)
		return obj.port;

	var _regs = obj.href.match(/\/(_P_HTTPS?)\/([^\/]+)\//);
	if (_regs==undefined || _regs[1]==undefined || _regs[2]==undefined)
		return obj.port;

	if (_regs[2].indexOf(':') == -1)
		return (_regs[1] == "_P_HTTP") ? 80 : 443;
	else
		return _regs[2].substring(_regs[2].indexOf(':')+1);
}

function __read_pathname(pname, obj)
{
	if (__obj_test("href", obj, 'string') == false)
		return obj.pathname;

	var _regs = obj.href.match(/\/_P_HTTPS?\/[^\/]+(\/.*)/);
	if (_regs==undefined || _regs[1]==undefined)
		return obj.pathname;
	else
		return _regs[1];
}

function __write_pathname(pname, selfinc, obj, ctx)
{
	if (__obj_test("href", obj, 'string') == false)
		return (selfinc) ? obj.pathname+=ctx : obj.pathname=ctx;

	var _regs = obj.href.match(/(\/_P_HTTPS?\/[^\/]+)(\/.*)/);
	if (_regs==undefined || _regs[1]==undefined || _regs[1]==undefined)
		return (selfinc) ? obj.pathname+=ctx : obj.pathname=ctx;
	
	var _url = obj.href.substring(0, _regs.index) + _regs[1];
	var _pathname = (selfinc) ? (_regs[2]+ctx) : ctx;
	obj.href = _url + _pathname;
	
	return _pathname;
}

function __read_cookie(pname, obj)
{
	if (obj != document)
		return obj.cookie;

	var _chips = obj.cookie.split(";");
	var _domain = new Array(-1, "");
	var _path = new Array(-1, "");
	for (var i=0; i<_chips.length; i++) {
		var _regs = _chips[i].match(/\s*([^=\s]+)\s*(=?)\s*(.*)/);
		if (_regs==undefined)
			continue;

		switch (_regs[1].toLowerCase()) {
		case "domain":
			_domain[0] = i;
			_domain[1] = _regs[3];
			break;
		case "path":
			_path[0] = i;
			_path[1] = _regs[3];
			break;
		default:
			break;
		}
	}


/*	_regs = _path[1].match(/\/_P_HTTPS?\/([^\/]+)(.*)/);
	var _pidx = _regs[1].indexOf(':')
	_chips[_domain[0]] = " domain=" + ((_pidx == -1) ? _regs[1] : _regs[1].substring(0, _pidx));
	_chips[_path[0]] = " path=" + _regs[2];*/

	return _chips.join(";");
}

function __write_cookie(pname, selfinc, obj, ctx)
{
	if (obj != document)
		return (selfinc) ? obj.cookie+=ctx : obj.cookie=ctx;

	var _chips = ctx.split(";");
	var _domain = new Array(-1, "");
	var _path = new Array(-1, "");
	for (var i=0; i<_chips.length; i++) {
		var _regs = _chips[i].match(/\s*([^=\s]+)\s*(=?)\s*(.*)/);
		if (_regs == undefined)
			continue;

		switch (_regs[1].toLowerCase()) {
		case "domain":
			_domain[0] = i;
			_domain[1] = _regs[3];
			break;
		case "path":
			_path[0] = i;
			_path[1] = _regs[3];
			break;
		default:
			break;
		}
	}


	if (_path[0] == -1) {
		_path[0] = _chips.length;
		_path[1] = "/";
	}

	_regs = _uu_web_root.match(/(\/_P_HTTPS?\/)(.+)/);	
	var _ps = " path=" + _uu_root + _regs[1];
	if (_domain[0]==-1 || _domain[1]==_regs[2])
		_ps += _regs[2] + _path[1];
	_chips[_path[0]] = _ps;

	if (_domain[0] != -1)
		_chips.splice(_domain[0], 1);

	return (selfinc) ? obj.cookie+=_chips.join(";") : obj.cookie=_chips.join(";");
}

function __read_url(pname, obj)
{
	if (__obj_test(obj, pname, 'string') == false)
		return obj[pname];

	return __UU_recover_url(obj[pname]);
}

function __write_url(pname, selfinc, obj, ctx)
{
	if (__obj_test(obj, pname, 'string') == false)
		return (selfinc) ? obj[pname]+=ctx : obj[pname]=ctx;
		
	return (selfinc) ? obj[pname]+=ctx : obj[pname]=__UU_rewrite_url(ctx);
}

function __read_location(pname, obj)
{
	if (obj == null)
		obj = window;
	return obj.location;
}

function __write_location(pname, selfinc, obj, ctx)
{
	if (obj == null)
		obj = window;

	if (typeof ctx == 'string') 
		return (selfinc) ? obj.location+=ctx : obj.location=__UU_rewrite_url(ctx);
	else
		return (selfinc) ? obj.location+=ctx : obj.location=ctx;
}

function __read_default(pname, obj)
{
	return obj[pname];
}

function __write_default(pname, selfinc, obj, ctx)
{
	return (selfinc) ? obj[pname]+=ctx : obj[pname]=ctx;
}

function __write_html(pname, selfinc, obj, ctx)
{
	//__UU_debug(ctx);
	var _html = __UU_lex_html(ctx);
	//__UU_debug(_html);
	return (selfinc) ? obj[pname]+=_html : obj[pname]=_html;
}

function __write_css(pname, selfinc, obj, ctx)
{
	var _css = __UU_lex_css(ctx);
	
	return (selfinc) ? obj[pname]+=_css : obj[pname]=_css;
}

function __func_emulate(_obj, _method, _args)
{
	var f;

	if (_obj) {
		f = "_obj." + _method + "(";
	} else {
		f = _method + "(";
	}

	for (var i=0; i<_args.length; i++) {
		if (i==0) {
			f += "_args["+i+"]";
		} else {
			f += ", _args["+i+"]";
		}
	}

	f += ")";
	return eval(f);
}

function __func_replace()
{
	var _args = Array.prototype.slice.call(arguments, 2);

	if (typeof arguments[2] == 'string')
		_args[0] = __UU_rewrite_url(arguments[2]);

	var _obj = arguments[1];
	return _obj.replace.apply(_obj, _args);
}

/*function __func_loadXML()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (typeof arguments[2] == 'string')
		_args[0] = __UU_lex_html(arguments[2]);

	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "loadXML", _args);
	else
		return _obj.loadXML.apply(_obj, _args);
}*/

function __func_write()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj == document && typeof arguments[2] == 'string')
		_args[0] = __UU_lex_html(arguments[2]);
	try {
		return _obj.write.apply(_obj, _args);
	} catch (ex) {
		return _obj.write(_args[0]);
	}
}

function __func_writeln()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj == document && typeof arguments[2] == 'string')
		_args[0] = __UU_lex_html(arguments[2]);

	try {
		return _obj.writeln.apply(_obj, _args);
	} catch (ex) {
		return _obj.writeln(_args[0]);
	}
}

function __func_open()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj==null || _obj==window) {
		_obj = window;
		if (typeof arguments[2] == 'string')
			_args[0] = __UU_rewrite_url(arguments[2]);
	} else if (typeof arguments[3] == 'string')
		_args[1] = __UU_rewrite_url(arguments[3]);

	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "open", _args);
	else
		return _obj.open.apply(_obj, _args);
}

function __func_load()
{
	var _args = Array.prototype.slice.call(arguments, 2);

	var _obj = arguments[1];
	if (typeof arguments[2] == 'string')
		_args[0] = __UU_rewrite_url(arguments[2]);

	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "load", _args);
	else
		return _obj.load.apply(_obj, _args);
}

function __func_eval()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj==null || _obj==window) {
		_obj = window;
		if (typeof arguments[2] == 'string')
			_args[0] = __UU_lex_script(arguments[2]);
	}
	
	return _obj.eval.apply(_obj, _args);
}

function __func_setTimeout()
{
	var _args = Array.prototype.slice.call(arguments, 2);

	var _obj = arguments[1];
	if (_obj==null || _obj==window) {
		_obj = window;
		if (typeof arguments[2] == 'string')
			_args[0] = __UU_lex_script(arguments[2]);
	}

	if (_obj==window && get_client_agent()=='ie')
		return __func_emulate(_obj, "setTimeout", _args);
	else
		return _obj.setTimeout.apply(_obj, _args);
}

function __func_assign()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (typeof arguments[2] == 'string')
		_args[0] = __UU_rewrite_url(arguments[2]);
	
	return _obj.assign.apply(_obj, _args);
}

function __func_addBehavior()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (typeof arguments[2] == 'string')
		_args[0] = __UU_rewrite_url(arguments[2]);

	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "addBehavior", _args);
	else
		return _obj.addBehavior.apply(_obj, _args);
}

function __func_showModalDialog()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj==null || _obj==window) {
		_obj = window;
		if (typeof arguments[2] == 'string')
			_args[0] = __UU_rewrite_url(arguments[2]);
	}
	
	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "showModalDialog", _args);
	else
		return _obj.showModalDialog.apply(_obj, _args);
}

function __func_showModelessDialog()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj==null || _obj==window) {
		_obj = window;
		if (typeof arguments[2] == 'string')
			_args[0] = __UU_rewrite_url(arguments[2]);
	}

	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "showModelessDialog", _args);
	else
		return _obj.showModelessDialog.apply(_obj, _args);
}

function __func_insertAdjacentHTML()
{
	var _args = Array.prototype.slice.call(arguments, 2);
	
	var _obj = arguments[1];
	if (_obj != null && typeof arguments[3] == 'string')
		_args[1] = __UU_lex_html(arguments[3]);

	if (get_client_agent() == 'ie')
		return __func_emulate(_obj, "insertAdjacentHTML", _args);
	else
		return _obj.insertAdjacentHTML.apply(_obj, _args);
}

function __obj_test(obj, fname, type)
{
	if (obj == null)
		return true;

	return (typeof obj[fname] == type);
}

function __UU_func(fname, obj)
{
	var _jobj = __js_rewrite_t[fname];
	if (_jobj[2] != _JS_FUNCTION)
		return obj[fname];

	return _jobj[3].apply(null, arguments);
}

function __UU_read(pname, obj)
{
	var _jobj = __js_rewrite_t[pname];
	if (_jobj==undefined || _jobj[2]!=_JS_PROPERTY)
		return obj[pname];
	else
		return _jobj[3](pname, obj);
}

function __UU_eval(pname, selfinc, obj)
{
	var _reurl = arguments[3];
	
	var _jobj = __js_rewrite_t[pname];
	if (_jobj==undefined || _jobj[2]!=_JS_PROPERTY)
		return (selfinc) ? obj[pname]+=_reurl : obj[pname]=_reurl;
	else
		return _jobj[4](pname, selfinc, obj, _reurl);
}

/*
0:	variable
1:	symbol
2:	terminal
3:	reserved words
6:	\s or notes
*/
function __expression_t(type, value)
{
	var _exp = new Object();
	_exp.type = type;
	_exp.value = value;
	return _exp;
}

function __expressions_join(_exps, sid, eid, c)
{
	if (eid<sid || eid<0)
		return '';

	if (eid > _exps.length)
		eid = _exps.length;
	var ob = _exps[sid].value;
	for (var i=sid+1; i<eid; i++)
		ob += c + _exps[i].value;
	return ob;
}

function __pick_string(_script)
{
	var idx;
	for (idx=1; idx<_script.length; idx++) {
		c = _script.charAt(idx);
		if (c == _script.charAt(0)) {
			idx ++;
			break;
		} else if (c == '\\')
			idx ++;
	}

	if (idx >= _script.length)
		idx = _script.length;
	var _exp = new __expression_t(0, _script.substring(0, idx));
	return _exp;
}

function __pick_note_0(_script)
{
	var chips = _script.match(/([^\n]+)/);
	if (!chips)
		return null;
	
	var _exp = new __expression_t(6, chips[1]);
	return _exp;
}

function __pick_note_1(_script)
{
	var idx = _script.indexOf("*/");
	if (idx == -1)
		return null;

	var _exp = new __expression_t(6, _script.substring(0, idx+2));
	return _exp;
}

function __pick_regexp(_script)
{
	var idx;
	for (idx=1; idx<_script.length; idx++) {
		c = _script.charAt(idx);
		if (c == _script.charAt(0)) {
			idx ++;
			break;
		} else if (c == '\\')
			idx ++;
	}

	if (idx >= _script.length)
		idx = _script.length;

	var chips = _script.substr(idx).match(/(\w*)/);
	var _exp = new __expression_t(0, _script.substring(0, idx) + chips[1]);
	return _exp;
}

function __pick_symbol(_script, _prev_exp)
{
	var _exp;

	switch (_script.charAt(0)) {
	case '/':
		if (_script.charAt(1) == '/')
			_exp = __pick_note_0(_script);
		else if (_script.charAt(1) == '*')
			_exp = __pick_note_1(_script);
		else if (_prev_exp==null || (_prev_exp.type!=0 && _prev_exp.value!=')' && _prev_exp.value!=']'))
			_exp = __pick_regexp(_script);
		else 
			break;
		
		return _exp;
	case "\"":
	case "\'":
		_exp = __pick_string(_script);
		return _exp;
	case '{':
	case '}':
	case ';':
		_exp = new __expression_t(2, _script.charAt(0));
		return _exp;
	default:
		break;
	}

	if (/^[\+|=]=/.test(_script)) {
		_exp = new __expression_t(1, _script.substr(0, 2));
	} else {
		_exp = new __expression_t(1, _script.charAt(0));
	}

	return _exp;
}

function __pick_blank(_script)
{
	var chips = _script.match(/(\s+)/);
	var _exp = new __expression_t(6, chips[1]);
	return _exp;
}

function __pick_variable(_script)
{
	var chips = _script.match(/([\w\$]+)/);
	var _exp = new __expression_t(0, chips[1]);

	if (chips[1] == "new")
		_exp.type = 3;
	else
		_exp.type = 0;

	return _exp;
}

function __pick_expression(_script, _prev_exp)
{
	if (/\s/.test(_script.charAt(0)))
		_exp = __pick_blank(_script);
	else if (/\w|\$/.test(_script.charAt(0)))
		_exp = __pick_variable(_script);
	else
		_exp = __pick_symbol(_script, _prev_exp);

	return _exp;
}

function __split_script(_script)
{	
	var out_stream = new Array();
	
	var cur_exp;
	var prev_exp = null;
	var expressions = new Array();

	var idx = 0;
	while (idx < _script.length) {
		cur_exp = __pick_expression(_script.substr(idx), prev_exp);
		expressions[expressions.length] = cur_exp;
		
		if (cur_exp.type != 6)
			prev_exp = cur_exp;

		idx += cur_exp.value.length;

		var si = __split_sentence(expressions);
		if (si >= 0) {
			out_stream[out_stream.length] = __rewrite_sentence(expressions.slice(0, si+1));
			expressions.splice(0, si+1);
		}
	}
	if (expressions.length > 0) {
		out_stream[out_stream.length] = __rewrite_sentence(expressions);
		expressions.splice(0, expressions.length);
	}
		
	return out_stream;
}

function __split_sentence(_exps)
{
	var sid = (arguments.length > 1) ? arguments[1] : 0;
	var eid = _exps.length-1;

	var lobj = false;
	var bracket = 0;
	var bc = ['', ''];

	for (var i=sid; i<eid; i++)
	{
		var c = _exps[i].value.charAt(0);
		if (bracket > 0) {
			if (c == bc[1])
				bracket --;
			else if (c == bc[0])
				bracket ++;

			if (bracket == 0)
				lobj = true;
			continue;
		}

		switch (_exps[i].type) {
		case 1:
			if (c == '(') {
				bracket = 1;
				bc = ['(', ')'];
			} else if (c == '[') {
				bracket = 1;
				bc = ['[', ']'];
			} else if (c==')' || c==']')
				return i;
			lobj = false;
			break;
		case 2:
			return i;
		case 3:
			if (lobj)
				return i-1;
			break;
		case 0:
			if (lobj == false) 
				lobj = true;
			else
				return i-1;
			break;
		}
	}

	return -1;
}

function __js_rewrite_able(_exps, sid, cid, rt)
{
	var jobj = __js_rewrite_t[_exps[cid].value];
	if (jobj == null)
		return false;
		
	var did = __find_effective_exp(_exps, cid, sid, false);
	if (jobj[0] == _JS_DEPEND) {
		if (did==-1 || _exps[did].value.charAt(0)!='.')
			return false;
	}
	
	var bid = __find_effective_exp(_exps, cid, _exps.length, true);
	if (jobj[2] == _JS_FUNCTION) {
		if (bid==-1 || _exps[bid].value.charAt(0)!='(')
			return false;
	} else {
		if (bid!=-1 && _exps[bid].value.charAt(0)=='(')
			return false;
		if (jobj[1] == _JS_WRONLY) {
			if (bid==-1 || (_exps[bid].value!='=' && _exps[bid].value!='+='))
				return false;
		} else if (jobj[1] == _JS_RDONLY) {
			if (bid!=-1 && (_exps[bid].value=='=' || _exps[bid].value=='+='))
				return false;
		}
	}
	
	rt[3] = jobj;
	rt[4] = did;
	rt[5] = bid;
	return true;
}

function __get_cell(_exps, sid)
{
	var rt = [-1, -1, -1, null, -1, -1];
	var bracket = 0;
	var bc = ['', ''];

	var cid = sid;
	for ( ; cid<_exps.length; cid++)
	{
		var c = _exps[cid].value.charAt(0);

		if (bracket > 0) {
			if (c == bc[1])
				bracket --;
			else if (c == bc[0])
				bracket ++;
			continue;
		}

		switch (_exps[cid].type) {
		case 1:
		case 2:
			if (c == '(') {
				bracket = 1;
				bc = ['(', ')'];
			} else if (c == '[') {
				bracket = 1;
				bc  = ['[', ']'];
			} else if (c != '.') {
				rt[0] = cid;
				return rt;
			}

			if (bracket==1 && rt[2]==-1)
				rt[2] = cid;
			break;
		case 0:
			if (__js_rewrite_able(_exps, sid, cid, rt) == true)
				rt[1] = cid;
			break;
		}
	}

	rt[0] = cid;
	return rt;
}

function __order_find(_exps, sid, eid)
{
	for (var i=sid+1; i<=eid; i++) {
		if (_exps[i].type != 6)
			return i;
	}
	
	return -1;
}

function __reverse_find(_exps, sid, eid)
{
	for (var i=sid-1; i>=eid; i--) {
		if (_exps[i].type != 6)
			return i;
	}
	
	return -1;
}

function __find_effective_exp(_exps, sid, eid, order)
{
	if (order == true)
		return __order_find(_exps, sid, eid);
	else
		return __reverse_find(_exps, sid, eid);
}

function __find_exp(_exps, sid, c, orderly)
{
	for (var i=sid; i<_exps.length&&i>=0; )
	{
		if (_exps[i].value == c)
			break;
		if (orderly)
			i ++;
		else
			i --;
	}

	return i;
}

function __rewrite_sentence(_exps)
{
	var os = '';
//	os += __expressions_join(_exps, 0, _exps.length, "")+"<br>";
//	return os;
	for (var i=0; i<_exps.length; ) {
		if (_exps[i].type == 6) {
			os += _exps[i].value;
			i++;
			continue;
		}
	
		var rt = __get_cell(_exps, i);
		var tid = (rt[1]==-1) ? i : __split_sentence(_exps, i);
//		os += __expressions_join(_exps, i, rt[2], "")+"<br>", i=rt[2];
		if (rt[1]==-1 || (tid>=i && tid<rt[1])) {
			if (rt == -1)
				tid = (rt[2] == -1) ? rt[0] : rt[2];
			os += __expressions_join(_exps, i, tid+1, "");
			i = tid + 1;
			continue;
		}

		var robj = rt[3];
		if (robj[2] == _JS_FUNCTION) {
			os += "__UU_func(\"" + _exps[rt[1]].value + "\",";
			tid = __find_effective_exp(_exps, rt[5], rt[0], true);
			if (tid == -1) ;
			else if (rt[4] == -1) {
				if (_exps[tid].value.charAt(0) == ')')
					os += " null";
				else
					os += " null,";
			} else {
				if (_exps[tid].value.charAt(0) == ')')
					_exps[rt[4]].value = '';
				else
					_exps[rt[4]].value = ',';
			}
			_exps.splice(rt[1], rt[5]-rt[1]+1);
		} else if ((rt[0]<_exps.length) && (_exps[rt[0]].value=="+=" || _exps[rt[0]].value=="=")) {
			os += "__UU_eval(\"" + _exps[rt[1]].value + "\",";
			if (_exps[rt[0]].value == "+=")
				os += " true, ";
			else
				os += " false, ";
			tid = __split_sentence(_exps, rt[0]+1);
			tid = (tid == -1) ? _exps.length-1 : tid;
			var _exp = new __expression_t(1, ")");
			_exps.splice(tid, 0, _exp);
			if (rt[4] == -1)
				os += " null,";
			else
				_exps[rt[4]].value = ",";

			_exps.splice(rt[1], rt[0]-rt[1]+1);
		} else {
			os += "__UU_read(\"" + _exps[rt[1]].value + "\",";

			if (rt[4] == -1)
				os += " null)";
			else
				_exps[rt[4]].value = ")";

			_exps.splice(rt[1], 1);
		}
	}
	return os;
}

function __UU_lex_script(_script)
{
	if (typeof _script != 'string')
		return _script;

	var out_stream = __split_script(_script);
	return out_stream.join("");
}

function __UU_script(_escript, obj)
{
	var _sscript = __base64_decode(_escript);
	if (/[\"']/.test(_sscript.charAt(0)) == true)
		_sscript = _sscript.substr(1, _sscript.length-2);
	var _regs = _sscript.match(/^(\s*javascript:)?/i);
	if (_regs[1] != undefined)
		_sscript = _sscript.substr(_regs[1].length);
	_regs = _sscript.match(/^(\s*return\s)?/i);
	if (_regs[1] != undefined)
		_sscript = _sscript.substr(_regs[1].length);
	_sscript = _sscript.replace(/this/g, "obj");

	_uscript = "_=function() {" + __UU_lex_script(_sscript) + "}";
	eval(_uscript);
	return _();
}

function __UU_lex_css(_css)
{
	var out_stream = "";

	while (true) {
		var _regs = _css.match(/url\(([^\)]*)\).*/);
		if (_regs==undefined || _regs[1]==undefined) {
			out_stream += _css;
			break;
		} else {
			out_stream += _css.substring(0, _regs.index);
			_css = _css.substr(_regs.index + _regs[0].length);
			out_stream += "url(" + __UU_rewrite_url(_regs[1]) + ")";
		}
	}

	return out_stream;
}

var __html_rewrite_t = {
	a:		["href", "onmouseover", "onmouseout", "onclick"],
	applet:		["codebase", "object", "archive"],
	area:		["href"],
	base:		["href"],
	bgsound:	["src"],
	blockquote:	["cite"],
	body:		["background"],
	del:		["cite"],
	div:		["onclick"],
	embed:		["src", "codebase"],
	fig:		["src", "imagemap"],
	form:		["action", "script"],
	frameset:	["onload"],
	frame:		["src", "longdesc"],
	h1:		["src"],
	h2:		["src"],
	h3:		["src"],
	h4:		["src"],
	h5:		["src"],
	h6:		["src"],
	head:		["profile"],
	hr:		["src"],
	iframe:		["src", "longdesc"],
	ilayer:		["src"],
	img:		["src", "lowsrc", "longdesc", "usemap", "dynsrc", "onclick", "onmouseout", "onmouseover", "onmouseup", "onmousedown"],
	image:		["src", "lowsrc", "longdesc", "usemap", "dynsrc"],
	input:		["src", "usemap"],
	ins:		["cite"],
	layer:		["src"],
	link:		["href", "urn"],
	meta:		["url"],
	node:		["href"],
	note:		["src"],
	object:		["usemap", "codebase", "data", "archive", "classid"],
	overlay:	["src", "imagemap"],
	param:		["name", "value"],
	q:		["cite"],
	script:		["src", "language", "type"],
	select:		["src"],
	table:		["background"],
	td:		["background", "onclick", "onmouseout", "onmouseover"],
	th:		["background"],
	tr:		["background"],
	ul:		["src"],
	xmp:		["href"]
};

function __tag_property(str)
{
	var __tp = ["href", "src", "action", "script", "url",
			"background", "codebase", "object", "archive"];
	var _ts = _tp.join("|");
	if (_ts.indexOf(str) == -1)
		return false;
	else
		return true;
}

function __tag_event(str)
{
	var _te = ["onclick", "onmouseout", "onmouseover", "onmouseup", "onmousedown"];
	var _ts = _te.join("|");
	if (_ts.indexOf(str) == -1)
		return false;
	else
		return true;
}

function __html_tag_regexp(_attrs)
{
	var _regs = "\\b(" + _attrs.join("|") + ")(\\s*=\\s*)(([\\\"'])([^\\4]*?)\\4|[^\\\"'][^\\s]+)";

	return new RegExp(_regs, "i");
}

function __rewrite_tag(_tag)
{
	var chips = _tag.match(/(<\s*)(\/?[\w]+)/);
	if (chips[2].toLowerCase() == "\/script")
		return __UU_lex_script(_tag.substring(0, chips.index)) + chips[1] + chips[2];
		
	var obj = __html_rewrite_t[chips[2].toLowerCase()];
	if (typeof obj == 'undefined')
		return _tag;
	
	var reg = __html_tag_regexp(obj);

	var os = '';
	while (true)
	{
		var regs = _tag.match(reg);
		if (regs == null)
			break;

		os += _tag.substring(0, regs.index);
		os += regs[1] + regs[2];

		if (__tag_event(regs[1]) == true) {
			if (regs[4] == null)
				os += "\"javascript:__UU_script('" + __base64_encode(regs[3]) + "', this)\"";
			else
				os += "\"javascript:__UU_script('" + __base64_encode(regs[5]) + "', this)\"";
		} else {
			if (regs[4] == null)
				os += __UU_rewrite_url(regs[3]);
			else
				os += regs[4] + __UU_rewrite_url(regs[5]) + regs[4];
		}

		_tag = _tag.substring(regs.index + regs[1].length + regs[2].length + regs[3].length);
	}

	os += _tag;
	return os;
}

function __UU_lex_html(_html)
{
	if (typeof _html != 'string')
		return _html;

	var _tags = _html.split(">");
	for (var i=0; i<_tags.length; i++) {
		if (/<\s*\/?[\w]+/.test(_tags[i]) == false)
			continue;
		_tags[i] = __rewrite_tag(_tags[i]);
	}
	return _tags.join(">");
}