photo_frame_isExpanded = true

$(document).ready(
    function()
    {
       $('#expand_button').click(photo_frame_slide);
       $('#expand_button').mousedown(expand_btn_mousedown);
       $('#expand_button').mouseup(expand_btn_mouseup);
       if ($.cookie('photo_frame_isExpanded') == 'false'){
           $('#photo_pane_container').css('marginRight',-156);
           $('#regional_content_container').css('marginRight',40);
           photo_frame_isExpanded = false;
       }
    });


function expand_btn_mouseup()
{
    $('#expand_button').removeClass('photo_pane_expand_button_closed');
    $('#expand_button').addClass('photo_pane_expand_button_open');
}

function expand_btn_mousedown()
{
    $('#expand_button').removeClass('photo_pane_expand_button_open');
    $('#expand_button').addClass('photo_pane_expand_button_closed');
}

function photo_frame_slide()
{
    if(photo_frame_isExpanded == true)
        {
            photo_frame_isExpanded = false;
            $('#photo_pane_container').animate({'marginRight':'-156px'}, 300);
            $('#regional_content_container').animate({'marginRight':'40px'},550);
            $.cookie('photo_frame_isExpanded', false,{path:'/'});
        }
    else
        {
            photo_frame_isExpanded = true;
            $('#photo_pane_container').animate({'marginRight':'0px'}, 450);
            $('#regional_content_container').animate({'marginRight':'210px'},200);
            $.cookie('photo_frame_isExpanded', true,{path:'/'});
        }

}
