// JavaScript Document var imageArray = ['buycredits.jpg','buypl.jpg','newguides.jpg','faq.jpg','login.jpg','signup.jpg','clicktobuy.jpg','buynow2.png','logout.jpg','mycenter.jpg','myinfo.jpg','myprofile.jpg','myorder.jpg','gold.jpg','powerlevel.jpg','confirm.jpg','update.jpg','','','','']; $.each(imageArray,function(n,value) { var strSearch = 'img[src$="/images/' + value + '"] , input:image[src$="/images/' + value + '"]'; var img = $(strSearch); if (img.size() > 0) { var srcimg = img[0].src; if(srcimg.indexOf("jpg")>-1) { srcimg = value.replace(".jpg",""); (new Image()).src = "/images/" + srcimg + "_hover.jpg"; img.bind("mouseover", function(){ this.src="/images/" + srcimg + "_hover.jpg"; }); img.bind("mouseout", function(){ this.src="/images/" + srcimg + ".jpg"; }); } else if(srcimg.indexOf("png")>-1) { srcimg = value.replace(".png",""); (new Image()).src = "/images/" + srcimg + "_hover.png"; img.bind("mouseover", function(){ this.src="/images/" + srcimg + "_hover.png"; }); img.bind("mouseout", function(){ this.src="/images/" + srcimg + ".png"; }); } else { srcimg = value.replace(".gif",""); (new Image()).src = "/images/" + srcimg + "_hover.gif"; img.bind("mouseover", function(){ this.src="/images/" + srcimg + "_hover.gif"; }); img.bind("mouseout", function(){ this.src="/images/" + srcimg + ".gif"; }); } } }); $('.switcher').bind('click', function() { $(this).find('.coption').slideToggle('fast'); }); $('.switcher').bind('mouseleave', function() { $(this).find('.coption').slideUp('fast'); }); $("#selectGame").bind('change',function() { ajaxAddOptions("/quickbuy/getGameServer/" + $("#selectGame").val() , $("#selectServer"), "id", "text"); ajaxAddOptions("/quickbuy/getGameFirstBlock/" + $("#selectGame").val() , $("#selectBlock"), "id", "text"); }); $("#selectServer").bind('change',function() { ajaxAddOptions("/quickbuy/getGameBlock/" + $("#selectGame").val() + "/" + $("#selectServer").val() , $("#selectBlock"), "id", "text"); }); function showgamelist() { if(!showlist) { $("#gamelist").slideDown('slow'); showlist = true; } else { $("#gamelist").slideUp('slow'); showlist = false; } }