Maddocks Group

Industrial Filter Division

1-800-263-8660

(905) 549-9626
sales@maddocksgroup.com

663 Woodward Avenue
Hamilton, Ontario, Canada L8H 6P3


Please enter your location for driving directions to Maddocks.



Traffic
'); pwin.document.close(); setTimeout(function(){pwin.close();},1000); } var chosen = []; // Object of available layers var layers = { "pano": new google.maps.panoramio.PanoramioLayer(), "traffic": new google.maps.TrafficLayer(), "biking": new google.maps.BicyclingLayer() }; /* Returns true if a checkbox is still checked * otherwise false */ function checkChecked() { var boxes = document.getElementsByName("box"); for (var i = 0; i < boxes.length; i++) { if (boxes[i].checked) return true; } return false; } function adaptButton(is_on) { var $ = function(_id) { return document.getElementById(_id) }; var hider = $("remover"); var text = $("clicktarget"); if (is_on) { // Reset chosen array chosen.length = 0; // Highlight the link and make the button font bold hider.className ="highlight"; text.style.fontWeight = "bold"; } else { // Reset the link and the button when all checkboxes are unchecked if (!checkChecked()) { hider.blur(); hider.className =""; text.style.fontWeight = "normal"; } } } function switchLayer(is_on, id) { var layer = layers[id]; // Filter for Panoramio pictures if (layer.setTag) { layer.setTag("big"); // layer.setUserId("12345678"); } if (is_on) { layer.setMap(map); } else { layer.setMap(null); } adaptButton(is_on); } function setPois(is_on) { // Enables and disables all pois var style = {}; style.featureType = "poi"; style.stylers = [{visibility : (is_on ? "on" : "off") }]; return [style]; } function shiftPois(is_on) { map.setOptions({styles: setPois(is_on) }); adaptButton(is_on); } function hideAll() { var boxes = document.getElementsByName("box"); for (var i = 0, m; m = boxes[i]; i++) { if (m.checked) { m.checked = false; if (m.id != "pois") { switchLayer(false, m.id); } else { shiftPois(false); } // Store id's of turned off layers to make them recallable by button click chosen.push(m.id); } } } function toggleLayers(e) { /* Taking care of the clicked target * because every click on a checkbox may also be a button click. * We only need real button clicks here */ var target = e ? e.target : window.event.srcElement; if (target.id != "clicktarget") return; if (chosen.length > 0 ) { /* Make an independent copy of chosen array * since it possibly will be reset. */ var copy = chosen.slice(); for (var i = 0, m; m = copy[i]; i++) { if (m != "pois") switchLayer(true, m); else shiftPois(true); document.getElementById(m).checked = true; } } else { hideAll(); } } function MoreControl() { var g = google.maps; var me = this; var outer = document.createElement("div"); outer.style.width = "93px"; var inner = document.createElement("div"); inner.id = "more_inner"; inner.className = "button"; inner.title ="Show/Hide layers"; var text = document.createElement("div"); text.id = "clicktarget"; text.appendChild(document.createTextNode("More...")); inner.appendChild(text); outer.appendChild(inner); // Take care of the clicked target inner.onclick = toggleLayers; var swingmenu = document.getElementById("swingbox"); inner.appendChild(swingmenu); outer.onmouseover = function() { if (me.timer) clearTimeout(me.timer); swingmenu.style.display = "block"; }; outer.onmouseout = function() { me.timer = setTimeout(function() { swingmenu.style.display = "none"; }, 300); }; map.controls[g.ControlPosition.TOP_RIGHT].push(outer); } // window.onload = function() { // // var g = google.maps; // var center = new g.LatLng(43.445753, -79.850178); // var pois = setPois(false); // var opts_map = { // center: center, zoom: 5, // streetViewControl: false, // draggableCursor:'auto', // mapTypeId: g.MapTypeId.ROADMAP, // styles: pois // }; // // map = new g.Map(document.getElementById("mapdiv"), opts_map); // // // Add self created control // var more_control = new MoreControl(); // };