// JavaScript Document

jQuery(function() {
	if (jQuery.cookie('hills') === null) {
		if ((homepage === true) && (jQuery.cookie('hillsrun') === null)) {
			if (showHills === true) {
				setTimeout(function () {
				jQuery('#drop').css({marginTop: '-168px'});
				jQuery('#drop').show();
				jQuery('#bar').css({marginTop: '-143px'});
				jQuery('#bar').show();
				jQuery('#drop').animate({
						marginTop: '-25px'
					}, 
					4000, 
					function() {}
				);
				jQuery('#bar').animate({
						marginTop: '0px'
					}, 
					4000, 
					function() {}
				);
				jQuery.cookie('hillsrun', '1');
				}, 2000);
			}
		} else {
			if (showHills === true) {
				jQuery('#bar').show();
				jQuery('#drop').show();
			}
		}
	}
	jQuery('.hide').click(function () {
		jQuery('#bar').hide();
		jQuery('#drop').hide();
		jQuery.cookie('hills', '1');
		return false;
	});
	
	jQuery('input[type="text"]').focus(function() {
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	
	jQuery('input[type="text"]').blur(function() {
		if (jQuery.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
});
