//window.onload = function() {
function doLoadMagic(color) {
	li = document.getElementById('subnavigation').getElementsByTagName('li');
	for(i=0;i<li.length;i++) {
		li[i].onmouseover = function() { // Show the submenu on hover
			this.className = 'active';
			/*switch(this.getAttribute('id')) {
        case 'back':
				case 'flag':
				case 'print':
				case 'contact':
				case 'key':
          this.getElementsByTagName('img')[0].setAttribute('src', this.getElementsByTagName('img')[0].getAttribute('src').replace('.gif', '_hover.gif'));
        break;
			}*/
		}
		li[i].onmouseout = function() { // Remove it again on !hover
			this.className = '';
			/*switch(this.getAttribute('id')) {
        case 'back':
				case 'flag':
				case 'print':
				case 'contact':
				case 'key':
          this.getElementsByTagName('img')[0].setAttribute('src', this.getElementsByTagName('img')[0].getAttribute('src').replace('_hover', ''));
        break;
			}*/
		}
	}
	
	li = document.getElementById('navigation').getElementsByTagName('li');
	for(i=0;i<li.length;i++) {
		li[i].onmouseover = function() { // Show the submenu on hover
			//this.className = 'active';
			switch(this.getAttribute('id')) {
        case 'verk':
				case 'services':
				case 'references':
				case 'people':
				case 'location':
				case 'positions':
          this.getElementsByTagName('img')[0].setAttribute('src', this.getElementsByTagName('img')[0].getAttribute('src').replace('graphics/navigation/', 'graphics/navigation/'+color+'/'));
					this.getElementsByTagName('img')[0].setAttribute('src', this.getElementsByTagName('img')[0].getAttribute('src').replace('.gif', '_active.gif'));
        break;
			}
		}
		li[i].onmouseout = function() { // Remove it again on !hover
			//this.className = '';
			switch(this.getAttribute('id')) {
        case 'verk':
				case 'services':
				case 'references':
				case 'people':
				case 'location':
				case 'positions':
          this.getElementsByTagName('img')[0].setAttribute('src', this.getElementsByTagName('img')[0].getAttribute('src').replace('graphics/navigation/'+color+'/', 'graphics/navigation/'));
					this.getElementsByTagName('img')[0].setAttribute('src', this.getElementsByTagName('img')[0].getAttribute('src').replace('_active', ''));
        break;
			}
		}
	}
}