function fWhatever() {
	alert('whatever');
}

function fHTTPRequest(sURL, aPostVars, fCallback){
  function fCheckRequest(oReqObj){  
    try {
      if (oReqObj.readyState == 4){ 
        if (oReqObj.status != 200) return 'warning';
	      else return 'ok';
	    }
	  } 
	  catch(e) {
	    // this is probably that the request couldn't be sent e.g. the host isn't available
	    // should we do some kind of alert?
	    return 'error'; 
	  } 
	  return 'not ready';
  }
  	  	 
  function fComplete(){ 
  	var sStatus=fCheckRequest(oReq);
  	switch(sStatus) {
  		case 'not ready':return; break;
  		case 'ok': fCallback(oReq.responseText,oReq.responseXML,true); break;
  		case 'warning':fCallback(false,false,false); break;
  	}
	}
			 
	function fPostString(){  
	  if (!aPostVars) return null;
	  var sPostString='';
	  for (var sKey in aPostVars){
	    if(sKey=='containsValue') continue; // this is a special case.  containsValue is a prototype method.  I can't think of another way to exclude it from the array :( 	
		if(sKey!='return') aPostVars[sKey]=encodeURIComponent(aPostVars[sKey]); // return is a special case.  Otherwise URI encode non-word chars
		sPostString+=sKey+(aPostVars[sKey]?'='+aPostVars[sKey]:'')+'&'; 
      }
	  // remove the trailing &
	  // alert(sPostString.slice(0,-1)+'\n'+sPostString.slice(80,-1)+'\n'+sPostString.slice(160,-1));
	  return sPostString.slice(0,-1);
	}
		
	var oReq=false;	
	if(window.XMLHttpRequest && !(window.ActiveXObject)) {
	  try {
	    oReq = new XMLHttpRequest();
	  } catch(e) {
		  oReq = false;
	  }
	  // branch for IE/Windows ActiveX version
	 } else if(window.ActiveXObject) {
	   try {
	     oReq = new ActiveXObject("Msxml2.XMLHTTP");
	   } catch(e) {
	     try {
	       oReq = new ActiveXObject("Microsoft.XMLHTTP");
	     } catch(e) {
	       oReq = false;
	     }
		}
	}
	
  if(!oReq) return null;
	oReq.onreadystatechange=fComplete;
	oReq.open('POST',sURL,true);
	if (aPostVars) oReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	oReq.send(fPostString());
	this.xml_http_request=oReq;
}

function fPopup(sLocation, iWidth, iHeight, sCaption) {
	function fShowPopup(sResponseText, sResponseXML, bResult) {
	  function fCentralise() {
	  	try {
  	    // top bottom
  	    var iParentHeight=oPopup.offsetParent.offsetHeight;
  	    var iTop=Math.round((iParentHeight-oPopup.offsetHeight)/2);
  	    if (iTop<0) iTop=0; // position at the top if the dialog is taller than the available screen space  	    
  	    oPopup.style.top=iTop+'px';  // use a margin to vertically position
  	      
  	    // left right
  	    var iParentWidth=oPopup.offsetParent.offsetWidth;
  	    var iLeft=Math.round((iParentWidth-oPopup.offsetWidth)/2);
  	    if (iLeft<0) iLeft=0; // position at the top if the dialog is taller than the available screen space  	    
  	    oPopup.style.left=iLeft+'px';  // use a margin to vertically position
  	       	      
  	    oPopup.style.visibility='visible';
  	  } 
  	  catch(e) {
  	    // don't do anything!
  	  }
  	  finally {
  	    //  maintain the central position by running again if the window is resized
  	    // IE isn't really happy with this and really slows down...
  	    //  if(top.addEventListener) top.addEventListener('resize',fCentralise,false);
  	    //  else top.attachEvent('onresize',fCentralise);
  	  }
	  }
	  
	  function fClose() {
	  	// hide any object elements because they show through :(
		  for(var i=0;i<document.getElementsByTagName('OBJECT').length;i++) {
		  	var oObject=document.getElementsByTagName('object')[i];
		  	if(oObject.getAttribute('hiddenByPopup')==true) {
		  	  oObject.removeAttribute('hiddenByPopup');
		  	  oObject.setAttribute('className','obj_visible');		  	  
		  	  oObject.setAttribute('class','obj_visible');
		  	}
		  }
	  	
	  	oBody.removeChild(oPopup);
	  	oBody.removeChild(oBlocker);
	  }
	  		
	  if(bResult!=true) {
	  	alert('unable to load content\nplease try again');
	  	oBody.removeChild(oBlocker);
		  for(var i=0;i<document.getElementsByTagName('OBJECT').length;i++) {
		  	var oObject=document.getElementsByTagName('object')[i];
		  	if(oObject.getAttribute('hiddenByPopup')==true) {
		  	  oObject.removeAttribute('hiddenByPopup');
		  	  oObject.setAttribute('className','obj_visible');		  	  
		  	  oObject.setAttribute('class','obj_visible');
		  	}
		  }	  	
	  	return;
	  }		
	  		
		var oPopup=document.createElement('div');
		oPopup.setAttribute('id','popup');
		
		if(sCaption) {
			var oCaption=document.createElement('div');
			oCaption.setAttribute('id','caption');
			oCaption.appendChild(document.createTextNode(sCaption));
			oPopup.appendChild(oCaption);
		}
		
		var oContent=document.createElement('div');
		oContent.setAttribute('id','content');
		oContent.innerHTML=sResponseText;
		oPopup.appendChild(oContent);
		
		var oCloser=document.createElement('a');
		oCloser.setAttribute('id','closer');
		oCloser.setAttribute('href','#');
		oCloser.appendChild(document.createTextNode('close x'));
  	if(oCloser.addEventListener) oCloser.addEventListener('click',fClose,false);
  	else oCloser.attachEvent('onclick',fClose);
		oPopup.appendChild(oCloser);
		
		if(iWidth) oPopup.style.width=iWidth+'px';
		if(iHeight) oPopup.style.height=iHeight+'px';
		
		oBody.appendChild(oPopup);
		fCentralise();
	}

  var oBlocker=document.createElement('div');
  oBlocker.setAttribute('id','blocker');
  
  var oBody=document.getElementsByTagName('body')[0];
  oBody.appendChild(oBlocker);
  
  // hide any object elements because they show through :(
  for(var i=0;i<document.getElementsByTagName('OBJECT').length;i++) {
  	document.getElementsByTagName('object')[i].setAttribute('hiddenByPopup',true);
  	document.getElementsByTagName('object')[i].setAttribute('className','obj_hidden');		  	  
		document.getElementsByTagName('object')[i].setAttribute('class','obj_hidden');
  }
  
  var oReq=new fHTTPRequest(sLocation,new Array(),fShowPopup);  
}

function fSetCompatMode() {
	// detect IE versions <IE6
	if (document.all && !(document.compatMode)) {
		// document.all detects IE  document.compatMode detects IE6+
		document.getElementsByTagName('body')[0].setAttribute('className','compat_ltIE6');
	}
}