

// START Top Nav Rollover Scripts

navAboutOn = new Image();
navAboutOn.src = "http://www.hornigcompanies.com/images/topnav_about_on.gif"
navAboutOff = new Image();
navAboutOff.src = "http://www.hornigcompanies.com/images/topnav_about_off.gif"

navDifferenceOn = new Image();
navDifferenceOn.src = "http://www.hornigcompanies.com/images/topnav_difference_on.gif"
navDifferenceOff = new Image();
navDifferenceOff.src = "http://www.hornigcompanies.com/images/topnav_difference_off.gif"

navServicesOn = new Image();
navServicesOn.src = "http://www.hornigcompanies.com/images/topnav_services_on.gif"
navServicesOff = new Image();
navServicesOff.src = "http://www.hornigcompanies.com/images/topnav_services_off.gif"

navCommunityOn = new Image();
navCommunityOn.src = "http://www.hornigcompanies.com/images/topnav_community_on.gif"
navCommunityOff = new Image();
navCommunityOff.src = "http://www.hornigcompanies.com/images/topnav_community_off.gif"

navNewsOn = new Image();
navNewsOn.src = "http://www.hornigcompanies.com/images/topnav_news_on.gif"
navNewsOff = new Image();
navNewsOff.src = "http://www.hornigcompanies.com/images/topnav_news_off.gif"

navContactOn = new Image();
navContactOn.src = "http://www.hornigcompanies.com/images/topnav_contact_on.gif"
navContactOff = new Image();
navContactOff.src = "http://www.hornigcompanies.com/images/topnav_contact_off.gif"

function rollover(whichimg,overimg) {
	eval('document.images["' + whichimg + '"].src = ' + overimg + '.src');
}
// END Top Nav Rollover Scripts

// START Drop Down Menus

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function show(id) {
	if (id == "dropdown_about"){clearTimeout(timeoutID1)}
	else if (id == "dropdown_difference"){clearTimeout(timeoutID2)}
	else if (id == "dropdown_services"){clearTimeout(timeoutID3)}

	if (ns4) document.layers[id].visibility = "show"
	else if (ie4) document.all[id].style.visibility = "visible"
	else if(!document.all && document.getElementById) document.getElementById(id).style.visibility = "visible"
}

var timeoutID1 = 0
var timeoutID2 = 0
var timeoutID3 = 0

function hide(id) {
	if (id == "dropdown_about"){timeoutID1 = setTimeout("hide2('dropdown_about')",800)}
	else if (id == "dropdown_difference"){timeoutID2 = setTimeout("hide2('dropdown_difference')",800)}
	else if (id == "dropdown_services"){timeoutID3 = setTimeout("hide2('dropdown_services')",800)}
}

function hide2(id) {
	if (ns4) document.layers[id].visibility = "hide"
	else if (ie4) document.all[id].style.visibility = "hidden"
	else if(!document.all && document.getElementById) document.getElementById(id).style.visibility = "hidden"
}

// END Drop Down Menus

// START Telescoping Functions

function showItem(id) {
	document.getElementById("item"+id).className = "itemList_expanded";
	document.getElementById("plus"+id).className = "hideBtn";
	document.getElementById("minus"+id).className = "showBtn";
}
function hideItem(id) {
	document.getElementById("item"+id).className = "itemList_collapsed";
	document.getElementById("plus"+id).className = "showBtn";
	document.getElementById("minus"+id).className = "hideBtn";
}

// END Telescoping Functions


/*
Some additional JavaScript
*/

function open_print(gohere) {
    window.open(gohere, "print", config="height=400,width=600,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,top=0,left=0")
}

function open_email(gohere) {
    window.open(gohere, "email", config="height=475,width=500,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,top=0,left=0")
}

function open_faq(gohere) {
    window.open(gohere, "faq", config="height=475,width=500,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,top=0,left=0")
}

function confirmSubmit() {
    var agree=confirm("Do you really want to mark this prospect as in the database?");

    if (agree) return true ;
    else return false ;
}

function toggle_display(display_area) {
    if (document.getElementById(display_area)) { 
        var display_element = document.getElementById(display_area);
        display_element.style.display = display_element.style.display == "none" ? "block":"none"; 
    }
}

function show_block(block)
{
	//alert(block);
	document.getElementById(block).style.display = "block";
}

function open_me(gohere)
{
	window.open(gohere, "popup", config="width=475,height=450,scrollbars=yes,toolbar=no,menubar=yes,resizable=no,top=0,left=0");
}

function printMe(gohere)
{
	window.open(gohere, "print", config="width=600,height=450,scrollbars=yes,toolbar=no,menubar=yes,resizable=no,top=0,left=0");
}
function emailMe(gohere)
{
	window.open(gohere, "print", config="width=600,height=450,scrollbars=yes,toolbar=no,menubar=yes,resizable=no,top=0,left=0");
}




    function showAddress(address) {
        var map = null;
        var geocoder = null;

      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        geocoder = new GClientGeocoder();
      }
    
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              map.addControl(new GSmallMapControl());
              map.addControl(new GMapTypeControl());              
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }