var sitefilm1 = 0;
var sitefilm2 = 0;
var colorChangeId;
var changeId;
var output;
var profileImg = 1;

function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}

function displayResult()
{

if (window.ActiveXObject)
	{
//	alert('Internet Explorer');
	var xml = new ActiveXObject("Microsoft.XMLDOM"); 
	var xslt = new ActiveXObject("Microsoft.XMLDOM");
	xml.async = false;
	xslt.async = false;
	xml.load("indhold_u01.xml");
	xslt.load("frontpage.xsl");
	
	var output = xml.transformNode(xslt);
	
	var outputDiv = document.getElementById("Output");
	outputDiv.innerHTML = output;
	}

else   
	{
//	alert('FireFox');
	xml=loadXMLDoc("indhold_u01.xml");
	xsl=loadXMLDoc("frontpage.xsl");
	xsltProcessor=new XSLTProcessor();
	xsltProcessor.importStylesheet(xsl);
	
	output = xsltProcessor.transformToFragment(xml,document);
	
	document.getElementById("Output").appendChild(output);

	}
}

function change(changeId)
{

if (window.ActiveXObject)
	{
//	alert('Internet Explorer :' + changeId);
	var xml = new ActiveXObject("Microsoft.XMLDOM"); 
	var xslt = new ActiveXObject("Microsoft.XMLDOM");
	xml.async = false;
	xslt.async = false;
	xml.load("indhold_u01.xml");
	xslt.load(changeId+".xsl");
	var output = xml.transformNode(xslt);
	var outputDiv = document.getElementById("Output");
	outputDiv.innerHTML = output;
	window.scroll(0,0);
	}

else   
	{
//	alert('Firefox :' + changeId);
	xml=loadXMLDoc("indhold_u01.xml");
	xsl=loadXMLDoc(changeId+".xsl");
	xsltProcessor=new XSLTProcessor();
	xsltProcessor.importStylesheet(xsl);
	
	var noInput = "";
	document.getElementById("Output").innerHTML =noInput;
	
	output = xsltProcessor.transformToFragment(xml,document);
	document.getElementById("Output").appendChild(output);
	window.scroll(0,0);	
	}
	
}

function siteFilm1()
{
	
	if ( sitefilm1 == 0 ) {
		sitefilm1 = 1;
		document.getElementById('sitefilm1').src="gfx/error1.gif";	
		}
	
	else {	
		sitefilm1 = 0;
		document.getElementById('sitefilm1').src="gfx/sitefilm2.gif";
	}

}

function siteFilm2()
{
	
	if ( sitefilm2 == 0 ) {
		sitefilm2 = 1;
		document.getElementById('sitefilm2').src="gfx/error2.gif";
		}
	
	else {	
		sitefilm2 = 0;
		document.getElementById('sitefilm2').src="gfx/sitefilm1.gif";
	}

}

function changeCss(colorChangeId)
{

	if (colorChangeId == 'red')
		{
//		alert('red it is');
		document.getElementById('csslink').href = 'css/layoutred.css';
		}

	if (colorChangeId == 'blue')
		{
//		alert('blue it is');
		document.getElementById('csslink').href = 'css/layoutblue.css';
		}		

	if (colorChangeId == 'green')
		{
//		alert('green it is');
		document.getElementById('csslink').href = 'css/layoutgreen.css';
		}		

	if (colorChangeId == 'orange')
		{
//		alert('orange it is');
		document.getElementById('csslink').href = 'css/layoutorange.css';
		}	

}

function changeProfileImg()
{

	if (profileImg == 1)
		{
			document.getElementById('profileHolderImg').src='gfx/profilImg02.jpg';
		}

	if (profileImg == 2)
		{
			document.getElementById('profileHolderImg').src='gfx/profilImg03.jpg';
		}

	if (profileImg == 3)
		{
			document.getElementById('profileHolderImg').src='gfx/profilImg04.jpg';
		}

	if (profileImg == 4)
		{
			document.getElementById('profileHolderImg').src='gfx/profilImg05.jpg';
		}

	if (profileImg == 5)
		{
			document.getElementById('profileHolderImg').src='gfx/profilImg01.jpg';
			profileImg = 0;
		}

profileImg++;

}
