$(document).ready(function() {


  // This function is for instrument dropdowns   
  $(function(){
	$('a#nav-ins').mouseover(function(){
      $('#dd-instrument').show();
    }).mouseout(function(){
      $('#dd-instrument').hide();
	return false;
	});
	$('#dd-instrument').mouseover(function(){
      $('#dd-instrument').show();
	  $('a#nav-ins').addClass('active');
    }).mouseout(function(){
      $('#dd-instrument').hide();
	  $('a#nav-ins').removeClass('active');
	var path = location.pathname.substring(1);
	if ( path == "instrument/borehole.php" )
     $('a#nav-ins').addClass('active');
	if ( path == "instrument/calibration.php" )
     $('a#nav-ins').addClass('active');
	if ( path == "instrument/seismographic/index.php" )
     $('a#nav-ins').addClass('active');
	if ( path == "instrument/laser-survey.php" )
     $('a#nav-ins').addClass('active');
	if ( path == "instrument/vod.php" )
     $('a#nav-ins').addClass('active');
	if ( path == "instrument/seismographic/instantel.php" )
     $('a#nav-ins').addClass('active');
	if ( path == "instrument/seismographic/white.php" )
     $('a#nav-ins').addClass('active');
	return false;
	});
  });
  
  // This function is for services dropdowns   
  $(function(){
	$('a#nav-ser').mouseover(function(){
      $('#dd-services').show();
    }).mouseout(function(){
      $('#dd-services').hide();
	return false;
	});
	$('#dd-services').mouseover(function(){
      $('#dd-services').show();
	  $('a#nav-ser').addClass('active');
    }).mouseout(function(){
      $('#dd-services').hide();
	  $('a#nav-ser').removeClass('active');
	var path = location.pathname.substring(1);
	if ( path == "services/equipment-monitoring.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/evaluation.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/laser-surveying.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/monitoring-programs.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/structural-surveys.php" )
     $('a#nav-ser').addClass('active'); 
   if ( path == "services/testing.php" )
     $('a#nav-ser').addClass('active'); 
   if ( path == "services/training.php" )
     $('a#nav-ser').addClass('active'); 	 
   return false;
	});
  });
  
  // This function is for software dropdowns   
  $(function(){
	$('a#nav-sof').mouseover(function(){
      $('#dd-software').show();
    }).mouseout(function(){
      $('#dd-software').hide();
	return false;
	});
	$('#dd-software').mouseover(function(){
      $('#dd-software').show();
	  $('a#nav-sof').addClass('active');
    }).mouseout(function(){
      $('#dd-software').hide();
	  $('a#nav-sof').removeClass('active');
	var path = location.pathname.substring(1);
	if ( path == "software/2D-laser-surveying.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/3D-laser-surveying.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/3D-survey-capture.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/asset-monitoring.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/cms.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/index.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/speed-vod.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/stock-control.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/stress-monitoring.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/transcap.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/wheel-impact.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/seismic-data-analysis.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/compu-blast.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/alpha-blast.php" )
     $('a#nav-sof').addClass('active');
	return false;
	});
  });

  // This function is for top square HOME & CONTACT navigation active class   
  $(function(){
   var path = location.pathname.substring(1);
   if ( path == "index2.php" )
     $('a#nav-hom').addClass('active');
   if ( path == "contact.php" )
     $('a#nav-con').addClass('active');
   return false;
  });
  
  // This function is for top square INSTRUMENT navigation active class   
  $(function(ins){
   var path = location.pathname.substring(1);
   if ( path == "instrument/borehole.php" )
     $('a#nav-ins').addClass('active');
   if ( path == "instrument/calibration.php" )
     $('a#nav-ins').addClass('active');
   if ( path == "instrument/seismographic/index.php" )
     $('a#nav-ins').addClass('active');
   if ( path == "instrument/laser-survey.php" )
     $('a#nav-ins').addClass('active');
   if ( path == "instrument/vod.php" )
     $('a#nav-ins').addClass('active');	 
   if ( path == "instrument/seismographic/instantel.php" )
     $('a#nav-ins').addClass('active');
   if ( path == "instrument/seismographic/white.php" )
     $('a#nav-ins').addClass('active');
   return false;
  });

  // This function is for left side INSTRUMENT navigation active class   
  $(function(){
   var path = location.pathname.substring(1);
   if ( path == "instrument/borehole.php" )
     $('li#boreh a').addClass('active');
   if ( path == "instrument/calibration.php" )
     $('li#calib a').addClass('active');
   if ( path == "instrument/seismographic/index.php" )
     $('li#instr a').addClass('active');
   if ( path == "instrument/laser-survey.php" )
     $('li#laser a').addClass('active');
   if ( path == "instrument/vod.php" )
     $('li#veloc a').addClass('active'); 
	if ( path == "instrument/seismographic/instantel.php" )
     $('li#instr a').addClass('active');
   if ( path == "instrument/seismographic/white.php" )
     $('li#instr a').addClass('active');
   return false;
  });

  // This function is for top square SERVICES navigation active class   
  $(function(){
   var path = location.pathname.substring(1);
   if ( path == "services/equipment-monitoring.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/evaluation.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/laser-surveying.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/monitoring-programs.php" )
     $('a#nav-ser').addClass('active');
   if ( path == "services/structural-surveys.php" )
     $('a#nav-ser').addClass('active'); 
   if ( path == "services/testing.php" )
     $('a#nav-ser').addClass('active'); 
   if ( path == "services/training.php" )
     $('a#nav-ser').addClass('active'); 	 
   return false;
  });
  
  // This function is for left side SERVICES navigation active class   
  $(function(){
   var path = location.pathname.substring(1);
   if ( path == "services/equipment-monitoring.php" )
     $('li#equip a').addClass('active');
   if ( path == "services/evaluation.php" )
     $('li#evalu a').addClass('active');
   if ( path == "services/laser-surveying.php" )
     $('li#laser a').addClass('active');
   if ( path == "services/monitoring-programs.php" )
     $('li#monit a').addClass('active');
   if ( path == "services/structural-surveys.php" )
     $('li#strut a').addClass('active'); 
   if ( path == "services/testing.php" )
     $('li#testi a').addClass('active'); 
   if ( path == "services/training.php" )
     $('li#train a').addClass('active'); 	 
   return false;
  });

  // This function is for top square SOFTWARE navigation active class   
  $(function(){
   var path = location.pathname.substring(1);
   if ( path == "software/2D-laser-surveying.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/3D-laser-surveying.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/3D-survey-capture.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/asset-monitoring.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/cms.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/index.php" )
     $('a#nav-sof').addClass('active'); 
	if ( path == "software/speed-vod.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/stock-control.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/stress-monitoring.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/transcap.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/wheel-impact.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/seismic-data-analysis.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/compu-blast.php" )
     $('a#nav-sof').addClass('active');
	if ( path == "software/alpha-blast.php" )
     $('a#nav-sof').addClass('active');
   return false;
  });

  // This function is for left side SOFTWARE navigation active class   
  $(function(){
   var path = location.pathname.substring(1);
   if ( path == "software/2D-laser-surveying.php" )
     $('li#2dlas a').addClass('active');
	if ( path == "software/3D-laser-surveying.php" )
     $('li#3dlas a').addClass('active');
	if ( path == "software/3D-survey-capture.php" )
     $('li#3dsur a').addClass('active');
	if ( path == "software/asset-monitoring.php" )
     $('li#remot a').addClass('active');
	if ( path == "software/cms.php" )
     $('li#conti a').addClass('active');
	if ( path == "software/index.php" )
     $('li#overv a').addClass('active');
	if ( path == "software/speed-vod.php" )
     $('li#speed a').addClass('active');
	if ( path == "software/stock-control.php" )
     $('li#inven a').addClass('active');
	if ( path == "software/stress-monitoring.php" )
     $('li#stres a').addClass('active');
	if ( path == "software/transcap.php" )
     $('li#trans a').addClass('active');
	if ( path == "software/wheel-impact.php" )
     $('li#wheel a').addClass('active');
	if ( path == "software/seismic-data-analysis.php" )
     $('li#seism a').addClass('active');
	if ( path == "software/compu-blast.php" )
     $('li#compu a').addClass('active');
	if ( path == "software/alpha-blast.php" )
     $('li#alpha a').addClass('active');
   return false;
  });
 
});