function changeBG(ID, colour){
	if(document.getElementById(ID)) {
		document.getElementById(ID).style.background=colour;
	}
}

function changeBorder(ID, colour){
	if(document.getElementById(ID)) {
		document.getElementById(ID).style.border="1px solid "+colour;
	}
}

linkdropdown = function() {
	var list = document.getElementById("nav").getElementsByTagName("LI");
	if (list!=null) {
		for (var i=0; i<list.length; i++) {
			list[i].onmouseover=function() {
				this.className+=" linkdropdown";
			}
			list[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" linkdropdown"), "");
			}
		}
	}
}
if (window.attachEvent) {
	window.attachEvent("onload", linkdropdown)
}
else {
	window.onload=linkdropdown;
}

function opacity(id, opacStart, opacEnd, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

function changeOpac(opacity, id) { 
	var object = document.getElementById(id).style; 
	if (document.getElementById(id)) {
		object.opacity = (opacity / 100); 
		object.MozOpacity = (opacity / 100); 
		object.KhtmlOpacity = (opacity / 100); 
		object.filter = "alpha(opacity=" + opacity + ")"; 
	}
} 

setupHover = function() {
	this1 = document.getElementById('subitem1');
	that1 = document.getElementById('item1');
	this2 = document.getElementById('subitem2');
	that2 = document.getElementById('item2');
	this3 = document.getElementById('subitem3');
	that3 = document.getElementById('item3');
	this4 = document.getElementById('subitem4');
	that4 = document.getElementById('item4');
	this5 = document.getElementById('subitem5');
	that5 = document.getElementById('item5');
	if(this1) { 
		if(that1) {
			this1.onmouseover=that1.onmouseover=function() { that1.style.color="white";  changeOpac (75, 'item1'); }
			this1.onmouseout=that1.onmouseout=function() { that1.style.color="#b5aa59"; changeOpac (85, 'item1'); }
		}
	}
	if(this2) { 
		if(that2) {
			this2.onmouseover=that2.onmouseover=function() { that2.style.color="white";  changeOpac (75, 'item2'); }
			this2.onmouseout=that2.onmouseout=function() { that2.style.color="#b5aa59"; changeOpac (85, 'item2'); }
		}
	}
	if(this3) { 
		if(that3) {
			this3.onmouseover=that3.onmouseover=function() { that3.style.color="white";  changeOpac (75, 'item3'); }
			this3.onmouseout=that3.onmouseout=function() { that3.style.color="#b5aa59"; changeOpac (85, 'item3'); }
		}
	}
	if(this4) { 
		if(that4) {
			this4.onmouseover=that4.onmouseover=function() { that4.style.color="white";  changeOpac (75, 'item4'); }
			this4.onmouseout=that4.onmouseout=function() { that4.style.color="#b5aa59"; changeOpac (85, 'item4'); }
		}
	}
	if(this5) { 
		if(that5) {
			this5.onmouseover=that5.onmouseover=function() {that5.style.color="white";  changeOpac (75, 'item5'); }
			this5.onmouseout=that5.onmouseout=function() {that5.style.color="#b5aa59"; changeOpac (85, 'item5'); }
		}
	}
}
if (window.attachEvent) {
	window.attachEvent("onload", setupHover)
}
else {
	window.onload=setupHover;
}


function change_subnav(name, image) {
	if(document.getElementById(name)) {
		document.getElementById(name).src = image;
	}
}

function change(id) {
	var i = 0;
	for (i=0; i<17; i++)
	{
		if(document.getElementById('image'+(i+1))) {
			document.getElementById('image'+(i+1)).style.display = 'none';
		}
	}
	if (document.getElementById(id)) {
		document.getElementById(id).style.display="block";
	}
}

function changeback() {
	var i = 0;
	for (i=0; i<16; i++)
	{
		if(document.getElementById('image'+(i+1))) {
			document.getElementById('image'+(i+1)).style.display = 'none';
		}
	}
	if(document.getElementById('image1')) {
		document.getElementById('image1').style.display="block";
	}
}