$.position = 10; $.total = 23343; $.municipalities = 43; jQuery.moreFeedItems = function(position){ $('#load-more').html(''); $.ajax({ url: '/partijen/13', data: 'action=morefeeditems&position=' + position, type: 'post', success: function(j){ $(j).hide().appendTo("ul.multiple-user-feeds").slideDown(); $(".flickr_link").colorbox(); $(".youtube_link").colorbox({ iframe:true, opacity:0.70, speed:500, width:800, height:600, href: function(){ return this.href.replace('watch?v=', 'v/'); } }); $.position += 10; $.total -= 10; if($.total <= 0){ $('#load-more').remove(); } else { $('#load-more').html('Meer...'); } } }); }; $(document).ready(function(){ getMunicipalityMarkers = function(){ var markerIcon = new GIcon(G_DEFAULT_ICON); markerIcon.image = "/img/layout.default/map_marker.png"; markerIcon.shadow = ""; markerIcon.iconSize = new GSize(28, 28); $.ajax({ url: '/partijen/13' + '.xml', data: 'action=municipalitymarkers', type: 'post', success: function(j){ map.clearOverlays(); $(j).find('marker').each(function(){ var lat = $(this).attr('lat'); var lng = $(this).attr('lng'); var point = new GLatLng(lat,lng); var markerTitle = $(this).attr('title'); var partyMunicipalityId = $(this).attr('party_municipality_id'); markerIcon.iconSize = new GSize(34, 34); markerOptions = { icon:markerIcon, title:markerTitle }; var marker = new GMarker(point, markerOptions); GEvent.addListener(marker,"click", function() { $.fn.colorbox({href: '/partijen/13?action=party_municipality' + '&municipality_name=' + markerTitle + '&party_municipality_id=' + partyMunicipalityId, opacity: 0.3, width: "950px", open:true}); }); map.addOverlay(marker); }); } }) }; $(".flickr_link").colorbox(); $(".youtube_link").colorbox({ iframe:true, opacity:0.70, speed:500, width:800, height:600, href: function(){ return this.href.replace('watch?v=', 'v/'); } }); $('#load-more').click(function(){ $.moreFeedItems($.position); }); if($.municipalities > 1){ if(GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("municipalities_map")); map.addControl(new GLargeMapControl3D()); map.setCenter(new GLatLng(52.1326330, 5.2912660), 7); getMunicipalityMarkers(); } } });