/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */
;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> È</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);

/* mt cookie js */
function mt_createCookie( name, value, expires, path, domain, secure ) {var today = new Date();today.setTime( today.getTime() );var expires_date;if ( expires ) {if(expires > 0 ) {expires = expires * 1000 * 60 * 60 * 24;}else {expires_date = new Date( 0 );}}if( !expires_date ) {expires_date = new Date( today.getTime() + (expires) );}document.cookie = name + "=" +escape( value ) +( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : ";path=/" ) + ( ( domain ) ? ";domain=" + domain : "" ) +( ( secure ) ? ";secure" : "" );}function mt_readCookie(name) {var nameEQ = name + "=";var ca = document.cookie.split(';');for(var i=0;i < ca.length;i++) {var c = ca[i];while (c.charAt(0)==' ') c = c.substring(1,c.length);if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length,c.length));}return null;}function mt_eraseCookie(name, path, domain ) {mt_createCookie(name,"",-1, path, domain );}

/* liveperson js */
var lpMTagConfig = {'lpServer' : "server.iad.liveperson.net",'lpNumber' : "74113245",'lpProtocol' : (document.location.toString().indexOf('https:')==0) ? 'https' : 'http'}; function lpAddMonitorTag(src){if(typeof(src)=='undefined'||typeof(src)=='object'){src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';}if(src.indexOf('http')!=0){src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;}else{if(src.indexOf('site=')<0){if(src.indexOf('?')<0)src=src+'?';else src=src+'&';src=src+'site='+lpMTagConfig.lpNumber;}};var s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','iso-8859-1');s.setAttribute('src',src);document.getElementsByTagName('head').item(0).appendChild(s);} if (window.attachEvent) window.attachEvent('onload',lpAddMonitorTag); else window.addEventListener("load",lpAddMonitorTag,false);

/* global docready js -- superfish nav, footer stuff: twitter link, domain search */
var $domain_initial_value='Search for a Domain Name...';var $domain_error_value='Oops! e.g. "my-amazing-site.com"';var $simple_fqdn_regxp='([a-zA-Z0-9-]+[.])+[a-zA-Z0-9-]+';$(document).ready(function(){$('ul.mt-nav').superfish({delay:500,animation:{opacity:'show',height:'show'},speed:'fast',autoArrows:false,dropShadows:false});$('#twitterlink strong').hide().animate({opacity:'0',left:'-117px',top:'-35px'},0);$('#twitterlink').hover(function(){$(this).find('strong').show().animate({opacity:'0.8',left:'-117px',top:'-49px'},200);},function(){$(this).find('strong').animate({opacity:'0',left:'-117px',top:'-35px'},200,function(){$(this).hide();});});$('.domaininput').val($domain_initial_value).focus(function(){if($(this).val()==$domain_initial_value||$(this).val()==$domain_error_value){$(this).val('');}}).blur(function(){if($(this).val()==''&&$(this).parents('fieldset').hasClass('error')){$(this).val($domain_error_value);}else if($(this).val()==''){$(this).val($domain_initial_value);}}).keydown(function(){$(this).parents('fieldset').removeClass('error');});$('#mt_domain_search').submit(function(evt){$(this).find('fieldset').addClass('loading');var $domaininput=$(this).find('.domaininput');var domain=$domaininput.val();if(domain==''||domain==$domain_initial_value||domain==$domain_error_value||!domain.match($simple_fqdn_regxp)){$(this).find('fieldset').removeClass('loading').addClass('error');$domaininput.val($domain_error_value);$domaininput.blur();evt.preventDefault();}
domain=escape(domain);});});

/* window onload js -- liveperson chat button hax */
$(window).load(function(){var lpChatOnline=$('#liveperson_bttn').height();if(lpChatOnline<=10){$('#liveperson_bttn').hide();}});

/* google analytics tracking for outbound links */
if(typeof jQuery!='undefined'){jQuery(document).ready(function($){var filetypes=/\.(zip|exe|pdf|doc*|xls*|ppt*|mp3)$/i;$('a').each(function(){var href=$(this).attr('href');if(href&&(href.match(/^https?\:/i))&&(!href.match('.mediatemple.net'))){$(this).click(function(event){var extLink=href.replace(/^https?\:\/\//i,'');_gaq.push(['_trackEvent','External','Click',extLink]);if($(this).attr('target')!='_blank'){event.preventDefault();setTimeout(function(){location.href=href;},200);}});}else if(href&&href.match(/^mailto\:/i)){$(this).click(function(event){var mailLink=href.replace(/^mailto\:/i,'');_gaq.push(['_trackEvent','Email','Click',mailLink]);});}else if(href&&href.match(filetypes)){$(this).click(function(event){var extension=(/[.]/.exec(href))?/[^.]+$/.exec(href):undefined;var filePath=href;_gaq.push(['_trackEvent','Download','Click-'+extension,filePath]);if($(this).attr('target')!='_blank'){event.preventDefault();setTimeout(function(){location.href=href;},200);}});}});});}
