jQuery(document).ready(function($){setTimeout(function()
{if(jQuery.scrollTo)
{jQuery('#serveroverview').scrollTo('600',0);jQuery('#serveroverview').scrollTo('0',1500);}},500);jQuery('#scrollleft, #scrollleftshort').click(function(){$('#serveroverview').stop().scrollTo('-=145',200,{axis:'x'});});jQuery('#scrollright, #scrollrightshort').click(function(){$('#serveroverview').stop().scrollTo('+=145',200,{axis:'x'});});$('#clientsleft').click(function(){$('#scrollcontent').stop().scrollTo('-=621',400,{axis:'x'});});$('#clientsright').click(function(){$('#scrollcontent').stop().scrollTo('+=621',400,{axis:'x'});});$('a[data-helpicon]').click(function(){var description=$('#description');if(!description.length)
{description=$('<div>').attr('id','description').css('display','none').append($('<h5>').addClass('lightbox')).append($('<div>').attr('id','lightbox')).appendTo($('body'));}
var close=$(this).attr('data-closelink')||'';var text='<p>'+ $(this).attr('data-helpicon')+'</p>'+ close;$('div#description').children('div#lightbox').html(text);$.facebox.settings.opacity=0.3;$.facebox({div:'#description'});$('#facebox a.close').hide();return false;});displayWebhostingPromo();if(jQuery.facebox)
{$('a[rel*=facebox]').facebox();$.facebox.settings.opacity=0.3;$(document).bind('reveal.facebox',function()
{if($('#facebox .body object').length>0)
{$('#facebox').css('width','auto');$('#facebox table').css('width',640+ 30);}});$(document).bind('close.facebox',function()
{$('#facebox').css('width','450');$('#facebox table').css('width','auto');});}
$('#facebox a.close').hide();if($('a.webhosting-popup').length)
{$('a.webhosting-popup').click(function(){var url=$(this).attr('href');var header=$(this).attr('data-header');$.get(url,function(r){var el=$(r);el.prepend(header);el.find('#contentmain').remove();el.find('.cols1:not(.pagetop)').remove();el.find('a.button').each(function(){$(this).parent().remove();});$.facebox(el,'webhosting-overlay');$('#facebox').width(660);});return false;});}
testFontFace('Calibri');setFlash();checkSpecialPrice();displayScroll();attachSearchSuggestions();jQuery('input[name*=agree]').live('click',function(){if(jQuery('#agree-checkbox:checked').val()==1)
{jQuery.cookie('green_hosting',1,{expires:1,path:'/'});jQuery.facebox.close();checkSession(jQuery.cookie('green_link'));}
else
{jQuery.cookie('green_link',null);jQuery.cookie('green_hosting',null);jQuery.facebox.close();}});var loc=new String(window.parent.document.location);jQuery('#login-submit').live('click',function(){var form=jQuery('#loginform');var username=jQuery('#signin_username').val();var password=jQuery('#signin_password').val();if(loc.indexOf("https://")!=-1)
{jQuery.ajax({type:'POST',url:jQuery(form).attr('action'),data:{'signin[username]':username,'signin[password]':password},success:function(resp,status){if(resp=='ok')
{window.location.reload();}
else
{jQuery('.popup .content').html(resp);}}});}
else
{jQuery(form).submit();}
return false;});jQuery('#btn-save-newsletter-settings').live('click',function()
{var form=jQuery('form#newsletter_settings_form');var setting=jQuery('input[name=receive_newsletter]:checked').val();jQuery.ajax({type:'POST',url:jQuery(form).attr('action'),data:{'receive_newsletter':setting},success:function(resp,status)
{if(resp=='ok')
{window.location.reload();}
else
{jQuery('.popup .content').html(resp);}}});return false;});jQuery('a.help-question-mark').click(function()
{var data=jQuery.parseJSON(jQuery(this).attr("data-info"));var text="<p>"+ data.info+"</p>"+ data.link;jQuery('div#description').children('div#lightbox').html(text);jQuery.facebox.settings.opacity=0.3;jQuery.facebox({div:'#description'});jQuery('#facebox a.close').hide();_gaq.push(['_trackPageview','/description/'+ data.desc]);_gaq.push(['_trackPageLoadTime']);return false;});jQuery('#langDropDown').click(function()
{if(jQuery('#flagsList').css('display')=='none'){jQuery('#flagsList').css('display','block');}else{jQuery('#flagsList').css('display','none');}});jQuery('#flagsList').mouseleave(function()
{jQuery('#flagsList').css('display','none');});if($("a[rel^='lightbox']").length)
{$('head').append($('<script type="text/javascript" src="/js/slimbox2.js"></script>'));$('head').append($('<link rel="stylesheet" type="text/css" href="/css/slimbox2.css"></script>'));}
jQuery('ul#faqCategories li div.faqCategory').live('click',function(){if(jQuery(this).parent().children('ul').is(':hidden')){jQuery('ul#faqCategories ul.faqQuestions').hide();jQuery('ul#faqCategories div.faqContent').hide();jQuery('ul#faqCategories li div.faqCategory').css('background-image','url(/images/lsw2/collapsed.png)');jQuery(this).css('background-image','url(/images/lsw2/expanded.png)');jQuery(this).parent().children('ul').show();}else{jQuery('ul#faqCategories ul.faqQuestions').hide();jQuery('ul#faqCategories div.faqContent').hide();jQuery('ul#faqCategories li div.faqCategory').css('background-image','url(/images/lsw2/collapsed.png)');}});jQuery('ul#faqCategories ul.faqQuestions span.faqQuestion').live('click',function(){if(jQuery(this).parent().children('div').is(':hidden')){jQuery('ul#faqCategories div.faqContent').hide();jQuery(this).parent().children('div').show();}else{jQuery(this).parent().children('div').hide();}});jQuery('div#expandAll span').click(function(){jQuery(this).parent().hide();jQuery('div#collapseAll').show();jQuery('ul#faqCategories li div.faqCategory').css('background-image','url(/images/lsw2/expanded.png)');jQuery('ul#faqCategories ul.faqQuestions').parent().children('ul').show();jQuery('ul#faqCategories div.faqContent').show();});jQuery('div#collapseAll span').click(function(){jQuery(this).parent().hide();jQuery('div#expandAll').show();jQuery('ul#faqCategories li div.faqCategory').css('background-image','url(/images/lsw2/collapsed.png)');jQuery('ul#faqCategories ul.faqQuestions').parent().children('ul').hide();jQuery('ul#faqCategories div.faqContent').hide();});jQuery("ul#cartSectionContent li div.sectionName").live('click',function(){if(jQuery(this).parent().children('dl').is(':hidden')){jQuery(this).css('background-image','url(/images/lsw2/expanded.png)');jQuery(this).parent().children('dl').show();}else{jQuery(this).parent().children('dl').hide();jQuery(this).css('background-image','url(/images/lsw2/collapsed.png)');}});$("select[name^='webhosting']").mousedown(function(){if($.browser.msie){$(this).css("width","auto");$(this).parent().children('a.webhosting-popup').hide();}});$("select[name^='webhosting']").change(function(){if($.browser.msie){$(this).css("width","115px");$(this).parent().children('a.webhosting-popup').show();}});$("select[name^='webhosting']").blur(function(){if($.browser.msie){$(this).css("width","115px");$(this).parent().children('a.webhosting-popup').show();}});});$(window).load(function(){calcServerOverviewPanelHeight();});function calcServerOverviewPanelHeight(){var c=jQuery('div.server-list');var table=c.find('#serveroverview table.serveroverview'),navbars=c.find('.navleft, .navright'),labels=c.find('>.labels'),marginTop=0;labels.css('margin-top',0);table.find('tr').each(function(i){var el=$(this).find('td,th').eq(0),label=labels.find('tr:eq('+ i+') td'),source,destination,height,diff;if(!label[0])
{return true;}
if(i<3)
{marginTop+=el.outerHeight();}
if(label.outerHeight()<el.outerHeight())
{source=el;destination=label;}
else if(label.outerHeight()>el.outerHeight())
{source=label;destination=el;}
else
{return true;}
height=source.outerHeight()-(destination.outerHeight()- destination.height());destination.height(height);diff=source.outerHeight()- destination.outerHeight();if(diff!=0)
{destination.height(height+ diff)}});var tHeight=(table.outerHeight()- 25- marginTop)/2;navbars.css({'margin-top':marginTop}).find('a').css({'padding':tHeight+'px 1px '});jQuery("td#no_results").css({'padding-top':marginTop});}
function displayWebhostingPromo()
{var numWebhost=jQuery('#numWebhost').val();var numDomains=jQuery("#numDomains").val();if(numWebhost==0&&(numDomains>numWebhost))
{jQuery('#webhosting_promo').show();}
else
{jQuery('#webhosting_promo').hide();}}
function focusSearch(){$('#searchsuggest').css("display","block");}
function testFontFace(whatfont){var detective=new Detector();if(!detective.test(whatfont)){$("#wrapper").css("font-size","89%");$("h2").css("font-size","180%");$("h2").css("line-height","120%");$("h2").css("padding-top","5px");$("th").css("padding-bottom","0");}}
function setFlash(){var params={wmode:"transparent"};$('div.lsw-product-block').each(function()
{var el=$(this);var elpa=$(el).find('p a');var flashvars={t1:$(el).find('h4').text(),t2:$(el).find('p:first').text(),la:$(el).find('.price span').text(),pr:$(el).find('.price strong').text(),bt:$(el).find('a.button').text(),lt1:$(elpa).eq(0).text(),l1:$(elpa).eq(0).attr('href'),lt2:$(elpa).eq(1).text(),l2:$(elpa).eq(1).attr('href')};swfobject.embedSWF("/flash/lsw_product.swf",$(this).attr('id'),"390","160","9.0.0","/flash/expressInstall.swf",flashvars,params);});var xmlLang=window.location.pathname.substring(1,3);var mapFlashvars={debugflashvars:"false",xml:"/maps/lswnetwork-"+ xmlLang+".xml"};swfobject.embedSWF("/flash/umap_cloudmade.swf","lsw-map","804","450","9.0.0","/flash/expressInstall.swf",mapFlashvars,params);$('div.lsw-small-product-block').each(function()
{var el=$(this);var elpa=$(el).find('p a');var flashvarsSmall={t1:$(el).find('h5').text(),t2:$(el).find('p').text(),la:$(el).find('.price span').text(),pr:$(el).find('.price strong').text(),bt:$(el).find('a.button').text(),l1:$(el).find('a.button').attr('href')};swfobject.embedSWF("/flash/lsw_product_small.swf",$(this).attr('id'),"185","185","9.0.0","/flash/expressInstall.swf",flashvarsSmall,params);});}
function $$(v){return jQuery(v);}
function Klapper(container,link,content){var exp=new Array();jQuery(container).find(content).hide();jQuery(container).find(link).click(function(){try
{var trackLink=getRequestPath([0,1]);trackLink=trackLink.replace('#','');trackLink+='/custom/'+ makeSlug(jQuery(this).text());_gaq.push(['_trackPageview',trackLink]);_gaq.push(['_trackPageLoadTime']);}
catch(e){}
jQuery(container).find(content).slideUp('slow');jQuery(this).parent().find(content).toggle('slow');return false;});}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};function openPopup(argStrFile,argStrFrameName,argIntWidth,argIntHeight,argIntLeftStart,argIntTopStart,argIntScrollbars,argIntResizeable)
{if(!argStrFrameName)
{argStrFrameName='popup';}
if(!argIntWidth)
{argIntWidth=560;}
if(!argIntHeight)
{argIntHeight=420;}
if(!argIntLeftStart)
{argIntLeftStart=(screen.width/2)-(argIntWidth/2);}
if(!argIntTopStart)
{argIntTopStart=(screen.height/2)-(argIntHeight/2);}
if(!argIntScrollbars)
{argIntScrollbars='no';}
if(!argIntResizeable)
{argIntResizeable='no';}
BrowserDetect.init();if(BrowserDetect.browser=='Chrome'){argIntHeight=450;}
var strProperties="width="+ argIntWidth+", height="+ argIntHeight+", left="+ argIntLeftStart+", top="+ argIntTopStart+", toolbar=no, titlebar=no, title=0, location=no, scrollbars="+ argIntScrollbars+", status=no, resizable="+ argIntResizeable;window.open(argStrFile,argStrFrameName,strProperties);}
function openLiveChat()
{_gaq.push(['_trackPageview','/contact/chat']);_gaq.push(['_trackPageLoadTime']);openPopup('http://slsw-im01.ocom.lan:9090/webchat/userinfo.jsp?chatID=32I3Xs4SN0&workgroup=sales@workgroup.slsw-im01.ocom.lan','framemain',620,400);return false;}
function InsertMailToTag(userName,domainName,text,className)
{var EmailId;var atSign="&#64;";var fullStop="&#46";EmailId=userName;EmailId=""+ EmailId+ atSign;EmailId=EmailId+ domainName;if(typeof text=='undefined'&&!text)
{text=EmailId;}
if(typeof className=='undefined'&&!className)
{className="";}
document.write("<a class='"+ className+"' href='mail"+"to:"+ EmailId+"'>"+ text
+"</A>");}
function checkSession(data,culture)
{if(jQuery.cookie('green_hosting')==1)
{window.location=data;}
else
{jQuery.cookie('green_link',data);jQuery.facebox({ajax:'/'+culture+'/greenhosting/terms'});}}
function checkGreenSession(data,culture,el)
{if(jQuery.cookie('green_hosting')==1)
{window.location=data;}
else
{jQuery.cookie('green_link',data);jQuery.get('/'+ culture+'/dedicated-servers/greenhosting-agreement',function(resp){var content=$('<div>').html(resp);content.find('.cols1').css({margin:20});var btn=content.find('.button.big');btn.click(function(e){if(!checkValue())
{return false;}
e.stopPropagation();window.location=$(el).attr('href');return false;}).attr('onclick','').attr('href','#');jQuery.facebox(content);});}}
function checkCallbackCookie(key,url,culture,el)
{if(!key||jQuery.cookie(key)==1)
{return true;}
else
{jQuery.get(url,function(resp){resp+='<p style="text-align: center;"><a class="button big" style="margin: 0 0 10px 140px;" onclick="return checkCallValue(\''+key+'\')" href="#">Order</a></p>';var content=$('<div>').html(resp);content.find('div.post').css({margin:20});var btn=content.find('.button.big');btn.click(function(){if(!checkCallValue(key,culture))
{return false;}
window.location=$(el).attr('href');return false;}).attr('onclick','').attr('href','#');jQuery.facebox(content);});return false;}}
function checkCallValue(key,culture)
{if(jQuery('#agree-checkbox').get(0).checked==1)
{jQuery.cookie('\''+key+'\'',1,{expires:null,path:'/'});return true;}
else
{if(culture=='de')
{alert('Bitte stimmen Sie zunächst den Allgemeinen Geschäftsbedingungen zu, um fortfahren zu können.');}
else if(culture=='nl')
{alert('U moet akkoord gaan met de voorwaarden om door te gaan.');}
else
{alert('You must agree to the terms and conditions to proceed.');}
return false;}}
function getTermsContent(url)
{jQuery.get(url,function(resp){var cont=$('<div>').html(resp).css({'padding':20});cont.find('a:last').remove();jQuery.facebox(cont);});}
function checkSpecialPrice()
{if($("span.offer").length>0&&$("#serveroverview tr.price td.fixed:visible span.offer").length>0)
{$("div.labels").addClass("offer");}
else
{$("div.labels").removeClass("offer");}}
function getVisibleElementHeight(elements)
{var returnHeight=0;$.each(elements,function(key,value){var isHidden=$(value).is(':hidden');if(isHidden==false)
{returnHeight=$(value).height();return returnHeight;}});return returnHeight;}
function displayScroll(numberOfProducts)
{var products_total=$("#products_total").val();if(arguments.length!=0)
{products_total=numberOfProducts;}
if(products_total>4)
{$("div.navleft").css("display","block");$("div.navright").css("display","block");$("div.labels").css({'margin-right':'5px'});}}
function getRequestPath(parts)
{var url=window.location.href;var match=url.match(/([a-z\.\:]+)\/\/([a-z\.]+)\/(.*)/);if(parts)
{var seg=match[3].split('/');var str='';for(i in parts)
{str+='/'+ seg[i];}
return str;}
else
{return'/'+ match[3];}}
function makeSlug(str)
{str=str.toLowerCase();str=str.replace(/[^a-z]+/g,'-');str=str.replace(/^-|-$/g,'');return str;}
var searchSuggestionTimeout;var searchSuggestionXhr;function attachSearchSuggestions()
{var $searchfield=jQuery('#searchfield');var searchUrl=jQuery('form#search').attr('action');var currentLanguage=$('#searchLang').val();var searchText=$('#searchText').val();$searchfield.focus(function()
{if(jQuery(this).val()==searchText)
{jQuery(this).val('');}});$searchfield.blur(function(i,e)
{jQuery(this).removeClass('has-focus');if(jQuery(this).val()=='')
{jQuery(this).val(searchText);}});$searchfield.keyup(function()
{if(jQuery(this).val().length<3)
{clearInterval(searchSuggestionTimeout);$('#searchsuggest').hide();return;}
var startVal=jQuery(this).val();searchSuggestionTimeout=setTimeout(function()
{try
{searchSuggestionXhr.abort();}
catch(e)
{}
searchSuggestionXhr=jQuery.get(searchUrl+'/suggestions',{query:startVal},function(data)
{var currentVal=$searchfield.val();if(startVal!=currentVal)
{return;}
if(jQuery('#searchsuggest').length==0)
{jQuery('#metanav').after('<div id="searchsuggest" />');}
var html='';for(sectionName in data)
{var section=data[sectionName];if(section.length==0)
{continue;}
html+='<li><a href="#" class="cat">'+ sectionName+'</a>';html+='<ul>';for(i in section)
{var item=section[i];html+='<li><a href="/'+ currentLanguage+'/'+ item.url+'">'+ cut(item.title,45)+' &rsaquo;</a></li>';}
html+='</ul>';html+='</li>';}
if(html!='')
{var h='<ul>'+ html+'</ul>'
+'<a class="seeall" href="'+ searchUrl+'/?query='+ escape(startVal)+'">See all search results &rsaquo;</a>';jQuery('#searchsuggest').html(h).show();}
else
{jQuery('#searchsuggest').hide();}},'json');},400);});}
function cut(str,len)
{if(str.length>len)
{str=str.substring(0,len- 2)+'...';}
return str;}
function showToolTip(hintText)
{var text='<p>'+ hintText+'</p>'+"<p><a href=\'#\' id=\'close\' onClick=jQuery.facebox.close(); >Close</a></p>";jQuery.facebox.close();jQuery('div#description').children('div#lightbox').html(text);jQuery.facebox.settings.opacity=0.3;jQuery.facebox(text);jQuery('#facebox a.close').hide();return false;}
function checkDomainField(){var val=jQuery("#domain_name").val();if(val.length==0){jQuery("span#domain_error").show();return false;}
return true;}
function setLocationFilterCookie(value)
{value=value.toUpperCase();if(null==jQuery.cookie('location'))
{jQuery.cookie('location',value,{expires:1});}
else
{jQuery.cookie('location',value);}}
function redirectToPage(url)
{window.location.href=url;}
