jQuery().ready(function(){


	//new scroller (yosi)
	if ($(".newsroller")){
			$(".newscroller").jCarouselLite({
				btnNext: ".next",
				btnPrev: ".prev",
				visible: 4,
				auto: true,
				timeout: 6000
			});
	}
	//handle the huge carousel on the home page
    if (jQuery('#info-main')[0]) {
    	jQuery('#info-main').children(':not(.display)').hide();
    	jQuery('#info-nav').children().children().click(function(){
    		var el = jQuery(this);
    		var catId = el.children().attr('rel');
    		jQuery('#info-nav ul li a.selected').removeClass('selected');
    		el.children().addClass('selected');
    		jQuery('#info-main').children().hide();
    		jQuery('#cat' + catId).fadeIn("normal");
    		return false;
    	});
	}
	
	if (jQuery('#info-featured')[0]) {
    	jQuery('#info-featured').children(':not(.display)').hide();
    	jQuery('#info-nav').children().children().click(function(){
    		var el = jQuery(this);
    		var catId = el.children().attr('rel');
    		jQuery('#info-nav ul li a.selected').removeClass('selected');
    		el.children().addClass('selected');
    		jQuery('#info-featured').children().hide();
    		jQuery('#info-featured' + catId).fadeIn("normal");
    		return false;
    	});
	}
    
    // for the tab drop downs at the top
    // ----------------------------------
	
	if (jQuery('#package-special')[0]) {
		jQuery('#package-special').hoverIntent({
			over: function(){
				jQuery('#show-package').slideDown('fast');
			},
			out: function() {
				//jQuery('#show-package').slideUp('fast');	
			}
		});
	}
	
	if (jQuery('#planning-tools')[0]) {
		jQuery('#planning-tools').hoverIntent({
			over: function(){
				jQuery('#show-planner').slideDown('fast');
				
			},
			out: function() {
				//jQuery('#show-planner').slideUp('fast');	
			}
		});
	}
	
	//hide the package when they click on it.
	if (jQuery('#show-package')[0]) {
		jQuery('#show-package a.button').click(function(){
			jQuery('#show-package').slideUp('fast');
			return false;
		});
	}
	//hide the package when the mouse leaves
	if (jQuery('#show-package')[0] && !(jQuery.browser.msie && (jQuery.browser.version <= 7))) {
		// on mouse leave
		jQuery('#show-package').mouseleave(function(){
			jQuery('#show-package').slideUp('fast');
			return false;
		});
	}
	
	//hide the planner when they click on it.
	if (jQuery('#show-planner')[0]) {
		jQuery('#show-planner a.button').click(function(){
			jQuery('#show-planner').slideUp('fast');
			return false;
		});
	}
	//hide the planner when the mouse leaves.
	if (jQuery('#show-planner')[0] && !(jQuery.browser.msie && (jQuery.browser.version <= 7))) {
		jQuery('#show-planner').mouseleave(function(){
			jQuery('#show-planner').slideUp('fast');
			return false;
		});
	}
	if(jQuery.browser.msie && (jQuery.browser.version <= 7)){
		jQuery('#show-planner a.button').show();
		jQuery('#show-package a.button').show();
	}
	//show the close button if it's IE7
	
	
	// ----------------------------------
	
	//carousel bar
	if (jQuery('#scroller-inner')[0]) {
		jQuery('#scroller-inner').jcarousel({
	        scroll:1,
	        auto: 0,
	        wrap: 'last',
	        initCallback: mycarousel_initCallback,
	        buttonNextHTML: null,
	        buttonPrevHTML: null
	    });
    }
			
});

function mycarousel_initCallback(carousel) {

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    
    jQuery('#scroll-left a').bind('click', function() {
        carousel.prev();
        carousel.startAuto(0);
        return false;
    });

    jQuery('##scroll-right a').bind('click', function() {
        carousel.next();
        carousel.startAuto(0);
        return false;
    });
};

var active_color = '#000'; // Colour of user provided text
var inactive_color = '#5e5e5e'; // Colour of default text
		jQuery(document).ready(function() {
		  jQuery("input.default-value").css("color", inactive_color);
		  var default_values = new Array();
		  jQuery("input.default-value").focus(function() {
			if (!default_values[this.id]) {
			  default_values[this.id] = this.value;
			}
			if (this.value == default_values[this.id]) {
			  this.value = '';
			  this.style.color = active_color;
			}
			jQuery(this).blur(function() {
			  if (this.value == '') {
				this.style.color = inactive_color;
				this.value = default_values[this.id];
			  }
			});
		  });
		});