var imageId = '';
var imageName;
var ie = (navigator.appName == 'Microsoft Internet Explorer');

if(navigator.userAgent.indexOf('Firefox/2')>-1) {
	document.write('<link rel="stylesheet" type="text/css" href="css/gecko2.css" />')	;
}

function img_swap(__id, __hover){
	imageId = document.getElementById(__id);
	imageName = document.getElementById(__id).src;
	document.getElementById(__id).src = 'images/' + __hover;
}

function img_restore(){
	if(imageId != ''){
		imageId.src = imageName;
	}
}

function toggle_menu_class() { // IE only function
	var a = window.event.srcElement;
	
	if (a.className.indexOf('iehover') > -1) {
		a.className = a.className.replace('iehover', '');
	} else {
		a.className += 'iehover';
	}
}

function attach_menu_event() {
	if (!ie) return;
	
	var a = document.getElementById('menu').getElementsByTagName('A');
	for (var i=0; i < a.length; i++) {
		a[i].attachEvent("onmouseover", toggle_menu_class);
		a[i].attachEvent("onmouseout", toggle_menu_class);
	}
}

function initialise() {
	attach_menu_event();
}

if (window.addEventListener) {
	window.addEventListener("load", initialise, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", initialise);
}

var _current;

function Menu(__div){
	if(_current != null){
		_current.style.display = 'none';
	}
	var menu_div = document.getElementById(__div);
	if(menu_div != null){
		_current = menu_div;
		menu_div.style.display = 'block';
	}
}

function Bookmark(){
	if(window.sidebar){
		window.sidebar.addPanel('Hippo', 'http://www.hippo.co.za', '');
	} else if(window.external){
		window.external.AddFavorite('http://www.hippo.co.za', 'Hippo');
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}