/* Copyright 2009 by Philip Shaw, phil@codestyle.org, see http://codestyle.org/scripts/CommonFunctions.js for un-compressed source and Creative Commons license. */
function addLoadListener(a){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",a,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",a,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",a)}else{var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){b();a()}}}}}};
/* Copyright 2009 by Philip Shaw, phil@codestyle.org, see http://codestyle.org/scripts/css/css3-ExtensionStyles.js for un-compressed source and Creative Commons license. */
var PREFIXES=new Array("Moz","Webkit","O","Khtml");var NOT_SUPPORTED="not supported";var BOX_SHADOW="BoxShadow";var BORDER_RADIUS="BorderRadius";var BACKGROUND_SIZE="BackgroundSize";var OPACITY="Opacity";var TEXT_OVERFLOW="TextOverflow";var AGENT_STYLE=new Array();var PAGE_ELEMENTS=new Array();var PAGE_ID_ELEMENTS=new Array();var PAGE_CLASS_ELEMENTS=new Array();function setExtensionStyles(){setBorderRadiusByClass("CTA","15px");setBorderRadiusByClass("FAQAction","5px");setBorderRadiusByClass("FAQSearchBox","5px");setBorderRadiusByClass("Information","5px");setBorderRadiusByClass("LogAction","5px");setBorderRadiusByClass("MenuBox","5px");setBorderRadiusByClass("NavBar","5px");setBorderRadiusByClass("RgtBox","5px");setBorderRadiusByClass("Subscription","7px");setBorderRadiusByClass("TextAdCTA","5px");setBorderRadiusByClass("TOC","0px 10px 10px 0px");setBorderRadiusByClass("Options","10px 10px 0px 0px");setBorderRadiusById("Sidebar","10px");setBoxShadowByClass("Thumbnail","0px 1px 3px #DDD");setBoxShadowByClass("CTA","0px 1px 3px #999")}function setExtensionStyleById(a,b,c){if(typeof document.getElementById!="undefined"){if(typeof PAGE_ID_ELEMENTS[a]=="undefined"){PAGE_ID_ELEMENTS[a]=document.getElementById(a)}setExtensionStyle(PAGE_ID_ELEMENTS[a],b,c)}}function setExtensionStyleByClass(c,b,d){if(typeof document.getElementsByClassName!="undefined"){if(typeof PAGE_CLASS_ELEMENTS[c]=="undefined"){PAGE_CLASS_ELEMENTS[c]=document.getElementsByClassName(c)}for(var a=0;a<PAGE_CLASS_ELEMENTS[c].length;a++){setExtensionStyle(PAGE_CLASS_ELEMENTS[c][a],b,d)}}}function setExtensionStyleByTagName(a,c,d){if(typeof document.getElementsByTagName!="undefined"){if(typeof PAGE_ELEMENTS[a]=="undefined"){PAGE_ELEMENTS[a]=document.getElementsByTagName(a)}for(var b=0;b<PAGE_ELEMENTS[a].length;b++){setExtensionStyle(PAGE_ELEMENTS[a][b],c,d)}}}function toLowerCaseInitial(b){var a=b.substring(0,1);return a.toLowerCase()+b.substring(1,b.length)}function getExtensionStyleName(c,b){if(typeof AGENT_STYLE[b]=="undefined"){for(var a=0;a<PREFIXES.length;a++){if(typeof c.style[PREFIXES[a]+b]!="undefined"){AGENT_STYLE[b]=PREFIXES[a]+b;return AGENT_STYLE[b]}}var d=toLowerCaseInitial(b);if(typeof c.style[d]!="undefined"){AGENT_STYLE[b]=d;return AGENT_STYLE[b]}AGENT_STYLE[b]=NOT_SUPPORTED;return AGENT_STYLE[b]}else{return AGENT_STYLE[b]}}function setExtensionStyle(c,b,d){if((c!=null)&&(typeof c!="undefined")&&(typeof c.style!="undefined")){if(typeof c.style[b]!="undefined"){return}else{var a=getExtensionStyleName(c,b);if(a!=NOT_SUPPORTED){c.style[a]=d;return}}}return}function setTextOverflowById(a,b){setExtensionStyleById(a,TEXT_OVERFLOW,b)}function setTextOverflowByClass(a,b){setExtensionStyleByClass(a,TEXT_OVERFLOW,b)}function setTextOverflowByTagName(a,b){setExtensionStyleByTagName(a,TEXT_OVERFLOW,b)}function setBackgroundSizeById(a,b){setExtensionStyleById(a,BACKGROUND_SIZE,b)}function setBackgroundSizeByClass(a,b){setExtensionStyleByClass(a,BACKGROUND_SIZE,b)}function setBackgroundSizeByTagName(a,b){setExtensionStyleByTagName(a,BACKGROUND_SIZE,b)}function setBoxShadowById(a,b){setExtensionStyleById(a,BOX_SHADOW,b)}function setBoxShadowByClass(a,b){setExtensionStyleByClass(a,BOX_SHADOW,b)}function setBoxShadowByTagName(a,b){setExtensionStyleByTagName(a,BOX_SHADOW,b)}function setBorderRadiusById(a,b){setExtensionStyleById(a,BORDER_RADIUS,b)}function setBorderRadiusByClass(a,b){setExtensionStyleByClass(a,BORDER_RADIUS,b)}function setBorderRadiusByTagName(a,b){setExtensionStyleByTagName(a,BORDER_RADIUS,b)}addLoadListener(setExtensionStyles);
/* Copyright 2009 by Philip Shaw, phil@codestyle.org, see http://codestyle.org/scripts/EntranceKeywords.js for un-compressed source and Creative Commons license. */
var ENGINES=[["google.","q","Google"],["yahoo.","p","Yahoo"],["bing.","q","Bing"],["search.","q","Search.com"],["ask.","q","Ask"],["aol.","q","AOL"],["altavista.","q","AltaVista"],["csdev.","q","Code Style test domain"]];function getReferringQuery(){if(document.referrer!=""){var c=getQueryParameter(document.referrer);if(c!=null){var a=document.referrer.split("?");if((a.length>1)&&(a[1]!="")){var d=a[1].split("&");for(var b=0;b<d.length;b++){if(d[b]!=""){var e=d[b].split("=");if((e.length>1)&&(e[1]!="")){if(e[0]==c){return urlDecode(e[1])}}}}}}}return null}function getQueryParameter(a){var d=getDomain(a);for(var b=0;b<ENGINES.length;b++){var c=ENGINES[b][0].toLowerCase();if(d.indexOf(c)>-1){return ENGINES[b][1]}}return null}function getDomain(c){var b=c.indexOf("//");if(b>-1){var a=c.substring(b+2,c.length);var d=a.indexOf("/");if(d>-1){return a.substring(0,d)}else{return a}}return domain.toLowerCase()}function urlDecode(c){var d=null;var b=null;var g=null;var f="";var h=true;var a=c.split("%2B");for(var e=0;e<a.length;e++){if(h){h=false}else{f+="+"}d=unescape(a[e]);b=cleanMarkup(d);g=b.split("+");f+=g.join(" ")}return f}function cleanMarkup(b){var a="";for(var c=0;c<b.length;c++){if(b.charAt(c)=="<"){a+="&lt;";continue}if(b.charAt(c)==">"){a+="&gt;";continue}if(b.charAt(c)=="&"){a+="&amp;";continue}a+=b.charAt(c)}return a}function setEntranceKeywords(){var f=getReferringQuery();if(f!=null){if(typeof document.getElementById!="undefined"){var c=document.getElementById("search-input");var d=document.getElementById("faq-search-input");var a=document.getElementById("log-search-input");var e=-1;if(c!=null){c.value=f}if(d!=null){var g="intitle:FAQ";e=f.indexOf(g);if(e>-1){d.value=f}else{d.value=g+" "+f}}if(a!=null){var b='intitle:"site log"';e=f.indexOf(b);if(e>-1){a.value=f}else{a.value=b+" "+f}}}}}addLoadListener(setEntranceKeywords);
