$(document).ready(function() {
	load_scrollbar();

	if ( $("#gallery a img").length > 0 ) { 
			$('#gallery a:has(img)').lightBox();
		}

	// external links	
	$('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });
	

	$("#checkin").datepicker({ showOn: "button", dateFormat: 'dd/mm/yy' });
	
	

	// external links	
	$('#ShowHideBooking').click( function() {
       $('#booking_fieldset').toggle();
	   $(this).toggleClass("block2");
    });
	
	// nivo slider
	$('#slider').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:500,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
      	controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8 //Universal caption opacity
	});
	
$.fn.hint = function (blurClass) {
    if (!blurClass) blurClass = 'blur';
    
    return this.each(function () {
        var $input = $(this),
            title = $input.attr('title'),
            $form = $(this.form),
            $win = $(window);

        function remove() {
            if (this.value === title && $input.hasClass(blurClass)) {
                $input.val('').removeClass(blurClass);
            }
        }

        // only apply logic if the element has the attribute
        if (title) { 
            // on blur, set value to title attr if text is blank
            $input.blur(function () {
                if (this.value === '') {
                    $input.val(title).addClass(blurClass);
                }
            }).focus(remove).blur(); // now change all inputs to title
            
            // clear the pre-defined text when form is submitted
            $form.submit(remove);
            $win.unload(remove); // handles Firefox's autocomplete
        }
    });
};	

	$('#frmsearch input').hint();
	$('#newsletter input').hint();
});

$(window).resize(function() { load_scrollbar(); });

function load_scrollbar() {
	if (parseInt($.browser.version, 10) != "7") { $('#LR3_C1').jScrollPane({hijackInternalLinks: true,autoReinitialise: true}); }	
	
	
	
}
/* Mouse Wheel */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(a($){d b=[\'z\',\'6\'];$.2.M.6={B:a(){7(4.l){m(d i=b.q;i;){4.l(b[--i],e,v)}}n{4.o=e}},K:a(){7(4.p){m(d i=b.q;i;){4.p(b[--i],e,v)}}n{4.o=P}}};$.9.A({6:a(9){h 9?4.E("6",9):4.F("6")},I:a(9){h 4.J("6",9)}});a e(2){d 5=2||L.2,g=[].O.x(y,1),8=0,C=D,f=0,c=0;2=$.2.G(5);2.H="6";7(2.r){8=2.r/j}7(2.t){8=-2.t/3}c=8;7(5.u!==k&&5.u===5.N){c=0;f=-1*8}7(5.w!==k){c=5.w/j}7(5.s!==k){f=-1*5.s/j}g.Q(2,8,f,c);h $.2.R.S(4,g)}})(T);',56,56,'||event||this|orgEvent|mousewheel|if|delta|fn|function|types|deltaY|var|handler|deltaX|args|return||120|undefined|addEventListener|for|else|onmousewheel|removeEventListener|length|wheelDelta|wheelDeltaX|detail|axis|false|wheelDeltaY|call|arguments|DOMMouseScroll|extend|setup|returnValue|true|bind|trigger|fix|type|unmousewheel|unbind|teardown|window|special|HORIZONTAL_AXIS|slice|null|unshift|handle|apply|jQuery'.split('|'),0,{}))


