/*
FILE ARCHIVED ON 5:41:24 May 31, 2012 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 19:15:32 Mar 17, 2015.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/* Mobify *********************************************************************/
var _mm = "/web/20120531054124/http://m.wired.com/";
(function() {
if ( document.domain.indexOf("howto.wired.com") >= 0 ) {
return;
}
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 a.primaryLink').bind('mouseover', function() {
jQuery(this).addClass('over');
}).bind('mouseout', function() {
jQuery(this).removeClass('over');
});
// Dropdowns for the top nav
jQuery('#pnav_list a.primaryLink').bind('mouseenter', function() {
// hide all the menus that may be showing already
jQuery('.dropdownMenu').hide();
jQuery(this).parentsUntil('#pnav_list').find('.dropdownMenu').show();
jQuery(this).addClass('over');
});
// Actions on leaving the dropdown
jQuery('#pnav_list li .dropdownMenu').bind('mouseleave', function() {
jQuery(this).delay(500).fadeOut(200);
jQuery(this).parentsUntil('#pnav_list').find('a.primaryLink').removeClass('over');
});
/* Footer ********************************************************************/
// Select links
jQuery('#footer_dropdowns_subscribe, #footer_dropdowns_sites, #footer_dropdowns_international').bind('change', function() {
window.open(jQuery(this).val());
});
/* 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 |');
}
});
/* OLDER CODE. Sort and strip out what is unused */
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
};
}
}
/*
* (c)2006 Jesse Skinner/Dean Edwards/Matthias Miller/John Resig
* Special thanks to Dan Webb's domready.js Prototype extension
* and Simon Willison's addLoadEvent
*
* For more info, see:
* /web/20120531054124/http://www.thefutureoftheweb.com/blog/adddomloadevent
*/
addDOMLoadEvent = (function(){
// create event function stack
var load_events = [],
load_timer,
script,
done,
exec,
old_onload,
init = function () {
done = true;
// kill the timer
clearInterval(load_timer);
// execute each function in the stack in the order they were added
while (exec = load_events.shift())
exec();
if (script) script.onreadystatechange = '';
};
return function (func) {
// if the init function was already ran, just run this function now and stop
if (done) return func();
if (!load_events[0]) {
// for Mozilla/Opera9
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", init, false);
// for Internet Explorer
/*@cc_on @*/
/*@if (@_win32)
document.write("