﻿// behaviors.js
// Dynamic Behaviors for fastie.com, Copyright ©2009 by Will Fastie. All Rights Reserved.
// 21 Oct 2009
// Edited 03 Jun 2011 - moved top notice code into its own file so this file could be used for new design

$(document).ready(function(){
  // Establish hover behavior for image and input tags
	$("img.hovereffect, input.hovereffect").hover(
	  function() {
	    this.src = this.src.replace( /_std\.png$/, '_hov.png' );
	    this.src = this.src.replace( /_std\.gif$/, '_hov.gif' );
	    this.src = this.src.replace( /_std\.jpg$/, '_hov.jpg' );
	  },
	  function() {
	    this.src = this.src.replace( /_hov\.png$/, '_std.png' );
	    this.src = this.src.replace( /_hov\.gif$/, '_std.gif' );
	    this.src = this.src.replace( /_hov\.jpg$/, '_std.jpg' );
	  }
	);
  // Establish hover behavior img tags inside a tags
	$("a.hovereffect").hover(
	  function() {
	    $('img', this).src = $('img', this).src.replace( /_std\.png$/, '_hov.png' );
	    $('img', this).src = $('img', this).src.replace( /_std\.gif$/, '_hov.gif' );
	    $('img', this).src = $('img', this).src.replace( /_std\.jpg$/, '_hov.jpg' );
	  },
	  function() {
	    $('img', this).src = $('img', this).src.replace( /_hov\.png$/, '_std.png' );
	    $('img', this).src = $('img', this).src.replace( /_hov\.gif$/, '_std.gif' );
	    $('img', this).src = $('img', this).src.replace( /_hov\.jpg$/, '_std.jpg' );
	  }
	);
	// -- end Apply Now hover behavior
});
