var isIE = ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1));
var thedata = ""; //holds the data grabbed by the getData function


//following getData stuff that I clearly didn't code is from
// http://jibbering.com/2002/4/httprequest.html
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}

function getData( url ) {
  xmlhttp.open( "GET", url, true );
  xmlhttp.onreadystatechange=function() {
    if ( xmlhttp.readyState==4 ) {
      thedata = xmlhttp.responseText;
      return 1;
    }
  }
  xmlhttp.send( null )
}

function sendData( url, data ) {
  xmlhttp.open( "POST", url, true );
  xmlhttp.onreadystatechange=function() {
    if ( xmlhttp.readyState==4 ) {
      thedata = xmlhttp.responseText;
      return 1;
    }
  }
  xmlhttp.setRequestHeader( "Man", "POST " + url + " HTTP/1.1" );
  xmlhttp.setRequestHeader( "Host", "www.ximwix.net" );
  xmlhttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );
  xmlhttp.setRequestHeader( "Content-Length", data.length );
  xmlhttp.setRequestHeader( "Connection", "close" );

  xmlhttp.send( data )
}

function rreplace( needle, newneedle, haystack ) {
  if ( needle == newneedle ) {
    return false;
  }
  b1 = haystack;
  b2 = b1.replace( needle, newneedle );
  while ( b1 != b2 ) {
    b1 = b2;
    b2 = b2.replace( needle, newneedle );
  }
  return b2;
}
