
var app_log=new Log(false||(debugging&&(""+window.location).indexOf('/app_log/')!=-1));var ua=navigator.userAgent.toLowerCase();var isIE=(ua.indexOf("msie")!=-1)&&(ua.indexOf("opera")==-1)&&(ua.indexOf("webtv")==-1);var isIE6=navigator.appVersion.indexOf("MSIE 6.")!=-1;var isIE7=navigator.appVersion.indexOf("MSIE 7.")!=-1;var isIE8=navigator.appVersion.indexOf("MSIE 8.")!=-1;var isFF=(ua.indexOf('gecko')!=-1)&&(ua.indexOf("firefox")!=-1);var isFF2=(navigator.appName.toUpperCase()=='FIREFOX'&&navigator.appVersion.startsWith('2'));var isChrome=(ua.indexOf('chrome')!=-1);var isSafari=(ua.indexOf('safari')!=-1);var isOpera=(ua.indexOf('opera')!=-1);String.prototype.endsWith=function(s)
{return((this.length>=s.length)&&(this.lastIndexOf(s)==this.length-s.length));}
String.prototype.startsWith=function(s)
{return(this.indexOf(s)==0);}
var $C=function(name)
{return(document.createElement(name));}
Array.prototype.remove=function(e)
{var index=this.indexOf(e);if(index!=-1)
{this.splice(index,1);}}
var __upper='ABCDEFGHIJKLMNOPQRSTUVWXYZ';var __lower='abcdefghijklmnopqrstuvwxyz';String.prototype.unCamelize=function()
{var s=this;if(s)
{for(var i=0;i<s.length;++i)
{var index=__upper.indexOf(s[i]);if(index!=-1)
{s=s.substring(0,i)+"-"+__lower[index]+s.substring(i+1);++i;}}}
return(s);}
var __whitespace=" \t\n\r";function isWhitespace(ch)
{return(__whitespace.indexOf(ch)!=-1);}
function isLowerCase(str)
{for(var i=0;i<str.length;++i)
{if(__lower.indexOf(str[i])==-1)
{return(false);}}
return(true);}
String.prototype.trim=function()
{var str=this;var trimmed=false;for(var i=0;i<str.length;++i)
{var ch=str.charAt(i);if(__whitespace.indexOf(ch)==-1)
{break;}
trimmed=true;}
for(var j=str.length-1;j>i;--j)
{var ch=str.charAt(j);if(__whitespace.indexOf(ch)==-1)
{break;}
trimmed=true;}
if(!trimmed)
{return(str);}
return(j>=i?str.substring(i,j+1):"");}
function linkSelf(e,url,open_in_new_page)
{if((typeof editing!='undefined')&&editing)
{return;}
if(iz_amzn&&url.indexOf('amazon.com')!=-1)
{if(url.indexOf('&tag=')!=-1)
{url=url.substring(0,url.indexOf('&tag='));}
url+="&tag="+iz_amzn;}
if(e.nodeName=='A')
{e.href=url;}
else if(e.parentNode.nodeName=='A')
{e.parentNode.href=url;}
else
{if(e.id&&e.id.startsWith("slot_picture"))
{e=e.firstChild;}
var link=$C('a');link.href=url;link.target="_top";if(open_in_new_page)
{link.target='_blank';}
link.style.left=e.offsetLeft+"px";link.style.top=e.offsetTop+"px";link.className=e.className;if(e.className)
{e.className=e.className.replace(/Slot/g,'');}
e.style.left=0;e.style.top=0;link.s_left=e.s_left;link.s_top=e.s_top;link.s_width=e.s_width;link.s_height=e.s_height;link.id=e.id+"_link";replaceSelf(e,link);link.appendChild(e);}}
function watchLinks(e)
{var kids=e.getElementsByTagName('A');for(var i=0,len=kids.length;i<len;++i)
{var kid=kids[i];var part=kid.parentNode;if(part.className==null||part.className.indexOf('Part')==-1)
{var parts=document.getElementsByClassName('Part',kid);part=parts.length>0?parts[0]:e;}
Event.observe(kid,'click',function(event){recordClick(part,kid.href);return true;});}}
function recordClick(e,url)
{new Ajax.Updater({},"/iz/pages/"+iz_page_id+"/clicked?part="+e.id,null);}
function getHTML(e)
{var tmp=$C("div");izEditor.showHandles(false);replaceSelf(e,tmp);tmp.appendChild(e);var html=tmp.innerHTML;replaceSelf(tmp,e);izEditor.showHandles(true);return(html);}
function replaceSelf(e,f)
{var p=e.parentNode;if(p)
{p.replaceChild(f,e);}}
function removeSelf(e)
{var p=e.parentNode;if(p)
{p.removeChild(e);}
return(p);}
function prepend(parent,child)
{var p=parent;if(p.firstChild)
{p.insertBefore(child,p.firstChild);}
else
{p.appendChild(child);}}
function insertAfter(e,rightBeforeE)
{var p=rightBeforeE.parentNode;if(rightBeforeE.nextSibling)
{p.insertBefore(e,rightBeforeE.nextSibling);}
else
{p.appendChild(e);}}
function removeAllChildren(e)
{while(e.lastChild)
{e.removeChild(e.lastChild);}}
function ss(val)
{return((""+val).substring(0,4));}
function geomToFloat(str)
{if(str)
{return(parseFloat(str.substring(0,str.length-2)));}
return(0.0);}
function getStyles(element,styles)
{var results={};var css=null;if(document.defaultView&&document.defaultView.getComputedStyle)
{css=document.defaultView.getComputedStyle(element,null);if(!css)
{return(results);}}
element=$(element);var len=styles.length;for(var i=0;i<len;++i)
{var style=styles[i];var value=element.style[style];if(!value)
{if(css)
{value=css[style];}
else if(element.currentStyle)
{value=element.currentStyle[style];}}
if((value=='auto')&&['width','height'].include(style)&&(element.getStyle('display')!='none'))
{value=element['offset'+style.capitalize()]+'px';}
if(window.opera&&['left','top','right','bottom'].include(style))
{if(Element.getStyle(element,'position')=='static')
{value='auto';}}
if(style=='opacity')
{if(value)
{value=parseFloat(value);}
if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
{if(value[1])
{value=parseFloat(value[1])/100;}
else
{value=1.0;}}}
results[style]=(value=='auto'?null:value);}
return(results);}
function styleToFloat(v)
{if(v=='medium')
{return(0);}
if(v=='small')
{return(6.0);}
if(v=='normal')
{return(1.2);}
return(geomToFloat(v));}
function _getStyle(element,style)
{element=$(element);style=style.camelize();var value=element.style[style];if(!value)
{if(document.defaultView&&document.defaultView.getComputedStyle)
{var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}
else if(element.currentStyle)
{value=element.currentStyle[style];}}
if((value=='auto')&&['width','height'].include(style)&&(element.getStyle('display')!='none'))
{value=element['offset'+style.capitalize()]+'px';}
if(window.opera&&['left','top','right','bottom'].include(style))
{if(Element.getStyle(element,'position')=='static')
{value='auto';}}
if(style=='opacity')
{if(value)
{return parseFloat(value);}
if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
{if(value[1])
{return parseFloat(value[1])/100;}
return 1.0;}}
return value=='auto'?null:value;}
function getStyle(e,name)
{var v=_getStyle(e,name);if(v=='medium')
{return(0);}
if(v=='small')
{return(6.0);}
if(v=='normal')
{return(1.2);}
return(geomToFloat(v));}
function getInsideWidthFloat(e)
{return(getStyle(e,'width'));}
function getInsideHeightFloat(e)
{return(getStyle(e,'height'));}
function getInsideWidth(e)
{return(e.offsetWidth-getStyle(e,"paddingLeft")-getStyle(e,"paddingRight")-getStyle(e,"borderLeftWidth")-getStyle(e,"borderRightWidth"));}
function getInsideHeight(e)
{return(e.offsetHeight-getStyle(e,"paddingTop")-getStyle(e,"paddingBottom")-getStyle(e,"borderTopWidth")-getStyle(e,"borderBottomWidth"));}
function getInsidesW(e)
{return(getStyle(e,"paddingLeft")+getStyle(e,"paddingRight")+getStyle(e,"borderLeftWidth")+getStyle(e,"borderRightWidth"));}
function getInsidesH(e)
{return(getStyle(e,"paddingTop")+getStyle(e,"paddingBottom")+getStyle(e,"borderTopWidth")+getStyle(e,"borderBottomWidth"));}
function getOutsideWidth(e)
{return(e.offsetWidth+getStyle(e,"marginLeft")+getStyle(e,"marginRight"));}
function getOutsideHeight(e)
{return(e.offsetHeight+getStyle(e,"marginTop")+getStyle(e,"marginBottom"));}
function getBordersW(e)
{return(getStyle(e,"borderLeftWidth")+getStyle(e,"borderRightWidth"));}
function getBordersH(e)
{return(getStyle(e,"borderTopWidth")+getStyle(e,"borderBottomWidth"));}
function getPaddingsW(e)
{return(getStyle(e,"paddingLeft")+getStyle(e,"paddingRight"));}
function getPaddingsH(e)
{return(getStyle(e,"paddingTop")+getStyle(e,"paddingBottom"));}
function getMarginsW(e)
{return(getStyle(e,"marginLeft")+getStyle(e,"marginRight"));}
function getMarginsH(e)
{return(getStyle(e,"marginTop")+getStyle(e,"marginBottom"));}
function capitalizem(str)
{var words=str.split(' ');var result="";for(var i=0;i<words.length;++i)
{var word=words[i].strip();if(word.length>0)
{result+=(result.length>0?" ":"");result+=word.charAt(0).toUpperCase()+word.substring(1);}}
return(result);}
function printHTML(html)
{var str=html.replace(/</g,'&lt;');str=str.replace(/>/g,'&gt;');log.info(str);}
function intersectsAdjusted(e,f,fSizeAdj)
{var eoff=cumulativeOffset(e);var foff=cumulativeOffset(f);foff[0]+=fSizeAdj;foff[1]+=fSizeAdj;return(eoff[0]<foff[0]+f.offsetWidth-2*fSizeAdj&&foff[0]<eoff[0]+e.offsetWidth&&eoff[1]<foff[1]+f.offsetHeight-2*fSizeAdj&&foff[1]<eoff[1]+e.offsetHeight);}
function intersects(e,f)
{var eoff=cumulativeOffset(e);var foff=cumulativeOffset(f);return(eoff[0]<foff[0]+f.offsetWidth&&foff[0]<eoff[0]+e.offsetWidth&&eoff[1]<foff[1]+f.offsetHeight&&foff[1]<eoff[1]+e.offsetHeight);}
function inside(e,f)
{var eoff=cumulativeOffset(e);var foff=cumulativeOffset(f);return(eoff[0]>=foff[0]&&eoff[0]+e.offsetWidth<=foff[0]+f.offsetWidth&&eoff[1]>=foff[1]&&eoff[1]+e.offsetHeight<=foff[1]+f.offsetHeight);}
function pick(e,x,y,footprint)
{var offsets=cumulativeOffset(e);if(typeof footprint=='undefined')
{footprint=10;}
return((e.offsetWidth)&&(!((x<offsets[0]-footprint)||(x>offsets[0]+e.offsetWidth+footprint)||(y<offsets[1]-footprint)||(y>offsets[1]+e.offsetHeight+footprint))));}
function hasIDLike(e,patterns)
{for(var i=0;i<patterns.length;++i)
{if(e.id.indexOf(patterns[i])!=-1)
{return(true);}}
return(false);}
function getParentWithIDLike(e,pattern)
{var p=e.parentNode;while(p)
{if(p.id&&p.id.indexOf(pattern)!=-1)
{return(p);}
p=p.parentNode;}
return(null);}
function getChildWithIdLike(container,pattern,tag)
{var kids=container.getElementsByTagName(tag||'*');for(var i=0;i<kids.length;++i)
{if(kids[i].id&&kids[i].id.indexOf(pattern)!=-1)
{return(kids[i]);}}
return(null);}
function getParentWithClassLike(e,pattern)
{var p=e.parentNode;while(p)
{if(p.className&&p.className.indexOf(pattern)!=-1)
{return(p);}
p=p.parentNode;}
return(null);}
function getPreviousSiblingsByClass(e,name)
{var result=[];var sib=e;while(sib=sib.previousSibling)
{if(sib.className)
{if(Element.classNames(sib).include(name))
{result.push(sib);}}}
result.reverse();return(result);}
function getNextSiblingsByClass(e,name)
{var result=[];var sib=e;while(sib=sib.nextSibling)
{if(sib.className)
{if(Element.classNames(sib).include(name))
{result.push(sib);}}}
return(result);}
function resizeImage(img,maxWidth,maxHeight)
{var width=img.offsetWidth;var height=img.offsetHeight;if(width==0)
{img.onload=function(){resizeImage(img,maxWidth,maxHeight);};return;}
if(width>0)
{var sx=maxWidth/width;var sy=maxHeight/height;if(sx>sy)
{width=width*sy;height=height*sy;}
else
{height=height*sx;width=width*sx;}
img.style.width=width+"px";img.style.height=height+"px";}}
function getElementsByTagName(e,tag)
{if(tag=="#text")
{return(_getElementsByTagName(e,tag,[]));}
return(e.getElementsByTagName(tag));}
function _getElementsByTagName(e,tag,results)
{if(e.childNodes)
{for(var i=0;i<e.childNodes.length;++i)
{var kid=e.childNodes[i];var nn=kid.nodeName;if(nn==tag)
{results.push(kid);}
if((nn!="#text")&&(nn!="#comment")&&(nn!="SCRIPT")&&(nn!="STYLE"))
{_getElementsByTagName(kid,tag,results);}}}
return(results);}
var unique_id=0;function genUniqueId(clue)
{return((clue?clue:"id")+unique_id++);}
var ALT_KEY=1;var CTL_KEY=2;var SHIFT_KEY=4;function getModifiers(event)
{var e=arguments[0]||window.event;var mods=0;if(arguments[0]!=null)
{mods+=(e.altKey)?ALT_KEY:0;mods+=(e.ctrlKey)?CTL_KEY:0;mods+=(e.shiftKey)?SHIFT_KEY:0;}
else
{mods+=((e.modifiers&Event.ALT_MASK)==Event.ALT_MASK)?this.ALT_KEY:0;mods+=((e.modifiers&Event.CTRL_MASK)==Event.CTRL_MASK)?this.CTL_KEY:0;mods+=((e.modifiers&Event.SHIFT_MASK)==Event.SHIFT_MASK)?this.SHIFT_KEY:0;}
return(mods);}
function rgbToHex(c)
{if(c.startsWith("rgb("))
{var n=c.substring("rgb(".length,c.indexOf(')')).split(',');c=toHex(n[0].strip())+toHex(n[1].strip())+toHex(n[2].strip());}
else if(c.startsWith('#'))
{c=c.substring(1);}
return(c);}
function toHexColor(c)
{if(c.startsWith("rgb("))
{var n=c.substring("rgb(".length,c.indexOf(')')).split(',');c='#'+toHex(n[0].strip())+toHex(n[1].strip())+toHex(n[2].strip());}
return(c);}
var __hex='0123456789abcdef';function toHex(n)
{if(n<0)
{return"00";}
if(n>255)
{return"ff";}
return(__hex[Math.floor(n/16)]+__hex[n%16]);}
var _toCallOnCreate=[];function addFunctionToCallOnPageCreate(f)
{_toCallOnCreate[_toCallOnCreate.length]=f;}
function callFunctionsToCallOnPageCreate()
{for(i=0;i<_toCallOnCreate.length;++i)
{_toCallOnCreate[i]();}}
function addFunctionToCallOnPageResize(f)
{var w=window;if(w.addEventListener)
{w.addEventListener("resize",f,false);}
else if(w.attachEvent)
{w.attachEvent("onresize",f);}}
function addFunctionToCallOnPageLoad(f)
{var w=window;if(w.addEventListener)
{w.addEventListener("load",f,false);}
else if(w.attachEvent)
{w.attachEvent("onload",f);}
else
{w["onload"]=f;}}
var _effects=[];var _visibles=[];var tooltipsEnabled=true;function fadeIn(tooltip)
{if(tooltipsEnabled)
{while(_effects.length>0)
{_effects.pop().cancel();}
while(_visibles.length>0)
{Element.setOpacity(_visibles.pop(),0.0);}
var e=$(tooltip);Element.setOpacity(e,0.0);e.style.visibility="visible";_visibles.push(e);_effects.push(Effect.Appear(e));}}
function fadeOut(tooltip)
{while(_effects.length>0)
{_effects.pop().cancel();}
var element=$(tooltip);_effects.push(Effect.Fade(element));}
function setAndRecordUserPreferedVisibility(e,visible)
{e=$(e);if(e)
{setVisibility(e,visible);e.userSetVisibility=visible;}}
function saveVisibility(user_id,panel_id)
{var e=$(panel_id);var visibility=e.style.visibility!='hidden';if(user_id>0)
{new Ajax.Request("/users/"+user_id+";set_preference?name="+panel_id+"&attribute=visibility&value="+visibility,{asynchronous:true,evalScripts:true,method:'put'});}
e.userSetVisibility=visibility;}
function _setVisibility(e,visible)
{if(visible)
{e.style.display="block";e.style.visibility="visible";}
else
{e.style.visibility="hidden";e.style.display="none";}}
function restoreVisibility(e)
{e=$(e);var visibility=e.style.visibility!='hidden';if((typeof e.userSetVisibility=='undefined')||(e.userSetVisibility!=visibility))
{toggleVisibility(e);}}
function setVisibility(element,visible)
{element=$(element);if(element)
{if(element.push)
{for(var i=0;i<element.length;++i)
{_setVisibility(element[i],visible);}}
else
{_setVisibility(element,visible);}}}
function toggleVisibility(element)
{element=$(element);if(element)
{if(element.push)
{var visible=element.length>0?Element.getStyle(element[0],"visibility")=='hidden':false;for(var i=0;i<element.length;++i)
{_setVisibility(element[i],visible);}}
else
{_setVisibility(element,Element.getStyle(element,"visibility")=='hidden');}}}
function isVisible(element)
{return(element.style.visibility!='hidden');}
function getTextShadow(e)
{var shadow=null;var shadowed=null;var shadows=document.getElementsByClassName('TextShadow',e);if(shadows.length>0)
{shadow=shadows[0];shadowed=shadow.nextSibling;}
else if(shadow=$(e.id+"_shadow"))
{shadowed=e;}
if(shadow&&shadowed)
{var dx=0;var dy=0;var classnames=shadow.className.split(' ');for(var i=0;i<classnames.length;++i)
{var cn=classnames[i];if(cn.startsWith('TextShadow_'))
{dx=parseInt(cn.substring('TextShadow_'.length,'TextShadow_'.length+2));dy=parseInt(cn.substring('TextShadow_'.length+3));}}
return({color:shadow.style.color,dx:dx,dy:dy,noShadow:false});}
return(null);}
function setTextShadows(e,options)
{setTextShadow(e,options.color,options.dx,options.dy,options.noShadow);}
function setTextShadow(e,color,dx,dy,noShadow,adjustForSelectionBorders)
{if(color==null)
{noShadow=true;}
var shadows=document.getElementsByClassName('TextShadow',e);for(var i=0;i<shadows.length;++i)
{removeSelf(shadows[i]);}
var peer=$(e.id+"_shadow");if(peer)
{removeSelf(peer);}
if(noShadow)
{return;}
if(!color)
{color="#000000";}
if(!dx)
{dx=2;}
if(!dy)
{dy=2;}
var texts=getElementsByTagName(e,"#text");var parents=[];for(var i=0;i<texts.length;++i)
{if(texts[i].nodeValue.strip().length>0)
{var p=texts[i].parentNode;while(['THEAD','TBODY','TR','TD','SPAN'].include(p.nodeName))
{p=p.parentNode;}
parents.push(p);}}
parents=parents.uniq();var ancestors=[];for(var i=0;i<parents.length;++i)
{var p=parents[i];ancestors[i]=[p].concat(Element.ancestors(p));}
var list=ancestors[0];for(var i=0;list&&i<list.length;++i)
{var p=list[i];if(!['THEAD','TBODY','TR','TD','SPAN'].include(p.nodeName))
{var failed=false;for(var j=1;j<ancestors.length;++j)
{if(!ancestors[j].include(p))
{for(var k=0;k<ancestors[j].length;++k)
{}
failed=true;}}
if(!failed)
{parents=[p];break;}}}
dx=parseInt(dx);dy=parseInt(dy);for(var i=0;i<parents.length;++i)
{var p=parents[i];var shadow=p.cloneNode(true);var s=shadow.style;s.borderStyle='none';shadow.className='TextShadow TextShadow_'+(dx<10?"0":"")+dx+"x"+(dy<10?"0":"")+dy;shadow.id+="_shadow";s.color=color;s.position="absolute";s.width=p.offsetWidth+"px";if(isFF2)
{s.zIndex=-1;}
else
{var pos=p.style.position;if(!pos)
{pos=Element.getStyle(p,"position");}
if(pos=='static')
{p.style.position='relative';}}
var left=p.offsetLeft+(adjustForSelectionBorders&&p==e?getStyle(e,'borderLeftWidth'):0);var top=p.offsetTop+(adjustForSelectionBorders&&p==e?getStyle(e,'borderTopWidth'):0);s.left=(left+parseInt(dx))+"px";s.top=(top+parseInt(dy))+"px";p.parentNode.insertBefore(shadow,p);}}
function hashToJSON(h,withOuterBraces,deep)
{var json=withOuterBraces?"{":"";var comma="";for(var name in h)
{var v=h[name];if(name.indexOf('-')!=-1)
{name='"'+name+'"';}
else
{for(var i=0;i<name.length;++i)
{if(name.charCodeAt(i)>255)
{name='"'+name+'"'
break;}}}
if(typeof v!='undefined'&&v!=null)
{var quotesToUse='"';if(v===false)
{quotesToUse='';}
if(v.push)
{json+=comma+name+': [';var acomma="";for(var i=0;i<v.length;++i)
{json+=acomma+quotesToUse+v[i]+quotesToUse;acomma=", ";}
json+="]";comma=", ";continue;}
if((typeof v=='string')&&(v.indexOf('"')!=-1))
{quotesToUse="'";if(v.indexOf("'")!=-1)
{v=v.replace(/'/g,"\\\'");}}
json+=comma+name+':'+((deep&&(typeof v=='object')&&v)?hashToJSON(v,true,true):(quotesToUse+v+quotesToUse));comma=", ";}}
return(json+(withOuterBraces?"}":""));}
function removeMoz(html)
{html=html.replace(/class="MsoPlainText"/g,'');var words=html.split(' ');for(var i=0;i<words.length;++i)
{var w=words[i];if(w.indexOf("-moz-")!=-1)
{if(w.charAt(0)=='"'||w.charAt(w.length-1)=='"')
{words[i]='"';}
else
{words.splice(i,1);--i;}}
else if(w.startsWith("s_"))
{var index=w.indexOf('>');if(index>0)
{words[i]=w.substring(index);}
else
{words.splice(i,1);--i;}}
else if(w.startsWith("_extended"))
{var index=w.indexOf('>');if(index>0)
{words[i]=w.substring(index);}
else
{words.splice(i,1);--i;}}}
return(words.join(' '));}
function cloneHash(h)
{if((typeof h=='undefined')||(h==null))
{return(h);}
var c={};for(var n in h)
{var v=h[n];c[n]=(typeof v=='object'?cloneHash(v):v);}
return(c);}
function cloneHashS(h)
{if((typeof h=='undefined')||(h==null))
{return(h);}
var c={};for(var n in h)
{var v=h[n];c[n]=v;}
return(c);}
function mergeTo(src,dest,override)
{if(typeof override=='undefined')
{override=true;}
if(src)
{for(var n in src)
{var v=src[n];if(v&&(typeof v=='object'))
{if(dest[n])
{mergeTo(v,dest[n],override);}
else
{dest[n]=cloneHash(v);}}
else if(override||(typeof dest[n]=='undefined'))
{dest[n]=v;}}}}
var ascii_table=" !\"#$%&`()*+'-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";function toAscii(ch)
{return(ascii_table.indexOf(ch)+32);}
function fromAscii(value)
{return(value-32>=0&&value-32<ascii_table.length?ascii_table.charAt(value-32):'?');}
function inspect(obj)
{if(obj===undefined)return'undefined';if(obj===null)return'null';if(obj.inspect)
{return(obj.inspect());}
str="";for(var n in obj)
{str+=n+"="+obj[n];}
return(str);}
function getWindowSize()
{var size=[0,0];if(typeof window.innerWidth!='undefined')
{size=[window.innerWidth,window.innerHeight];}
else if((typeof document.documentElement!='undefined')&&(typeof document.documentElement.clientWidth!='undefined')&&(document.documentElement.clientWidth!=0))
{size=[document.documentElement.clientWidth,document.documentElement.clientHeight];}
else
{size=[document.getElementsByTagName('body')[0].clientWidth,document.getElementsByTagName('body')[0].clientHeight];}
return(size);}
function itemize(num)
{var ext="th";if(num<4||num>20)
{last=(""+num).substr(-1,1);switch(last)
{case'1':ext="st";break;case'2':ext="nd";break;case'3':ext="rd";break;}}
return(num+ext);}
var iz_top_bar_rescaled=false;function scaleHeaderToWindow()
{var top_bar=$('top-bar-id');var dim=getWindowSize();var page_number_field=$('header_goto_page_number_field');var scale=1;if(top_bar&&dim[0]<2600||iz_top_bar_rescaled)
{iz_top_bar_rescaled=true;var zoom=getPageZoom();scale=getPageZoom()*(1-0.90*(1600-dim[0])/1600);var fontSize=(scale*18)+"px";var texts=getElementsByTagName(top_bar,"#text");for(var i=0;i<texts.length;++i)
{texts[i].parentNode.style.fontSize=fontSize;}
if(page_number_field)
{page_number_field.style.fontSize=(scale*22)+"px";}
var imgs=getElementsByTagName(top_bar,"img");var imgSize=(scale*22)+"px";for(var i=0;i<imgs.length;++i)
{var img=imgs[i];if(img.className=='Big_Header_Button')
{img.style.height=scale*50+"px";img.style.marginBottom=-scale*20+"px";img.style.top="-2px";}
else
{img.style.height=(img.id&&img.id.endsWith('-design-id'))?scale*50+"px":imgSize;}}}
if(page_number_field)
{var ed=(typeof editing!='undefined')&&editing;page_number_field.style.width=(20+(ed?1:(""+page_number_field.value).length-1)*scale*16)+"px";if(isIE)
{page_number_field.style.top="-2px";}}
var page_header=$('page_header_content');if(page_header)
{page_header.style.display='block';}}
function updatePageNumberWidth()
{var ed=(typeof editing!='undefined')&&editing;var page_number_field=$('header_goto_page_number_field');var dim=getWindowSize();var scale=getPageZoom()*(1-0.90*(1600-dim[0])/1600);page_number_field.style.width=(20+(ed?1:(""+page_number_field.value).length-1)*scale*16)+"px";}
function getPageZoom()
{var detector=$("zoom_level_detector");var zoom=1.0;if(detector)
{if(isIE)
{zoom=detector.offsetLeft/detector.style.pixelLeft;}
else
{zoom=detector.offsetHeight/16;}}
return(zoom);}
function getUrlArg(name)
{name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
return"";else
return results[1];}
function withImageSize(img,fn)
{var remove=!img.parentNode;if(remove)
{document.body.appendChild(img);}
_withImageSize(img,fn,1,remove);}
function _withImageSize(img,fn,tries,remove)
{if(img.offsetHeight==0)
{if(tries<100)
{setTimeout(function(){_withImageSize(img,fn,tries,remove);},100);}
return;}
var w=img.offsetWidth;var h=img.offsetHeight;if(remove)
{img.parentNode.removeChild(img);}
fn(w,h);}
function reloadWindow()
{var href=window.location.href;if(href.indexOf('#')!=-1)
{href=iz_url+href.substring(href.indexOf('#')+1);}
window.location.replace(href);window.location.reload(false);window.location=""+window.location;}
function urlify(str)
{return(str.toLowerCase().strip().replace(/' - '/,'-').replace(/\s+/,'-').replace(/[^a-zA-Z0-9_-]+/,''));}
function sizeOfHash(obj)
{var size=0;for(var e in obj)
{if(obj.hasOwnProperty(e))
{++size;}}
return(size);}
function convertUnicodeToRTF8(str)
{return(str);}
function cumulativeOffset(e)
{var offsets=Position.cumulativeOffset(e);if((typeof editing=='undefined')||(!editing))
{offsets[0]-=$('prefetched_pages_array').scrollLeft;}
return(offsets);}
function timeago(seconds)
{var sprintf=function(astring,value){return astring.replace(/%d/i,value);};var agos={seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years"};var minutes=seconds/60;var hours=minutes/60;var days=hours/24;var years=days/365;var words=seconds<45&&sprintf(agos.seconds,Math.round(seconds))||seconds<90&&agos.minute||minutes<45&&sprintf(agos.minutes,Math.round(minutes))||minutes<90&&agos.hour||hours<24&&sprintf(agos.hours,Math.round(hours))||hours<48&&agos.day||days<30&&sprintf(agos.days,Math.floor(days))||days<60&&agos.month||days<365&&sprintf(agos.months,Math.floor(days/30))||years<2&&agos.year||sprintf(agos.years,Math.floor(years));return(words+" ago");}