// --------------

var XmlHttp; 
function initXmlHttp(requestUrl) 
{
	w = window;
	if (w.XMLHttpRequest) 
	{
		XmlHttp = new XMLHttpRequest();
	}
	else if (w.ActiveXObject) 
	{
		XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	// If browser supports XMLHTTPRequest object
	if(XmlHttp)
	{
		//Setting the event handler for the response
		XmlHttp.onreadystatechange = HandleXmlHttp;
		
		//Initializes the request object with GET (METHOD of posting), 
		//Request URL and sets the request as asynchronous.
		XmlHttp.open("GET", requestUrl,  true);
		
		//Sends the request to server
		XmlHttp.send(null);		
	}
}
	  

//Called when response comes back from server
function HandleXmlHttp()
{
	// To make sure receiving response data from server is completed
	if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp.status == 200)
		{						
			XmlonLoadHandler(XmlHttp.responseText)
			// XmlonLoadHandler(XmlHttp.responseXML)
		}
		else
		{
			XmlonLoadHandler("<!--There was a problem retrieving data from the server.-->")
			// alert("There was a problem retrieving data from the server.");
		}
	}
}
// --------------

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
} 

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function DoPopUp(psURL,psName,piwidth,piheight,piScroll){
	window.open(psURL,psName,'directories=no,height=' + piheight + ',location=no,menubar=no,resizable=no,scrollbars=' +piScroll+ ',status=no,toolbar=no,width=' + piwidth);}

function FTVlaunch(video){
	DoPopUp('http://www.iex.nl/FTV/ClickTrackerFTV.asp?id='+video,'FTVIEX',665,430);
}

function switchIndicesChart(iNewInstrumentID) {
	oImg = document.getElementById('imgSmallChart');
	oImg.src=oImg.src.replace(oImg.name,iNewInstrumentID);
	oImg.name=iNewInstrumentID;
} 

function ClickIndicesChart() {
	window.location = "/stocks/stocks_detail.asp?iId=" + document.getElementById('imgSmallChart').name;
}

function sitestat(ns_l){ns_l+='&amp;ns__t='+(new Date()).getTime();ns_pixelUrl=ns_l;
	ns_0=document.referrer;
	ns_0=(ns_0.lastIndexOf('/')==ns_0.length-1)?ns_0.substring(ns_0.lastIndexOf('/'),0):ns_0;
	if(ns_0.length>0)ns_l+='&amp;ns_referrer='+escape(ns_0);
	if(document.images){ns_1=new Image();ns_1.src=ns_l;}else
	document.write('<img src="'+ns_l+'" width="1" height="1" alt="">');}
