var fwtfx = new Object(); fwtfx.Top = Class.create(); fwtfx.Top.prototype = Object.extend(new fx.Base(), { initialize: function(el, options) { this.el = $(el); this.setOptions(options); if(this.el.currentStyle) { this.now = parseInt(this.el.currentStyle.getAttribute("top")); } else { this.now = parseInt(document.defaultView.getComputedStyle(this.el,null).getPropertyValue("top")); } }, increase: function() { this.el.style.top = this.now + 'px'; } }); fwtfx.Color = Class.create(); fwtfx.Color.prototype = Object.extend(new fx.Base(), { initialize: function(el, options) { this.el = $(el); this.setOptions(options); this.now = 0; this.regex = new RegExp("#?(..)(..)(..)"); if (!this.options.fromColor) this.options.fromColor = "#FFFFFF"; if (!this.options.toColor) this.options.toColor = "#FFFFFF"; if (!this.options.property) this.props = new Array("backgroundColor"); else this.props = this.options.property.split(","); }, increase: function() { var hex = "rgb(" + (Math.round(this.cs[0] + (this.ce[0]-this.cs[0])*this.now))+","+(Math.round(this.cs[1] + (this.ce[1]-this.cs[1])*this.now))+","+ (Math.round(this.cs[2] + (this.ce[2]-this.cs[2])*this.now))+")"; for (i=0; i < this.props.length; i++) { if (this.props[i] == "backgroundColor") this.el.style.backgroundColor = hex; else if (this.props[i] == "color") this.el.style.color = hex; else if (this.props[i] == "borderColor") this.el.style.borderColor = hex; } }, customColor: function(from, to) { this.cs = this.regex.exec(from); this.ce = this.regex.exec(to); for (i=1; i < this.cs.length; i++) { this.cs[i-1] = parseInt(this.cs[i], 16); this.ce[i-1] = parseInt(this.ce[i], 16); } this.custom(0, 1); } }); fwtfx.backIn = function(pos){ return (pos)*pos*((2.7)*pos - 1.7); }; fwtfx.backOut = function(pos){ return ((pos-1)*(pos-1)*((2.7)*(pos-1) + 1.7) + 1); }; function darkenColor(color,cent) { var percent = cent||.3; var merge = "#000000"; var regex = new RegExp("#?(..)(..)(..)"); var cs = regex.exec(color); var ce = regex.exec(merge); for (i=1; i < cs.length; i++) { cs[i-1] = parseInt(cs[i], 16); ce[i-1] = parseInt(ce[i], 16); } var hex = "rgb(" + (Math.round(cs[0] + (ce[0]-cs[0])*percent))+","+(Math.round(cs[1] + (ce[1]-cs[1])*percent))+","+(Math.round(cs[2] + (ce[2]-cs[2])*percent))+")"; return hex; } var setBackground = function(el,src,repeat) { if(el.tagName == 'IMG' && repeat==false) { el.src = src; } else { el.style.background = "url('" + src + "')" + (repeat?"":" no-repeat"); } }; if(document.all) { setBackground = function(el,src,repeat) { el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='" + (repeat?"scale":"image") + "');"; }; } function makeButton(el) { if(document.all) { el.parentNode.style.filter = 'alpha(opacity=45)'; Event.observe(el,"mouseover",function(e){e.srcElement.parentNode.style.filter='alpha(opacity=100)';}); Event.observe(el,"mouseout",function(e){e.srcElement.parentNode.style.filter='alpha(opacity=45)';}); } else { el.style.opacity = .7; Event.observe(el,"mouseover",function(e){e.target.style.opacity=1;}); Event.observe(el,"mouseout",function(e){e.target.style.opacity=.7;}); } } var FWToolbar = { obj : $("fwt-toolbar"), compactMode : null, loggedIn : false, isOwner : false, owner : null, winObj : null, color : null, darkColor : null, smallWidth : 0, largeWidth : 0, defaultHidden : false, setColor : function(color) { var dark = darkenColor(color); new fwtfx.Color($('fwt-toolbar'), {duration:400, transition:fwtfx.backIn, onComplete:function(){ $("fwt-window").style.backgroundColor = color; $S(".fwt-darken").each(function(el) { el.style.backgroundColor = FWToolbar.darkColor; }); }}).customColor(FWToolbar.color,color); FWToolbar.color = color; FWToolbar.darkColor = dark; // $("fwt-toolbar").style.backgroundColor = color; fw.jjax.req("http://link.freewebs.com/Members/Toolbar/setColor.jsp", {postBody:{'color':color.substring(1)}}); }, submitSearchForm : function(frm) { var sitesearch = frm.elements["sitesearch"]; sitesearch = sitesearch[0].checked?sitesearch[0].value:sitesearch[1].value; document.location = "http://members.freewebs.com/afsResults.jsp?domains=freewebs.com&q=" + frm.elements["q"].value + "&sa=Search&sitesearch=" + sitesearch + "&client=pub-4763110844767107&channel=&safe=active&cof=GALT%3A666666%3BDIV%3AEFEFEF%3BVLC%3A663399%3BALC%3A0099CC%3BLC%3A0033CC%3BBGC%3AFFFFFF%3BT%3A666666%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BS%3Ahttp%3A%2F%2Fwww.freewebs.com%3BFORID%3A11%3B"; return false; }, getSiteAddress : function() { var uri = window.location.href.split('/'); if (uri[2].indexOf('freewebs.com') > -1) { if (uri[3] && uri[3].indexOf('html') == -1) return uri[2]+'/'+uri[3]+'/'; } else { return uri[2]; } }, addBookmark : function() { var site = "http://" + FWToolbar.getSiteAddress(); if (window.sidebar) window.sidebar.addPanel(document.title, site,""); else if(window.ActiveXObject) window.external.AddFavorite(site, document.title); else return false; }, fixToolbar : function() { var ow = $("fwt-toolbar").offsetWidth; var mode; if(ow<(350+FWToolbar.largeWidth)) { mode = true; } else { mode = false; } if(mode==FWToolbar.compactMode) return; FWToolbar.compactMode = mode; $S(".button").each(function(el) { var index = el.name.indexOf("_"); var src = el.name.substring(0,index); if(mode) { el.style.width = '16px'; } else { el.style.width = el.name.substring(index+1) + 'px'; } setBackground(el,"http://images.freewebs.com/Images/Freebar/" + src + (mode?"_ico":"") + ".png"); }); FWToolbar.fixExtraWidths(); }, fixExtraWidths : function() { $S("#extraButtons ul")[0].style.width = (FWToolbar.compactMode?FWToolbar.smallWidth:FWToolbar.largeWidth) + "px"; if(FWToolbar.extrafx.now==0) { FWToolbar.extrafx.el.iniWidth = (FWToolbar.compactMode?FWToolbar.smallWidth:FWToolbar.largeWidth); document.cookie = "hte=1;path=/"; } else { $("extraButtons").style.width = (FWToolbar.compactMode?FWToolbar.smallWidth:FWToolbar.largeWidth) + "px"; document.cookie = "hte=0;path=/"; } }, toggleWindow : function(windowName) { var h = FWToolbar.winObj.offsetHeight; var win = FWToolbar.winObj; var overlay = $('fwt-window-overlay'); var curr = $('fwt-window-' + windowName); if(win.fx.timer != null) { return false; } if(win.isOpen) { win.isOpen = false; win.fx.options.transition = fwtfx.backIn; if(curr.style.display != 'block') { //window is open, but has the wrong content win.fx.options.onComplete = function(){FWToolbar.toggleWindow(windowName);}; } win.fx.custom(win.fx.now,-10-win.offsetHeight); return false; } var kids = $("fwt-window-inner").childNodes; for(var i=0;i'; str += ''; if(FWToolbar.loggedIn) { str += '' + (fwuser.username.length>13?(fwuser.username.substring(0,13)+'...'):fwuser.username) + ''; } else { str += ''; } str += ' '; str += ' '; str += '
'; str += ' '; str += '
'; str += ''; str += ''; str += '
'; str += '
'; str += '
'; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
'; str += '
'; document.write(str); setBackground($("fwt-overlay"),"http://images.freewebs.com/Images/Freebar/glassy-overlay.png",true); setBackground($("fwt-logo"),"http://images.freewebs.com/Images/Freebar/freewebs.png"); setBackground($("fwt-window-overlay"),"http://images.freewebs.com/Images/Freebar/windowpng.png"); var tmp; var btns = $S("#extraButtons li"); var start = 0; if(document.all) { FWToolbar.smallWidth = 4; FWToolbar.largeWidth = 4; } if(FWToolbar.isOwner) { start = 1; tmp = btns[0].offsetWidth; FWToolbar.smallWidth += tmp; FWToolbar.largeWidth += tmp; } for(var i=start;i= 4) { if(document.cookie.charAt(index) == '1') { stb = 0; } else if(document.cookie.charAt(index) == '0') { stb = 1; } } var ste = 1; index = document.cookie.indexOf("hte=")+4; if(index >= 4) { if(document.cookie.charAt(index) == '1') { ste = 0; } else if(document.cookie.charAt(index) == '0') { ste = 1; } } if(typeof(tbc)!='string') tbc = '444444'; FWToolbar.init(un,'#'+tbc,stb,ste); FWToolbar.draw(); }