var uid = new Date().getTime();
var flashProxy = new FlashProxy(uid, 'js/JavaScriptFlashGateway.swf'); //change to where the swf you have is located

function closePopUp(){
	//CALL ACTIONSCRIPT
	var obj = parent.window.document.getElementById('popup');
	parent.window.flashProxy.call('closePaper'); //call the doStuff method and send following parameter(s).
	obj.style.display = "none";
	parent.window.document.getElementById('popupframe').src = "";
}

function showPopUp(url){
	document.getElementById('popupframe').src = url;	
	var obj = window.document.getElementById('popup');
	obj.style.display = "block";
}

//+++++++++++++++++++++++++
// HTTP REQUEST
//+++++++++++++++++++++++++
var xmlhttp = null;

function loadHTMLDoc(url)
{
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  xmlhttp.onreadystatechange=HTMLhttpChange
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=HTMLhttpChange
    xmlhttp.open("GET",url,true)
    xmlhttp.send()
    }
  }
}

function HTMLhttpChange()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
    {
	document.getElementById('content').innerHTML=xmlhttp.responseText;
    	// ...some code here...
    }
  else
    {
    alert("Problem retrieving XML data")
    }
  }
}
function closeWindow() {
	window.open('','_parent','');
	window.close();
}