function initMap(targetCollege) 
    {
    if (GBrowserIsCompatible()) 
        {
        var map = new GMap2(document.getElementById("map"));
        map.enableScrollWheelZoom();
        map.addControl(new GSmallMapControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT));
        map.setCenter(new GLatLng(44.7, -92), 6); 
        var colleges = getColleges();
        for(i=0; i < colleges.length; i++)  
            {
            var currentMarker = addMarker(map,colleges[i]);
            addViewAll(map);
            if (targetCollege == colleges[i][0])
                {
                // Let's Zoom into the target College
                var lat = currentMarker.getLatLng().lat();
                var lng = currentMarker.getLatLng().lng() - 1;
                map.setCenter(new GLatLng(lat,lng), 10);
                var html = createHtml(colleges[i][0],colleges[i][4],colleges[i][5],colleges[i][6],colleges[i][7],colleges[i][8],colleges[i][9]);
                currentMarker.openInfoWindowHtml(html,{maxWidth:300});
                }    
            }
        }
    }

function getColleges()
    {
    // Array: 0 = Name, id = 1, 2 = Latitude, 3 = Longitude, 4 = phone, 5 = phonetty, 6 = website, 7 = address, 8 = Description, 9 = image 
    var collegeLatLng = new Array();
    collegeLatLng[0] = new Array('Blackhawk Technical College', 'BTC', 42.593189, -89.011381, '608-758-6900', '608-743-4422 (TTY)', 'www.blackhawk.edu', '6004 S. County Road G Janesville, WI 53547', 'Blackhawk Tech provides comprehensive technical training and community education on its campuses in Janesville and Monroe and state-of-the-art training centers in aviation and transportation studies.', '3995_WTCS_web_blackhawk.jpg');
    collegeLatLng[1] = new Array('Chippewa Valley Technical College', 'CVTC', 44.793230, -91.505930, '715-833-6200','715-833-6509 (TTY)', 'www.cvtc.edu', '620 W. Clairemont Ave. Eau Claire, WI 54701', 'Five campuses&mdash;Chippewa Falls, Eau Claire, Menomonie, Neillsville and River Falls&mdash;offer plenty of room for this college’s 20,000+ student body to study. And with CVTC Flex, students have plenty of off-campus options.', '3995_WTCS_web_chippewa.jpg');
    collegeLatLng[2] = new Array('Fox Valley Technical College', 'FVTC', 44.278561, -88.456474, '800-735-3882', '920-993-5106 (TTY)', 'www.fvtc.edu', '1825 N. Bluemound Dr. Appleton, WI 54912', 'About 50,000 students fill Fox Valley’s Appleton, Chilton, Clintonville, Neenah, Oshkosh, Waupaca and Wautoma campuses. The college offers 200+ career-centered programs, including aviation, printing technologies, robotics and wildland firefighter.', '3995_WTCS_web_foxvalley.jpg');
    collegeLatLng[3] = new Array('Gateway Technical College', 'GTC', 42.663445, -88.521998, '262-564-2201', '262-564-2206 (TTY)', 'www.gtc.edu', '', 'There are more than 65 career-focused degrees to explore at Gateway’s campuses in Burlington, Elkhorn, Kenosha, Pleasant Prairie, Racine, and Sturtevant. Discover your options by visiting Gateway’s <a href="www.gtc.edu">Web site</a> online.', '3995_WTCS_web_gateway_aviation.jpg');
    collegeLatLng[4] = new Array('Lakeshore Technical College', 'LTC', 43.921495, -87.735356, '888-468-6582', '920-693-8956 (TTY)', 'www.gotoltc.edu', '1290 North Avenue Cleveland, WI 53015', 'Lakeshore offers nearly 90 different career-focused academic programs. Add cutting-edge opportunities in Nuclear Technology and Wind Energy Technology, and this college\'s 14,000 students have plenty to choose from - on campus in Cleveland or through flexible learning options.', '3995_WTCS_web_lakeshore.jpg');
    collegeLatLng[5] = new Array('Madison Area Technical College', 'MATC', 43.120749, -89.326748, '608-246-6100', '800-322-6282 (TTY)', 'www.matcmadison.edu', '3550 Anderson Street Madison, WI 53704', 'With nearly 45,000 students from 12 counties on 5 campuses&mdash;in Fort Atkinson, Madison, Portage, Reedsburg and Watertown&mdash;MATC is a nationally recognized tech college&mdash;and one of Wisconsin’s largest.', '3995_WTCS_web_madison.jpg');
    collegeLatLng[6] = new Array('Mid-State Technical College', 'MSTC', 44.393044, -89.786997, '715-422-5300', '866-331-3603 (TTY)', 'www.mstc.edu', '500 32nd Street North Wisconsin Rapids, WI 54494', 'On MSTC’s Adams, Marshfield, Stevens Point and Wisconsin Rapids campuses, 11,000 students have access to over 50 of the latest career opportunities—including 5 new renewable energy programs and urban forestry.', '3995_WTCS_web_midstate.jpg');
    collegeLatLng[7] = new Array('Milwaukee Area Technical College', 'MTC', 43.042993, -87.920259, '414-297-6282', '414-297-6986 (TTY)', 'www.matc.edu', '700 West State Street Milwaukee, WI 53233', 'Boasting more than 200 programs for career-focused learners on its Mequon, Milwaukee, Oak Creek and West Allis campuses, Milwaukee Area has lots to offer the 55,000 students it enrolls.', '3995_WTCS_web_milwaukee.jpg');
    collegeLatLng[8] = new Array('Moraine Park Technical College', 'MPTC', 43.784976, -88.421800, '800-472-4554', '920-929-2109 (TTY)', 'www.morainepark.edu', '235 North National Ave. Fond du Lac, WI 54935', 'A complete college experience is what Moraine Park offers its 24,000 students. The College\'s international studies opportunities, student clubs and national competitions combine with more than 100 programs and certificates—20 offered completely online—to ensure students meet their educational and career goals.', '3995_WTCS_web_morraine.jpg');
    collegeLatLng[9] = new Array('Nicolet Area Technical College', 'NATC', 45.610920, -89.415036, '715-365-4451', '715-365-4558 (TTY)', 'www.nicoletcollege.edu', '5364 College Drive Rhinelander, WI 54501', 'On the shores of Lake Julia, the 280-acre wooded Rhinelander campus offers 1,500 students a semester a beautiful place to study its 30+ academic programs including four-year collegiate transfers. The college also has a campus in Minocqua.', '3995_WTCS_web_nicolet.jpg');
    collegeLatLng[10] = new Array('Northcentral Technical College', 'NTC', 44.988089,-89.648296, '888-NTC-7144', '715-675-6341 (TTY)', 'www.ntc.edu', '1000 West Campus Drive Wausau, WI 54401', 'NTC offers over 150 degree, diploma and certificate programs, including those that transfer to four-year colleges. Over 20,000 learners experience hands-on learning opportunities at the College’s Antigo, Medford, Merrill, Phillips, Spencer, Wausau and Wittenberg campuses.', '3995_WTCS_web_northcentral.jpg');
    collegeLatLng[11] = new Array('Northeast Wisconsin Technical College', 'NWTC', 44.523995, -88.104282, '920-498-5444', '920-498-6390 (TTY)', 'www.nwtc.edu', '2740 W. Mason Street Green Bay, WI 54303', 'With over 43,000 students served per year, NWTC offers 170 degrees, diplomas, apprenticeships and certificates. Specialized programs include renewable energy, manufacturing engineering and digital media.', '3995_WTCS_web_northeast.jpg');
    collegeLatLng[12] = new Array('Southwest Wisconsin Technical College', 'SWTC', 42.973083, -90.635800, '608-822-3262', '608-822-2072', 'www.swtc.edu', '1800 Bronson Blvd. Fennimore, WI 53809', 'While Southwest Tech in Fennimore presently serves nearly 12,000 students, it also is preparing for future learners with plans to build four new facilities, including a flagship Health Sciences Building and a Public Safety Training complex, which will be completed in 2010. Schedule a program shadow for a close-up look at this changing and growing college.', '3995_WTCS_web_southwest.jpg');
    collegeLatLng[13] = new Array('Waukesha County Technical College', 'WCTC', 43.071992, -88.255330, '262-691-5566', '262-691-5088 (TTY)', 'www.wctc.edu', '800 Main Street Pewaukee, WI 53072', 'WCTC leads the way in providing cutting-edge technology, exceptional employer connections and individualized attention.  Over 30,000 students a year enjoy the modern facilities in Pewaukee, Waukesha and Menomonee Falls.', '3995_WTCS_web_waukesha.jpg');
    collegeLatLng[14] = new Array('Western Technical College', 'WTC', 43.815018, -91.246812, '608-785-9553', '608-785-9551 (TTY)', 'www.westerntc.edu', '400 Seventh Street North La Crosse, WI 54601', 'There are more than 200 scholarships available to the 20,000+ students on Western’s Black River Falls, Independence, La Crosse, Mauston, Sparta, Tomah and Viroqua campuses. Western’s regional campuses bring your education within arms’ reach.', '3995_WTCS_web_western.jpg');
    /* collegeLatLng[15] = new Array('Wisconsin Indianhead Technical College', 'WITC', 46.546291, -90.885822, '800-243-9482', '888-261-8578 (TTY)', 'www.witc.edu', '505 Pine Ridge Dr. Shell Lake, WI 54871', 'Ranked one of America’s Top 10 Technical Colleges by <i>Washington Monthly</i>, Wisconsin Indianhead offers over 50 programs and certificates, including 7 unique programs. WITC serves over 25,000 students at campuses in Ashland, New Richmond, Rice Lake and Superior.', '3995_WTCS_web_indianhead_ashland.jpg'); */
    collegeLatLng[15] = new Array('Wisconsin Indianhead Technical College', 'WITC', 45.747574, -91.916132, '800-243-9482', '888-261-8578 (TTY)', 'www.witc.edu', '505 Pine Ridge Dr. Shell Lake, WI 54871', 'Ranked one of America’s Top 10 Technical Colleges by <i>Washington Monthly</i>, Wisconsin Indianhead offers over 50 programs and certificates, including 7 unique programs. WITC serves over 25,000 students at campuses in Ashland, New Richmond, Rice Lake and Superior.', '3995_WTCS_web_indianhead_ashland.jpg');
    return collegeLatLng;
    }

function addMarker(map,college)
    {
    var focusPoint = function(){
        var lat = marker.getLatLng().lat();
        var lng = marker.getLatLng().lng() - 1;
        map.setCenter(new GLatLng(lat,lng), 10);
        marker.openInfoWindowHtml(createHtml(name,phone,phonetty,web,address,desc,img),opts);
        }
    var name = college[0];
    var id = college[1]   
    var lat = college[2];
    var lng = college[3];
    var phone = college[4];
    var phonetty = college[5];    
    var web = college[6];   
    var address = college[7];    
    var desc = college[8];
    var img = college[9];
    var marker = new GMarker(new GLatLng(lat,lng));
    opts = {maxWidth:300}
    GEvent.addListener(marker, 'click', focusPoint);
    var panelItem = document.getElementById(id);
    GEvent.addDomListener(panelItem, 'click', focusPoint)
    map.addOverlay(marker);
    return marker;
    }

function createHtml(name,phone,phonetty,web,address,desc,img)
    {
    html = '<div class="map_bubble_title">'+ name +'</div>';
    html = html + '<div class="map_bubble_text">'+ desc +'</div>';
    html = html + '<div class="map_bubble_img"><img alt="'+ name +' Campus" src="/images/map/'+ img +'"/></div>';
    html = html + '<div class="map_bubble_contact">';
    html = html + '<div class="map_bubble_text">Call: '+ phone +'<br/>'+ phonetty +'</div>';
    html = html + '<div class="map_bubble_text">Click: <a href="http://'+ web +'" target="_blank">'+ web +'</a></div>'; 
    html = html + '<div class="map_bubble_text">Go: '+ address +'</div>';
    html = html + '</div><div style="float:left;clear:both;">&nbsp;</div>';
    return html; 
    }
    
function addViewAll(map)
    {
    var focusPoint = function(){
        map.closeInfoWindow();
        map.setCenter(new GLatLng(44.7, -92), 6);
        }
    GEvent.addDomListener(document.getElementById("all"), 'click', focusPoint)
    }