function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function init(){
	
	var industry = document.getElementById('industry');
	var industryMenu = document.getElementById('industryMenu');	
	var equipment = document.getElementById('equipment');
	var equipmentMenu = document.getElementById('equipmentMenu');
	var device = document.getElementById('device');
	var deviceMenu = document.getElementById('deviceMenu');
	
	if(industry){
	
		industry.onclick = function(){
			
			if(industrySwitch){
				industryMenu.style.display = 'block';
				industrySwitch = false;
			} else {
				industryMenu.style.display = 'none';
				industrySwitch = true;
			}
		
		}	
		
	}
	
	if(equipment){

		equipment.onclick = function(){
			
			if(equipmentSwitch){
				equipmentMenu.style.display = 'block';
				equipmentSwitch = false;
			} else {
				equipmentMenu.style.display = 'none';
				equipmentSwitch = true;
			}
		
		}	
		
	}
		
	if(device){
		
		device.onclick = function(){
			
			if(deviceSwitch){
				deviceMenu.style.display = 'block';
				deviceSwitch = false;
			} else {
				deviceMenu.style.display = 'none';
				deviceSwitch = true;
			}
		
		}
	}
}

addLoadEvent(init);