$(document).ready( function(){ $('#navigation img').hover(function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }, function() { var currentImg = $(this).attr('src'); $(this).attr('src', $(this).attr('hover')); $(this).attr('hover', currentImg); }); $("#navigation img").each(function() { rollsrc = $(this).attr("src"); rollON = rollsrc.replace(/btn$/ig,"on_btn"); $("").attr("src", rollON); }); }); function AjaxBH() { this.setup = function() { var requestObj; try { requestObj = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { requestObj = new XMLHttpRequest(); } return requestObj; } this.get = function(url, func) { var http = this.setup(); http.open("GET", url, true); http.onreadystatechange = function() { func(http); } http.send(null); } this.post = function(url, func) { var http = this.setup(); var parts = url.split("?"); var script = parts[0]; url = parts[1]; http.open("POST", script, true); http.onreadystatechange = function() {func(http); } http.setRequestHeader("Content-Length", script.length + url.length + 100); http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); http.setRequestHeader("ENCTYPE", "plain/text"); http.send(url); } }