$(document).ready(function(){

	// SET height of sidebar to 100% of content container so it fills pages. 
	$('div#contentWrapper div#sidebar').height($('div#contentWrapper').height());

	// Admin header.
	if($('div.controlpanel').height() != 0 && $('div.controlpanel').height() >20)
	{$('body').css("background-position", "0 127px")}

	$('input.commentFirstNameTextbox').click(function(){ if( $(this).val() == "First Name") {$(this).val(""); $(this).addClass("active");} });
	$('input.commentLastNameTextbox').click(function(){ if( $(this).val() == "Last Name") {$(this).val(""); $(this).addClass("active");} });
	$('input.commentEmailTextbox').click(function(){ if( $(this).val() == "Email Address") {$(this).val(""); $(this).addClass("active");} });
	$('textarea.commentTextbox').click(function(){ if( $(this).val() == "Comments") {$(this).val(""); $(this).addClass("active");} });

	$('input.commentFirstNameTextbox').blur(function() { if (this.value == "") {$(this).removeClass('active'); this.value = this.defaultValue; } });
	$('input.commentLastNameTextbox').blur(function() { if (this.value == "") {$(this).removeClass('active'); this.value = this.defaultValue; } });
	$('input.commentEmailTextbox').blur(function() { if (this.value == "") {$(this).removeClass('active'); this.value = this.defaultValue; } });


	$('a#cover-gallery-button').click(function(){
		$('div#photos-box-page1 a').animate({ top: '-=134px' });	
		$(this).hide();
		$('a#cover-gallery-button-prev').show();
		});

	$('a#cover-gallery-button-prev').click(function(){
		$('div#photos-box-page1 a').animate({ top: '+=134px' });	
		$(this).hide();
		$('a#cover-gallery-button').show();
		});

	$('input#headerSearchText').keypress(function(e){
      if(e.which == 13){
	   window.location ='/SearchResults.aspx?Search=' + $('input#headerSearchText').val();
       e.preventDefault();
       }
      });

	$('input.rmv-dft-val').click(
		function() {
			if (this.value == this.defaultValue) {
				$(this).removeClass('default');
				this.value = '';
			}
		}
	);

	$('input.rmv-dft-val').blur(
		function() {
			if (this.value == "") {
				$(this).addClass('default');
				this.value = this.defaultValue;

			}
		}
	);


});

