/*
FILE ARCHIVED ON 14:26:04 Jan 10, 2012 AND RETRIEVED FROM THE
AN OPENWAYBACK INSTANCE ON 16:30:04 Oct 18, 2024.
JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/* Mobify *********************************************************************/
var _mm = "https://webarchive.library.unt.edu/web/20120110142604/http://m.wired.com/";
if ( document.domain.indexOf("wired.com") >= 0 ) {
var m = document.createElement('script');
m.type = 'text/javascript';
m.async = true;
m.src = 'http' + (document.location.protocol[4] == 's' ? 's' : '') + '://m.wired.com/mobify/redirect.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(m, s);
}
jQuery(function(){
/* Top Nav ********************************************************************/
// Mouseovers
jQuery('#pnav_list li a.primaryLink, #pnav_list_test li a.primaryLink').bind('mouseover', function() {
jQuery('.dropdownMenu').hide();
jQuery(this).addClass('over');
}).bind('mouseout', function() {
jQuery(this).removeClass('over');
});
// Dropdowns for the top nav
jQuery('#pn_subscribe_a, #pn_sections, #pn_blogs, #pn_reviews, #pn_sections_test').bind('mouseover', function() {
// hide all the menus that may be showing already
jQuery('.dropdownMenu').hide();
jQuery(this).find('a').addClass('over');
jQuery(this).find('.dropdownMenu').show();
});
jQuery('#pnav_list, #pnav_list_test').bind('mouseleave', function() {
// hide all the menus that may be showing already
jQuery('.dropdownMenu').delay(500).fadeOut(200);
jQuery('#pnav_list li a').removeClass('over');
});
// Close button on subscribe
jQuery('#gh_close_sub_flyout').bind('click', function() {
jQuery('.dropdownMenu').fadeOut(200);
});
/* Sign In/Sign Out ***********************************************************/
// Check if the user is logged in
var username_string = CN.cookie.get('amg_user_info');
if (username_string !== '') {
jQuery('#gh_greeting').html('Hi, ' + username_string + ' | Sign Out |');
} else {
jQuery('#gh_greeting').html('Sign In |');
}
});
/* Text size widget */
function setActiveStyleSheet(title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}
function getActiveStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}
return null;
}
function getPreferredStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title")) {
return a.getAttribute("title");
}
}
return null;
}
/* Reviews */
function resizeImage(img,new_width,new_height) {
if(img.width == new_width && img.height == new_height){
img.className = "prod_review_img_on";
return
}
else {
if (jQuery(img).height() > jQuery(img).width()) {
var h = new_height;
var w = Math.ceil($(img).width() / jQuery(img).height() * new_height);
} else {
var w = new_width;
var h = Math.ceil(jQuery(img).height() / jQuery(img).width() * new_width);
}
jQuery(img).css({ height: h, width: w });
img.className = "prod_review_img_offset";
}
}