/* Initialize google map related variables */
var bounds = null;
var markerClusterer = null;
var styles = [[
        {
        url: 'http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/images/conv30.png',
        height: 27,
        width: 30,
        anchor: [3, 0],
        textColor: '#FF00FF'

      },
       {
        url: '../images/conv40.png',
        height: 36,
        width: 40,
        opt_anchor: [6, 0],
        opt_textColor: '#FF0000'
      },
      {
        url: '../images/conv50.png',
        width: 50,
        height: 45,
        opt_anchor: [8, 0]
      }
      ]];

/* GENERATE TABS */
$(document).ready(function () {
    var tabContainers = $('div.projectTabs > div');
    $('div.projectTabs ul.tabNavigation a').click(function () {
        // Need to activate only first tab for 'add company' page
        if ("" == this.hash) {
            return false;
        }

       tabContainers.hide().filter(this.hash).show();

         //$('#small_google_map_wrapper').hide();
        $('div.projectTabs ul.tabNavigation a').removeClass('selected');
        $(this).addClass('selected');
        return false;
    });

    if ("" == window.location.hash)
    {
        $("div.projectTabs ul.tabNavigation a").filter(':first').click();
    }
    else
    {
        window.scrollTo(0, 0);
        $("a[href='" + window.location.hash + "']").click();
    }

    // Attach the click
    $('#showHideMap').click(function (){
        if($('#showHideMap').html() == 'X') {
            $('#showHideMap').html('+');
        } else {
           $('#showHideMap').html('X');
        }
        $('#map').slideToggle();
        return false;
    });

    // Show the big project location map
    $('#bigMapLink').click(function() {
        var categoryId = $('div.projectTabs ul.tabNavigation a.selected').attr('categoryid');
        $.prettyPhoto.open(this.href + '/' +profileId+'/'+categoryId+'?iframe=true&width=800&height=450',this.title);
        return false;
    });

});

function bindBigMapLink()
{
    // Added code to open the chose map in thickbox
    $('#bigMapLink').click(function() {
        //$.prettyPhoto.open(this.href + '/ProjectPartner' + '?iframe=true&width=650&height=100%',this.title);
        return false;
    });
}

