var skinSet={"blue-shaded":new WidgetTheme("#FFFFFF","#FFFFFF","#90ACC5","#324E8B","#87A5C0"),green:new WidgetTheme("#333333","#FF9900","#77BB00","#FFFFFF","#77BB00"),blue:new WidgetTheme("#333333","#E7073B","#326599","#FFFFFF","#326599"),grey:new WidgetTheme("#333333","#FF1100","#999999","#FFFFFF","#333333"),"grey-shaded":new WidgetTheme("#FFFFFF","#FFFFFF","#0084D3","#4E4E4E","#A1A1A1"),"black-1":new WidgetTheme("#F8F8F8","#E7073B","#7995CD","#000000","#FFFFFF"),"black-2":new WidgetTheme("#F8F8F8","#00FF00","#FFFFFF","#000000","#FFFFFF"),red:new WidgetTheme("#333333","#444444","#888888","#FFFFFF","#CC0000")};var layoutSet={"vertical-stack-narrow":new WidgetLayout("175px","173px","95px","95px"),"horizontal-stack-narrow":new WidgetLayout("175px","173px","95px","95px"),"short-narrow":new WidgetLayout("175px","173px","95px","107px"),"tall-narrow":new WidgetLayout("175px","173px","95px","308px"),"vertical-stack-wide":new WidgetLayout("250px","248px","135px","100px"),"horizontal-stack-wide":new WidgetLayout("250px","248px","135px","147px"),"short-wide":new WidgetLayout("250px","248px","135px","147px"),"tall-wide":new WidgetLayout("250px","248px","135px","331px"),"vertical-stack-extra-wide":new WidgetLayout("357px","355px","192px","100px"),"short-extra-wide":new WidgetLayout("357px","355px","192px","204px"),"tall-extra-wide":new WidgetLayout("357px","355px","192px","388px")};var skinParams=["TEXT_COLOR","HOT","LINK_COLOR","MAINBG","BORDER_COLOR"];var layoutParams=["WIDTH","MAP_WIDTH","MAP_HEIGHT","LIST_HEIGHT"];function WidgetTheme(D,C,B,A,E){this.textColor=D;this.hotColor=C;this.linkColor=B;this.mainBg=A;this.borderColor=E}function WidgetLayout(C,B,D,A){this.width=C;this.mapWidth=B;this.mapHeight=D;this.listHeight=A}function getWidgetStyle(C,D){var K=skinSet[D];var F=[K.textColor,K.hotColor,K.linkColor,K.mainBg,K.borderColor];var G=layoutSet[C];var J=[G.width,G.mapWidth,G.mapHeight,G.listHeight];var I="Stack";if(C.match(/short/)){I="Short"}else{if(C.match(/tall/)){I="Tall"}}var H=document.getElementById("ggwCss"+I).firstChild.data;var B="[$NAME]";var A=".ggw-"+C+"-"+D;while(H.indexOf(B)>=0){H=H.replace(B,A)}for(var E=0;E<skinParams.length;E++){var B="[$"+skinParams[E]+"]";while(H.indexOf(B)>=0){H=H.replace(B,F[E])}}for(var E=0;E<layoutParams.length;E++){var B="[$"+layoutParams[E]+"]";while(H.indexOf(B)>=0){H=H.replace(B,J[E])}}H=H.replace(/\n/g," ");H=H.replace(/\s{2,}/g," ");return H}function toggleWidgetTab(D,C,A){document.getElementById(D).style.display="";document.getElementById(C).style.display="none";var B=A.parentNode;if(B.nextSibling){B.nextSibling.className="wtab wtab-right";B.className="wtab wtab-selected"}else{B.previousSibling.className="wtab";B.className="wtab wtab-right wtab-selected"}}function getWidgetScript(C,D,E){var A="";if(E){A=document.getElementById("widgetScript").firstChild.data;A=A.replace(/\n/g," ");A=A.replace(/\s{2,}/g," ")}var B="http://www.geckogo.com/services/Logger?t=wid&m="+C+","+D+"&u="+getUserId();A+="<img width='1' height='1' style='display:none' src='"+B+"'>";return A}function renderWidgetCode(){loadWidget(layout,skin,false,renderWidgetCodeNow)}function renderWidgetCodeNow(G,I,F){var C;var J=isLimitedPlatform();if(J){C=convertInline(G,F)}else{G="<style type='text/css'>"+G+"</style>";C=G+I+F}document.widgetForm.code.value=C;document.bloggerForm["widget.content"].value=C;document.typepadForm.content.value=C;var D=getRadioValue(document.blogForm.platform);var A=(D=="blogger"&&layout.match("narrow"));var B=(D=="typepad"&&layout.match("narrow"));showHideArea(document.bloggerForm,A);showHideArea(document.typepadForm,B);showHideArea($("blogAddLabel"),B||A);var E=document.getElementById("widgetCode");E.style.display="";var H=YAHOO.util.Dom.getXY("getThis");H[0]-=100;H[1]-=50;if(H[0]<10){H[0]=10}YAHOO.util.Dom.setXY(E,H)}function isLimitedPlatform(A){if(!A){A=getRadioValue(document.blogForm.platform)}if(A=="wordpress"||A=="livejournal"){return true}else{return false}}function loadWidget(C,D,B,G){closeBox();var A=getRadioValue(document.blogForm.platform);var F=!isLimitedPlatform();var E="event=getWidget&skin="+D+"&layout="+C+"&platform="+A+"&sample="+B;YAHOO.util.Connect.asyncRequest("POST","/services/Widgets",{success:function(J){var K=J.responseText;var I="<div style='width:"+layoutSet[C].mapWidth+"; border:1px solid "+skinSet[D].borderColor+"; border-top:none; background-color:"+skinSet[D].mainBg+"; height:18px'>";I+="<div style='float:left; '>&nbsp;<a style='font-size:11px; color:"+skinSet[D].linkColor+"' href='http://www.geckogo.com/widgets/?t=fbw&m=left-link&u="+geckoId+"'>Get your own widget</a></div>";I+="<div style='float:right'><a style='font-size:11px; color:"+skinSet[D].linkColor+"' href='http://www.geckogo.com/?t=fbw&m=right-link&u="+geckoId+"'>GeckoGo</a>&nbsp;</div>";I+="</div>";K="<div class='ggw-"+C+"-"+D+"'>"+K+I+"</div>";var H=(B)?"":getWidgetScript(C,D,F);var L=getWidgetStyle(C,D);G(L,H,K)},failure:function(H){}},E)}YAHOO.util.Event.onDOMReady(init);var defaultLayout="layout-vertical-stack-wide";var defaultSkin="skin-blue-shaded";function init(){var D=isLimitedPlatform();if(!D){defaultLayout="layout-tall-wide"}var F=null,B=null;if(document.blogForm.lastLayout){platform=document.blogForm.lastPlatform.value;renderRadioValue(platform,document.blogForm.platform);defaultLayout=document.blogForm.lastLayout.value;defaultSkin=document.blogForm.lastSkin.value}var A=YAHOO.util.Dom.getElementsByClassName("skin","div",document.getElementById("skinSet"));for(var C=0;C<A.length;C++){A[C].className.match(/skin-(.*)/);var E={elem:A[C],skin:RegExp.$1};YAHOO.util.Event.addListener(A[C],"click",selectSkin,E);if(A[C].className.match(defaultSkin)){selectSkin(null,E,true)}}var A=YAHOO.util.Dom.getElementsByClassName("layout","div",document.getElementById("layoutSet"));for(var C=0;C<A.length;C++){A[C].className.match(/layout-(.*)/);var E={elem:A[C],layout:RegExp.$1};YAHOO.util.Event.addListener(A[C],"click",selectLayout,E);if(A[C].className.match(defaultLayout)){selectLayout(null,E,true)}}loadWidget(layout,skin,true,renderWidget);if(document.blogForm.lastLayout){renderWidgetCode()}}function convertInline(D,C){var F={};var H=D.split(/}/);for(var B=0;B<H.length;B++){var G=H[B];G=G.replace(/\.ggw[-\w]+ /,"");G.match(/\.(.*?) \{ (.*)/);var A=RegExp.$1;var E=RegExp.$2;if(!A){A="TOP";E=G.replace(/\{ /,"")}F[A]=E}C=C.replace(/^<div class='.*?'/,'<div style="'+F.TOP+'"');C=C.replace(/class='contGroup'/g,'style="'+F.contGroup+'"');C=C.replace(/class='cityRow'/g,'style="'+F.cityRow+'"');C=C.replace(/class='ggw-cities'/g,'style="'+F["ggw-cities"]+'"');C=C.replace(/class='ggw-hot'/g,'style="'+F["ggw-hot"]+'"');C=C.replace(/class='ggw-banner'/g,'style="'+F["ggw-banner"]+'"');C=C.replace(/class='ggw-image'/g,'style="'+F["ggw-image"]+'"');C=C.replace(/<img /,'<img style="'+F["ggw-image img"]+'" ');C=C.replace(/<a /g,'<a style="'+F["ggw-cities-list a"]+'" ');return C}function renderWidget(D,B,C){var A=document.getElementById("exampleStyle");if(webBrowser.isIE){A.styleSheet.cssText=D}else{A.innerText="";document.createTextNode(D);A.appendChild(document.createTextNode(D))}document.getElementById("example").innerHTML=C}var skin,layout;var skinArea,layoutArea;function selectSkin(A,C,B){skin=C.skin;if(skinArea){skinArea.id=""}skinArea=C.elem;skinArea.id="selectedSkin";if(!B){loadWidget(layout,skin,true,renderWidget)}}function selectLayout(A,C,B){layout=C.layout;if(layoutArea){layoutArea.id=""}layoutArea=C.elem;layoutArea.id="selectedLayout";if(!B){loadWidget(layout,skin,true,renderWidget)}}function selectPlatform(A){renderRadioValue(A,document.blogForm.platform);var D=isLimitedPlatform();var B=YAHOO.util.Dom.getElementsByClassName("layout","div",document.getElementById("layoutSet"));for(var C=0;C<B.length;C++){if(!B[C].className.match(/limited/)){if(D){showHideArea(B[C],false)}else{showHideArea(B[C],true)}}}if(D&&!layout.match(/stack/)){defaultLayout="layout-vertical-stack-wide"}else{defaultLayout=layout}var B=YAHOO.util.Dom.getElementsByClassName("layout","div",document.getElementById("layoutSet"));for(var C=0;C<B.length;C++){B[C].className.match(/layout-(.*)/);var E={elem:B[C],layout:RegExp.$1};if(B[C].className.match(defaultLayout)){selectLayout(null,E)}}}function closeBox(){document.getElementById("widgetCode").style.display="none"};
