function clickclear(thisfield, defaulttext) {
	if (thisfield.value.toLowerCase() == defaulttext.toLowerCase()) {
		thisfield.value = "";
	}
}

function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

function blnInputChecked(sString) {
	if (sString = 's') {
		var sMsg = "Please enter a value to search for";
		if (document.forms["simple_search_header"].elements[0].value.toLowerCase() == "search") {
			if (sMsg != "") {
				alert(sMsg);
			}
			return false;
		}
		else {
			return true;
		}
	}
}

$(document).ready(function(){

	$(".hovermenu a").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "90"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "90"}, "fast");
	});
	$(".toolNavNew a").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "35"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "35"}, "fast");
	});
	$(".hoverlogo a").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "90"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "90"}, "fast");
	});

	$('input').blur(function() {
		$(this).val($(this).val().replace(/(\<\/|\<|\>)/g,''));
	});
	

	// Gallery *******************************************
	$(".Gallery A[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow', theme:'dark_square', slideshow:3000, autoplay_slideshow:false});
	$(".Gallery LI.hide").hide();

	//HP Billboard - DHTML version of existing Flash
	$('#bx-slider').bxSlider({
		mode: 'fade',                 		// 'horizontal', 'vertical', 'fade'
		infiniteLoop: true,                 // true, false - display first slide after last
		hideControlOnEnd: false,            // true, false - if true, will hide 'next' control on last slide and 'prev' control on first
		controls: false,                    // true, false - previous and next controls
		speed: 1000,                         // integer - in ms, duration of time slide transitions will occupy
		pager: true,                        // true / false - display a pager
		pagerSelector: '#bx-pager',                // jQuery selector / null - element to contain the pager. ex: '#pager'
		pagerType: 'full',                  // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4
		pagerLocation: 'bottom',            // 'bottom', 'top' - location of pager
		pagerShortSeparator: '/',           // string - ex: 'of' pager would display 1 of 4
		pagerActiveClass: 'pager-active',   // string - classname attached to the active pager link				
		nextText: '&raquo;',                   // string - text displayed for 'next' control
		nextImage: '',                      // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
		nextSelector: null,                 // jQuery selector / null - element to contain the next control. ex: '#next'
		prevText: '&laquo;',                // string - text displayed for 'previous' control
		prevImage: '',                      // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
		prevSelector: null,                 // jQuery selector / null - element to contain the previous control. ex: '#next'				
		captions: true,                    	// true, false - display image captions (reads the image 'title' tag)
		captionsSelector: '#bx-captions',             // jQuery selector / null - element to contain the captions. ex: '#captions'				
		auto: true,                        // true, false - make slideshow change automatically
		autoDirection: 'next',              // 'next', 'prev' - direction in which auto show will traverse
		autoControls: true,                // true, false - show 'start' and 'stop' controls for auto show
		autoControlsSelector: '#bx-autoplay',         // jQuery selector / null - element to contain the auto controls. ex: '#auto-controls'
		autoStart: true,                    // true, false - if false show will wait for 'start' control to activate
		autoHover: false,                   // true, false - if true show will pause on mouseover
		autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
		pause: 5000,                        // integer - in ms, the duration between each slide transition
		startText: 'PLAY',                 // string - text displayed for 'start' control
		startImage: '/images/bullet_play.png',                     // string - filepath of image used for 'start' control. ex: 'images/start.jpg'
		stopText: 'PAUSE',                   // string - text displayed for 'stop' control
		stopImage: '/images/bullet_pause.png',                      // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg'
		ticker: false,                      // true, false - continuous motion ticker mode (think news ticker)
											// note: autoControls and autoControlsSelector apply to ticker!
		tickerSpeed: 5000,                  // integer - has an inverse effect on speed. therefore, a value of 10000 will 
											// scroll very slowly while a value of 50 will scroll very quickly.
		tickerDirection: 'next',            // 'next', 'prev' - direction in which ticker show will traverse
		tickerHover: false,                 // true, false - if true ticker will pause on mouseover
		wrapperClass: 'bx-wrapper',         // string - classname attached to the slider wraper
		startingSlide: 0,                   // integer - show will start on specified slide. note: slides are zero based!
		displaySlideQty: 1,                 // integer - number of slides to display at once
		moveSlideQty: 1,                    // integer - number of slides to move at once
		randomStart: true,                 // true, false - if true show will start on a random slide
		onBeforeSlide: function(currentSlide, totalSlides){
				$('#bx-captions').attr('class', '');
			}   
	});
	$("#bx-container").click(function(){
		var slideURL = $(".bx-window").attr("data-href");
		var slideTarget = $(".bx-window").attr("data-target");
		var slideWT = $(".bx-window").attr("data-WT");
		dcsMultiTrack('WT.ac', slideWT);		
		if (slideTarget == "_blank") {
			window.open(slideURL, "newWin","width="+screen.width+",height="+screen.height+",location=1,resizable=1,menubar=1,toolbar=1,scrollbars=1,status=1");
		} else {
			window.location.href = slideURL;
		}
	});
});

function AlignBlocks(box1, box2, iePadding)
{
	var $extraPadding = 0;
	if ( $.browser.msie ) {$extraPadding = iePadding;} 
	var $firstBox = $("[id$='" + box1 + "']");
	var $secondBox = $("[id$='" + box2 + "']");
	var firstBoxHeight = $firstBox.height();
	var secondBoxHeight = $secondBox.height();
	if(firstBoxHeight > secondBoxHeight) {
		$secondBox.height(firstBoxHeight + $extraPadding);
	} else {
		$firstBox.height(secondBoxHeight+ $extraPadding);
	}
}
