var domain = ""; var currentUrl = ""; var groupName = ""; var groups = ""; var map; setDomain(); if ( !isIE7() ) { $(window).load(function() { // $(document).ready(function() { processLandroof(); }); } else { $(window).load(function() { processLandroof(); }); } function isIE7() { version = 0 if (navigator.appVersion.indexOf("MSIE")!=-1){ temp=navigator.appVersion.split("MSIE") version=parseFloat(temp[1]) } if ( version > 6) { return true; } else { return false; } } function processLandroof() { hideSendMessage(); hideAddAsFriend(); groupName = $(' div.xg_3col > h1 ').text(); if ( isGroupUrl() ==true ) { getMedia("video"); getMedia("photo"); } if ( isShowVideoPhoto() ==true ) { //$('li#tag-list > strong').text("Locatie: "); // verberg "taggen" // $('ul.actions > li:eq(0)').hide(); } if ( isHomeUrl() ==true ) { initCloud(); setTimeout("initGoogleMap()", 100); } if ( isAuthorizationUrl() ==true ) { initNavigation(); } ////////////////////////////// if ( isAddGroupUrl() ==true ) { setTimeout("addGroupHidePrivacy()", 100); } ////////////////////////////// if ( isPhotoEditUrl() ==true ) { removeGoogleMapsCache(); $('div.edit_item > fieldset.details > fieldset ').hide(); $('div.edit_item > div:eq(1) ').hide(); $('div.xg_module_body > p.right > a ').hide(); $('div.xg_module_body > p:eq(0) ').hide(); for ( counter = 0; counter < 7; counter++ ) { if ( document.getElementById("photo-"+counter+"-tags") ) { if ( document.getElementById("photo-"+counter+"-latInput").value == "25" && document.getElementById("photo-"+counter+"-lngInput").value == "-40" ) { document.getElementById("photo-"+counter+"-latInput").value = "52.22590673891196"; document.getElementById("photo-"+counter+"-lngInput").value = "5.177478790283203"; document.getElementById("photo-"+counter+"-zoomLevelInput").value = "6"; } $("input[@name='photo"+counter+"-locationType']:nth(1)").attr("checked","checked"); $('#photo-'+counter+'-addressRadio').hide(); $('div.edit_item:eq('+counter+') > fieldset.details > p:eq(2)').hide(); $('fieldset.location > fieldset > ul.options > li:eq('+(counter * 2)+')').hide(); } } getGroups("photo"); } if ( isVideoEditUrl() ==true ) { removeGoogleMapsCache(); $('div.edit_item > fieldset.details > fieldset ').hide(); $('div.edit_item > fieldset.location > fieldset > ul.options > li:eq(0) ').hide(); if ( document.getElementById("video-latInput").value == "25" && document.getElementById("video-lngInput").value == "-40" ) { document.getElementById("video-latInput").value = "52.22590673891196"; document.getElementById("video-lngInput").value = "5.177478790283203"; document.getElementById("video-zoomLevelInput").value = "6"; } if ( document.getElementById("video_tags") ) { $("input[@name='locationType']:nth(1)").attr("checked","checked"); $('#video-addressRadio').hide(); $('div.edit_item > fieldset.details > p:eq(2)').hide(); } getGroups("video"); } } function hideSendMessage() { $('a.sendmessage').hide(); } function hideAddAsFriend() { $('dd.relationship').remove(); // $('div.xg_module > div.xg_module_body.account-links > ul > li:eq(0)').remove(); } function addGroupHidePrivacy() { $('#add_group_form > div.xg_module > div.xg_module_body > div.block:eq(1) > fieldset.nolegend ').hide(); } function initNavigation() { strHtml = ""; strHtml+="
\n"; strHtml+="

\n"; strHtml+="\n"; strHtml+="\n"; strHtml+=" \n"; strHtml+="VPRO Landroof

\n"; strHtml+="
\n"; strHtml+="
\n"; strHtml+="\n"; strHtml+="
\n"; //$('#xg_head').html(strHtml); //$('#xn_bar').hide(); } function initPhotoEdit() { groups = groups.split(","); for ( counter = 0; counter < 7; counter++ ) { if ( document.getElementById("photo-"+counter+"-tags") ) { locatie = document.getElementById("photo-"+counter+"-tags").value; photoTag = ""; photoTag+= "\n"; photoTag+= "
\n"; photoTag+= "\n"; $('div.edit_item:eq('+counter+') > fieldset.details > p:eq(2)').html(photoTag); $('div.edit_item:eq('+counter+') > fieldset.details > p:eq(2)').show(); } } $('#useValuesForAll').hide(); } function initVideoEdit() { groups = groups.split(","); if ( document.getElementById("video_tags") ) { locatie = document.getElementById("video_tags").value; videoTag = ""; videoTag+= "\n"; videoTag+= "
\n"; videoTag+= "\n"; $('div.edit_item > fieldset.details > p:eq(2)').html(videoTag); $('div.edit_item > fieldset.details > p:eq(2)').show(); } } function isGroupUrl() { if ( currentUrl.indexOf(domain+"/group/") == 0 && currentUrl.indexOf("/forum/") == -1 ) { return(true); } else { return(false); } } function isAuthorizationUrl() { if ( currentUrl.indexOf(domain+"/main/authorization/signUp?") == 0 || currentUrl.indexOf(domain+"/main/authorization/signIn?") == 0 ) { return(true); } else { return(false); } } function setDomain() { currentUrl = unescape(location.href); domain = "http://www.landroof.nl"; if ( currentUrl.indexOf("landroof.ning.com") != -1 ) { domain = "http://landroof.ning.com"; } } function isHomeUrl() { if ( currentUrl == domain+"/" || currentUrl == domain+"/#" || currentUrl == domain ) { return(true); } else { return(false); } } function isShowVideoPhoto() { if ( currentUrl.indexOf(domain+"/photo/photo/show") != -1 || currentUrl.indexOf(domain+"/video/video/show") != -1 ) { return(true); } else { return(false); } } function isAddGroupUrl() { if ( currentUrl.indexOf(domain+"/groups/group/new") != -1 ) { return(true); } else { return(false); } } function isPhotoEditUrl() { if ( currentUrl.indexOf("/photo/photo/edit") != -1 ) { return(true); } else { return(false); } } function isVideoEditUrl() { if ( currentUrl.indexOf("/video/video/edit") != -1 ) { return(true); } else { return(false); } } function getMedia(contentType) { url = domain+"/eturn/getMedia.php?contentType="+escape(contentType)+"&group="+escape(groupName); $.ajax({ url: url, type: 'GET', dataType: 'html', timeout: 20000, error: function(){ // do something }, success: function(returnHTML){ fillMediaDiv(contentType, returnHTML); } }); } function removeGoogleMapsCache() { url = domain+"/eturn/removeCache.php"; $.ajax({ url: url, type: 'GET', dataType: 'html', timeout: 20000, error: function(){ // do something }, success: function(returnHTML){ // do something } }); } function initCloud() { url = domain+"/eturn/cloud.php"; $.ajax({ url: url, type: 'GET', dataType: 'html', timeout: 20000, error: function(){ // do something }, success: function(returnHTML){ fillCloud(returnHTML); } }); } function getGroups(contentType) { groups = "broek- en simontjespolder,sally,Mylene,Rengerspark,Zuidoord,de Purmer (gemeente Waterland),Megahotel Heren2 gepland aan oever Sloterplas in Amsterdam-West,HAS- en BADlocatie IJzeren Vrouw,Papiermolen streek Makkum Friesland,Nekkerzoom, Gemeente Beemster,Test,Bedrijventerrein bovenop de Ecologische Hoofdstructuur,Soesterberg,Apollo Noord,14 ha tanktestbaan moet natuur blijven,Oud Zandbergen,Kerkebosch, Zeist,LOG Halle-Heide,D. van Gerven,Overschiese park,Soestdijk, gebied Jachthuislaan, Koninginnelaan,Driewegen (Gemeente Terneuzen),Libellebos / Biezenwaard - Uithoorn,De Hondswaard bij Vuren uiterwaarden langs de rivier,Stoutenburg,groet wit knien,De Boterbloem, Amsterdam Osdorp,Heierhoeve,Bestemmingsplan Zeist (Hoge Dennen/Kerckebosch),Zorgwonen in de mode: Abrona,log elshof,Agrarisch gebied Dalem/Hapert,Dragonderpark Veenendaal,BeemsterWerelderfgoed,Numansdorp,Dorpsrand De Oude Melkhaven,log,Polder Nieuw-Lekkerland,Buurse Overijssel,Buurse,Haaksbergen,Dijkzone te Maurik,Witham,Oostelijke en westelijke rondweg Nunspeet,Velserbroek - Grote Buitendijk,Meridiaan / Almere Buiten,Project Stadzigt Naardermeer,BVDuurzaam,Afsluiten Fiets en wandelbos,Vliegveld Valkenburg,Den Haag, Florence Nightingale Park,Westvlietweg Den Haag,Park Saendelft-Oost, Waterrijk.,Tuin Missiehuis Bredase weg Tilburg,Bestemmingsplan Den Dolder Noord,Sauna ruilen voor de beestjes?,Vijverhof Den Dolder,vd Hoevenlaan Den Dolder,Vierde kwadrant/Leeuwenhorstd den Dolder,Schreuder vd Kolklaan Den Dolder,Assen-Noord,Sportpark Sloten, Amsterdam,De Haese Geleen-Sittard,Wij Jan Cremer,Nabij de Kooybrug Noordhollandskanaal in de Anna Paulowna polder.,Esther de Hoop,Jos Vulto,Sportterrein RKC Schiebroek Rotterdam,Katwoude Waterland,zevenbergsedijkje roterdam,De Hallen Oud-West Amsterdam,Groot Bronswijk Wagenborgen,Gebied bij Samenvloeiing van Selzerbeekdal met Geuldal ten westen van Partij-Wittem (Zuid-Limburg),Klavertje 4,Stichting Bankgebouw Van Straaten,vissergronden, naarden, postcode 1411,vissergronden, inaarden, postcode 1411,de Hoven in Zutphen,Gaasperdam,Kanaaldijk 264 te Koedijk Gem. Alkmaar,Bunnik & A12 Salto,Amsterdam,Damplein Leidschendam,Ede van Heutszlaan,Loosdrechtse Plassen,log elshof in wijhe,Parkstad Limburg,almelo noord- oost,Eeserwold bedrijvenpark,De Locatie is Centraal plateau Zuid Limburg.,steenfabriek gilze,Ter Apel,Bestemmingsplan Seghwaert,SWOMP,leidsche rijn, utrecht,NDSM werf,Stevensbeek,Stadionplein,Bedrijventerrein Lutkemeerpolder, Amsterdam-Osdorp,Ermelo (Gelderland),"; if ( contentType == "photo" ) { initPhotoEdit(); } if ( contentType == "video" ) { initVideoEdit(); } } function getGroupsAjax(contentType) { url = domain+"/eturn/getGroups.php"; $.ajax({ url: url, type: 'GET', dataType: 'html', timeout: 20000, error: function(){ // do something }, success: function(returnHTML){ groups = returnHTML; if ( contentType == "photo" ) { initPhotoEdit(); } if ( contentType == "video" ) { initVideoEdit(); } } }); } function fillMediaDiv(contentType, mediaHTML) { var divHTML = ""; var title = ""; if ( contentType == "photo" ) { title = "Foto's uit "+groupName; } if ( contentType == "video" ) { title = "Video's uit "+groupName; } divHTML+="
\n"; divHTML+="

"+title+"

\n"; divHTML+="
"+mediaHTML+"
\n"; $('div.xg_colgroup > div.xg_2col').append(divHTML); } function fillCloud(mediaHTML) { var divHTML = ""; var title = ""; title = "Zoek meldingen van Landroof op onderwerp"; divHTML+="
\n"; divHTML+="

"+title+"

\n"; divHTML+="
"+mediaHTML+"
\n"; $('div.xg_colgroup > div.xg_2col').append(divHTML); } ///////////////////////////////////////////// google map function initGoogleMap() { // A function to create the marker and set up the event window function createMarker(point,name,html) { // Create our marker icon var landroofIcon = new GIcon(G_DEFAULT_ICON); landroofIcon.image = domain+"/eturn/images/landroof_gmap_trans32.png"; landroofIcon.iconSize = new GSize(32, 32); landroofIcon.iconAnchor = new GPoint(16, 32); landroofIcon.infoWindowAnchor = new GPoint(16, 0); landroofIcon.shadow = domain+"/eturn/images/landroof_gmap_trans32_shadow.png"; landroofIcon.shadowSize = new GSize(64, 32); landroofIcon.imageMap = [0,0, 31,0, 31,31, 0,31]; // Set up our GMarkerOptions object markerOptions = { icon:landroofIcon }; var marker = new GMarker(point, markerOptions); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); // save the info we need to use later for the side_bar gmarkers[i] = marker; // add a line to the side_bar html i++; return marker; } // This function picks up the click and opens the corresponding info window function myclick(i) { GEvent.trigger(gmarkers[i], "click"); } if (GBrowserIsCompatible()) { // arrays to hold copies of the markers used by the side_bar // because the function closure trick doesnt work there var gmarkers = []; var i = 0; // create the map map = new GMap2(document.getElementById("locationMap")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(52.22399,5.170999), 7, G_HYBRID_TYPE); var request = GXmlHttp.create(); request.open("GET", "http://www.landroof.nl/eturn/getMediaLangLat.php", true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = GXml.parse(request.responseText); // obtain the array of markers and loop through it var markers = xmlDoc.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { // obtain the attribues of each marker var lat = parseFloat(markers[i].getAttribute("lat")); var lng = parseFloat(markers[i].getAttribute("lng")); var point = new GLatLng(lat,lng); // var html = markers[i].getAttribute("html"); var html = markers[i].firstChild.nodeValue; var label = unescape(markers[i].getAttribute("label")); // create the marker var marker = createMarker(point,label,html); map.addOverlay(marker); } } } request.send(null); } else { alert("Sorry, the Google Maps API is not compatible with this browser"); } }