function ctlSearch_OnClick ()
{
 var url;
 var theform = document.frmSearchBox;
 
 if (theform.keyword.value.length < 2)
 {
  alert('Please enter at least two characters.');
  theform.keyword.focus();
 }
 else
 {
 var iIndex = theform.ddlSearchType.selectedIndex;
 var sSearchType = theform.ddlSearchType.options[iIndex].value;
  
// Version 2.7 release
// 1. using default Domain, like "orientalmotor.thomasnet.com" in our sample 
// 2. using root category shortName, like "all-categories" in our sample
  url = "http://industrialwerks.stage.thomasnet.com/keyword/?&plpver=10&key=all&keycateg=100"
  url = url + "&SchType=" + sSearchType;
  url = url + "&keyword=" + encodeURI(theform.keyword.value);
  url = url + "&refer=" + encodeURI("http://" + document.location.hostname);
   
  document.location.href = url;
 }
//alert (url);    
}   




URL = window.location.href; 
indexhtml = (URL.indexOf('index.') > -1); 
rfqhtml = (URL.indexOf('request/all-categories') > -1); 
contacthtml = (URL.indexOf('contact.') > -1); 
newshtml = (URL.indexOf('news.') > -1); 
industrialhtml = (URL.indexOf('industrial-machinery-equipment-moving') > -1);
millwrighthtml = (URL.indexOf('all-categories/millwright-services') > -1);
weldinghtml = (URL.indexOf('welding-and-fabrication-services') > -1);
heavyhtml = (URL.indexOf('heavy-equipment-trucking') > -1);
demolitionhtml = (URL.indexOf('all-categories/demolition-services') > -1);
mechanicalhtml = (URL.indexOf('all-categories/mechanical-contracting') > -1);
constructionhtml = (URL.indexOf('all-categories/construction') > -1);
machineryhtml = (URL.indexOf('machinery-equipment-storage') > -1); 

 

window.onload = function navigations(){ 
if (indexhtml) { 
var x=document.getElementById("home"); 
x.className = 'highlight_class'; 
} 

else if (contacthtml){ 
var x=document.getElementById("contact"); 
x.className = 'highlight_class'; 
} 

else if (rfqhtml){ 
var x=document.getElementById("rfq"); 
x.className = 'highlight_class'; 
} 



else if (newshtml){ 
var x=document.getElementById("news"); 
x.className = 'highlight_class'; 
}


else if (industrialhtml){ 
var x=document.getElementById("industrial"); 
x.className = 'highlight_leftnav'; 
} 


else if (millwrighthtml){ 
var x=document.getElementById("millwright"); 
x.className = 'highlight_leftnav'; 
} 
else if (weldinghtml){ 
var x=document.getElementById("welding"); 
x.className = 'highlight_leftnav'; 
} 
else if (heavyhtml){ 
var x=document.getElementById("heavy"); 
x.className = 'highlight_leftnav'; 
} 
else if (demolitionhtml){ 
var x=document.getElementById("demolition"); 
x.className = 'highlight_leftnav'; 
} 
else if (mechanicalhtml){ 
var x=document.getElementById("mechanical"); 
x.className = 'highlight_leftnav'; 
} 

else if (constructionhtml){ 
var x=document.getElementById("construction"); 
x.className = 'highlight_leftnav'; 
} 

else if (machineryhtml){ 
var x=document.getElementById("machinery"); 
x.className = 'highlight_leftnav'; 
} 







































} 
