
WF.Presales={HQ:{},UI:{},CONF:{},API:{},DATA:{},UTILS:{},OO:{}};WF.P=WF.Presales;WF.A=WF.P.HQ;WF.D=WF.P.DATA;WF.C=WF.P.CONF;WF.API=WF.P.API;WF.F=WF.P.UTILS;WF.UI=WF.P.UI;WF.OO=WF.P.OO;WF.D.copy={};WF.D.copy.chooseLocalSitePopup=['<p>We have a local website for visitors from the US and Canada.</p>','<p>Where do you want to go?</p>','<ul>','<li class="go_us"><input id="cn_pref_US" type="radio" name="cn_pref" value="US"/><label for="cn_pref_US">Take me to my local site</label></li>','<li class="stay_uk"><input id="cn_pref_GB" type="radio" name="cn_pref" value="GB"/><label for="cn_pref_GB">Stay on Webfusion UK</label></li>','</ul>','<button id="site_choice">Continue</button>','<p>We\'ll remember your preference once you select it.</p>'].join('');WF.A.handleAction=function(p){switch(p.status){case'connectionerror':UI.showMessage({text:"There was a connection problem and we couldn't check for available domains. Please try again."});};};WF.UI.isModalOn=false;WF.UI.components={};WF.UI.prepareOverlay=function(){WF.UI.components.Overlay={};WF.UI.components.Overlay.overlay=$('<div id="trans_back" class="hidden"></div>').appendTo('body');WF.UI.components.Overlay.header="Have you seen our North American site?";WF.UI.components.Overlay.cancel="Okay";WF.UI.components.Overlay.close="Close";WF.UI.components.Overlay.msgbox=$('<div id="overlay_wrap" class="hidden">'+'<div id="msgbox"></div>'+'</div>').insertAfter(WF.UI.components.Overlay.overlay);if($.browser.opera){WF.UI.components.Overlay.msgbox}};WF.UI.showOverlay=function(){var contentHeight=$('body').height();WF.UI.components.Overlay.overlay.removeClass('hidden').height(contentHeight).fadeTo(100,0.7);if($.browser.msie&&parseInt($.browser.version,10)<7){$('select').css('visibility','hidden')}};WF.UI.showMessage=function(p){if(!WF.UI.components.Overlay){WF.UI.prepareOverlay();}
if(!WF.UI.isModalOn){WF.UI.isModalOn=true;WF.UI.showOverlay();WF.UI.components.Overlay.msgbox.removeClass('hidden').css('top',(WF.UI.getWindowSize().height/2)-(WF.UI.components.Overlay.msgbox.height()/2)+'px').css('left',WF.UI.components.Overlay.overlay.width()/2-WF.UI.components.Overlay.msgbox.width()/2).fadeTo(100,1);$('#msgbox').html("<h3>"+(p.header||WF.UI.components.Overlay.header)+"</h3>"+"<p>"+
p.text+"<a id=\"msg_close\" href=\"javascript:WF.UI.cancelMessage()\">"+"<span>"+WF.UI.components.Overlay.close+"</span>"+"</a>"+"</p>");}};WF.UI.getWindowSize=function(){var width=0,height=0,w=window,d=document;if(typeof(w.innerWidth)=='number'){width=w.innerWidth;height=w.innerHeight;}
else{if(d.documentElement&&(d.documentElement.clientWidth||d.documentElement.clientHeight)){width=d.documentElement.clientWidth;height=d.documentElement.clientHeight;}
else{if(d.body&&(d.body.clientWidth||d.body.clientHeight)){width=d.body.clientWidth;height=d.body.clientHeight;}}}
return{width:width,height:height};};WF.UI.cancelMessage=function(){$('#trans_back, #overlay_wrap').fadeTo('fast',0,function(){$('#trans_back, #overlay_wrap').addClass('hidden');if($.browser.msie&&parseInt($.browser.version,10)<7){$('select').css('visibility','visible');}
WF.UI.isModalOn=false;});};WF.UI.showWebsiteChoice=function(){WF.UI.showMessage({text:WF.D.copy.chooseLocalSitePopup});WF.F.handleWebsiteChoice();};WF.UI.prepareTopNavMenu=function(){$('#navRowMain li a').each(function(i,node){$(node).mouseover(function(){var sel_node_to_show='#nav'+(i+1);var now_visible=$('#navRowSub ul:visible');if(!now_visible.is(sel_node_to_show)){now_visible.css('display','none');$(sel_node_to_show).css({'opacity':'0'}).css({'display':'inline'}).animate({'opacity':'1'});}});});};WF.F.handleWebsiteChoice=function(){$('#site_choice').click(function(){var pref=$(':radio[name=cn_pref]:checked').val();WF.UI.cancelMessage();if(pref){WF.geoCheck.fixatePref(pref);}});};WF.OO.clear_on_focus=function(p){return function(){$(p.selector).find(':text').focus(function(){var t=$(this);if(t.val().indexOf(p.default_word)>=0){t.val(p.new_content)}
if($.browser.msie){var range=_t.get(0).createTextRange();range.collapse(false);range.select();}
return false;});};};WF.UI.expandMoreInfo=function(){$('p.link').toggle(function(){var clicked_class=$.trim($(this).attr('class').replace('link',''));$('div.moredetails.'+clicked_class).show('fast')},function(){var clicked_class=$.trim($(this).attr('class').replace('link',''));$('div.moredetails.'+clicked_class).hide('fast')});};WF.UI.featuresTooltips=function(){var tooltipsLinks='a.show_hint, input.show_hint',timeout;$(tooltipsLinks).mouseover(function(){clearTimeout(timeout);if($('.triggerred').length){$('.triggerred').remove();return false;}
var _t=$(this),_title=$.data(_t.get(0),'ttl');var _o=_t.offset(),_parent=$('#container'),_Po=_parent.offset(),_timestamp=new Date().getTime(),_tooltip=$('<div class="tooltip">'+'<div class="tooltip_header"></div>'+'<div class="tooltip_content">'+
_title+'</div>'+'<div class="tooltip_arrow"></div>'+'<div class="tooltip_footer"></div>'+'</div>').css('top',_o.top-_Po.top-25+'px').css('left',7+'px').attr('id',_timestamp);$.data(_t.get(0),'tooltip',_timestamp);if(!arguments[1]){timeout=setTimeout(function(){_parent.append(_tooltip).find('#'+_timestamp);},500);}
else if(arguments[1]==='trigger'){_tooltip.addClass('hidden').addClass('triggerred').appendTo(_parent).show('slow');}
return false;}).mouseout(function(){clearTimeout(timeout);var _t=$(this),_title=$.data(_t.get(0),'ttl'),_tooltip='#'+$.data(_t.get(0),'tooltip');$(_tooltip).remove();}).each(function(){var _t=$(this);$.data(_t.get(0),'ttl',_t.attr('title'));_t.removeAttr('title');});};$(document).ready(function(){WF.UI.prepareTopNavMenu();WF.UI.expandMoreInfo();if(WF.ifShowWebsiteChoice){WF.UI.showWebsiteChoice();}
WF.OO.clear_on_focus({selector:'#domainside',default_word:'www.',new_content:''})();WF.UI.featuresTooltips();});