var theNews = '';

function addListeners() {
	if (!document.getElementsByTagName) {
		getEl('wrapper').innerHTML = "<div id='errorMessage'>Please upgrade your browser!</div>";
		getEl('wrapper').style.visibility = 'visible';
		return;
	}

	// These are dynamic values!
	myVars.allImages = document.getElementsByTagName('img');
	myVars.allDivs = document.getElementsByTagName('div');
	myVars.allLinks = document.getElementsByTagName('a');

	addEvent('logooverlay', 'mousedown', function() {
		if (myVars.theMenu != 'menu01')
			newPage('menu01');
	}, false);
	myVars.content = getEl('content');

	myVars.j = myVars.allImages.length;
	for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
		myVars.theImage = myVars.allImages[myVars.i];
		if (myVars.theImage.className == 'fadeImage') {
			addEvent(myVars.theImage, 'mouseover', fadeImageListener, false);
			addEvent(myVars.theImage, 'mouseout', fadeImageListener, false);
			myVars.theImage.state = 'none';
			myVars.theImage.index = 0;
			myVars.theImage.fadeImage = 'off';
			myVars.theImage.setAttribute('base', myVars.theImage.src);
			myVars.theImage.setAttribute('overSrc', getFront(myVars.theImage.src, '.png') + 'Over.png');
			myVars.theImage.parentNode.style.backgroundImage = 'url(' + myVars.theImage.getAttribute('base') + ')';
			if (myVars.isIE) {
				// To avoid: document.write("<link rel='stylesheet' href='CSS/" + ((myVars.isIE) ? "IE" : "Moz") + ".css' type='text/css' />");
				myVars.theImage.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
			}
		}
	}

	myVars.j = myVars.allDivs.length;
	var theID = ''; // theID variable name cannot contain periods...
	for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
		myVars.theDiv = myVars.allDivs[myVars.i];
		if (isInMainstring(myVars.theDiv.id, 'menu')) {
			theID = myVars.theDiv.id;
			// if (!myVars.theDeal) continue;
			// closure by value!
			addEvent(myVars.theDiv, 'mousedown', function(theID) {
				return function(e) {
					newPage(theID);
				};
			}(theID), false);
		}
	}

	myVars.j = myVars.allLinks.length;
	for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
		myVars.theLink = myVars.allLinks[myVars.i];
		if (!myVars.isIE)
			addEvent(myVars.theLink, 'mouseup', aBlurListener, false);
		if (myVars.theLink.id == 'hyperText') {
			addEvent(myVars.theLink, 'mouseover', hyperText, false);
			addEvent(myVars.theLink, 'mouseout', hyperText, false);
		}
	}

	newPage();

	resize();

	preloadImage('Images/Layout/ButForsideOver.png', 67, 32);
	preloadImage('Images/Layout/ButKinesiologiOver.png', 142, 32);
	preloadImage('Images/Layout/ButSessionOver.png', 114, 32);
	preloadImage('Images/Layout/ButProfilOver.png', 60, 32);
	preloadImage('Images/Layout/ButPrisOver.png', 52, 32);
	preloadImage('Images/Layout/ButBestilOver.png', 78, 32);
	preloadImage('Images/Layout/ButFindOver.png', 76, 32);
	preloadImage('Images/Layout/ButKontaktOver.png', 76, 32);
	preloadImage('Images/Layout/ButSes1.png', 115, 26);
	preloadImage('Images/Layout/ButSes1Over.png', 115, 26);
	preloadImage('Images/Layout/ButSes2.png', 177, 26);
	preloadImage('Images/Layout/ButSes3.png', 89, 26);
	preloadImage('Images/Layout/ButSes4.png', 123, 26);
	preloadImage('Images/Layout/ButCD.png', 202, 32);
	preloadImage('Images/Layout/ButCDOver.png', 202, 32);
	preloadImage('Images/Layout/ButSens.png', 202, 32);
	preloadImage('Images/Layout/ButSensOver.png', 202, 32);
	preloadImage('Images/FindVej.jpg', 304, 290);
	preloadImage('Images/forTitle.png', 450, 22);
	preloadImage('Images/udtalTitle.png', 450, 20);
	preloadImage('Images/kinTitle.png', 450, 20);
	preloadImage('Images/sesTitle.png', 450, 20);
	preloadImage('Images/proTitle.png', 450, 20);
	preloadImage('Images/priTitle.png', 450, 20);
	preloadImage('Images/besTitle.png', 450, 20);
	preloadImage('Images/finTitle.png', 450, 20);
	preloadImage('Images/konTitle.png', 450, 20);
	preloadImage('Images/tipTitle.png', 450, 20);
	preloadImage('Images/cdTitle.png', 450, 45);
	preloadImage('Images/gKortTitle.png', 450, 20);
	preloadImage('Images/CD.png', 90, 90);
	preloadImage('Images/cdReturTitle.png', 450, 20);
	preloadImage('Images/ssmTitle.png', 450, 20);
	preloadImage('Images/ssmMere.png', 450, 20);
	preloadImage('Images/ssmBoernTitle.png', 450, 20);
	preloadImage('Images/ssmUngeTitle.png', 450, 20);
	preloadImage('Images/ssmVoksneTitle.png', 450, 20);
	preloadImage('Images/kort.png', 450, 20);
	preloadImage('Images/AnneMarie.png', 237, 280);
	preloadImage('Images/Layout/ButMere.png', 182, 24);
	preloadImage('Images/Layout/ButBoern.png', 46, 24);
	preloadImage('Images/Layout/ButUnge.png', 46, 24);
	preloadImage('Images/Layout/ButVoksne.png', 55, 24);
	preloadImage('Images/Layout/ButCDSmall.png', 186, 24);
	preloadImage('Images/Layout/ButBestilCD.png', 74, 24);
	preloadImage('Images/Layout/ButUdtalelserOver.png', 79, 24);
	preloadImage('Images/Layout/ButUdtalelserCDOver.png', 137, 24);
	preloadImage('Images/Layout/ButBestilGavekortOver.png', 109, 24);
}


function resize() {
	setDimensions();

	getEl('wrapper').style.visibility = 'visible';

	if (winWidth() < 1120) {
		getEl('greyMan').style.left = findPosX('wrapper') + 'px';
		getEl('greyMan').style.top = findPosY('wrapper') + 'px';
	} else {
		getEl('greyMan').style.left = findPosX('wrapper') + ((myVars.isIE) ? 810 : 810) + 'px';
		getEl('greyMan').style.top = ((myVars.wrapperHeight + findPosY('wrapper')) - 300) + 'px';
		getEl('greyMan').style.visibility = 'visible';
	}
}


function setDimensions() {
	if (getEl('finThree')) {
		myVars.content.style.height = ((myVars.isIE)? 690 : 680) + 'px';
	} else {
		myVars.content.style.height = '400px';
	}

	myVars.wrapperHeight = getElementHeight('wrapper');
	myVars.wrapperTop = ((winHeight() - myVars.wrapperHeight) / 2);
	if (myVars.wrapperTop > 0) {
		getEl('wrapper').style.top = myVars.wrapperTop + 'px';
	} else{
		getEl('wrapper').style.top = '10px';
	}
}


function checkPage() {
	setDimensions();

	if (myVars.theMenu != '') {
		getEl(myVars.theMenu).style.backgroundImage = 'url(' + getEl(myVars.theMenu).firstChild.getAttribute('overSrc') + ')';
		getEl(myVars.theMenu).style.cursor = 'default';
	}

	myVars.j = myVars.allLinks.length;
	for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
		myVars.theLink = myVars.allLinks[myVars.i];
		if (!myVars.isIE)
			addEvent(myVars.theLink, 'mouseup', aBlurListener, false);
	}

	if (myVars.theMenu != 'menu01') {
		getEl('logooverlay').title = 'Til forsiden';
		getEl('logooverlay').style.cursor = 'pointer';
	}


	if (getEl('forTitle')) {
		if (!myVars.isIE) {
			getEl('forTitle').style.top = '-24px';
			getEl('forsideOne').style.top = '6px';
			getEl('forsideOneInside').style.top = '-5px';
			getEl('forsideOneInside').style.paddingTop = '1px';
			getEl('forsideOneInsideBox').style.top = '-8px';
			getEl('forsideOneInsideUl').style.paddingTop = '6px';
			getEl('forsideTwoInside').style.top = '-5px';
			getEl('forsideTwoInside').style.paddingTop = '1px';
			getEl('forsideTwoInsideBox').style.top = '-8px';
			getEl('forsideTwoInsideText').style.top = '-12px';
			getEl('forsideTwo').style.top = '128px';
			getEl('forsideThree').style.top = '128px';
		}
		getEl('logooverlay').title = '';
		getEl('logooverlay').style.cursor = 'default';
		getEl('forTitle').innerHTML = "<img src='Images/forTitle.png' width='450' height='22' alt='' />";
		// Front page preloads important images from other pages.
		// Every page preloads its own OverSrc images.
		// Images called from style sheet is already preloaded.
		preloadImage('Images/Layout/ButForsideOver.png', 67, 32);
		preloadImage('Images/Layout/ButKinesiologiOver.png', 142, 32);
		preloadImage('Images/Layout/ButSessionOver.png', 114, 32);
		preloadImage('Images/Layout/ButProfilOver.png', 60, 32);
		preloadImage('Images/Layout/ButPrisOver.png', 52, 32);
		preloadImage('Images/Layout/ButBestilOver.png', 78, 32);
		preloadImage('Images/Layout/ButFindOver.png', 76, 32);
		preloadImage('Images/Layout/ButKontaktOver.png', 76, 32);
		preloadImage('Images/Layout/ButSes1.png', 115, 26);
		preloadImage('Images/Layout/ButSes1Over.png', 115, 26);
		preloadImage('Images/Layout/ButSes2.png', 177, 26);
		preloadImage('Images/Layout/ButSes3.png', 89, 26);
		preloadImage('Images/Layout/ButSes4.png', 123, 26);
		preloadImage('Images/Layout/ButCDOver.png', 202, 32);
		preloadImage('Images/Layout/ButSensOver.png', 202, 32);
		preloadImage('Images/FindVej.jpg', 390, 364);
		preloadImage('Images/kinTitle.png', 450, 20);
		preloadImage('Images/sesTitle.png', 450, 20);
		preloadImage('Images/proTitle.png', 450, 20);
		preloadImage('Images/priTitle.png', 450, 20);
		preloadImage('Images/besTitle.png', 450, 20);
		preloadImage('Images/finTitle.png', 450, 20);
		preloadImage('Images/kort.png', 450, 20);
		preloadImage('Images/konTitle.png', 450, 20);
		preloadImage('Images/tipTitle.png', 450, 20);
		preloadImage('Images/AnneMarie.png', 237, 280);
		if (!myVars.isIE) {
			getEl('bestilGavekort').style.left = '580px';
			getEl('bestilGavekort').style.top = '270px';
		}
	} else if (getEl('udtalTitle')) {
		if (!myVars.isIE) {
			getEl('udtalTitle').style.top = '-7px';
			getEl('udtalBox').style.height = '354px';
			getEl('udtalOne').style.top = '48px';
		}
		getEl('udtalTitle').innerHTML = "<img src='Images/udtalTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('kinTitle')) {
		if (!myVars.isIE) {
			getEl('kinTitle').style.top = '-7px';
			getEl('kinOne').style.top = '48px';
			getEl('kinOne').style.height = '240px';
			getEl('kinTwo').style.top = '290px';
		}
		getEl('kinTitle').innerHTML = "<img src='Images/kinTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('sesTitle')) {
		if (!myVars.isIE) {
			getEl('sesTitle').style.top = '-7px';
			getEl('sesLinks').style.top = '49px';
			getEl('sesOne').style.top = '84px';
		}
		getEl('sesTitle').innerHTML = "<img src='Images/sesTitle.png' width='450' height='20' alt='' />";
		myVars.j = myVars.allImages.length;
		for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
			myVars.theImage = myVars.allImages[myVars.i];
			if (myVars.theImage.className == 'sesLink') {
				addEvent(myVars.theImage, 'mouseover', rollImageListener, false);
				addEvent(myVars.theImage, 'mouseout', rollImageListener, false);
				addEvent(myVars.theImage, 'mousedown', rollImageListener, false);
				myVars.theImage.setAttribute('base', myVars.theImage.src);
				myVars.theImage.setAttribute('overSrc', getFront(myVars.theImage.src, '.png') + 'Over.png');
				if (myVars.theImage.id == 'ses1')
					myVars.theImage.style.cursor = 'default';
			}
		}
		getEl('ses1').src = getEl('ses1').getAttribute('overSrc');
		myVars.theSesImage = getEl('ses1').getAttribute('overSrc');
		preloadImage('Images/Layout/ButSes2Over.png', 177, 26);
		preloadImage('Images/Layout/ButSes3Over.png', 89, 26);
		preloadImage('Images/Layout/ButSes4Over.png', 123, 26);
	} else if (getEl('proTitle')) {
		if (!myVars.isIE) {
			getEl('proTitle').style.top = '-7px';
		}
		getEl('proTitle').innerHTML = "<img src='Images/proTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('priTitle')) {
		if (!myVars.isIE) {
			getEl('priTitle').style.top = '-7px';
		}
		getEl('priTitle').innerHTML = "<img src='Images/priTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('besTitle')) {
		if (!myVars.isIE) {
			getEl('besTitle').style.top = '-7px';
			if (getEl('submitInput6'))
				getEl('submitInput6').style.marginLeft = '240px';
		}
		getEl('besTitle').innerHTML = "<img src='Images/besTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('finTitle')) {
		if (!myVars.isIE) {
			getEl('finTitle').style.top = '-7px';
		}
		getEl('finTitle').innerHTML = "<img src='Images/finTitle.png' width='450' height='20' alt='' />";
		myVars.j = myVars.allLinks.length;
		for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
			myVars.theLink = myVars.allLinks[myVars.i];
			if (myVars.theLink.className == 'scrollimage') {
				addEvent(myVars.theLink, 'mousemove', scrollImageListener, false);
				addEvent(myVars.theLink, 'click', handleScrollPopUp, false);
				myVars.theLink.onclick = function() {return false;}
				myVars.theLink.style.width = '304px';
				myVars.theLink.style.height = '290px';
				myVars.theLink.style.backgroundImage = 'url(Images/FindVejBig2.jpg)';
			 	myVars.theLink.setAttribute('mainx', '629');
				myVars.theLink.setAttribute('mainy', '600');
				myVars.theLink.setAttribute('thumbx', '304');
				myVars.theLink.setAttribute('thumby', '290');
			}
		}
		preloadImage('Images/FindVejBig2.jpg', 629, 600);
	} else if (getEl('kort')) {
		if (!myVars.isIE) {
			getEl('kort').style.top = '-7px';
		}
		getEl('kort').innerHTML = "<img src='Images/kort.png' width='450' height='20' alt='' />";
	} else if (getEl('konTitle')) {
		if (!myVars.isIE) {
			getEl('konTitle').style.top = '-7px';
		}
		getEl('konTitle').innerHTML = "<img src='Images/konTitle.png' width='450' height='20' alt='' />";
		myVars.emailAnneMarie = "<a class='emailAnneMarie' href='mail" + "to:amstavnstrup" + myVars.varAt + "kinesiologisk-coaching.dk' title='Send mig en email'>amstavnstrup" + myVars.varAt + "kinesiologisk-coaching.dk<\/a>";
		getEl('emailAnneMarie').innerHTML = myVars.emailAnneMarie;
	} else if (getEl('ssmTitle')) {
		if (!myVars.isIE) {
			getEl('ssmTitle').style.top = '-7px';
			getEl('ssmOne').style.paddingTop = '0';
		}
		getEl('ssmTitle').innerHTML = "<img src='Images/ssmTitle.png' width='450' height='20' alt='' />";
		preloadImage('Images/Layout/ButMereOver.png', 182, 24);
		preloadImage('Images/Layout/ButBoernOver.png', 46, 24);
		preloadImage('Images/Layout/ButUngeOver.png', 46, 24);
		preloadImage('Images/Layout/ButVoksneOver.png', 55, 24);
	} else if (getEl('ssmMereTitle')) {
		if (!myVars.isIE) {
			getEl('ssmMereTitle').style.top = '-7px';
			getEl('ssmMereSagtens').style.top = '-6px';
		}
		getEl('ssmMereTitle').innerHTML = "<img src='Images/ssmMereTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('ssmBoernTitle')) {
		if (!myVars.isIE) {
			getEl('ssmBoernTitle').style.top = '-7px';
		}
		getEl('ssmBoernTitle').innerHTML = "<img src='Images/ssmBoernTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('ssmUngeTitle')) {
		if (!myVars.isIE) {
			getEl('ssmUngeTitle').style.top = '-7px';
		}
		getEl('ssmUngeTitle').innerHTML = "<img src='Images/ssmUngeTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('ssmVoksneTitle')) {
		if (!myVars.isIE) {
			getEl('ssmVoksneTitle').style.top = '-7px';
		}
		getEl('ssmVoksneTitle').innerHTML = "<img src='Images/ssmVoksneTitle.png' width='450' height='20' alt='' />";
		preloadImage('Images/Layout/ButCDSmallOver.png', 186, 24);
	} else if (getEl('cdTitle')) {
		if (!myVars.isIE) {
			getEl('cdTitle').style.top = '-7px';
			getEl('bestilCD').style.top = '383px';
			getEl('cdLabel').style.left = '-25px';
			getEl('cdLabel').style.top = '-87px';
		}
		getEl('cdTitle').innerHTML = "<img src='Images/cdTitle.png' width='450' height='40' alt='' />";
		preloadImage('Images/Layout/ButBestilCDOver.png', 74, 24);
	} else if (getEl('udtalCDTitle')) {
		if (!myVars.isIE) {
			getEl('udtalCDTitle').style.top = '-7px';
			getEl('udtalCDBox').style.height = '354px';
			getEl('udtalCDOne').style.top = '48px';
		}
		getEl('udtalCDTitle').innerHTML = "<img src='Images/udtalCDTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('besCDTitle')) {
		if (!myVars.isIE) {
			getEl('besCDTitle').style.top = '-7px';
			getEl('besCDOne').style.top = '-5px';
			getEl('submitCDInput9').style.marginLeft = '347px';
			getEl('gadeCD').style.width = '367px';
			getEl('byCD').style.width = '359px';
			getEl('gadeCD2').style.width = '373px';
			getEl('byCD2').style.width = '365px';
		}
		getEl('besCDTitle').innerHTML = "<img src='Images/cdTitle.png' width='450' height='40' alt='' />";
	} else if (getEl('cdReturTitle')) {
		getEl('cdReturTitle').innerHTML = "<img src='Images/cdReturTitle.png' width='450' height='20' alt='' />";
	}	else if (getEl('tipTitle')) {
		if (!myVars.isIE) {
			getEl('tipTitle').style.top = '-7px';
		}
		if (getEl('noregistration'))
			getEl('noregistration').style.top = '-30px';
		getEl('tipTitle').innerHTML = "<img src='Images/tipTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('besGavekortTitle')) {
		if (!myVars.isIE) {
			getEl('besGavekortTitle').style.top = '-13px';
			getEl('besGavekortOne').style.top = '-5px';
			getEl('submitGavekortInput11').style.marginLeft = '128px';
			getEl('gadeGavekort').style.width = '367px';
			getEl('byGavekort').style.width = '359px';
			getEl('gadeGavekort2').style.width = '373px';
			getEl('byGavekort2').style.width = '365px';
		}
		getEl('besGavekortTitle').innerHTML = "<img src='Images/gKortTitle.png' width='450' height='20' alt='' />";
	} else if (getEl('gavekortReturTitle')) {
		getEl('gavekortReturTitle').innerHTML = "<img src='Images/gKortReturTitle.png' width='450' height='20' alt='' />";
	}

	if (winWidth() < 1120) {
		getEl('greyMan').style.left = findPosX('wrapper') + 'px';
		getEl('greyMan').style.top = findPosY('wrapper') + 'px';
	} else {
		getEl('greyMan').style.left = findPosX('wrapper') + ((myVars.isIE) ? 810 : 810) + 'px';
		getEl('greyMan').style.top = ((myVars.wrapperHeight + findPosY('wrapper')) - 300) + 'px';
		getEl('greyMan').style.visibility = 'visible';
	}

	if (getEl('antal')) {
		getEl('antal').tabindex = 1;
		getEl('antal').focus(); // Repeat for IE7
		getEl('antal').focus();
	} else if (getEl('userName')) {
		getEl('userName').tabindex = 1;
		getEl('userName').focus(); // Repeat for IE7
		getEl('userName').focus();
	} else if (getEl('recipientName')) {
		getEl('recipientName').tabindex = 1;
		getEl('recipientName').focus(); // Repeat for IE7
		getEl('recipientName').focus();
	} else if (getEl('antalCD')) {
		getEl('antalCD').tabindex = 1;
		getEl('antalCD').focus(); // Repeat for IE7
		getEl('antalCD').focus();
	} else if (getEl('antalGavekort')) {
		getEl('antalGavekort').tabindex = 1;
		getEl('antalGavekort').focus(); // Repeat for IE7
		getEl('antalGavekort').focus();
	}

	if (getEl('forsideTwoInside')) {
		if (theNews == 'No') {
			getEl('forsideTwoInside').style.display = 'none';
			getEl('forsideOne').style.left = '173px';
		}
	}
}


function newPage(thePage) {
	if (initRequest() == false) {
		alert("Your browser does not support XMLHttpRequest.\nPlease upgrade your browser!");
		return;
	}

	var theFile = '';

	if (myVars.theMenu != '')
		getEl(myVars.theMenu).style.cursor = 'pointer';

	myVars.j = myVars.allImages.length;
	for (myVars.i = 0; myVars.i < myVars.j; myVars.i++) {
		myVars.theImage = myVars.allImages[myVars.i];
		if (myVars.theImage.className == 'fadeImage') {
			myVars.theImage.parentNode.style.backgroundImage = 'url(' + myVars.theImage.getAttribute('base') + ')';
		}
	}

	// Start with cookie check to see if we are returning from mailform
	if (getCookie("thePage") == "order") {
		deleteCookie('thePage', '/');
		theFile = '06BesReturn.php';
		myVars.theMenu = '';
	} else if (getCookie("thePage") == "tip") {
		deleteCookie('thePage', '/');
		theFile = '09TipReturn.php';
		myVars.theMenu = '';
	} else if (getCookie("thePage") == "orderCD") {
		deleteCookie('thePage', '/');
		theFile = '09CDReturn.php';
		myVars.theMenu = '';
	} else if (getCookie("thePage") == "orderGavekort") {
		deleteCookie('thePage', '/');
		theFile = '11GavekortReturn.php';
		myVars.theMenu = '';
	} else if (typeof thePage === 'undefined') {
		theFile = '01For.php';
		myVars.theMenu = 'menu01';
	} else if (isInMainstring(thePage, 'menu'))
		myVars.theMenu = thePage;
	else
		myVars.theMenu = '';

	if (thePage == 'menu01')
		theFile = '01For.php';
	else if (thePage == 'menu02')
		theFile = '02Kin.php';
	else if (thePage == 'menu03')
		theFile = '03Ses.php';
	else if (thePage == 'menu04')
		theFile = '04Pro.php';
	else if (thePage == 'menu05')
		theFile = '05Pri.php';
	else if (thePage == 'menu06')
		theFile = '06Bes.php';
	else if (thePage == 'menu07')
		theFile = '07Fin.php';
	else if (thePage == 'kort') {
		theFile = '07FinPrintBig.php';
		myVars.theMenu = 'menu07';
	} else if (thePage == 'kortReturn') {
		theFile = '07Fin.php';
		myVars.theMenu = 'menu07';
	}	else if (thePage == 'menu08')
		theFile = '08Kon.php';
	else if (thePage == 'menu09')
		theFile = '09CD.php';
	else if (thePage == 'bestilCD')
		theFile = '09CDBes.php';
	else if (thePage == 'udtalelser')
		theFile = '01Udtal.php';
	else if (thePage == 'udtalelserCD')
		theFile = '09CDUdtal.php';
	else if (thePage == 'menu10')
		theFile = '10SSM.php';
	else if (thePage == 'ssm10-1')
		theFile = '10SSM-1.php';
	else if (thePage == 'ssm10-2')
		theFile = '10SSM-2.php';
	else if (thePage == 'ssm10-3')
		theFile = '10SSM-3.php';
	else if (thePage == 'ssm10-4')
		theFile = '10SSM-4.php';
	else if (thePage == 'bestilGavekort')
		theFile = '11BesGavekort.php';
	else if (thePage == 'tip')
		theFile = '09Tip.php';

	myVars.req.open('GET', theFile, true);
	myVars.req.onreadystatechange = function() {
		if (myVars.req.readyState == 4) {
			if ((myVars.req.status == 200) || (myVars.req.status == 304)) {
				myVars.content.innerHTML = myVars.req.responseText;
				myVars.req = null;
				checkPage();
			}
		}
		return true;
	}
	myVars.req.send(null);
}


function initRequest() {
	myVars.req = null;
	if (window.XMLHttpRequest) myVars.req = new XMLHttpRequest();
	else if (window.ActiveXObject) myVars.req = new ActiveXObject("Msxml2.XMLHTTP");
	if (myVars.req == null) myVars.req = new ActiveXObject("Microsoft.XMLHTTP");
	if (myVars.req == null) {
		return false;
	} else {
		return true;
	}
}


addEvent(window, 'resize', resize, false);
addEvent(window, 'load', addListeners, false);

