// JavaScript Document
var xmlHttp = createXmlHttpRequestObject(); 

// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject() 
{	
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // if running Internet Explorer
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // if running Mozilla or other browsers
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // return the created object or display an error message
  if (!xmlHttp)
 
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}


function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }

    return vars;
}

function ReinitializeAddThis(){
      if (window.addthis){
         window.addthis.ost = 0;
         window.addthis.ready();
      }
   }



function handleServerResponse4(dText, whatUID, whatObj) 
{
  if (xmlHttp.readyState == 4) 
  {
	if (xmlHttp.status == 200) 
    {
		var xmlResponse = xmlHttp.responseXML;
		  
		if(!xmlResponse || !xmlResponse.documentElement)
		{
			throw("Invalid XML structure:\n" + xmlHttp.responseText);  
		}
		  
		var rootNodeName=xmlResponse.documentElement.nodeName;
		  
		if(rootNodeName == "parserror")
		{
			throw("Invalid XML structure");
		}
	  	xmlRoot=xmlResponse.documentElement;		
		
		
		var titleArray1 = xmlRoot.getElementsByTagName("obj1");
		var helloMessage1=titleArray1.item(0).firstChild.data;	
		dText.innerHTML = helloMessage1;
		
				
		var titleArray4 = xmlRoot.getElementsByTagName("obj4");
		var helloMessage4=titleArray4.item(0).firstChild.data;
		
		var hashes = window.location.href;
		
		//alert(hashes);
		
		window.location.hash = helloMessage4 + "|" + whatUID + "|" + whatObj.id;
		
		ReinitializeAddThis();
		

		if(xmlRoot.getElementsByTagName("obj2").length>0)
		{
			var titleArray2 = xmlRoot.getElementsByTagName("obj2");
			var helloMessage2=titleArray2.item(0).firstChild.data;	
			prodid=helloMessage2;
		}
		
		if(xmlRoot.getElementsByTagName("obj3").length>0)
		{
			var titleArray3 = xmlRoot.getElementsByTagName("obj3");
			var helloMessage3=titleArray3.item(0).firstChild.data;	
			if(document.getElementById("theDiv2"))
			{
				document.getElementById("theDiv2").innerHTML=helloMessage3;
			}
		}
		//if(xmlRoot.getElementsByTagName("obj4"))
		//{
			
		//}
		//alert(prodid);
		if(document.getElementById("shareButtonsDown"))
		{
			document.getElementById("shareButtonsDown").style.display = "block";
		}
		
    } 
    else 
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}


function handleServerResponse41(dText, whatUID, whatObj, preHash) 
{
  if (xmlHttp.readyState == 4) 
  {
	if (xmlHttp.status == 200) 
    {
		var xmlResponse = xmlHttp.responseXML;
		  
		if(!xmlResponse || !xmlResponse.documentElement)
		{
			throw("Invalid XML structure:\n" + xmlHttp.responseText);  
		}
		  
		var rootNodeName=xmlResponse.documentElement.nodeName;
		  
		if(rootNodeName == "parserror")
		{
			throw("Invalid XML structure");
		}
	  	xmlRoot=xmlResponse.documentElement;
		
			
		var titleArray1 = xmlRoot.getElementsByTagName("obj1");
		var helloMessage1=titleArray1.item(0).firstChild.data;	
		dText.innerHTML = helloMessage1;
		
				
		var titleArray4 = xmlRoot.getElementsByTagName("obj4");
		var helloMessage4=titleArray4.item(0).firstChild.data;
		
		window.location.hash = preHash + helloMessage4 + "|" + whatUID + "|" + whatObj.id;

		if(xmlRoot.getElementsByTagName("obj2"))
		{
			var titleArray2 = xmlRoot.getElementsByTagName("obj2");
			var helloMessage2=titleArray2.item(0).firstChild.data;	
			prodid=helloMessage2;
		}
		if(xmlRoot.getElementsByTagName("obj3"))
		{
			var titleArray3 = xmlRoot.getElementsByTagName("obj3");
			var helloMessage3=titleArray3.item(0).firstChild.data;	
			if(document.getElementById("theDiv2"))
			{
				document.getElementById("theDiv2").innerHTML=helloMessage3;
			}
		}
		//if(xmlRoot.getElementsByTagName("obj4"))
		//{
			
		//}
		//alert(prodid);
		
    } 
    else 
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}


function handleServerResponse4List(targetpage, whatUID, dText, maxListItem, whatObj, addHash1, addHash2, addHash3) 
{
  if (xmlHttp.readyState == 4) 
  {
	if (xmlHttp.status == 200) 
    {
		var xmlResponse = xmlHttp.responseXML;
		  
		if(!xmlResponse || !xmlResponse.documentElement)
		{
			throw("Invalid XML structure:\n" + xmlHttp.responseText);  
		}
		prodid1=0;
		  
		var rootNodeName=xmlResponse.documentElement.nodeName;
		  
		if(rootNodeName == "parserror")
		{
			throw("Invalid XML structure");
		}
	  	xmlRoot=xmlResponse.documentElement;		
		
		var titleArray10 = xmlRoot.getElementsByTagName("obj10");
		var helloMessage10=titleArray10.item(0).firstChild.data;	
		
		var titleArray1 = xmlRoot.getElementsByTagName("obj1");
		var helloMessage1=titleArray1.item(0).firstChild.data;	
		dText.innerHTML = helloMessage1 + helloMessage10;
		
				
		var titleArray4 = xmlRoot.getElementsByTagName("obj4");
		var helloMessage4=titleArray4.item(0).firstChild.data;
		window.location.hash = helloMessage4 + "|" + whatUID + "|" + whatObj.id + "|" + addHash1 + "|" + addHash2 + "|" + addHash3;
		
		var titleArray5 = xmlRoot.getElementsByTagName("obj5");
		var helloMessage5=titleArray5.item(0).firstChild.data;
		whatUID1=helloMessage5;
		
		var preHash = helloMessage4 + "|" + whatUID + "|" + whatObj.id + "|"; 
		
		
		goToa4Ajax41(whatUID, addHash2, "gymnasiumTextBlock4FAQ", maxListItem, document.getElementById(addHash3), preHash);

		if(xmlRoot.getElementsByTagName("obj2"))
		{
			var titleArray2 = xmlRoot.getElementsByTagName("obj2");
			var helloMessage2=titleArray2.item(0).firstChild.data;	
			prodid=helloMessage2;
		}
		
		
			
    } 
    else 
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}

function goToNewsAjax(whatUID, objText, maxListItem, whatObj, newsCat)
{
	var folderpath="fileadmin/template/main/php/";

	for(var i=0; i<maxListItem; i++)
	{
		if(document.getElementById("nList" + i))
		{
			revertColorBlock(document.getElementById("nList" + i));
		}
	}	
	changeColorBlock(whatObj);
	
	if(document.getElementById(objText))
	{
		var divObjText = document.getElementById(objText);
	}
		
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{			
		var date = new Date();
		var timestamp = date.getTime();

		xmlHttp.open("GET", folderpath + "NewsShow_xml.php?id=" + whatUID + "&newscat=" + newsCat + "&time=" + timestamp, true);
		// define the method to handle server responses
		xmlHttp.onreadystatechange =function()
		{
			handleServerResponse4(divObjText, whatUID, whatObj);
		}
		
		// make the server request
		xmlHttp.send(null);
	 }		
}


function goToNewsAjax1(maxP, arrIDString, prodidTemp, way, divID, listObj, newsCat)
{
	//maxP=parseInt(maxP);
	
	var arrID=new Array;
	arrID=arrIDString.split(",");
		
	if(typeof(prodid)=='undefined')
	{
		//prodid=parseInt(prodidTemp);
		prodid=prodidTemp;
	}	
	
	if(way=='next')
	{
		prodid++;
	}
	if(way=='prev')
	{
		prodid--;
	}
	
	if(prodid-maxP==0)
	{
		prodid=0;
	}
	if(prodid==-1)
	{
		prodid=maxP-1;
	}	
	if(document.getElementById(listObj + "" + prodid))
	{
		whatObj=document.getElementById(listObj + "" + prodid);
	}
	goToNewsAjax(arrID[prodid], divID, maxP, whatObj, newsCat);
}


function goToa4Ajax(targetpage, whatUID, objText, maxListItem, whatObj)
{
	var folderpath="fileadmin/template/main/php/";

	for(var i=0; i<maxListItem; i++)
	{
		if(document.getElementById("nList" + i))
		{
			document.getElementById("nList" + i).className="bodytext1";
		}
	}	
	whatObj.className="curListItem";
	
	whatCurObjId=whatObj.id.substr(5);
	
	if(document.getElementById(objText))
	{
		var divObjText = document.getElementById(objText);
	}
		
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{			
		var date = new Date();
		var timestamp = date.getTime();

		xmlHttp.open("GET", folderpath + "a4Show_xml.php?id=" + whatUID + "&targetpage=" + targetpage + "&time=" + timestamp, true);
		// define the method to handle server responses
		xmlHttp.onreadystatechange =function()
		{
			handleServerResponse4(divObjText, whatUID, whatObj);
		}
		
		// make the server request
		xmlHttp.send(null);
	 }		
}

function goToa4NFAjax(targetpage, whatUID, objText, maxListItem, whatObj)
{
	var folderpath="fileadmin/template/main/php/";

	for(var i=0; i<maxListItem; i++)
	{
		if(document.getElementById("nList" + i))
		{
			document.getElementById("nList" + i).className="bodytext1";
		}
	}	
	whatObj.className="curListItem";
	
	whatCurObjId=whatObj.id.substr(5);
	
	if(document.getElementById(objText))
	{
		var divObjText = document.getElementById(objText);
	}
		
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{			
		var date = new Date();
		var timestamp = date.getTime();

		xmlHttp.open("GET", folderpath + "a4ShowNF_xml.php?id=" + whatUID + "&targetpage=" + targetpage + "&time=" + timestamp, true);
		// define the method to handle server responses
		xmlHttp.onreadystatechange =function()
		{
			handleServerResponse4(divObjText, whatUID, whatObj);
		}
		
		// make the server request
		xmlHttp.send(null);
	 }		
}



function goToa4Ajax41(targetpage, whatUID, objText, maxListItem, whatObj, preHash)
{
	var folderpath="fileadmin/template/main/php/";

	for(var i=0; i<maxListItem; i++)
	{
		if(document.getElementById("nList" + i))
		{
			document.getElementById("nList" + i).className="bodytext1";
		}
	}	
	whatObj.className="curListItem";
	
	whatCurObjId=whatObj.id.substr(5);
	
	if(document.getElementById(objText))
	{
		var divObjText = document.getElementById(objText);
	}
		
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{			
		var date = new Date();
		var timestamp = date.getTime();

		xmlHttp.open("GET", folderpath + "a4Showfaq_xml.php?id=" + whatUID + "&targetpage=" + targetpage + "&time=" + timestamp, true);
		// define the method to handle server responses
		xmlHttp.onreadystatechange =function()
		{
			handleServerResponse41(divObjText, whatUID, whatObj, preHash);
		}
		
		// make the server request
		xmlHttp.send(null);
	 }		
}

function goToa4FAQListAjax(targetpage, whatUID, objText, maxListItem, whatObj, addHash1, addHash2, addHash3)
{
	var folderpath="fileadmin/template/main/php/";

	for(var i=0; i<maxListItem; i++)
	{
		//document.getElementById("nListFAQ" + i).className="alfabetItem";
	}	
	whatObj.className="alfabetItemCur";
	
	whatCurObjId=whatObj.id.substr(8);
	
	if(document.getElementById(objText))
	{
		var divObjText = document.getElementById(objText);
	}
		
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{			
		var date = new Date();
		var timestamp = date.getTime();

		xmlHttp.open("GET", folderpath + "a4FAQListShow_xml.php?id=" + whatUID + "&targetpage=" + targetpage + "&ordList=" + whatCurObjId + "&time=" + timestamp, true);
		// define the method to handle server responses
		xmlHttp.onreadystatechange =function()
		{
			handleServerResponse4List(targetpage, whatUID, divObjText, maxListItem, whatObj, addHash1, addHash2, addHash3);
		}
		
		// make the server request
		xmlHttp.send(null);
	 }		
}



function goToa4Ajax1(targetpage, maxP, arrIDString, prodidTemp, way, divID, listObj)
{
	maxP=parseInt(maxP);
	
	var arrID=new Array;
	arrID=arrIDString.split(",");
		
	if(typeof(prodid)=='undefined')
	{
		prodid=prodidTemp;
	}	
	
	if(way=='next')
	{
		prodid++;
	}
	if(way=='prev')
	{
		prodid--;
	}
	
	if(prodid==maxP)
	{
		prodid=0;
	}
	if(prodid==-1)
	{
		prodid=maxP-1;
	}	
	if(document.getElementById(listObj + "" + prodid))
	{
		whatObj=document.getElementById(listObj + "" + prodid);
	}
	goToa4Ajax(targetpage, arrID[prodid], divID, maxP, whatObj);
}


function goToa4NFAjax1(targetpage, maxP, arrIDString, prodidTemp, way, divID, listObj)
{
	maxP=parseInt(maxP);
	
	var arrID=new Array;
	arrID=arrIDString.split(",");
		
	if(typeof(prodid)=='undefined')
	{
		prodid=prodidTemp;
	}	
	
	if(way=='next')
	{
		prodid++;
	}
	if(way=='prev')
	{
		prodid--;
	}
	
	if(prodid==maxP)
	{
		prodid=0;
	}
	if(prodid==-1)
	{
		prodid=maxP-1;
	}	
	if(document.getElementById(listObj + "" + prodid))
	{
		whatObj=document.getElementById(listObj + "" + prodid);
	}
	goToa4NFAjax(targetpage, arrID[prodid], divID, maxP, whatObj);
}


function goToa4Ajax41_1(targetpage, maxP, arrIDString, prodidTemp1, way, divID, listObj, preHash)
{
	maxP=parseInt(maxP);
	
	var arrID=new Array;
	arrID=arrIDString.split(",");
		
		
	if(typeof(prodid1)=="undefined")
	{
		prodid1=prodidTemp1;
	}
		
	if(way=='next')
	{
		prodid1++;
	}
	if(way=='prev')
	{
		prodid1--;
	}	
	if(prodid1==maxP)
	{
		prodid1=0;
	}
	if(prodid1==-1)
	{
		prodid1=maxP-1;
	}
	if(document.getElementById(listObj + "" + prodid1))
	{
		whatObj=document.getElementById(listObj + "" + prodid1);
	}
	
	goToa4Ajax41(targetpage, arrID[prodid1], divID, maxP, whatObj, preHash);
}


function goToAnsatteAjax(whatUID, objText, maxListItem, whatObj, curshow)
{
	var folderpath="fileadmin/template/main/php/";

	for(var i=0; i<maxListItem; i++)
	{
		document.getElementById("nList" + i).className="bodytext1";
	}	
	whatObj.className="curListItem";
	
	if(document.getElementById(objText))
	{
		var divObjText = document.getElementById(objText);
	}
		
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{			
		var date = new Date();
		var timestamp = date.getTime();

		xmlHttp.open("GET", folderpath + "ansatteShow_xml.php?id=" + whatUID + "&targetpage=" + curshow + "&time=" + timestamp, true);
		// define the method to handle server responses
		xmlHttp.onreadystatechange =function()
		{
			handleServerResponse4(divObjText, whatUID, whatObj);
		}
		
		// make the server request
		xmlHttp.send(null);
	 }		
}


function goToAnsatteAjax1(maxP, arrIDString, prodidTemp, way, divID, listObj, curshow)
{
	maxP=parseInt(maxP);
	
	var arrID=new Array;
	arrID=arrIDString.split(",");
		
	if(typeof(prodid)=='undefined')
	{
		prodid=prodidTemp;
	}	
	
	if(way=='next')
	{
		prodid++;
	}
	if(way=='prev')
	{
		prodid--;
	}
	
	if(prodid==maxP)
	{
		prodid=0;
	}
	if(prodid==-1)
	{
		prodid=maxP-1;
	}	
	if(document.getElementById(listObj + "" + prodid))
	{
		whatObj=document.getElementById(listObj + "" + prodid);
	}
	goToAnsatteAjax(arrID[prodid], divID, maxP, whatObj, curshow);
}



function clearValue(obj)
{
	if(obj.value=="Skriv søgeord her...")
	{
		obj.value="";
	}
}

function setValue(obj)
{
	if(obj.value=="" || obj.value.length<3)
	{
		obj.value="Skriv søgeord her...";
	}
}

function validateFormSubmit(obj)
{
	curForm=document.getElementsByTagName('form')[0];
	curObj=document.getElementById(obj);
	if(curObj.value=="")
	{
		alert("Search criteria may not be an empty string");
		return false;
	}
	else if(curObj.value.length<3)
	{
		alert("Search word must have at least 3 characters!");
		return false;
	}
	else if(curObj.value!="" && curObj.value.length>=3)
	{
		if(curObj.value=="Skriv søgeord her...")
		{
			alert("You are not provided to use this text as search criteria \"Skriv søgeord her... \" ");
			return false;
		}
		if(curObj.value!="Skriv søgeord her...")
		{
			curForm.submit();
			return true;
		}
	}
}

function changeColorBlock(obj)
{
	var spanObj=obj.getElementsByTagName("span");
	spanObj[1].style.color = "#000000";
}

function revertColorBlock(obj)
{
	var spanObj=obj.getElementsByTagName("span");
	spanObj[1].style.color = "#707070";
}

function closeDivBack(obj, objBack, objDiv, obj1, obj2)
{
	if(typeof(obj)!="undefined")
	{
		obj.style.display="none";
	}
	if(document.getElementById(obj1))
	{
		document.getElementById(obj1).style.display = "block";
	}
	if(document.getElementById(obj2))
	{
		whooleMovieSrc=document.getElementById(obj2).innerHTML;
		document.getElementById(obj2).innerHTML=" ";
		document.getElementById(obj2).className="hideElement";
		
	}
	if(document.getElementById(objBack))
	{
		document.getElementById(objBack).style.display="none";
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==7)
	{
		if(document.getElementById("theDivBackIE7"))
		{
			document.getElementById("theDivBackIE7").style.display="none";
		}
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
	{
		if(document.getElementById("theDivBackIE7"))
		{
			document.getElementById("theDivBackIE7").style.display="none";
		}
	}
	
}

function closeDivBackFilm(obj, objBack, objDiv, obj1, obj2)
{
	if(typeof(obj)!="undefined")
	{
		obj.style.display="none";
	}
	if(document.getElementById(obj1))
	{
		document.getElementById(obj1).style.display = "block";
	}
	if(document.getElementById(obj2))
	{
		whooleMovieSrc=document.getElementById(obj2).innerHTML;
		document.getElementById(obj2).innerHTML=" ";
		document.getElementById(obj2).className="hideElement";
		
	}
	if(document.getElementById(objBack))
	{
		document.getElementById(objBack).style.display="none";
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==7)
	{
		if(document.getElementById("theDivBackIE7"))
		{
			document.getElementById("theDivBackIE7").style.display="none";
		}
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
	{
		if(document.getElementById("theDivBackIE7"))
		{
			document.getElementById("theDivBackIE7").style.display="none";
		}
	}
	
}


function closeDivBackFromFlash(objBack, objDiv)
{
	if(document.getElementById(objBack))
	{
		document.getElementById(objBack).style.display="none";
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==7)
	{
		if(document.getElementById("theDivBackIE7"))
		{
			document.getElementById("theDivBackIE7").style.display="none";
		}
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
	{
		if(document.getElementById("theDivBackIE7"))
		{
			document.getElementById("theDivBackIE7").style.display="none";
		}
	}
	if(document.getElementById(objDiv))
	{
		document.getElementById(objDiv).style.zIndex=4; 
	}
}

function createElforIE7()
{
	if(document.getElementById("main"))
	{
		if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
		{
			if(!document.getElementById("shadowTopIE6"))
			{
				var st = document.createElement("div");
				st.id = "shadowTopIE6";	
				st.className = "shadowTop";
			}
			if(document.getElementById("shadowTopIE6"))
			{
				st = document.getElementById("shadowTopIE6");
			}
			document.getElementById("main").insertBefore(st, document.getElementById("main").firstChild);			
			
			var curHeight=document.getElementById("main").offsetHeight;
			if(document.getElementById("body_1"))
			{
				document.getElementById("body_1").style.height=curHeight + "px";
			}
			else if(document.getElementById("body_2"))
			{
				document.getElementById("body_2").style.height=curHeight + "px";
			}
			if(document.getElementById("theDivBackIE7"))
			{
				//document.getElementById("theDivBackIE7").style.display = "block";				
				document.getElementById("theDivBackIE7").style.height = (curHeight-47) + "px";
				document.getElementById("theDivBackIE7").onmousedown=function()
				{
					closeDivBack(document.getElementById('imgBtnClose'), 'theDivBack', 'fotoGallery');
				}
			}
			if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
			{
				//IE 6+ in 'standards compliant mode'
				var myWidth = document.documentElement.clientWidth;
				var myHeight = document.documentElement.clientHeight;
				if(document.getElementById("theDivBack"))
				{
					document.getElementById("theDivBack").style.height = myHeight + "px";
					if(document.getElementById("body_1"))
					{
						document.getElementById("body_1").style.height = myHeight + "px";
					}
					else if(document.getElementById("body_2"))
					{
						document.getElementById("body_2").style.height = myHeight + "px";
					}
				}
			} 
		}
		if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==7)
		{
			if(document.getElementById("theDivBackIE7"))
			{
				document.getElementById("theDivBackIE7").onmousedown=function()
				{
					closeDivBack(document.getElementById('imgBtnClose'), 'theDivBack', 'fotoGallery');
				}
			}
		}
	}	
}





function startEffectionPlayer1(obj)
{
	if(document.getElementById(obj))
	{
		var curObj=document.getElementById(obj);
			
		curObj.style.display = "block";
		if(typeof(whooleMovieSrc)!="undefined")
		{
			curObj.innerHTML=whooleMovieSrc;			
		}
		
		var _main = document.getElementById('main');
		_main.style.zIndex=30;
		_main.style.overflow="visible";
		//_main.style.position="absolute";
					
		if(!document.getElementById("theDivBack"))
		{
			var d = document.createElement("div");
			d.id = "theDivBack";			
		}
		if(document.getElementById("theDivBack"))
		{
			d = document.getElementById("theDivBack");
		}
		_main.insertBefore(d, _main.firstChild);
		
		
		if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
		{
			doResizeC();
		}
			
		d.onmousedown=function()
		{
				var flash = document.getElementById("flvImgSlide");
				flash.closeTheMovie();
		}
		
		
					
		
	
	}
}




function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
     return document[movieName];
}

function showDivFromFlash()
{
	if(document.getElementById("effectionDiv1"))
	{
		ed = document.getElementById("effectionDiv1");
		ed.style.backgroundColor = "#ffffff";
	}
	if(document.getElementById("effectionDiv"))
	{
		ed = document.getElementById("effectionDiv");
		ed.style.backgroundColor = "#ffffff";
	}
	if(document.getElementById("theDivBack"))
	{
		d = document.getElementById("theDivBack");
		d.style.display = "block";
	}	
}

function hideDivFromFlash()
{
	if(document.getElementById("effectionDiv1"))
	{
		ed = document.getElementById("effectionDiv1");
		ed.style.backgroundColor = "transparent";
		if(BrowserDetect.browser=="Explorer")
		{
			ed.style.left = 20 + "px";
		}
	}
	if(document.getElementById("effectionDiv"))
	{
		ed = document.getElementById("effectionDiv");
		ed.style.backgroundColor = "transparent";
	}
	if(document.getElementById("theDivBack"))
	{
		d = document.getElementById("theDivBack");
		d.style.display = "none";
	}	
	
}

function startEffectionPlayer(obj, isHidden)
{
	if(document.getElementById(obj))
	{
		var curObj=document.getElementById(obj);
		curObj.style.display = "none";
		whooleMovieSrc=curObj.innerHTML;
		curObj.innerHTML=" ";		
		
	}
}

function overList(objS, bClassCheck, bClass)
{
	if(objS.className==bClassCheck)
	{
		objS.className=bClassCheck;
	}
	else if(objS.className == "bodytext1")
	{
		objS.className=bClass;
	}
}

function outList(objS, bClassCheck, bClass)
{	
	if(objS.className==bClassCheck)
	{
		objS.className=bClassCheck;
	}
	else if(objS.className == bClass)
	{
		objS.className="bodytext1";
	}
}


function overListFAQ(objS, bClassCheck, bClass)
{
	if(objS.className==bClassCheck)
	{
		objS.className=bClassCheck;
	}
	else if(objS.className == "alfabetItem")
	{
		objS.className=bClass;
	}
}

function outListFAQ(objS, bClassCheck, bClass)
{	
	if(objS.className==bClassCheck)
	{
		objS.className=bClassCheck;
	}
	else if(objS.className == bClass)
	{
		objS.className="alfabetItem";
	}
}



function startFilmReal(obj1, obj2, obj2Show, divGallery, obj1Show)
{
	if(document.getElementById(obj1))
	{
		document.getElementById(obj1).style.display = "none";
	}
	if(document.getElementById(obj2))
	{
		document.getElementById(obj2).className="showElement";
		if(typeof(whooleMovieSrc)!="undefined")
		{
			document.getElementById(obj2).innerHTML=whooleMovieSrc;
		}
	}
	if(document.getElementById(divGallery))
	{
		document.getElementById(divGallery).style.zIndex=210;
	}
	if(document.getElementById(obj1Show))
	{
		document.getElementById(obj1Show).style.display="block";
	}
	var _main = document.getElementById('main');
	_main.style.zIndex=30;
	_main.style.overflow="visible";
	//_main.style.position="absolute";
				
	if(!document.getElementById(obj2Show))
	{
		var d = document.createElement("div");
		d.id = obj2Show;			
	}
	if(document.getElementById(obj2Show))
	{
		d = document.getElementById(obj2Show);
	}
	_main.insertBefore(d, _main.firstChild);
	d.style.display = "block";
	
	
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
	{
		doResizeC();
	}
		
	d.onmousedown=function()
	{
		//if(typeof(intervalDivBack)!="undefined") window.clearInterval(intervalDivBack);
		closeDivBackFilm(document.getElementById(obj1Show), obj2Show, divGallery, obj1, obj2);
	}
}


function doResizeC()
{
	if(document.getElementById("theDivBack"))
	{
		intervalDivBack=window.setInterval(resizeContiniousC, 1);		
	}	
}

function resizeContiniousC()
{
	scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;

	
	dHeight=document.body.clientHeight>document.getElementsByTagName('html')[0].offsetHeight ? document.body.clientHeight : document.getElementsByTagName('html')[0].offsetHeight;
	dWidth=document.body.clientWidth>document.getElementsByTagName('html')[0].offsetWidth ? document.body.clientWidth : document.getElementsByTagName('html')[0].offsetWidth;
	
	dWidth = document.documentElement.clientWidth;
    dHeight = document.documentElement.clientHeight;

	
	if(scrOfY>0)
	{
		dHeight +=scrOfY;
	}
	if(scrOfX>0)
	{
		dWidth +=scrOfX;
	}
	
	
		//alert(myHeight + " + " + scrOfY + " = " + dHeight);
		//alert(dHeight);
		d=document.getElementById("theDivBack");
		d.style.left = (document.getElementById("main").offsetLeft * -1) + "px";
		d.style.height = dHeight + "px";
		d.style.width = dWidth + "px";
}


function fPrintCont()
{
	if(document.getElementById("gymnasiumDefaultContent2"))
	{
		contDiv1=document.getElementById("gymnasiumDefaultContent2");
		contDiv="<div id='printArea'><div id='gymnasiumDefaultContent2'>" + contDiv1.innerHTML + "</div></div>";
		winFinal=396;
	}
	else if(document.getElementById("newsShow"))
	{
		contDiv1=document.getElementById("theDiv2");
		contDiv2=document.getElementById("theDiv3");
		contDiv="<div id='printArea'><div id='theDiv2'>" + contDiv1.innerHTML + "</div><div id='theDiv3'>" + contDiv2.innerHTML + "</div></div>";
		winFinal=399;
	}
	else if(document.getElementById("gymnasiumDefaultContent3"))
	{
		contDiv1=document.getElementById("gymnasiumDefaultContent3");
		contDiv="<div id='printArea'><div id='gymnasiumDefaultContent3'>" + contDiv1.innerHTML + "</div></div>";
		if(document.getElementById("gymnasiumTextBlock"))
		{
			contDiv2=document.getElementById("gymnasiumTextBlock");
			contDiv="<div id='printArea'><div id='gymnasiumDefaultContent3'>" + contDiv1.innerHTML + "</div><div id='gymnasiumTextBlock'>" + contDiv2.innerHTML + "</div></div>";
		}
		winFinal=710;
	}
	else if(document.getElementById("gymnasiumDefaultContent4"))
	{
		contDiv1=document.getElementById("gymnasiumDefaultContent4");
		contDiv="<div id='printArea'><div id='gymnasiumDefaultContent4'>" + contDiv1.innerHTML + "</div></div>";
		if(document.getElementById("gymnasiumTextBlock4"))
		{
			contDiv2=document.getElementById("theDiv1");
			contDiv="<div id='printArea'><div id='gymnasiumDefaultContent4'>" + contDiv1.innerHTML + "</div><div id='gymnasiumTextBlock4'>" + contDiv2.innerHTML + "</div></div>";
		}
		winFinal=710;
	}
	else
	{
		return;
	}
	
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==6)
	{
		winFinal +=2;
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==7)
	{
		winFinal +=2;
	}
	if(BrowserDetect.browser=="Explorer" && BrowserDetect.version==8)
	{
		winFinal +=2;
	}
	
		var a = window. open('', '', 'scrollbars=yes, width=' + winFinal + ', height=650');
		a.document.open("text/html");
		a.document.write("<html><head><script type='text/javascript'>function initAll(){ document.getElementById('finalDiv').style.display = 'block'; } window.onload=initAll;</script><link rel='stylesheet' href='http://www.herningsholm.dk/fileadmin/template/main/css/style_print.css' media='all' /></head><body class='body2'><div id='finalDiv' style='display: none;'>" + contDiv + "</div></body></html>");
		a.document.close();
		a.print();				
}