function callHandlerAjaxVote( postObj, handlercall ) {
new Ajax.Request( "http://rolandiberia.com/js/../ajax_handler_ajax.php?uid=&uoid=&un=d41d8cd98f00b204e9800998ecf8427e&ue=d41d8cd98f00b204e9800998ecf8427e&l=", { method: "post", postBody: 'data=' + Object.toJSON(postObj), onSuccess: function(t) { eval(handlercall+"(t);"); },on404: function(t) { return -1 }, onFailure: function(t) { return -1 } } );
}
function SaveMapsPoints( cnt_oids, point ){
postObj = { 'action': 'SaveMapsPoints', 'cnt_oid': cnt_oids,'point': point};
new Ajax.Request(
"http://rolandiberia.com/js/../ajax_handler_ajax.php?uid=&uoid=&un=d41d8cd98f00b204e9800998ecf8427e&ue=d41d8cd98f00b204e9800998ecf8427e&l=",
{
method: "post",
postBody: 'data=' + Object.toJSON(postObj),
onSuccess: function(t) {
},
on404: function(t) { return -1 },
onFailure: function(t) { }
}
);
}
function showHide_googleMap(cnt_oid,thisObj,address,cord_x,cord_y){
if($('map_'+cnt_oid).style.display){
thisObj.innerHTML = "Esconder mapa
";
$('map_'+cnt_oid).style.display = "";
location.href = "#"+'branch_'+cnt_oid;
if (GBrowserIsCompatible() && document.getElementById("map_"+cnt_oid).innerHTML == '') {
var map = new GMap2(document.getElementById("map_"+cnt_oid));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.enableScrollWheelZoom();
map.setCenter(new GLatLng(cord_y,cord_x),13);
var marker = new GMarker(new GLatLng(cord_y,cord_x));
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(address);});
}
}else{
$('map_'+cnt_oid).style.display = "none";
thisObj.innerHTML = "Ver mapa
";
}
}
//http://maps.google.com/maps/geo?q=1000+Avenida%20da%20Boavista,+Porto,+Portugal&output=xml&key=ABQIAAAABDPqx4os859DQfSjeZq-eBSZx48PqOLaEmBa5GpIfehshTA1UhTtW8STZ-VQsk-7EZjAuoCnclJvcA
//-3.754962,40.430367,0
function showAddress(address,map,cord_x,cord_y) {
var marker = new GMarker(new GLatLng(cord_y,cord_x));
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(address);});
}
function show_all_stores_map(){
if (GBrowserIsCompatible() && document.getElementById("all_maps").innerHTML == '') {
var map = new GMap2(document.getElementById("all_maps"));
map.setCenter(new GLatLng(40.430367,-3.754962),6);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.enableScrollWheelZoom();
for(var i=0;i < ALL_STORES_NAMES.length;i++){
showAddress(ALL_STORES_NAMES[i],map,ALL_STORES_X[i],ALL_STORES_Y[i]);
}
if(ALL_STORES_UPDATE.length > 0 && ALL_STORES_UPDATE_OID.length > 0) processMapsPoints();
}
}
//var iii = 0;
function processMapsPoints()
{
var geocoder = new GClientGeocoder();
geocoder.getLatLng(
ALL_STORES_UPDATE[ALL_STORES_UPDATE.length - 1],
function(point){
if (!point) {
SaveMapsPoints( ALL_STORES_UPDATE_OID[ALL_STORES_UPDATE_OID.length - 1],0);
ALL_STORES_UPDATE.pop();
ALL_STORES_UPDATE_OID.pop();
if(ALL_STORES_UPDATE.length>0){ processMapsPoints();}
}else{
//iii++;
//if(iii==300) return;
SaveMapsPoints( ALL_STORES_UPDATE_OID[ALL_STORES_UPDATE_OID.length - 1],point.x+"_"+point.y);
ALL_STORES_UPDATE.pop();
ALL_STORES_UPDATE_OID.pop();
if(ALL_STORES_UPDATE.length>0) processMapsPoints();
}
}
);
}