/****************************************************************************** * Module: custom.js.php * Author: Bmalloc Studio * Email: support@bmalloc.com * Web: http://www.bmalloc.com (Bmalloc Studio) * Date: Oct 04, 07 * Purpose: * Modified History: null *******************************************************************************/ function create_map_overlay(map,response) { /************** Create Mutiple Marks ********/ for (var i = 0; i < response.length; i++){ var latitude = response[i].getElementsByTagName("Latitude")[0].firstChild.nodeValue; var longitude = response[i].getElementsByTagName("Longitude")[0].firstChild.nodeValue; var id = response[i].getElementsByTagName("id")[0].firstChild.nodeValue; var pos = new GLatLng(latitude,longitude); //get tags var tabs = response[i].getElementsByTagName("Tab"); var infoTabs = new Array(); for(var j = 0; j < tabs.length; j++){ var tab_name = tabs[j].getElementsByTagName("TabName")[0].firstChild.nodeValue; var tab_content = tabs[j].getElementsByTagName("TabContent")[0].firstChild.nodeValue; infoTabs[j] = new GInfoWindowTab(tab_name,tab_content); } map.addOverlay(createMarker(pos, infoTabs,id)); } } function createMarker(point, infoTabs,id) { // Create a base icon for all of our markers that specifies the // shadow, icon dimensions, etc. var baseIcon = new GIcon(); baseIcon.shadow = ""; baseIcon.iconSize = new GSize(50, 31); baseIcon.shadowSize = new GSize(40, 17); baseIcon.iconAnchor = new GPoint(9, 34); baseIcon.infoWindowAnchor = new GPoint(9, 2); baseIcon.infoShadowAnchor = new GPoint(18, 25); // Create a lettered icon for this point using our icon class var icon = new GIcon(baseIcon); icon.image = "images/nisa (5).gif"; var marker = new GMarker(point, icon); GEvent.addListener(marker, "click", function() { marker.openInfoWindowTabsHtml(infoTabs); document.getElementById('tab1').innerHTML = ''; document.getElementById('tab2').innerHTML = ''; document.getElementById('tab3').innerHTML = ''; var loader1 = new net.ContentLoader("get_tab_html.php?tab=1&id=" + id,tab1_callback); var loader2 = new net.ContentLoader("get_tab_html.php?tab=2&id=" + id,tab2_callback); var loader3 = new net.ContentLoader("get_tab_html.php?tab=3&id=" + id,tab3_callback); }); return marker; } function tab1_callback() { var mydiv = document.getElementById('tab1'); mydiv.innerHTML = this.req.responseText; } function tab2_callback() { var mydiv = document.getElementById('tab2'); mydiv.innerHTML = this.req.responseText; } function tab3_callback() { var mydiv = document.getElementById('tab3'); mydiv.innerHTML = this.req.responseText; change_people('stop'); } function change_people(direction){ var people_index = parseInt(document.getElementById('people_index').value); var directions = new Array(); directions['prev'] = -1; directions['next'] = 1; directions['stop'] = 0; var peoples = new Array(); //Don's Info. peoples[0] = new Array(); peoples[0]['title'] = 'VP Sales and Marketing'; peoples[0]['name'] = 'Don Bonner'; peoples[0]['image'] = 'images/no_image.jpg'; peoples[0]['email'] = 'sales@nisa.com'; peoples[0]['phone'] = '250-741-8483'; //Robin's Info peoples[1] = new Array(); peoples[1]['title'] = 'Accounting and Support'; peoples[1]['name'] = 'Robin Boxwell'; peoples[1]['image'] = 'images/no_image.jpg'; peoples[1]['email'] = 'robin@nisa.com'; peoples[1]['phone'] = '250-741-8483'; //Chris's Info peoples[2] = new Array(); peoples[2]['title'] = 'Senior Web Programmer'; peoples[2]['name'] = 'Chris Schneck'; peoples[2]['image'] = 'images/no_image.jpg'; peoples[2]['email'] = 'chirs@nisa.com'; peoples[2]['phone'] = '250-741-8483'; //Scott's Info peoples[3] = new Array(); peoples[3]['title'] = 'Senior Web Programmer'; peoples[3]['name'] = 'Scott Wang'; peoples[3]['image'] = 'images/thinking.jpg'; peoples[3]['email'] = 'scott@nisa.com'; peoples[3]['phone'] = '250-741-8483'; //Amy's Info peoples[4] = new Array(); peoples[4]['title'] = 'Graphic/Web Designer'; peoples[4]['name'] = 'Amy Liu'; peoples[4]['image'] = 'images/no_image.jpg'; peoples[4]['email'] = 'amy@nisa.com'; peoples[4]['phone'] = '250-741-8483'; people_index += directions[direction]; if(people_index < 1){ people_index = peoples.length; }else if(people_index > peoples.length){ people_index = 1; } document.getElementById('people_title').innerHTML = peoples[people_index-1]['title']; document.getElementById('people_name').innerHTML = 'Name: ' + peoples[people_index-1]['name']; document.getElementById('people_image').innerHTML = ''; document.getElementById('people_email').innerHTML = 'Email: ' + peoples[people_index-1]['email']; document.getElementById('people_phone').innerHTML = 'Phone: ' + peoples[people_index-1]['phone']; document.getElementById('people_index').value = people_index + ''; }