﻿var xmlhttp;

    function loadXMLDoc(url)
    {
    xmlhttp=null;
    if (window.XMLHttpRequest)
      {// code for IE7, Firefox, Mozilla, etc.
        xmlhttp=new XMLHttpRequest();
      }
    else if (window.ActiveXObject)
        {// code for IE5, IE6
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    if (xmlhttp!=null)
      {
          xmlhttp.onreadystatechange=onResponse;
          xmlhttp.open("GET",url,true);
          xmlhttp.send(null);
      }
    else
      {
          alert("Your browser does not support XMLHTTP.");
      }
    }

    function onResponse()
    {
        if(xmlhttp.readyState!=4) return;
        if(xmlhttp.status!=200)
        {
            alert("Problem retrieving XML data");
            return;
        }
        txt="";
        x=xmlhttp.responseXML.documentElement.getElementsByTagName("Project");
        for (i=0;i<x.length;i++)
          {
            xx=x[i].getElementsByTagName("Title");
            {
                try
                  {
                    txt=txt + "<div id=\"projectinfo1\"><div class=\"projecttitle\"><font color=\"#146482\">Title:</font></div><div class=\"projecttitle2\">" + xx[0].firstChild.nodeValue + "</div>";
                  }
                catch (er)
                  {
                    txt=txt + "<div id=\"projectinfo1\"><div class=\"projecttitle\">&nbsp;</div><div class=\"projecttitle2\">&nbsp;</div>";
                  }
            }
            xx=x[i].getElementsByTagName("What");
            {
                try
                  {
                    txt=txt + "<div class=\"projectwhat\"><font color=\"#146482\">What:</font></div><div class=\"projectwhat2\">" + xx[0].firstChild.nodeValue + "</div></div>";
                    txt=txt + "<div class=\"divider\"></div>";
                  }
                catch (er)
                  {
                    txt=txt + "<div class=\"projectwhat\">&nbsp;</div><div class=\"projectwhat2\">&nbsp;</div></div>";
                  }
            }
            xx=x[i].getElementsByTagName("Client");
            {
                try
                  {
                    txt=txt + "<div id=\"projectinfo2\"><div class=\"projectclient\"><font color=\"#146482\">Client:</font></div><div class=\"projectclient2\">" + xx[0].firstChild.nodeValue + "</div>";
                  }
                catch (er)
                  {
                    txt=txt + "<div id=\"projectinfo2\"><div class=\"projectclient\">&nbsp;</div><div class=\"projectclient2\">&nbsp;</div>";
                  }
            }
            xx=x[i].getElementsByTagName("Role");
            {
                try
                  {
                    txt=txt + "<div class=\"projectrole\"><font color=\"#146482\">Role:</font></div><div class=\"projectrole2\">" + xx[0].firstChild.nodeValue + "</div></div>";
                    txt=txt + "<div class=\"divider\"></div>";
                  }
                catch (er)
                  {
                    txt=txt + "<div class=\"projectrole\">&nbsp;</div><div class=\"projectrole2\">&nbsp;</div></div>";
                  }
            }
            xx=x[i].getElementsByTagName("Extra");
            {
                try
                  {
                    txt=txt + "<div id=\"projectinfo3\"><div class=\"projectextra\"><font color=\"#146482\">Extra:</font></div><div class=\"projectextra2\">" + xx[0].firstChild.nodeValue + "</div>";
                  }
                catch (er)
                  {
                    txt=txt + "<div id=\"projectinfo3\"><div class=\"projectextra\">&nbsp;</div><div class=\"projectextra2\"></div>";
                  }
            }
            xx=x[i].getElementsByTagName("Extra2");
            {
                try
                  {
                    txt=txt + "<div class=\"projectextraline\"><font color=\"#146482\">&nbsp;</font></div><div class=\"projectextraline2\">" + xx[0].firstChild.nodeValue + "<br/>";
                  }
                catch (er)
                  {
                    txt=txt + "<div class=\"projectextraline\">&nbsp;</div><div class=\"projectextraline2\"></div></div>";
                  }
            }
            document.getElementById('ProjectInfoFooter').innerHTML=txt;
        }
   }
   function clearinfo()
   {
       document.getElementById('ProjectInfoFooter').innerHTML="";
   }
   //Player

	function deletePlayer(theWrapper, thePlaceholder, thePlayerId) {
			swfobject.removeSWF(thePlayerId);
			var tmp=document.getElementById(theWrapper);
			if (tmp) { tmp.innerHTML = "<div id=" + thePlaceholder + "></div>"; }
	}


	function createPlayer(thePlaceholder, thePlayerId, theFile) {
			var flashvars = {
					file:theFile,
					autostart:"false",
					controlbar:"over",
					skin:"http://www.mtime.nl/swf/inverted4.swf",
					logo:"http://www.mtime.nl/i/hoekie.png"
			}
			var params = {
					allowfullscreen:"true",
					allowscriptaccess:"always"
			}
			var attributes = {
					id:thePlayerId,
					name:thePlayerId
			}
			swfobject.embedSWF("swf/player.swf", thePlaceholder, "720", "428", "9.0.115", false, flashvars, params, attributes);
	}


	function initPlayer(theFile) {
			deletePlayer('wrapper1', 'placeholder1', 'player1');
			createPlayer('placeholder1', 'player1', theFile);
	}
// Image Swap
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_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_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];}
}




