// JavaScript Document
$(document).ready(function() {
	$('a[rel="external"]').click( function() {
		window.open( $(this).attr('href') );
		return false;
	});
});

// Preloads all images with class="hoverswap" including hover state images; goes hand in hand with swap image function
$(window).bind('load', function() {
	var preload = new Array();
		$(".hoverswap").each(function() {
			s = $(this).attr("src").replace(/\.(.+)$/i, "-hover.$1");
			preload.push(s)
		});
	var img = document.createElement('img');
	$(img).bind('load', function() {
		if(preload[0]) {
			this.src = preload.shift();
		}
	}).trigger('load');
});

// Swap images with class="hoverswap"; works with <img> and <input type="image">
$(function() { 
	  $("img.hoverswap, input[type=image].hoverswap").hover(function() {
	    $(this).attr("src", $(this).attr("src").split("-off.").join("-on."));
	  }, function() {
	    $(this).attr("src", $(this).attr("src").split("-on.").join("-off."));
	  });
});


/* Add This
var addthis_config = {
	data_track_linkback: true
    ui_cobrand: "CHARGE Anywhere&reg;"
    ui_header_color: "#ffffff",
    ui_header_background: "#000000"
}
 */
