$(document).ready(function() {//CLEAR FIELDS
$("input#formemail").focus(function () {
if ($(this).val() == "Email") {
$(this).val("");
}
});

$("input#formzip").focus(function () {
if ($(this).val() == "Zip") {
$(this).val("");
}
});

$("input#formstate").focus(function () {
if ($(this).val() == "ST") {
$(this).val("");
}
});
// MENU IMAGE ROLLOVERS //// Preload all rollovers
		$("#menu img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			if (!rollsrc.match(/_over/)) {
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("<img>").attr("src", rollON);
		}
		});
		
		// Navigation rollovers
		$("#menu a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
		});
		$("#menu a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});	// HOVER-FADE FUNCTIONS$("a.fade img").hover(function() {// animate opacity to full$(this).stop().animate({ opacity: 0.75 }, 200); },// on mouse outfunction () {// animate opacity to nill$(this).stop().animate({ opacity: 1 }, 200);});


//SCROLLING
$(".scroll").click(function(event){
//prevent the default action for the click event
event.preventDefault();
//get the full url - like mysitecom/index.htm#home
var full_url = this.href;
//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
var parts = full_url.split("#");
var trgt = parts[1];
//get the top offset of the target anchor
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top;
//goto that anchor by setting the body scroll top to anchor top
$('html, body').animate({scrollTop:target_top}, 500);
});
});//END DOM
