
jQuery.fn.extend( {

  swapThisImage: function() {
    var imageSource = this.attr("src");
    arrayParts = imageSource.split('.');
    var extension = arrayParts.pop();
    var path = arrayParts.join('.');
    if(imageSource.lastIndexOf('2.') > 1) {
      path = path.substring(0, path.length-1)
      this.attr("src", path + '.' + extension);
    } else {
      this.attr("src", path + '2.' + extension);
    }
  }

} );


$(document).ready( function() {

  $("#c2a_email").hover(function () {
    $(this).swapThisImage();
  }, function () {
    $(this).swapThisImage();
  } );


  $(".downloadLink").hover( function () {
		$(this).attr("href", "../downloads/CATALOGUE FOR WEB.pdf");
  } );

  $(".downloadLink").click( function () {
		$.get("../include/logDownload.asp");
		return true;
  } );


});

