﻿function popupWindow(mypage, w, h, scroll, resizeable) {
	//var scroll = 0;
	//var resizeable = 0;
	var myname = "popupWindow";
	
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizeable
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function escapeString(text) {
  output = "";
  escapedChar = "";
  for (i=0;i<text.length;i++) {
    escapedChar = escape(text.substring(i, i+1));
    if(escapedChar.length > 1) {
        escapedChar = escapedChar.replace("%", "&#x");
        output += escapedChar + ";";
    } else {
        output += escapedChar;
    }
  }
  return output;
}


