var mapOfficeAPI;
var start;
var locale;
$.ajaxSetup({
	cache: true			
});

$(function() {
	$("#mapOfficeStatic img").dropShadow();	   
	$(".tabchanger").css("display", "block");
	$(".jq_tab hr").css("display", "none");
	$(".jq_tab h3").css("display", "none");
	$("#au_tabs").tabs({
		cookie: { name: 'au_tabs', expires: 30, path: '/' } 				   
	});
	$("#mapOfficeStatic").qtip({
		content: {
		text: '<div class="loading center"><img src="/media/images/general/ajax-loader-circle-thickbox.gif" width="100" height="100" alt="Loading..." /></div>',
         title: {
            text: 'yourVIVA Centro Location',
            button: 'Close'
         },
         url: '/static_content/office_map.php?start=' + $("#office_quickdir input[name='driveFrom']").val() + '&locale=' + $("#office_quickdir select[name='locale']").val()
      },
      position: {
         target: $(document.body), 
         corner: 'center' 
      },
      show: {
         when: {
			target: $("#office_quickdir button, a#mapOfficeStatic"),
			event: 'click'
		 },
         solo: true 
      },
      hide: false,
      style: {
         width: 940,
         padding: '14px',
         border: {
            width: 9,
            radius: 9,
            color: '#666666'
         },
         name: 'light'
      },
      api: {
         beforeShow: function() {
            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
         },
         beforeHide: function() {
            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
         },
		 beforeContentLoad: function() {
			// start = $("#office_quickdir input[name='driveFrom']").val();
			 // locale = $("#office_quickdir select[name='locale']").val();
		 }
      }					   
	});
	mapOfficeAPI = $("#mapOfficeStatic").qtip("api");
	$('<div id="qtip-blanket">')
      .css({
         position: 'absolute',
         top: $(document).scrollTop(),
         left: 0,
         height: $(document).height(), 
         width: '100%',

         opacity: 0.7, 
         backgroundColor: 'black',
         zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
      })
      .appendTo(document.body) 
      .hide();
	$("a#mapOfficeStatic").bind("click", function() {
		return false;
	});
});


