$(function() {
	// below all from existing

    $("a.share-link").click(function() {
        $("div.share-panel").show();
         return false;
    });
    $("a.share-close").click(function() {
        $("div.share-panel").hide();
         return false;
    });

    $("#close-btn").click(function(e) {
        e.preventDefault();
        hideShare();
    });
    
    var openFnSignup=function(hash){    
        hash.w.show();
        $('#signup-modal').css({left:($(window).width()-$('#signup-modal').width())/2,top:$(window).scrollTop()+10});               
    };
    
    var hideFn=function(hash){
        hash.w.hide()
        hash.o.remove();
    };
    
    $('#signup-modal').jqm({trigger: '#utility-subscribe a', onShow: openFnSignup, onHide: hideFn});
    
    $('.sectioned #content').jScrollPane({
    	showArrows: true,
    	verticalGutter: 0,
    	verticalDragMinHeight: 37,
    	verticalDragMaxHeight: 37
    });
    
    // nav.xml can't handle the funky link, so we'll spit it out here
    var forwardlink = 'mailto:?subject=I thought you might be interested&body=I just read the eNewsletter, Impressions, from Montage Hotels %26 Resorts. You can view this eNewsletter by visiting http://www.montageimpressions.com.%0D%0A%0D%0AI think you would enjoy their email updates as well. You can sign-up for their newsletter by filling in your information at http://www.montagehotels.com/contact-us.php, and also receive this eNewsletter in the future.';
    
    $('#utility-forward a').each(function() {
    	$(this).attr('href', forwardlink);
    });

});

function showShare() {
    $("#share-panel").show();
}

function hideShare() {
    $("#share-panel").hide();
}
