
 function obreMaps() {
    if (GBrowserIsCompatible()) {
        Shadowbox.open({
            player:     "html",
            content:    "",
            height:     600,
            width:      800,
            options:    {
                onFinish: function(item) {
                    var body = document.getElementById(Shadowbox.playerId);
                    var map = new GMap2(body);
                    
                    
                     
					var marker = new GMarker(new GLatLng(41.447849,2.244532), {draggable: true, bouncy: true});
					var marker2 = new GMarker(new GLatLng(41.451187,2.248002), {draggable: true, bouncy: true} );
                    map.setCenter(new GLatLng(41.447584, 2.24503), 16);
					//map.openInfoWindowHtml(new GLatLng(41.447507, 2.244934),"Maristes Champagnat Badalona");  
					//map.openInfoWindowHtml(new GLatLng(41.451114, 2.248095),"Maristes Champagnat Badalona - edifici Infantil i Primària"); 
             	
					map.addOverlay(marker);
					map.addOverlay(marker2);
                    // add some simple controls
                    map.addControl(new GSmallMapControl());
                    map.addControl(new GMapTypeControl());
                }
            }
        });
    } else {
        alert("El teu navegador no és compatible amb Google Maps!");
    }
}

Shadowbox.init();

function posaAlt(text){
    
    document.getElementById('onva').innerHTML = "<font color='#467aa7'>estat&nbsp;</font>";
    
   document.getElementById('onva').innerHTML =  text ;

    
}
function treuAlt(){
    document.getElementById('onva').innerHTML = "<font color='#467aa7''>estat&nbsp;</font>"
}
function obreFin(URL,w,h){
    var ScreenWidth=window.screen.width;
    var ScreenHeight=window.screen.height;
    var movefromedge=0;
    //w= 280 //(ScreenWidth * 80)/100;
    //h= 250 //(ScreenHeight * 80)/100;
    placementx=(ScreenWidth/2)-((w)/2);
    placementy=(ScreenHeight/2)-((h+50)/2);
    var PopUpUrl=URL;
    WinPop=window.open(PopUpUrl,"","width="+w+",height="+h+",toolbar=0,location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,  left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
   }
   
   //jquery per centrer capes
   
(function($){
     $.fn.extend({
          center: function (options) {
               var options =  $.extend({ // Default values
                    inside:window, // element, center into window
                    transition: 0, // millisecond, transition time
                    minX:0, // pixel, minimum left element value
                    minY:0, // pixel, minimum top element value
                    vertical:true, // booleen, center vertical
                    withScrolling:true, // booleen, take care of element inside scrollTop when minX < 0 and window is small or when window is big
                    horizontal:true // booleen, center horizontal
               }, options);
               return this.each(function() {
                    var props = {position:'absolute'};
                    if (options.vertical) {
                         var top = ($(options.inside).height() - $(this).outerHeight()) / 2;
                         if (options.withScrolling) top += $(options.inside).scrollTop() || 0;
                         top = (top > options.minY ? top : options.minY);
						 //top-=60; //ho he posat pel titol
                         $.extend(props, {top: top+'px'});
                    }
                    if (options.horizontal) {
                          var left = ($(options.inside).width() - $(this).outerWidth()) / 2;
                          if (options.withScrolling) left += $(options.inside).scrollLeft() || 0;
                          left = (left > options.minX ? left : options.minX);
                          $.extend(props, {left: left+'px'});
                    }
                    if (options.transition > 0) $(this).animate(props, options.transition);
                    else $(this).css(props);
                    return $(this);
               });
          }
     });
})(jQuery);

(function($){
     $.fn.extend({
          sota: function (options) {
               var options =  $.extend({ // Default values
                    inside:window, // element, center into window
                    transition: 0, // millisecond, transition time
                    minX:0, // pixel, minimum left element value
                    minY:0, // pixel, minimum top element value
                    vertical:true, // booleen, center vertical
                    withScrolling:true, // booleen, take care of element inside scrollTop when minX < 0 and window is small or when window is big
                    horizontal:true // booleen, center horizontal
               }, options);
               return this.each(function() {
                    var props = {position:'absolute'};
                    if (options.vertical) {
                         var top = ($(options.inside).height() - $(this).outerHeight());
                         if (options.withScrolling) top += $(options.inside).scrollTop() || 0;
                         top = (top > options.minY ? top : options.minY);
                         $.extend(props, {top: top+'px'});
                    }
                    if (options.horizontal) {
                          var left = ($(options.inside).width() - $(this).outerWidth()) / 2;
                          if (options.withScrolling) left += $(options.inside).scrollLeft() || 0;
                          left = (left > options.minX ? left : options.minX);
                          $.extend(props, {left: left+'px'});
                    }
                    if (options.transition > 0) $(this).animate(props, options.transition);
                    else $(this).css(props);
                    return $(this);
               });
          }
     });
})(jQuery);

