function popup(mypage, myname, w, h, scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no';
	win = window.open(mypage, myname, winprops);
}


function clean(what)
{
	return what.replace(/ /g,"%20").replace(/&/g,"/amp;/").replace(/</g,"/lt;/").replace(/>/g,"/gt;/").replace(/''/g,"/quot;/").replace(/\n/g,"<br>")
}


function createPost(f)
{ 
	var e = f.elements,t=''; 
	for (var i=0;i<e.length;i++) 
	{
		if (e[i].type=='text' || e[i].type== "textarea" ) 
		{
			t+= e[i].name+'='+clean(e[i].value)+'&'; 
		}
		if (e[i].type=='select-one') 
		{
			t+= e[i].name+'='+clean(e[i].options[e[i].selectedIndex].value)+'&';
			
		}	
		if (e[i].type=='checkbox') 
		{
			
			if (e[i].checked)
			{
				t+= e[i].name+'='+clean(e[i].value)+'&'; 
			}	
		}	
	}
	return t
  
}; 

var myConn = new XHConn();
var d = new Date();
var time = d.getTime();
		


/** XHConn - Simple XMLHTTP Interface - bfults@gmail.com - 2005-04-08        **
 ** Code licensed under Creative Commons Attribution-ShareAlike License      **
 ** http://creativecommons.org/licenses/by-sa/2.0/                           **/
function XHConn()
{
  var xmlhttp, bComplete = false;
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
  catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
  catch (e) { try { xmlhttp = new XMLHttpRequest(); }
  catch (e) { xmlhttp = false; }}}
  if (!xmlhttp) return null;
  this.connect = function(sURL, sMethod, sVars, fnDone, fnWaiting)
  {
    if (!xmlhttp) return false;
    bComplete = false;
    sMethod = sMethod.toUpperCase();

    try {
      if (sMethod == "GET")
      {
        xmlhttp.open(sMethod, sURL+"?"+sVars, true);
        sVars = "";
      }
      else
      {
        xmlhttp.open(sMethod, sURL, true);
        xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
        xmlhttp.setRequestHeader("Content-Type",
          "application/x-www-form-urlencoded");
      }
      xmlhttp.onreadystatechange = function()
	  {
	  	if (xmlhttp.readyState != 4)
        {
		
         fnWaiting();
        }
	  	if (xmlhttp.readyState == 4 && !bComplete)
        {
          bComplete = true;
          fnDone(xmlhttp);
        }
	  };
      xmlhttp.send(sVars);
    }
    catch(z) { return false; }
    return true;
  };
  return this;
}
