$(document).ready(function() {
	//load_scrollbar();
	
	if ( $("#article_gal a img").length > 0 ) { 
			$('#article_gal a:has(img)').lightBox();
		}
		
	if ( $("#gallery a img").length > 0 ) { 
			$('#gallery a:has(img):not(.dis)').lightBox();
		}	
	
	if ( $("ul.thumb li a img").length > 0 ) { 
			$('ul.thumb li a:has(img):not(.dis)').lightBox();
		}
	// external links	
	$('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });
	
	//innser gallery news_pics_show.cfm
	if ($('ul.thumb li').length) {
	$('ul.thumb li').Zoomer({speedView:200,speedRemove:400,altAnim:true,speedTitle:400,debug:false});
	}
	
	$("#checkin").datepicker({ dateFormat:'dd/mm/yy', showOn: "button",buttonImage: "images/calendar.png", buttonImageOnly:false });
	
$.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();
	
	$('.contact #fullname').hint();
	$('.contact #company').hint();	
	$('.contact #email').hint();
	$('.contact #address').hint();
	$('.contact #city').hint();	
	$('.contact #phone').hint();
	$('.contact #description').hint();
	$('.contact #hash_text').hint();	

});

$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'sliceDown', //Specify sets like: 'fold,fade,sliceDown'
		slices:10,
		animSpeed:300,
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:true, //Use thumbnails for Control Nav
      	controlNavThumbsFromRel:true, //Use image rel for thumbs
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.6 //Universal caption opacity
	});
});



/*$(window).resize(function() { load_scrollbar(); });*/

/*function load_scrollbar() {
	if (parseInt($.browser.version, 10) != "7") { $('#article_gal').jScrollPane(); }	
}*/
/* 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,{}))



