// JavaScript Document

/*
var browser = '';
var version = '';
var entrance = '';
var cond = '';

if (browser == '')
{
     if (navigator.appName.indexOf('Microsoft') != -1)
          browser = 'IE'
     else if (navigator.appName.indexOf('Netscape') != -1)
          browser = 'Netscape'
     else browser = 'IE';
}

if (version == '')
{
     version= navigator.appVersion;
     paren = version.indexOf('(');
     whole_version = navigator.appVersion.substring(0,paren-1);
     version = parseInt(whole_version);
}

	if (browser == 'IE')
	{
		alert("IE");
	}
	if (browser != 'IE')
	{
		 alert("!IE");
	}
*/
function showhide(showWhat, shownValue, hiddenValue, hideOthers)
{
	if(document.getElementById(showWhat).style.display == shownValue)
	{
		var isShown = true;	
	} else {
		var isShown = false;	
	}
	
	if(typeof(hideOthers) == 'undefined'){
	} else {
		if (hideOthers=='electrical-services'){
			document.getElementById('residential-installation').style.display = hiddenValue;
			document.getElementById('residential-maintenance').style.display = hiddenValue;
			document.getElementById('commercial-installation').style.display = hiddenValue;
			document.getElementById('commercial-maintenance').style.display = hiddenValue;
			document.getElementById('commercial-faults').style.display = hiddenValue;
			
		
		//for (var idx in hideOthers){
		//	document.getElementById(idx).style.display = hiddenValue;
		//}
		}
	}

if(typeof(showWhat) == 'undefined'){return;}
	if(typeof(shownValue) == 'undefined'){shownValue = 'block';}
	if(typeof(hiddenValue) == 'undefined'){hiddenValue = 'none';}
	
	if(isShown == true){
	//	alert('trying to hide');
		document.getElementById(showWhat).style.display = hiddenValue;
	} else {
	//	alert('trying to show');
		document.getElementById(showWhat).style.display = shownValue;
	}
	
//	if(document.getElementById(showWhat).style.display == 'hidden'){
//		alert('trying to show');
//		document.getElementById(showWhat).style.display = 'block';
//	} else {
//		alert('trying to hide');
//		document.getElementById(showWhat).style.display = 'hidden';
//	}
	
	//changeOpacity('test','test');
}

function changeOpacity(objectname, opacity)
{
	if (browser == 'IE')
	{
		
	}
	if (browser != 'IE')
	{
		 
	}
	
}
