
/****************************

Menyskript
Copyright 2006 Hemsidan.com 

*****************************/


// Ge menyn dess egenskaper
function fixMenu () {
	
	if (document.getElementById('subnav1')) {
		document.getElementById('a1').onfocus = function() { this.blur(); };
		document.getElementById('a1').href = 'javascript:void(0)';
		document.getElementById('a1').onclick = function() { showHideSub('1'); };
	}
	
	if (document.getElementById('subnav2')) {
		document.getElementById('a2').onfocus = function() { this.blur(); };
		document.getElementById('a2').href = 'javascript:void(0)';
		document.getElementById('a2').onclick = function() { showHideSub('2'); };
	}
	
	if (document.getElementById('subnav3')) {
		document.getElementById('a3').onfocus = function() { this.blur(); };
		document.getElementById('a3').href = 'javascript:void(0)';
		document.getElementById('a3').onclick = function() { showHideSub('3'); };
	}
	
	if (document.getElementById('subnav4')) {
		document.getElementById('a4').onfocus = function() { this.blur(); };
		document.getElementById('a4').href = 'javascript:void(0)';
		document.getElementById('a4').onclick = function() { showHideSub('4'); };
	}
	
	if (document.getElementById('subnav5')) {
		document.getElementById('a5').onfocus = function() { this.blur(); };
		document.getElementById('a5').href = 'javascript:void(0)';
		document.getElementById('a5').onclick = function() { showHideSub('5'); };
	}
	
	if (document.getElementById('subnav6')) {
		document.getElementById('a6').onfocus = function() { this.blur(); };
		document.getElementById('a6').href = 'javascript:void(0)';
		document.getElementById('a6').onclick = function() { showHideSub('6'); };
	}
	
	if (document.getElementById('subnav7')) {
		document.getElementById('a7').onfocus = function() { this.blur(); };
		document.getElementById('a7').href = 'javascript:void(0)';
		document.getElementById('a7').onclick = function() { showHideSub('7'); };
	}	
}


// Visa eller dölj undermeny vid klick
function showHideSub(obj) {
	
	var headnav = document.getElementById('a'+obj);
	var subnav = document.getElementById('subnav'+obj);
	
	// Visa
	if ((subnav.style.display=='none') || (subnav.style.display=='')) {

		subnav.style.display = 'block';
		document.getElementById('nav_arrow' + obj).style.display = 'inline';
			
	// Dölj
	} else { 

		subnav.style.display = 'none';
		document.getElementById('nav_arrow' + obj).style.display = 'none';
	} 
	
}




