﻿jQuery(document).ready(function () {
	var $graphHead = jQuery('#graphical-header');
	var $h1 = jQuery('h1');
	if ($graphHead.length > 0 && $h1.length > 0) {
		$graphHead.append('<div class="pgTitle"><div class="title">' + $h1.html() + '</div><div class="tagline">Exclusive Hotels</div></div>');
    }
    $("a.anchor").anchorAnimate();
});

jQuery.fn.anchorAnimate = function (settings) {
    return this.each(function () {
        $(this).click(function (event) {
            event.preventDefault()
            var elementClick = $(this).attr("href");
            var destination = $(elementClick).offset().top;
            $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, (destination), 'swing', function () {
                window.location.hash = elementClick;
            });
            return false;
        })
    })
}
