ie4 = false;
ns4 = false;
ns6 = false;
if(document.all){ie4 = true;}	
else if(document.layers){ns4 = true;}
else if(!document.all && document.getElementById) {ns6 = true;}


function MM_openBrWindow(theURL,winName,features) { //v2.0
 var theNewWin = window.open(theURL,winName,features);
theNewWin.moveTo(0,0);
}

function MM_openBrWindow2(theURL,winName,features) { //v2.0
 var theNewWin = window.open(theURL,winName,features);
}



function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

topcnt = -31;

function getRefElement(eid)
{
  if (document.getElementById) 
    var RefElement = document.getElementById(eid);
  else if (document.all) 
    var RefElement = document.all[eid];
  return RefElement;
}

function findItFast( sh )
{

	var RefElement = getRefElement("finditfaston");
	if ( sh == "s" ) {

		if (RefElement && RefElement.style)
		{ 
			RefElement.style.display = "none";
			changeImages('finditfast', pathtoroot+'/images/finditfast-over.gif');			
			basicexpand("finditfaston");
			basiccontract("finditfastoff");	
		}
	
	} else {

		if (RefElement && RefElement.style)
		{ 
			RefElement.style.display = "none";
			changeImages('finditfast', pathtoroot+'/images/finditfast.gif');					
			basiccontract("finditfaston");
			basicexpand("finditfastoff");	
		}
	
	}

}

function basicexpand(id)
{
  var RefElement = getRefElement(id);
  if (RefElement && RefElement.style)
    RefElement.style.display = "";
}

function basiccontract(id)
{
  var RefElement = getRefElement(id);
  if (RefElement && RefElement.style)
	RefElement.style.display = "none";
}

function toggle(id)
{
  var RefElement = getRefElement(id);
  if (RefElement && RefElement.style)
  { 
	if(RefElement.style.display == "none")
		basicexpand(id);
	else
		basiccontract(id);
  }
}

function movemenu()
{
  var RefElement = getRefElement("topnav");
  topcnt = (topcnt + 1);
  RefElement.style.top = topcnt;
  if ( topcnt < 0 )    
  {
    command = "movemenu()";
    setTimeout(command,1);
  } 

    if ( getRefElement("redmenubox") ) 
	  addEvent(document.getElementById('redmenubox'), 'mouseout', clearRedTextbox);  
    else if ( getRefElement("menubox") ) 
	  addEvent(document.getElementById('menubox'), 'mouseout', clearRedTextbox);  
    else if ( getRefElement("bluemenubox") ) 
	  addEvent(document.getElementById('bluemenubox'), 'mouseout', clearRedTextbox);  
}

function clearTextbox()
{
	changeImages('home', pathtoroot + '/images/mm_home.gif');
	changeImages('aboutus', pathtoroot + '/images/mm_aboutus.gif');
	changeImages('products', pathtoroot + '/images/mm_products.gif');
	changeImages('quotes', pathtoroot + '/images/mm_quotes.gif');
	changeImages('applications', pathtoroot + '/images/mm_applications.gif'); 
	changeImages('news', pathtoroot + '/images/mm_news.gif'); 
	changeImages('home', pathtoroot + '/images/mm_home.gif');	
	
	if (getRefElement('redmenubox')){
	    var RefElement = getRefElement('redmenubox');
	} else if (getRefElement('menubox')) {
	    var RefElement = getRefElement('menubox');
	} else if (getRefElement('bluemenubox')) {
	    var RefElement = getRefElement('bluemenubox');
	}
  
    RefElement.style.display = "none";
}

function clearRedTextbox(e)
{

	if (!e) var e = window.event;
	var tg = (window.event) ? e.srcElement : e.target;
	if (tg.nodeName != 'DIV') return;
	var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	while (reltg != tg && reltg.nodeName != 'BODY')
		reltg= reltg.parentNode
	if (reltg== tg) return;
	
	if (getRefElement('redmenubox')){
	    var RefElement = getRefElement('redmenubox');
    	RefElement.style.display = "none";
	} else if (getRefElement('menubox')) {
	    var RefElement = getRefElement('menubox');
    	RefElement.style.display = "none";
	} else if (getRefElement('bluemenubox')) {
	    var RefElement = getRefElement('bluemenubox');
    	RefElement.style.display = "none";
	}

}

function showTextbox(txtblk,eid,e)
{
  clearTextbox();
	
  if (txtblk == "aboutus") {

/*   var txt = 
		'<a href="'+pathtoroot+'/aboutus/offices.html" class="menunav">Our Offices</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/ourpeople.html" class="menunav">Our People</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/codeofethics.html" class="menunav">Code of Ethics</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/employment.html" class="menunav">Employment</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + 
		'<a href="'+pathtoroot+'/aboutus/history.html" class="menunav">History</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/internship.html" class="menunav">Internship Program</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/testimonials.html" class="menunav">Testimonials</a>';

*/

   var txt = 
		'<a href="'+pathtoroot+'/aboutus/offices.html" class="menunav">Offices</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/ourpeople.html" class="menunav">Staff Bios</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/aboutus/aboutshsmith.html" class="menunav">About S. H. Smith</a>';


	    marginright = 375;
  } else if (txtblk == "products") {
   var txt = 
		'<a href="'+pathtoroot+'/products/markets.html" class="menunav">Markets</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/products/products.html" class="menunav">Products</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +		
		'<a href="'+pathtoroot+'/products/industries.html" class="menunav">Industries</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/products/keypeople.html" class="menunav">Key People</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/products/requestlossrun.html" class="menunav">Request Loss Run</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		marginright = 200; 
  } else if (txtblk == "quotes") {
   var txt =
		'<a href="/quotes/instantquotes.html" class="menunav">Online Quotes</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="/quotes/telephone.html" class="menunav">Telephone Quotes</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';		

/*		 + '<a href="'+pathtoroot+'/cgi-bin/search/apps.pl" class="menunav">Applications</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="/quotes/instantquotes.html" class="menunav">Instant Quotes</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
		'<a href="http://www.eriskservices.com/BAMApSel.asp?Broker=MVT0PUBSDK&CompanyID=JavaKid"  class="menunav">Live Rating</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="http://www.aigexcess.com" class="menunav" target="_blank">AIG Excess</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +

				
		'<a href="'+pathtoroot+'/cgi-bin/applications/formapp.cgi." class="menunav">Online</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
*/

		marginright = 145;
  } else if (txtblk == "applications") {
   var txt = 
		'<a href="'+pathtoroot+'/apps/index.php" class="menunav">Applications Database</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		marginright = 115;      
  } else if (txtblk == "news") {
   var txt =
		'<a href="'+pathtoroot+'/news/flyers.html" class="menunav">Flyers</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/news/outandabout.html" class="menunav">Out &amp; About</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/news/awards.html" class="menunav">Awards &amp; Recognition</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/news/pressreleases.html" class="menunav">Press Releases</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/news/newsletters.html" class="menunav">Newsletters</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
	    marginright = 2;      
  } else if (txtblk == "mainlinks") {
   var txt = '<a href="'+pathtoroot+'/index.html" class="menunav">Main page</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
			'<a href="'+pathtoroot+'/aboutus/index.html" class="menunav">About Us</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
			'<a href="'+pathtoroot+'/products/index.html" class="menunav">Products + Services</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
			'<a href="'+pathtoroot+'/quotes/index.html" class="menunav">Quotes</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
			'<a href="'+pathtoroot+'/cgi-bin/srch/apps.pl" class="menunav">Applications</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
			'<a href="'+pathtoroot+'/news/index.html" class="menunav">Press Room</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
	    marginright = 5;    
  } else if (txtblk == "pr-awards") {
    var txt = "Awards and Recognition:	Check out our awards--and our award winning materials.";
	    marginright = 5;    
  } else if (txtblk == "pr-press") {
   var txt = "We're making news.";
	    marginright = 5;    
  } else if (txtblk == "pr-newsletter") {
   var txt = "Stay on top of the latest trends by subscribing to our newsletters.";
	    marginright = 5;    
  } else if (txtblk == "apps-database") {
   var txt = "press S.H. Smith & Company, Inc. is one of the largest independently owned excess ";
	    marginright = 5;    
  } else if (txtblk == "prod-markets") {
   var txt = 
	   '<a href="'+pathtoroot+'/whatshot.html" class="menunav">What&#039;s Hot</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
	   '<a href="'+pathtoroot+'/marketnews.html" class="menunav">Market News</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
 		'<a href="'+pathtoroot+'/keypeople.html" class="menunav">Key People/Product Lines</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
	    marginright = 5;    
  } else if (txtblk == "prod-products") {
   var txt = 
		'<a href="'+pathtoroot+'/riskcategories.html" class="menunav">Risk Categories</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/largecommercial.html" class="menunav">Large Commercial Casualty</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/professionalliability.html" class="menunav">Professional Liability/D&amp;O</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/smallaccounts.html" class="menunav">Small Accounts</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/workerscomp.html" class="menunav">Workers Compensation</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/progadmin.html" class="menunav">Risk Purchasing Groups</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/property.html" class="menunav">Property</a><p>';
	    marginright = 5;    
  } else if (txtblk == "prod-industries") {
   var txt = '<a href="'+pathtoroot+'/industries_contracting.html" class="menunav">Contracting</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +	
			'<a href="'+pathtoroot+'/industries_realestate.html" class="menunav">Real Estate</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +	
			'<a href="'+pathtoroot+'/industries_educational.html" class="menunav">Educational</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +	
			'<a href="'+pathtoroot+'/industries_healthcare.html" class="menunav">Health Care</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +	
			'<a href="'+pathtoroot+'/industries_hospitality.html" class="menunav">Hospitality</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +	
			'<a href="'+pathtoroot+'/industries_technology.html" class="menunav">Technology</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

	    marginright = 5;    
  } else if (txtblk == "prod-key") {
   var txt = '<a href="'+pathtoroot+'/keypeople.html" class="menunav">Key People/Product Lines</a>';
	    marginright = 5;    
   
  } else if (txtblk == "aboutus-offices") {
	var txt = 
		'<a href="'+pathtoroot+'/offices.html" class="menunav">Our Offices</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/offices_westhartford.html" class="menunav">Connecticut</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +	
		'<a href="'+pathtoroot+'/offices_portorange.html" class="menunav">Florida</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/offices_boston.html" class="menunav">Massachusetts</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/offices_stpaul.html" class="menunav">Minnesota</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'offices_newyork.html" class="menunav">New York</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/offices_cleveland.html" class="menunav">Ohio</a>' ;
	    marginright = 5;    
 } else if (txtblk == "aboutus-ourpeople") {
	var txt = 
		'<a href="'+pathtoroot+'/ourpeople.html" class="menunav">Our People</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<A href="'+pathtoroot+'/bios.html" class="menunav">Biographies</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/contact/index.html" class="menunav">Contact Info</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
		'<a href="'+pathtoroot+'/keypeople.html" class="menunav">Key People/Product Lines</a>';
	    marginright = 5;    
  } else if (txtblk == "aboutus-codeofethics") {
	var txt = "Our commitment to our clients";
	    marginright = 5;    
  } else if (txtblk == "aboutus-employment") {
	var txt = "Find out about current job opportunities with S.H.Smith &amp; Company";
	    marginright = 5;    
  }

   boxlength = 20; 
  
  var RefElement = getRefElement(eid);
  RefElement.style.display = "block";
  RefElement.style.marginRight = marginright;  
  RefElement.innerHTML = txt;  
}

function rolldown(eid)
{
  var RefElement = getRefElement(eid);
  heightcnt = heightcnt + 10;
  RefElement.style.height = heightcnt;
  if ( heightcnt < boxlength )    
  {
    command = "rolldown('" + eid + "')";
    setTimeout(command,1);
  } 
}

function rollup(eid) {
  var RefElement = getRefElement(eid);
  heightcnt = heightcnt - 10;
  RefElement.style.height = heightcnt;
  //document.forms[0].ht.value = heightcnt;  
  if ( heightcnt > 0 )    
  {
    command = "rollup('" + eid + "')";
    setTimeout(command,1);
  } else {
    RefElement.style.display = "none";    
  }
  
}
	
function ScreenDimen( wh )
{
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winW = window.innerWidth;
      winH = window.innerHeight;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth;
      winH = document.body.offsetHeight;
     }
    }
    
    if ( wh == "w" ) return winW;
    if ( wh == "h" ) return winH;    

}
        
function getXpos(e)
{
	if(e)
	{
	    if (ie4){
		xmouse = e.screenX;
		ymouse = e.screenY;
		} else if (ns4){
		xmouse = e.x;
		ymouse = e.y;
		} else if (ns6){
		xmouse = e.pageX;
		ymouse = e.pageY;
		}
		
		return xmouse;
	}	
}

function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}

if ( getRefElement("topnav") ) getRefElement("topnav").style.top = -31;
