var power_tools = ['search_share', 'calendar']; var xmlns_html = 'http://www.w3.org/1999/xhtml'; function blur_field(field, placeholder) { if (field.value == '' || field.value == placeholder) { field.value = placeholder; field.className = 'placeholder'; } } function bouncer(url) { var birthday; var entry = prompt('Please enter your birth date (MM/DD/YYYY). You must be 21 years old to participate.', ''); var minAge = 662695445000; // Are you 662,695,445,000 milliseconds old? Can I see proof? var now = new Date().valueOf(); if (entry) { try { birthday = new Date(entry); } catch(e) {alert(e);} } if (birthday && (now - birthday.valueOf() >= minAge)) document.location.href = url; else alert('Sorry, you must be 21 years old to participate.'); return false; } function click_tool_tab(tab) { var id = tab.id; for (var i = 0; i < power_tools.length; ++i) { var name = power_tools[i]; var img = document.getElementById(name + '_img'); var src = img.src; var tab = document.getElementById(name); var tool = document.getElementById(name + '_tool'); if (name == id) { tool.className = 'selected power-tool'; img.src = src.substring(0, src.lastIndexOf('_over')) + '_selected_over' + src.substring(src.lastIndexOf('.')); } else { var selected_index = img.src.lastIndexOf('_selected'); tool.className = 'power-tool'; if (selected_index >= 0) img.src = src.substring(0, selected_index) + src.substring(src.lastIndexOf('.')); } } return false; } // an 85-line function because Internet Explorer can't get right ... Jesus. function embed(element_id, activeXName, attributes, params) { var allAttributes; var alt = document.getElementById(element_id + '_alt'); var attributesActiveX = {classid: attributes.classid, codebase: attributes.codebase}; var attributesEither = {height: attributes.height, id: element_id, width: attributes.width}; var attributesPlugin = {data: attributes.data, type: attributes.type}; var ns = document.createElementNS; var plugin; var replacement; var self = document.getElementById(element_id); if (navigator.plugins) { var plugins = navigator.plugins; var type = attributesPlugin.type; for (var i = 0; !plugin && i < navigator.plugins.length; ++i) { var a_plugin = plugins[i]; for (var j = 0; !plugin && j < a_plugin.length; ++j) { if (a_plugin[j].type == type) plugin = a_plugin; } } if (plugin) { var replacement = ns ? document.createElementNS(xmlns_html, 'object') : document.createElement('object'); allAttributes = [attributesEither, attributesPlugin]; for (var i = 0; i < allAttributes.length; ++i) { var attributes = allAttributes[i]; for (var name in attributes) { var value = attributes[name]; if (value != undefined) replacement[name] = value; } } for (var name in params) { var param = ns ? document.createElementNS(xmlns_html, 'param') : document.createElement('param'); param.name = name; param.value = params[name]; replacement.appendChild(param); } self.parentNode.replaceChild(replacement, self); } } if (!plugin) { try { plugin = new ActiveXObject(activeXName); } catch (e) {} if (plugin) { allAttributes = [attributesEither, attributesActiveX]; replacement = '"; replacement += ''; self.outerHTML = replacement; } } if (plugin) { if (alt) alt.parentNode.removeChild(alt); } else self.parentNode.removeChild(self); return document.getElementById(element_id); } function embed_flash(element_id, data, height, width, more_params) { var params = {movie: data}; update(params, more_params); return embed(element_id, 'ShockwaveFlash.ShockwaveFlash', { classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000', codebase: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0', data: data, height: height, type: 'application/x-shockwave-flash', width: width}, params); } function embed_quicktime(element_id, data, height, width, more_params) { var params = {src: data}; update(params, more_params); return embed(element_id, 'QuickTimeCheckObject.QuickTimeCheck', { classid: 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b', codebase: 'http://www.apple.com/qtactivex/qtplugin.cab', data: data, height: height, type: 'video/quicktime', width: width}, params); } function focus_field(field) { if (field.className == 'placeholder') { field.className = ''; field.value = ''; } } function mouse_out_img(img) { if (img) { var src = img.src; img.src = src.substring(0, src.lastIndexOf('_over')) + src.substring(src.lastIndexOf('.')); } } function mouse_out_menu(menu) { var id = menu.id; var menu_items = document.getElementById(id + '_menu'); mouse_out_img(document.getElementById(id + '_img')); if (menu_items) mouse_out_menu_items(menu_items); } function mouse_out_menu_items(menu_items) { menu_items.style.visibility = 'hidden'; } function mouse_out_tool_tab(tool_tab) { var id = tool_tab.id; mouse_out_img(document.getElementById(id + '_img')); } function mouse_over_img(img) { if (img) { var src = img.src; var dot = src.lastIndexOf('.'); var extension = src.substring(dot); img.src = src.substring(0, dot) + '_over' + extension; } } function mouse_over_menu(menu) { var id = menu.id; var menu_items = document.getElementById(id + '_menu'); mouse_over_img(document.getElementById(id + '_img')); if (menu_items) menu_items.style.visibility='visible'; } function mouse_over_menu_items(menu_items) { menu_items.style.visibility = 'visible'; } function mouse_over_tool_tab(tool_tab) { var id = tool_tab.id; mouse_over_img(document.getElementById(id + '_img')); } function print_page() { window.print(); return false; } function show_permalink() { var permalink = document.getElementById('permalink'); if (permalink.style.display == 'block') permalink.style.display = 'none'; else permalink.style.display = 'block'; return false; } function update(object, properties) { for (var key in properties) object[key] = properties[key]; }