
(function(){$.ajaxSettings.cache=true;var HSW={};window.HSW=HSW;})();HSW.debug=(function()
{return{log:function(s)
{if(window.console)
{console.log(s);}
else if(typeof Debug==='object')
{Debug.writeln(s);}
else if(typeof opera==='opera')
{opera.postError(s);}}};}());var JSON=JSON||{};(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());Date.prototype.toCookieString=function()
{return this.toUTCString().replace(/([0-9]{2}) (.{3}) ([0-9]{3})/,'$1-$2-$3');};HSW.cookies=(function()
{var cookies;function _cookie(args)
{var properties=['name','value','expires','path','domain','secure'];var cookie;function _getDomain()
{var hostname=document.location.hostname,p=hostname.indexOf('.');if(p===-1)
{return hostname;}
return hostname.slice(p);}
cookie={value:'',path:'/',domain:_getDomain(),secure:false,remove:function()
{if(!this.name)
{return;}
this.value='';var d=new Date();d.setTime(0);this.expires=d;this.set();delete HSW.cookies[this.name];},set:function()
{var cookie=[];if(!this.name)
{return;}
cookie.push(this.name+'='+escape(this.value)+';');if(this.expires)
{if(this.expires instanceof Date)
{cookie.push('expires='+this.expires.toCookieString()+';');}}
if(this.path)
{cookie.push('path='+this.path+';');}
if(this.domain)
{cookie.push('domain='+this.domain+';');}
if(this.secure)
{cookie.push('secure;');}
document.cookie=cookie.join(' ');}};jQuery.each(properties,function()
{if(typeof args[this]!=='undefined')
{cookie[this]=args[this];}});return cookie;}
cookies={exists:function(cookie)
{return(this.hasOwnProperty(cookie)&&typeof this[cookie]==='object');},add:function(cookie)
{if(!this.exists(cookie)&&typeof this[cookie]!=='function')
{cookies[cookie]=_cookie({name:cookie});}},get:function(cookie)
{if(this.exists(cookie))
{return cookies[cookie];}
return false;},set:function(cookie,value)
{if(!this.exists(cookie))
{this.add(cookie);}
cookies[cookie].value=value;},remove:function(cookie)
{if(this.exists(cookie))
{cookies[cookie].remove();}},getInstance:function()
{return this;}};function _init()
{if(!document.cookie)
{return;}
var rawCookies=document.cookie.split(/;\s*/);jQuery.each(rawCookies,function()
{var cookieValue=this.split('=');if(cookieValue.length===2)
{cookies[cookieValue[0]]=_cookie({name:cookieValue[0],value:unescape(cookieValue[1])});}});}
_init();return cookies;})();HSW.loader=(function()
{var that={};function _classNameToFilename(className)
{if(className.indexOf('HSW.')!==0)
{HSW.debug.log('Classname is not prefixed with HSW, this is a problem.');return'';}
return $.map(className.substr(4).split('.'),function(item,i)
{return item.charAt(0).toLowerCase()+item.substr(1);}).join('/')+'.js';}
function _getClassesToLoad(className)
{var ns=HSW,bundling=[],levels=className.split('.'),tmpClasses=['HSW'],length=levels.length;for(var i=1;i<length;++i)
{if(typeof ns[levels[i]]==='undefined')
{break;}
tmpClasses.push(levels[i]);ns=ns[levels[i]];}
$.each(levels.slice(i),function(i,item)
{tmpClasses.push(item);bundling.push(_classNameToFilename(tmpClasses.join('.')));});return bundling;}
that.loadStyle=function(url)
{if(typeof url==='object')
{url='http://www.howstuffworks.com/css?m='+url.join('%2C')+'&amp;r=8009';}
var head=document.getElementsByTagName('head')[0],link=document.createElement('link');$(link).attr({rel:'stylesheet',href:url,type:'text/css'});head.appendChild(link);};that.loadScript=function(urls,callback,cache)
{if(urls instanceof Array)
{urls='http://www.howstuffworks.com/js?m='+urls.join('%2C')+'&r=8009';}
var oCache=$.ajaxSettings.cache;$.ajaxSettings.cache=cache||true;$.getScript(urls,callback);$.ajaxSettings.cache=oCache;};that.loadClass=function(classNames,callback)
{var classesToLoad=[];if(typeof classNames==='string')
{classesToLoad=_getClassesToLoad(classNames);}
else if(classNames instanceof Array)
{$.each(classNames,function(i,item)
{classesToLoad=classesToLoad.concat(_getClassesToLoad(item));});}
that.loadScript(classesToLoad,callback);};that.getInstance=function()
{return this;};return that;})();HSW.ab=function()
{var tests=[],ab={};function _abTest(args)
{var properties=['name','type','id','tId'];var abTest;abTest={name:'Ab',type:0,id:0,tId:0,toString:function()
{return[this.name,this.id,this.tId].join('_');},getDomId:function()
{return['#',this.toString()].join('');}};$.each(properties,function()
{if(typeof args[this]!=='undefined')
{if(this=='name')
{abTest[this]=args[this];}
else
{abTest[this]=parseInt(args[this],10);}}});return abTest;}
var last=_abTest({id:0,tId:0});ab.add=function(args)
{var abTest=_abTest(args);if(abTest.id>0&&abTest.tId>0){tests.push(abTest);last=abTest;}};ab.getId=function()
{return last.id;};ab.getTId=function(id)
{return ab.getTest(id).tId;};ab.count=function(type)
{type=type||0;var i=0,n=0,l=tests.length;for(;i<l;i++){var abTest=tests[i];if(abTest.type===type)
{n++;}}
return n;};ab.toString=function(type)
{type=type||0;var i=0,s=[],l=tests.length;for(;i<l;i++){var abTest=tests[i];if(abTest.type===type)
{s.push(abTest.toString());}}
return s.join('_');};ab.toOmniString=function(type)
{return this.toString(type);};ab.getDomId=function(id)
{return ab.getTest(id).getDomId();};ab.getTest=function(id)
{if(id)
{var i,l=tests.length;for(i=0;i<l;i++)
{var abTest=tests[i];if(abTest.id===id)
{return abTest;}}
return _abTest({id:0,tId:0});}
return last;};ab.getData=function(id)
{return ab['ab_'+id];};ab.run=function(args,cb)
{var abTest=_abTest(args);function _callback()
{if(typeof cb==='function')
{cb.apply(abTest,[]);}}
if(abTest.id>0&&abTest.tId>0)
{ab.add(abTest);_callback();}
else
{if(typeof args.tId==='undefined'&&HSW.cookies.exists('htvid'))
{try
{var data=eval('('+HSW.cookies.htvid.value+')'),tId=data[abTest.id];if(tId)
{abTest.tId=parseInt(tId,10);ab.add(abTest);_callback();return undefined;}}
catch(e){}}
var url=['http://getstuff.howstuffworks.com/ab?f=js&id=',abTest.id];if(typeof args.tId!=='undefined')
{url.push('&tid=',args.tId);}
HSW.loader.loadScript(url.join(''),function()
{var data=ab.getData(abTest.id);if(data)
{abTest.id=parseInt(data.id,10);abTest.tId=parseInt(data.tId,10);ab.add(abTest);}
else
{abTest=_abTest({id:0,tId:0});}
_callback();});}};return ab;}();HSW.ui={}
HSW.RealMedia={adImpressions:new Array,referrer:{refCount:0,setCookie:function(){if(this.refCount===0)
{setCookie('r',document.URL,false,false,'howstuffworks.com');this.refCount=1;}}}}
HSW.Omniture={};var adBackgroundColor='';var browser=navigator.appName;var b_version=navigator.appVersion;var version=parseFloat(b_version);if((browser=="Microsoft Internet Explorer")&&(version<7))
{$(document).ready(function()
{$('#nav1>ul>li').each(function()
{if(this.getAttribute('id')=="nav1HomeLink")
{if(!$(this).hasClass("on"))
{$(this).bind('mouseenter',function()
{$(this).addClass("on");});$(this).bind('mouseleave',function()
{$(this).removeClass("on");});}}
else
{if(!$(this).hasClass('divider'))
{$(this).bind('mouseenter',function()
{if(!$(this).hasClass("on"))
{$(this).addClass($(this).hasClass("nosub")?"nosubhover":"hover");}});$(this).bind('mouseleave',function()
{if(!$(this).hasClass("on"))
{$(this).removeClass($(this).hasClass("nosub")?"nosubhover":"hover");}});}}});$('#nav2 > ul > li').each(function()
{if(!$(this).hasClass('divider'))
{$(this).bind('mouseenter',function()
{$(this).addClass($(this).hasClass("nosub")?"nosubhover":"hover");});$(this).bind('mouseleave',function()
{$(this).removeClass($(this).hasClass("nosub")?"nosubhover":"hover");});}});$('.moreBox').each(function()
{$(this).bind('mouseenter',function()
{$(".morePop").css({display:'block'});});$(this).bind('mouseleave',function()
{$(".morePop").css({display:'none'});});});$('.shareVideo').each(function()
{$(this).bind('mouseenter',function()
{$(".sharePop").css({display:'block'});});$(this).bind('mouseleave',function()
{$(".sharePop").css({display:'none'});});});});}
function getTabType1Content(str)
{return str.replace('tab-','tab-content-');}
var tabSets={whatsHot:{css:'.vTabbed .tabs li a',tab2content:getTabType1Content,isCarousel:false},featuredItems:{css:'#featuredItems .tabs li a',tab2content:getTabType1Content,isCarousel:false},featuredSubTabs:{css:'#featured-articles .stabs li a',tab2content:getTabType1Content,isCarousel:true},popularSubTabs:{css:'#popular-articles .stabs li a',tab2content:getTabType1Content,isCarousel:true},doitSubTabs:{css:'#doit-articles .stabs li a',tab2content:getTabType1Content,isCarousel:true}}
var refreshAds=(function()
{var counters={};return{position:function(name)
{counters[name]=counters[name]||0;if(HSW.ads)
{var pageName=[window.location.hostname,window.location.pathname,/\/$/.test(window.location.pathname)?'':'/',name,++counters[name]].join('');registerPage(pageName,"s.events='event4';");HSW.ads.refresh();}}};})();function whatsInsideClick()
{refreshAds.position('whatsinside');}
function setUpTabs(key,clickCallback)
{var st=tabSets[key];st.currentTab=null;st.tabs=$(st.css);if(st.tabs.length>0)
{st.tabs.each(function()
{var subs=$('#'+st.tab2content(this.id)+' .stabs');if(subs.length>0)
{var nd=$('ul',subs[0])[0];carousel.setUp(nd);if($(this).hasClass('on'))
{carousel.setActive(nd,true);}
$(this).bind('click',function()
{carousel.setActive(nd);});}
if($(this).hasClass('on'))
{st.currentTab=this.id;$('#'+st.tab2content(this.id)).removeClass('off');}
else
{var cId=st.tab2content(this.id);if(!$('#'+cId).hasClass('off'))
{$('#'+cId).addClass('off');}}
$(this).bind('click',function(e,autoMove)
{if(this.id!=st.currentTab)
{$(this).addClass('on');$('#'+st.tab2content(this.id)).removeClass('off');$('#'+st.currentTab).removeClass('on');$('#'+st.tab2content(st.currentTab)).addClass('off');st.currentTab=this.id;if(/whatsHot/i.test(key))
{whatsInsideClick();}}
if(this.id.substr(0,3)!='tab')
{if(!autoMove&&HSW.ads)
{refreshAds.position('topcontent');}
carousel.stop();}
return false;});});if(st.isCarousel)
{var gp=st.tabs[0].parentNode.parentNode.parentNode;}
if(st.currentTab==null)
{var cnt=0;$(st.tabs[cnt]).addClass('on');$('#'+st.tab2content(st.tabs[cnt].id)).removeClass('off');st.currentTab=st.tabs[cnt].id;var subs=$('#'+st.tab2content(st.currentTab)+' .stabs');if(subs.length>0)
{var nd=$('ul',subs[0]);carousel.setActive(nd[0],true);}}}}
var nonWhiteSpace=/\S/;function DOMCleanGecko(node)
{for(var i=0;i<node.childNodes.length;i++)
{var childNode=node.childNodes[i];if((childNode.nodeType==3)&&(!nonWhiteSpace.test(childNode.nodeValue)))
{node.removeChild(node.childNodes[i]);i--;}
if(childNode.nodeType==1)
{DOMCleanGecko(childNode);}}}
$(document).ready(function()
{try
{DOMCleanGecko(document.getElementById('nav1'));DOMCleanGecko(document.getElementById('nav2'));}
catch(e)
{}
$("#nav1 > ul > li").mouseover(function(){$(".popNav",this).css({display:'block'})}).mouseout(function(){$(".popNav",this).css({display:'none'})})
try
{if(typeof $('#nav1')[0]!='undefined')
{var menuItemCurrent=document.getElementById('nav1').childNodes[0].childNodes[0];var selectedMenuItemOffset=0;var count=0;do
{if(menuItemCurrent.className=='on')
{selectedMenuItemOffset=menuItemCurrent.offsetLeft+menuItemCurrent.offsetWidth;}
count++;}while(menuItemCurrent=menuItemCurrent.nextSibling)
var menu2Width=document.getElementById('nav2').childNodes[0].offsetWidth;$("#nav2 > ul").css({position:'relative',left:Math.max((selectedMenuItemOffset-menu2Width),document.getElementById('nav1').childNodes[0].offsetLeft)+'px'});$("#nav2").css({visibility:'visible',zIndex:'80'});$("#nav2 > ul").css({zIndex:'80'});$("#nav2 > ul > li").css({zIndex:'80'});$("#nav2 > li > .popNav").css({zIndex:'80'});}}
catch(e)
{}
for(var x in tabSets)
{setUpTabs(x);}
if(carousel.node==null)
{var subs=$('#notab-content .stabs');if(subs.length>0)
{var nd=$('ul',subs[0]);carousel.setActive(nd[0],true);}}
$(window).load(function()
{carousel.start();});$('.tab-more a').unbind('click');$('.tab-less a').unbind('click');$('.tab-more a').click(next);$('.tab-less a').click(previous);if($('#whatsInside .vTabbed .tabs ul li').length>10)
{$('#whatsInside .vTabbed .tabs ul').append('<li class="tab-more"><a href="#" class="tab-more-btn">More Topics</a></li>');$('.tab-more').click(next);}
function next(e)
{e.preventDefault();$('#whatsInside .vTabbed .tabs ul li:visible:not(.tab-more):not(.tab-less)').each(function(i)
{$(this).slideUp();});$('#whatsInside .vTabbed .tabs ul li.tab-more, #whatsInside .vTabbed .tabs ul li.tab-less').remove();$('#whatsInside .vTabbed .tabs ul li:hidden').each(function(i)
{$(this).slideDown();});$('#whatsInside .vTabbed .tabs ul').prepend('<li class="tab-less"><a href="#" class="tab-less-btn">Previous Topics</a></li>');$('.tab-less').click(previous);whatsInsideClick();}
function previous(e)
{e.preventDefault();$('#whatsInside .vTabbed .tabs ul li:visible:not(.tab-more):not(.tab-less)').each(function(i)
{$(this).slideUp();});$('#whatsInside .vTabbed .tabs ul li.tab-more, #whatsInside .vTabbed .tabs ul li.tab-less').remove();$('#whatsInside .vTabbed .tabs ul').append('<li class="tab-more"><a href="#" class="tab-more-btn">More Topics</a></li>');$('.tab-more').click(next);$('#whatsInside .vTabbed .tabs ul li:hidden').each(function(i)
{$(this).slideDown();});whatsInsideClick();}});function swapToggles(onId,offId)
{$('#'+onId).toggleClass('hidden');$('#'+offId).toggleClass('hidden');}
var carousel={defaultTiming:10000,direction:-1,tracker:null,node:null,items:null,moveUnit:149,continual:false,lastMoveDirection:-1,inMotion:false,changedNodes:null,finishScrolling:false,stop:function()
{clearTimeout(carousel.tracker);},start:function()
{if(!carousel.inMotion)
{carousel.tracker=setTimeout(function(){carousel.move()},(carousel.continual?100:carousel.defaultTiming));}},move:function()
{var nd=$(carousel.node);carousel.inMotion=true;carousel.endAnimation();},setActive:function(nd,setup)
{carousel.stop();if(carousel.inMotion)
{carousel.changedNodes=nd;return;}
carousel.node=nd;carousel.items=$('li',this.node);if(!setup)
{carousel.start();}},endAnimation:function()
{carousel.inMotion=false;carousel.lastMoveDirection=carousel.direction;if(!carousel.continual)
{if(carousel.finishScrolling)
{carousel.finishScrolling=false;}
else
{if(carousel.items!=null)
{var nxt=false;carousel.items.each(function(idx)
{var nds=$('a',this)[0];if($(nds).hasClass('on'))
{nxt=true;if((idx+1)==carousel.items.length)
{var nd=$('a',carousel.items.get(0))[0];$(nd).triggerHandler('click',true);}}
else if(nxt)
{$(nds).triggerHandler('click',true);nxt=false;}});}}}
if(carousel.changedNodes)
{carousel.setActive(carousel.changedNodes);carousel.changedNodes=null;}
else
{carousel.start();}},setDirection:function(dir)
{carousel.direction=dir;if(!carousel.inMotion)
{carousel.lastMoveDirection=dir;}},setUp:function(nd)
{}}
function textCounter(field,cntfield,maxlimit)
{var countField=document.getElementById(field);var counterField=document.getElementById(cntfield);if(countField.value.length>maxlimit)
{countField.value=countField.value.substring(0,maxlimit);}
else
{counterField.value=maxlimit-countField.value.length;}}
function inject_code(str)
{document.write(str);}
function omnitureClick(str)
{var s=s_gi(s_account);void(s.tl(true,'o',str));}
function bubble(options)
{this.subject=null;this.text='test';this.bubble1=null;this.bubble2=null;this.bubble3=null;this.bubbleMain=null;this.arrow=null;this.style='bubbleExpanding';this.direction='right';this.align='left';this.width=200;this.timeout=null;if(typeof options.text!='undefined')
{this.text=options.text;}
if(typeof options.subject!='undefined')
{this.subject=options.subject;}
if(typeof options.style!='undefined')
{this.style=options.style;}
if(typeof options.direction!='undefined')
{this.direction=options.direction;}
if(typeof options.align!='undefined')
{this.align=options.align;}
this.show();}
bubble.prototype.show=function()
{this.subject.style.position='relative';if(this.style=='bubbleExpanding')
{this.bubble1=this.addDiv(this.subject.offsetLeft+this.subject.offsetWidth-21,this.subject.offsetTop-1,13,8);this.bubble2=this.addDiv(this.subject.offsetLeft+this.subject.offsetWidth-15,this.subject.offsetTop-10,20,15);this.bubble3=this.addDiv(this.subject.offsetLeft+this.subject.offsetWidth-7,this.subject.offsetTop-20,30,22);this.bubbleMain=this.addDiv(this.subject.offsetLeft+this.subject.offsetWidth+4,this.subject.offsetTop-35,null,null,this.text);}
else if(this.style=='block')
{if(this.align=='left')
{this.bubbleMain=this.addDiv(this.subject.offsetLeft,this.subject.offsetTop+this.subject.offsetHeight,this.width,null,this.text);}
else
{this.bubbleMain=this.addDiv((document.documentElement.clientWidth)-(this.subject.offsetLeft+this.subject.offsetWidth),this.subject.offsetTop+this.subject.offsetHeight+10,this.width,null,this.text);this.arrow=document.createElement('IMG');this.bubbleMain.parentNode.insertBefore(this.arrow,null);this.arrow.src='http://static.howstuffworks.com/en-us/www/default/layout/bubblePointerUpWhite.gif';this.arrow.style.position='absolute';this.arrow.style.left=this.bubbleMain.offsetLeft+parseInt(this.width*5/6)+'px';this.arrow.style.top=(this.bubbleMain.offsetTop-9)+'px';this.arrow.style.zIndex=1000;}}};bubble.prototype.showSupportingBubble=function(depth)
{var tempHeight=this.bubbleMain.offsetHeight*0.8;var offsetTop=this.bubbleMain.offsetHeight*0.1;this.addDiv(this.bubbleMain.offsetLeft-(this.bubbleMain.offsetLeft-this.subject.offsetLeft)*0.1,(this.bubbleMain.offsetHeight*0.8));}
bubble.prototype.addDiv=function(x,y,width,height,text)
{var tempDiv=document.createElement('DIV');tempDiv.style.position='absolute';tempDiv.style.zIndex=999;if(text)
{var my=this;tempDiv.innerHTML=text;tempDiv.style.padding='9px';tempDiv.style.borderWidth='2px';tempDiv.style.MozBorderRadius='5px';tempDiv.style.webkitBorderRadius='5px';tempDiv.style.width=width+'px';$(tempDiv).click(function()
{my.remove();});$(this.subject).mouseout(function(e)
{my.timeout=setTimeout(function()
{my.remove();},500);});$(tempDiv).mouseover(function(e)
{clearTimeout(my.timeout);});$(tempDiv).mouseout(function(e)
{if(e.relatedTarget&&(e.relatedTarget!=this)&&(e.relatedTarget.parentNode!=this))
{my.remove();}});}
else
{tempDiv.style.width=width+'px';tempDiv.style.height=height+'px';tempDiv.style.borderWidth='1px';tempDiv.style.MozBorderRadius='15px';tempDiv.style.webkitBorderRadius='15px';}
tempDiv.style.borderStyle='solid';tempDiv.style.borderColor='#AAA';tempDiv.style.backgroundColor='#fff';tempDiv.style.MozBorderRadius='5px';tempDiv.style.webkitBorderRadius='5px';tempDiv.style.borderRadius='10px';if(this.align=='left')
{tempDiv.style.left=x+'px';}
else
{tempDiv.style.right=x+'px';}
tempDiv.style.top=y+'px';document.body.appendChild(tempDiv);return tempDiv;};bubble.prototype.remove=function()
{if(this.bubbleMain)
{this.bubbleMain.parentNode.removeChild(this.bubbleMain);this.bubbleMain=null;}
if(this.bubble1)
{document.body.removeChild(this.bubble1);}
if(this.bubble2)
{document.body.removeChild(this.bubble2);}
if(this.bubble3)
{document.body.removeChild(this.bubble3);}
if(this.arrow)
{this.arrow.parentNode.removeChild(this.arrow);this.arrow=null;}}
$(document).ready(function()
{});function getCookie(name)
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));}
function setCookie(name,value,expires,path,domain,secure)
{var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function deleteCookie(name,path,domain)
{if(getCookie(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function getHSWCookie()
{var results=document.cookie.match('HSWCookie'+'=(.*?)(;|$)');if(results)
{return true;}
else
{return null;}}
function createRequestObject()
{var ro;var browser=navigator.appName;if(browser=="Microsoft Internet Explorer")
{ro=new ActiveXObject("Microsoft.XMLHTTP");}
else
{ro=new XMLHttpRequest();}
return ro;}
var cobrand=createRequestObject();var cobrand_firstpageonly=false;function sendCobrandRequest()
{var ref=document.referrer;if(cobrand_firstpageonly!=true)
{var refcookie=getCookie('HSWPartner');if(refcookie!=""&&refcookie!=null&&refcookie!=undefined)
{ref=refcookie;}}
var partner=getPartner(ref);if(partner==""||partner==undefined||partner==null)
{return;}
if(cobrand_firstpageonly!=true)
{if(refcookie==""||refcookie==null||refcookie==undefined)
{setCookie('HSWPartner',ref,'','/','.howstuffworks.com');}}
var cobrand_url='cobrand.htm?partner='+partner;cobrand.open('get',cobrand_url);cobrand.onreadystatechange=handleResponse;cobrand.send(null);}
function getPartner(ref)
{if(ref.indexOf('www.forbestraveler.com')>=0)
{return'forbestravel';}
else
{return'';}}
function handleResponse()
{switch(cobrand.readyState)
{case 1:case 2:case 3:break;case 4:if(cobrand.responseText!=''&&cobrand.responseText!=null)
{document.getElementById('coBrand').style.display='';document.getElementById('coBrandContents').innerHTML=cobrand.responseText;}
break;default:break;}}
function embedVideo(videofile)
{var msg='<iframe src="http://videos.howstuffworks.com/vid_inpage.php?pageID='+videofile+'" name="vidFrame" frameborder=0 width=420 hscroll=no vscroll=no height=410>Your Browser Does Not Support iFrames</iframe>';document.write(msg);}
function embedVideoSmall(videofile)
{var msg='<iframe src="http://videos.howstuffworks.com/vid_inpage_s.php?pageID='+videofile+'" name="vidFrame" frameborder=0 width=225 hscroll=no vscroll=no height=195>Your Browser Does Not Support iFrames</iframe>';document.write(msg);}
function embedVideoPlain(videofile)
{var msg='<iframe src="http://videos.howstuffworks.com/vid_inpage_plain.php?pageID='+videofile+'" name="vidFrame" frameborder="0" width="420" hscroll="no" vscroll="no" height="410">Your Browser Does Not Support iFrames</iframe>';document.write(msg);}
function embedVideo280(videofile)
{var msg='<iframe src="http://videos.howstuffworks.com/vid_inpage_280.php?pageID='+videofile+'" name="vidFrame" frameborder=0 width=290 hscroll=no vscroll=no height=300>Your Browser Does Not Support iFrames</iframe>';document.write(msg);}
function inPagePlayer(videoId,args)
{args=args?args:{};var url='http://videos.howstuffworks.com/inline-player.htm';var winWidth=460;var winHeight=496;var noSkin=0;options=new Array;options.push('videoId='+videoId);options.push('adCode='+escape(typeof OAS_sitepage==='string'?OAS_sitepage:''));if(args.noSkin)
{options.push('noSkin='+(args.noSkin?noSkin=1:0));}
if(args.width!=null)
{options.push('width='+args.width);if(noSkin)
{winWidth=args.width;}}
if(args.height)
{options.push('height='+args.height);if(noSkin)
{winHeight=args.height;}}
if(args.autostart)
{options.push('autostart='+(args.autostart?1:0));}
var msg='<br><iframe  style="clear: both;"  src="'+url+'?'+options.join('&')+'" name="vidFrame" frameborder="0" width="'+winWidth+'" hscroll="no" vscroll="no" scrolling="no" height="'+winHeight+'">'
+'Your Browser Does Not Support iFrames'
+'</iframe>';document.write(msg);}
function inject_code(str){document.write(str);}
function browserAcceptsCookies()
{var HSW_acceptsCookies=false;if(document.cookie=='')
{document.cookie='HSW_acceptsCookies=yes';if(document.cookie.indexOf('HSW_acceptsCookies=yes')!=-1)
{HSW_acceptsCookies=true;}}
else
{HSW_acceptsCookies=true;}
return(HSW_acceptsCookies);}
function recordStats(webpage,referer)
{}
function tsStats(parms)
{var _bs='<img height=1 width=1 border=0 src="http://www.howstuffworks.com/tsform.php?'+parms+'">';document.write(_bs);}
function OpenWindow(url)
{newwindow=window.open("/"+url,'HowStuffWorks','status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=yes,width=485,height=675');}
function OpenWindow2(url,h,w)
{newwindow=window.open("/"+url,'HowStuffWorks','status=no,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h);}
var RN=new String(Math.random());var RNS=RN.substring(2,11);function DisplayAds(sitepage,position,width,height)
{var oas='http://ad.howstuffworks.com/RealMedia/ads/';var oaspage=sitepage+'/1'+RNS+'@'+position;if(_version<11)
{document.write('<A HREF="'+oas+'click_nx.ads/'+oaspage+'" TARGET="_top"><IMG SRC="'+oas+'adstream_nx.ads/'+oaspage+'" BORDER="0" WIDTH="'+width+'" HEIGHT="'+height+'"></a>');}
else
{document.write('<SCRIPT LANGUAGE="JavaScript1.1" SRC="'+oas+'adstream_jx.ads/'+oaspage+'">');document.write('\<\!-- --\>');document.write('\<\/SCRIPT\>');document.write('\<\!-- --\>');}}
function showImage(html)
{windowOps="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,"+"width=500,height=500,left=250,top=50";ImageWindow=window.open("","ImageWindow",windowOps);windowHTML='<html><body><base href="http://www.howstuffworks.com/"><center><font face="arial,helvetica">'+html+'<p><font face="arial,helvetica">'+'<a href="javascript:window.close();">Click here</a> to close this window.</font></center>'+'</body></html>';self.ImageWindow.document.clear();self.ImageWindow.document.write(windowHTML);self.ImageWindow.focus();self.ImageWindow.document.close();}
function tryIt(HTML)
{windowOps="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,"+"width=500,height=500,left=250,top=50";ImageWindow=window.open("","ImageWindow",windowOps);windowHTML='<html><body>'+HTML+'<p><font face="arial,helvetica">'+'<A HREF="javascript:window.close();">Click here</a> to close this window.</font>'+'</body></html>';self.ImageWindow.document.clear();self.ImageWindow.document.write(windowHTML);self.ImageWindow.focus();self.ImageWindow.document.close();}
function shopTI(url,lid)
{if(url.indexOf("LINKIN_ID")==-1)
{url="http://"+escape(url.substring(7))+"/LINKIN_ID-"+lid;}
return url;}
function videoWin(id)
{window.open('mediacenter/mcPlayerFull.php?vidID='+id,'mcPlayer','width=740,height=440,menubar=no,status=no,location=no,toolbar=no,scrollbars=yes,resizable=yes');}
function D_findPosX(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curleft+=obj.offsetLeft
obj=obj.offsetParent;}}
else if(obj.x)
{curleft+=obj.x;}
return curleft;}
function D_findPosY(obj)
{var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curtop+=obj.offsetTop
obj=obj.offsetParent;}}
else if(obj.y)
{curtop+=obj.y;}
return curtop;}
function revealDiv(divID,parentID)
{this._timeout=0;this._element=document.getElementById(divID);this._parent=document.getElementById(parentID);}
revealDiv.prototype.show=function()
{this._clear();var y=D_findPosY(this._parent)+this._parent.clientHeight;var doc=document.getElementById('doc');var docX=D_findPosX(doc);this._element.style.top=y;this._element.style.left=(docX+doc.clientWidth-this._element.offsetWidth)+'px';this._element.style.visibility='visible';}
revealDiv.prototype.hide=function(divID)
{element=this._element;this._timeout=setTimeout(function()
{element.style.visibility='hidden';},500);}
revealDiv.prototype._clear=function()
{if(this._timeout==0)
return;window.clearTimeout(this._timeout);this._timeout=0;}
hswVideoOverlay={_documentWrite:null,_bufferContent:'',_bufferStatus:false,_randomNumber:null,displayAds:function()
{$('#inlinePlayerAds').html('');this._documentWrite=document.write;document.write=function(string)
{if(string.match(/^<script/))
{hswVideoOverlay._bufferStatus=true;return;}
if(string.match(/^<\/script/))
{eval(hswVideoOverlay._bufferContent);hswVideoOverlay._bufferStatus=false;hswVideoOverlay._bufferContent='';return;}
if(hswVideoOverlay._bufferStatus)
{hswVideoOverlay._bufferContent+=string;return;}
$('#inlinePlayerAds').append(string);}
$('#inlinePlayerAds').append(this.getAdString("x58,x59!x58","400","75")+
this.getAdString("x58,x59!x59","150","700"));},getAdString:function(position,width,height)
{var oas=OAS_url;var oaspage=OAS_sitepage+'/1'+this.getRandomNumber()+'@'+position;var adString='';if(OAS_version<11)
{adString+='<A HREF="'+oas+'click_nx.ads/'+oaspage+'" TARGET="_top"><IMG SRC="'+oas+'adstream_nx.ads/'+oaspage+'" BORDER="0" WIDTH="'+width+'" HEIGHT="'+height+'"></a>';}
else
{adString+='<SCRIPT LANGUAGE="JavaScript1.1" SRC="'+oas+'adstream_jx.ads/'+oaspage+'">';adString+='\<\!-- --\>';adString+='\<\/SCRIPT\>';adString+='\<\!-- --\>';}
return adString;},getRandomNumber:function()
{if(this._randomNumber==null)
{var rn=new String(Math.random());this._randomNumber=rn.substring(2,11);}
return this._randomNumber;}}
var realMediaPM={_cssRules:(document.all?'rules':'cssRules'),_classChange:new Array(),changeColor:function(color)
{adBackgroundColor=color;},setColor:function(color)
{document.body.style.background=color;for(i in this._classChange)
{for(var S=0;S<document.styleSheets.length;++S)
{for(var R=0;R<document.styleSheets[S][this._cssRules].length;R++)
{if(document.styleSheets[S][this._cssRules][R].selectorText==this._classChange[i])
{document.styleSheets[S][this._cssRules][R].style['background']=color;}}}}},changeVideoOverlayBackground:function(url)
{$(document).ready(function(){$.fn.hswModal._defaultOptions.backgroundImage="url('"+url+"')";$.fn.hswModal._args.backgroundImage="url('"+url+"')";$.fn.hswModal.changeModalBg({backgroundImage:"url('"+url+"')"});});},changeVideoOverlayTransparency:function(transparency)
{$(document).ready(function(){$.fn.hswModal._defaultOptions.opacity=transparency;$.fn.hswModal._args.opacity=transparency;$.fn.hswModal.changeModalBg({opacity:transparency});});}}
function makeHomePage(domain)
{var obj=document.getElementById("hplink");if(!domain)
{domain="http://www.howstuffworks.com/";}
if(window.sidebar)
{window.sidebar.addPanel('HowStuffWorks',domain,"");}
else
{if(navigator.appName=="Microsoft Internet Explorer"&&(parseInt(navigator.appVersion)>=4))
{obj.style.behavior="url(#default#homepage)";obj.setHomePage(domain);}
else
{sethp=window.open("/sethomepage.php","sethp","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=300,alwaysRaised=yes,screenX=250,screenY=250,top=250,left=250,alwaysRaised=yes");}}}
function swapHealthBox(display)
{switch(display)
{case"symptom":document.getElementById("diseases").style.visibility="hidden";document.getElementById(display).style.visibility="visible";break;case"diseases":document.getElementById("symptom").style.visibility="hidden";document.getElementById(display).style.visibility="visible";break;}}
function onFSCommand()
{}