function createXMLHttpRequest() {
	try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
	try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
	try { return new XMLHttpRequest(); } catch (e) {}
	alert("XMLHttpRequest not supported");
	return null;
}

function what(nameofpage, nameofdiv) {

var xhreq =  createXMLHttpRequest();

xhreq.onreadystatechange = function() {
 if (xhreq.readyState==4) {
  if (xhreq.status==200) {
   document.getElementById(nameofdiv).innerHTML = xhreq.responseText;
               //document.getElementById("footer").style.display = "none";
  }
  else {
   alert("AJAX call returned an error");
               //alert(xhreq.status);
  }
 }
}

// xhreq.open("GET", "http://www.pollster.com/blogs/remote.php?nameofpage=" + nameofpage, true);
xhreq.open("GET", nameofpage, true);
xhreq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhreq.send(null);
}


function what2(nameofpage2, nameofdiv2) {

var xhreq =  createXMLHttpRequest();

xhreq.onreadystatechange = function() {
 if (xhreq.readyState==4) {
  if (xhreq.status==200) {
   document.getElementById(nameofdiv2).innerHTML = xhreq.responseText;
               //document.getElementById("footer").style.display = "none";
  }
  else {
   alert("AJAX call returned an error");
               //alert(xhreq.status);
  }
 }
}

// xhreq.open("GET", "http://www.pollster.com/blogs/remote.php?nameofpage=" + nameofpage, true);
xhreq.open("GET", nameofpage2, true);
xhreq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhreq.send(null);
}


 
function insertChart(chart,w,h)
{
	document.write('<object id="voxpop" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="' + w + '" height="' + h + '">'
	    + '<param name="movie" value="' + chart + '" />'
		+ '<param name="quality" value="high" />'
		+ '<param name="allowScriptAccess" value="sameDomain" />'		
	    + '<embed  class="flashClass" src="' + chart + '" quality="high" '
	    + 'quality="high" width="' + w + '" height="' + h + '"'		
	    + 'allowScriptAccess="sameDomain"'
	    + 'type="application/x-shockwave-flash"'
	    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
	    + '<\/embed>'
	    + '<\/object>');							
}
