  function open_lightbox(popup_name, top, left, width, height) {
    var arrayPageSize = getPageSize();
    Element.setHeight("box_overlay", arrayPageSize[1]);
//    new Effect.Appear("box_overlay", { duration: 0, from: 0.0, to: 0.5 });
    document.getElementById("box_overlay").style.display = "block";
    element = document.getElementById(popup_name);   
    var arrayPageSize = getPageSize();
    Element.setTop(popup_name, top);
    if (height != 0) {
    	Element.setTop(popup_name, (arrayPageSize[3] - height) / 2 );
    }
    Element.setWidth(popup_name, width);
    var left_pos = left;
    if (left == 0) {
      left_pos = ((arrayPageSize[0] - width) / 2);
    }
    Element.setLeft(popup_name, left_pos);
    if (!document.body.style.maxHeight || typeof document.body.style.maxHeight == "undefined") {
      element.style.display = "block";
      var selectBoxs = document.getElementsByTagName("SELECT");
      for (var i=0; i<selectBoxs.length; i++) {
        if (!document.getElementById(popup_name).contains(selectBoxs[i]))
        selectBoxs[i].style.visibility = "hidden";
      }
    }
      
     document.getElementById(popup_name).style.display = "block";
 //   new Effect.Appear(popup_name);
  }
  
  
  function close_lightbox(popup_name) {
 //   element = document.getElementById(popup_name);
    document.getElementById(popup_name).style.display = "none";  
    if (typeof document.body.style.maxHeight == "undefined") {
      var selectBoxs = document.getElementsByTagName("SELECT");
      for (var i=0; i<selectBoxs.length; i++) {
        selectBoxs[i].style.visibility = "visible";
      }
    }
//    new Effect.Fade(popup_name, { duration: 0 });
	
    pause(500);
//    new Effect.Fade("box_overlay", { duration: 0 });
    document.getElementById("box_overlay").style.display = "none";
  }

// Google Maps

function load(location) {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
	//	map.setCenter(new GLatLng(-28.000693, 153.413795), 13);
		var geocoder = new GClientGeocoder();
		showAddress(location);
    	}
	function showAddress(address) {
		if(geocoder){
			  geocoder.getLatLng(
		    address,
		    function(point) {
		      if (!point) {
		        alert(address + " not found");
		      } else {
		        map.setCenter(point, 15);
		        
		        // add icon
		        var icon = new GIcon();
				icon.image = "http://innovag0.sauceopen.com/portal/images/pin.png";
				icon.shadow = "http://innovag0.sauceopen.com/portal/images/shadow.png";
				icon.iconSize = new GSize(27, 41);
				icon.shadowSize = new GSize(41, 41);
				icon.iconAnchor = new GPoint(13, 40);
				icon.infoWindowAnchor = new GPoint(22, 2);
				
				// add marker
		        var marker = new GMarker(point,icon);
		        map.addOverlay(marker);
		        marker.openInfoWindowHtml(address);
		      }
		    }
		  );
		}    	
   	}
}

