$(document).ready(function(){ $(".external").click(function(){ this.target = "_blank"; }); // screenshot viewer // for each anchor w/ a class of .screenshot do this: $(".screenshot").each(function() { largeImage = $(this).css('background-image'); largeImage = largeImage.substr(4); largeImage = largeImage.substr(0, largeImage.length - 1); largeImage = largeImage.replace("_thumb", "_med"); $(".screenshot_display").append("\"Classified"); // $(".screenshot_display").append("\"Classified"); }); $(".screenshot").hover(function() { featureID = "#" + $(this).attr("id") + "_show"; $(featureID).css("z-index", "10"); $("#screen_default").attr("src","/assets/en_screenshot_default_med.jpg"); $(".screenshot").removeClass("current_shot"); }, function() { featureID = "#" + $(this).attr("id") + "_show"; $(featureID).css("z-index", "-1"); }); // DONT DO .screenshot :hover if disabled! $(".disable").hover(function() { featureID = "#" + $(this).attr("id") + "_show"; $(featureID).css("z-index", "-1"); $("#screen_default").attr("src","/assets/en_screenshot_default_med.jpg"); $(".screenshot").removeClass("current_shot"); }, function() { featureID = "#" + $(this).attr("id") + "_show"; $(featureID).css("z-index", "-1"); }); $("a.screenshot").click(function(){ // if current class = "screenshot" then go ahead w/ everything currentClass = $(this).attr("class"); if (currentClass == "screenshot") { $(this).addClass("current_shot"); largeImage = $(this).css('background-image'); largeImage = largeImage.substr(4); largeImage = largeImage.substr(0, largeImage.length - 1); largeImage = largeImage.replace("_thumb", "_med"); $("#screen_default").attr("src",largeImage); this.target = "_blank"; } else { alert("You must enter a valid code to gain access to the exclusive content."); return false; } }); // make a specific class for the "View More exclusive content" link, to avoid conflict w/ all the otherstuff that .disable do BK $("a.disable_viewmore").click(function(){ alert("You must enter a valid code to gain access to the exclusive content."); return false; }); // greybox close links $("a.close_link,body.screen_view #container").click(function(){ parent.parent.GB_hide('screen_view'); return false; }); $("#GB_frame").click(function(){ GB_hide('screen_view'); return false; }); $("a#cancel").click(function(){ parent.parent.GB_hide('confirm_leave'); return false; }); $("a#continue").click(function(){ parent.parent.GB_hide('confirm_leave'); window.open( $(this).attr('href') ); return false; }); // Greybox links $("a.greybox").click(function(){ var t = this.title || $(this).text() || this.href; GB_show(t,this.href,250,450,'confirm_leave'); return false; }); // Greybox links $("a.greybox_special").click(function(){ var t = this.title || $(this).text() || this.href; GB_show(t,this.href,250,450,'confirm_leave'); return false; }); // POPUP (strategy game) $("a.popup").click(function(){ window.open($(this).attr('href'),'strategy_game','width=960,height=580'); return false; }); });