
	window.onresize = checkFooter;

	function checkFooter()
	{
		windowwidth = window.innerWidth;

		if (!windowwidth) windowwidth = document.documentElement.clientWidth;

		if (!windowwidth || windowwidth == 0) windowwidth = document.body.clientWidth

//		pagewidth = document.getElementById("page_wrapper").offsetWidth;

//		bodywrapperwidth = document.getElementById("body_wrapper").offsetWidth;

//		difference = windowwidth - pagewidth;

		
		if(document.getElementById('content_wrapper')) {

			var tcon = document.getElementById('content_wrapper');
		
			var pcon = tcon.getElementsByTagName('p');

			if(windowwidth < 950) {
	        	        for (var i=0;i<pcon.length;i++) {
					pcon[i].style.width = "380px";
				}
			} else {
	        	        for (var i=0;i<pcon.length;i++) {
					pcon[i].style.width = "550px";
				}
			}

		}
	
		if(document.getElementById('text_box3')) {

			var box3 = document.getElementById('text_box3');

			if(windowwidth < 1000) {
				box3.style.display = "none";
			} else {
				box3.style.display = "";
			}
	
		}

		if(document.getElementById('pic_box3')) {

			var pic3 = document.getElementById('pic_box3');

			if(windowwidth < 1040) {
				pic3.style.display = "none";
			} else {
				pic3.style.display = "";
			}
	
		}
	
		if(windowwidth < 850) {
//			document.body.style.borderLeftWidth = 0;
//			document.body.style.borderRightWidth = 0;
//			document.getElementById('bookingform').style.right = "10px";
//			document.getElementById('offer_wrapper').style.right = "10px";
		} else {
//			document.body.style.borderLeftWidth = 20;
//			document.body.style.borderRightWidth = 20;
		}

//		if (difference > 0) document.getElementById("body_wrapper").style.height = (bodywrapperheight+difference)+"px";

	}


function runSlideShow(backid, imageid, imagearray,d)
{
	if (!d) var d = 0;

    nextPic = d + 1; if (nextPic >= imagearray.length) nextPic = 0; 

    fadelength = 2000;
    steps = 100;

    // Set Background Image To Match Foreground
    document.getElementById(backid).style.background = "url('"+document.getElementById(imageid).src+"')";

    // Set Foreground Opacity to Transparent
    setTimeout('setOpacity("'+imageid+'",0)',50);

    // Set Foreground to the next Picture
    setTimeout('document.getElementById(\''+imageid+'\').src = \''+imagearray[nextPic]+'\'',100);

    // Loop through changing the Opacity
    for(i = 0; i <= steps; i++)
    {
        opacity = i/steps * 100;
        setTimeout('setOpacity("'+imageid+'",'+opacity+')',((i*(fadelength/steps))+150));
    }

    d++;
    if (d >= imagearray.length) d=0;

	setTimeout( function () { runSlideShow(backid,imageid,imagearray,d) } ,16000);

}

function arrayToString(arr) {
        return str = 'new Array("' + arr.join('", "') + '")';
}

function setOpacity(id,value)
{
    document.getElementById(id).style.opacity = (value / 100);
    document.getElementById(id).style.MozOpacity = (value / 100);
    document.getElementById(id).style.KhtmlOpacity = (value / 100);
    document.getElementById(id).style.filter = "alpha(opacity=" + value + ")";
}



// STORE REQUIRED ACTIONS IN VARIABLE //
var W3CDOM = (document.getElementsByTagName);
function init() {


	// IF ACTIONS ARE NOT SUPPORTED STOP SCRIPT //
	if (!W3CDOM) return;

	// STORE ELEMENT IN VARIABLE //
	var nav = document.getElementById('mainmenu');

	// IF ELEMENT EXISTS THEN CONTINUE //
	if(nav) {

		// STORE LI TAGS WITHIN ELEMENT INTO AN ARRAY //
		var lis = nav.getElementsByTagName('li');
	
		// FOR EACH LI TAG //
		for (var i=0;i<lis.length;i++) {		

			if(lis[i].className != "selected" && lis[i].className != "selectednohighlight" && lis[i].id != "topcat" && lis[i].id != "topcat2") { 
				lis[i].onmouseover = mouseGoesOver;
				lis[i].onmouseout = mouseGoesOut;
			} 

			if(lis[i].className == "selected") { 
				lis[i].onmouseover = mouseGoesOver2;
				lis[i].onmouseout = mouseGoesOut2;
			} 

			if(lis[i].id == "topcat") { 
				lis[i].onclick = showsubcat;
			}

			if(lis[i].id == "topcat2") { 
				lis[i].onclick = showsubcat2;
			}

		}

	}

}

function showsubcat() {
	document.getElementById('submenu').style.display = "block";
	this.className = "selectednohighlight";
}

function showsubcat2() {
	document.getElementById('submenu2').style.display = "block";
	this.className = "selectednohighlight";
}

function mouseGoesOver() {
	
	this.className = "over";
}

function mouseGoesOut() {

	this.className = "";
}

function mouseGoesOver2() {
	
	this.className = "selectedover";
}

function mouseGoesOut2() {

	this.className = "selected";
}

function mouseOverLast() {
	this.className = 'test';
}

function mouseOutLast() {
	this.className = 'last';
}

function mouseOverFirst() {
	document.getElementById('content_wrapper').id = "content_wrapper_over";
	this.style.backgroundColor = "#274E0A";
}

function mouseOutFirst() {
	document.getElementById('content_wrapper_over').id = "content_wrapper";
	this.style.backgroundColor = "#801D28";
}

        var hide = true;

        function showhide(obj,lyr)
        {
                var x = document.getElementById(lyr);
                x.style.display = '';
        }

        function setLyr(obj,lyr)
        {
                var coors = findPos(obj);
                if (lyr == 'testP') coors[1] -= 50;
                var x = document.getElementById(lyr);
                x.style.top = coors[1]+0 + 'px';
                x.style.left = coors[0]+80 + 'px';
                x.style.display = 'block';
        }

        function findPos(obj)
        {
                var curleft = curtop = 0;
                if (obj.offsetParent) {
                        curleft = obj.offsetLeft
                        curtop = obj.offsetTop
                        while (obj = obj.offsetParent) {
                                curleft += obj.offsetLeft
                                curtop += obj.offsetTop
                        }
                }
                return [curleft,curtop];
        }
