/*function position(){
  h1 = document.getElementById("div1").offsetHeight;
  h2 = document.getElementById("div2").offsetHeight;
  h3 = document.getElementById("div3").offsetHeight;
  h4 = document.getElementById("div4").offsetHeight;
  h5 = document.getElementById("div5").offsetHeight;
  h6 = document.getElementById("div6").offsetHeight;

  document.getElementById("div1").style.top = h6+"px";
	h345=h3+h4+h5+h6;
  document.getElementById("div2").style.top = h345+"px";
	h26=h6-h2;
  document.getElementById("div3").style.top = h26+"px";
	h56=h5+h6-h2;
  document.getElementById("div4").style.top = h56+"px";
	h246=h2+h4-h6;
  document.getElementById("div5").style.top = -h246+"px";
	h12345=h1+h2+h3+h4+h5;
  document.getElementById("div6").style.top = -h12345+"px";
}*/

function popupChart(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=400,screenX=150,screenY=150,top=150,left=150')
}

var flashinstalled = 0;
var flashversion = 0;
if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		flashinstalled = 1;
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		flashversion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else
	for(var i=7; i>0; i--){
		flashVersion = 0;
		try{
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			flashVersion = i;
      flashinstalled = 2;
      break;
		}
		catch(e){
		}
	}

	    function makeRequest(url) {

        var http_request = false;
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

        http_request.onreadystatechange = function() { alertContents(http_request); };
        http_request.open('GET', url, true);
    		http_request.send(null);
    }

    function alertContents(http_request) {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {

                
                var xmlDoc = http_request.responseXML.documentElement;
                try {
                  document.getElementById('flash_destination').innerHTML += '<a href="' +  xmlDoc.childNodes[1].childNodes[0].childNodes[0].attributes[0].value + '"><img src="' + xmlDoc.childNodes[0].childNodes[0].attributes[0].value + '" border="0" /></a>';
                } catch (e) {
                }
            }
        }
        
    }
