$(document).ready(function(){if($.cookie("duo3_cookie_bar")){$(".cookie-bar").remove()}else{$(".cookie-bar").show();var b=$(".cookie-bar").outerHeight();$("footer").css({marginBottom:b+1});$(window).on("resize",function(){b=$(".cookie-bar").outerHeight();$("footer").stop().animate({marginBottom:b+1})});$(".cookie-bar button").click(function(){$(".cookie-bar").stop().fadeOut();$.cookie("duo3_cookie_bar",1,{expires:90,path:"/"});$("footer").stop().animate({marginBottom:0});if($("#livechat-box").length>0){$("#livechat-box").css("bottom",12)}})}if($.cookie("duo3_site_note")){$(".sticky-note").remove()}else{$(".sticky-note").show()}$(".sticky-note .close").click(function(){$(".sticky-note").hide();$.cookie("duo3_site_note",1,{expires:90,path:"/"})});$(".clickBox").css("cursor","pointer");$(".clickBox").click(function(){window.location=$(this).find("a").attr("href");return false});$("#signin").mouseover(function(){$("#signin").addClass("active")});$("#signin").mouseleave(function(){$("#signin").removeClass("active")});$("#form-body").mouseover(function(){$("#signin").addClass("active")});$("#form-body").mouseleave(function(){$("#signin").removeClass("active")});$("#video, #video-ovz, #video-virtuozzo").bind("opened",function(){if($(this).attr("id")=="video"){var h=$("#fv")}else{if($(this).attr("id")=="video-virtuozzo"){var h=$("#fv-virtuozzo")}else{var h=$("#fv-ovz")}}var g=h.html();if(g==""){if(h.attr("data-video-format")=="flv"){h.html('<video autoplay><source type="video/x-flv" src="/videos-source/'+h.attr("title")+'.flv"/></video>')}else{h.html('<video autoplay><source type="video/mp4" src="/videos-source/'+h.attr("title")+'.mp4"/></video>')}h.css({overflow:"hidden"});h.flowplayer();$("#video .flowplayer").removeClass("is-paused").addClass("is-playing")}flowplayer().play()}).bind("closed",function(){flowplayer().pause()});$("#webmail-btn, #forgot-btn").click(function(h){h.preventDefault();var g=is_mob||$(document).width()<1011?"-100%":"-515px";$("#login-to-cp").animate({left:g,opacity:0});if($(this).attr("id")=="webmail-btn"){$("#login-to-webmail").animate({left:0,opacity:1})}if($(this).attr("id")=="forgot-btn"){$("#forgotten-pass").animate({left:0,opacity:1});$(".reload_captcha").click()}});$(".back-btn, #menu-form .back").click(function(h){h.preventDefault();var g=is_mob||$(document).width()<1011?"100%":"515px";$("#forgotten-pass, #login-to-webmail").animate({left:g,opacity:0});$("#login-to-cp").animate({left:0,opacity:1})});$('a[href="#toBottom"]').on("click",function(g){$("html, body").animate({scrollTop:$(document).height()},1000);$("a[href='#toTop']").show();g.preventDefault()});$('a[href="#toTop"]').on("click",function(g){$("html, body").animate({scrollTop:0},1000);$(this).hide();g.preventDefault()});$(".show-more-promos").on("click",function(g){if($(this).data("scroll")==true){$("html,body").animate({scrollTop:$(".tabs").offset().top-50},"slow");$("a[href=#panel-registerdomains]").click()}});if($(".swipe-check").length!=0&&$(".swipe-check:visible").hasHorizontalScrollBar()){$(".table-swipe").show()}if((window.location.hash.length!=0)){var d=["show-promo-domains","cookie-privacy","shared","vps","semi_dedicated","dedicated"];var a="("+d.join("|")+")";var f=window.location.hash.match(new RegExp(a));var e=f!=null?f[0]:"";var c=$(".accordion").length>0?"accordion":"other";if(e.length>0&&$.inArray(e,d)>-1){setTimeout(function(){window.scrollTo(0,0)},1);if(e=="show-promo-domains"){$("a[href=#panel-registerdomains]").click();e="tabs"}else{if($.inArray(e,["shared","vps","semi_dedicated","dedicated"])>-1){e=e.replace("_","")+"cat"}}autoScrollTo(e,c)}}$("a[data-plans]").click(function(h){var g=$(this).attr("data-plans-type");var i=$(this).attr("data-plans");$("div#features").empty();$("#features").html('<i class="icon-spinner icon-spin big-icon-spin"></i>');$("#features").load("/compare-dialog/?type="+g+"&plans="+i+"&lang="+tr_lang,function(){$(this).foundation("tooltip");$(this).foundation("accordion");check_stock()});h.preventDefault()});$("#take-a-tour").on("click","a[data-plans]",function(h){var g=$(this).attr("data-plans-type");var i=$(this).attr("data-plans");$("div#features").empty();$("#features").html('<i class="icon-spinner icon-spin big-icon-spin"></i>');$("#features").load("/compare-dialog/?type="+g+"&plans="+i+"&lang="+tr_lang);h.preventDefault()});$("#forgotten-pass").on("submit",function(g){g.preventDefault();getJSON("/reset-password/",$(this).serialize(),function(h){if("error_code" in h&&h.error_code==0){$("#login-to-cp").animate({left:0,opacity:1});$("#forgotten-pass, #forgot-btn").remove()}else{$(".reload_captcha").click()}},"post")});$(".reload_captcha").on("click",function(){var g=$(this).closest("form").find("img.captcha");g.attr("src","/get-captcha-code/?v="+Math.round(new Date().getTime()/1000));$(".captcha_box").html('<i class="icon-spinner icon-spin big-icon-spin"></i>').append(g);$(".captcha").on("load",function(){$(".captcha_box i").remove()})});check_livechat();$("#domain-search-tld").on("change",function(){$("#domain-search-tld > option").removeClass("selected").removeAttr("class");var g=$(this).val();$('#domain-search-tld > option[value="'+g+'"]').addClass("selected")})});$.fn.hasHorizontalScrollBar=function(){if((typeof this[0]!="undefined"&&this[0].length!=0)&&this[0].clientWidth<this[0].scrollWidth){return true}else{return false}};$(window).resize(function(){if($(".swipe-check").length!=0&&$(".swipe-check:visible").hasHorizontalScrollBar()){$(".table-swipe").show()}else{$(".table-swipe").hide()}check_livechat()});$(window).scroll(function(){check_livechat()});$(".period-toggle").on("click",function(){var a=$(this).parent().data("group");var b=$(this).data("period");$(this).parent(".period-slider").find(".period-toggle").each(function(){$(this).removeClass("active")});$(this).addClass("active");$(this).parents(".box-wrap.row").find('.compare-dedi[data-group="'+a+'"] .the-price').each(function(f){var d=$(this).data("price-"+b);var c=$(this).data("price-old-"+b);$(this).find(".price").html(d);$(this).parents("tr").find("a.button.round").attr("href",function(h,e){return e.replace(/(period=)[0-9]+/ig,"$1"+b)});if(typeof c!="undefined"){var g=$(this).parents("tr").find(".discount").data("discount-"+b);$(this).parents("tr").find(".discount").removeClass("hide-this").html(g);$(this).parents("tr").find(".old-price").removeClass("hide-this").html(c);$(this).parents("tr").find(".promo-period-text").removeClass("hide-this").find("strong").html(b)}else{$(this).parents("tr").find(".discount").addClass("hide-this").html();$(this).parents("tr").find(".old-price").addClass("hide-this");$(this).parents("tr").find(".promo-period-text").addClass("hide-this")}})});$(".stock-switch:not(.first-bar)").on("click",function(){group=$(this).parent().data("switch-group");yes=$('.compare-dedi[data-group="'+group+'"]').find('tr[data-plan-stock="yes"]');no=$('.compare-dedi[data-group="'+group+'"]').find('tr[data-plan-stock="no"]');if($(this).hasClass("checked")){yes.show();no.show();$(this).removeClass("checked")}else{if(!$(this).hasClass("disabled")){yes.show();no.hide();$(this).addClass("checked")}}});$(".show-stock").on("click",function(){$(".stock-switch").click()});$(".tabs").on("toggled",function(){if($(".swipe-check").length!=0&&$(".swipe-check:visible").hasHorizontalScrollBar()){$(".table-swipe").show()}else{$(".table-swipe").hide()}});function check_livechat(){var d=$("#livechat-box").outerWidth()+15,f=$("footer .row.bkg6"),a=$("#livechat-box"),c=$(".cookie-bar"),b=(f.offset().left+f.outerWidth())-10,e=$(window).width()-b;if(e<d&&f.offset().top+f.height()<($(window).scrollTop()+$(window).height())){f.css("position","relative");a.css({right:10,bottom:12,position:"absolute"})}else{f.add(a).removeAttr("style");if(c.is(":visible")){a.css("bottom",c.outerHeight()+12)}}}function sum(c){var b=0;for(var a in c){if(c.hasOwnProperty(a)){b+=parseFloat(c[a])}}return b}function check_stock(){$.post("/check-dedicated-stock/",{},function(b){if(b.status){var a={};a=b.stocks;is_stock=false;$.each(a,function(d,c){var e=(c==0||sum(c)==0)?false:true});$(".achtung").achtung("close");$("span[data-check-stock]").each(function(f){var c=$(this).attr("data-check-stock");var d=$(this).attr("data-banner-stock");var g=$(this).attr("data-compare-stock");if(typeof(a[c])=="undefined"||sum(a[c])==0){if(typeof d!==typeof undefined&&d!==false){$(this).after('<img src="/template2/img/out-of-stock.png" alt="+out_of_stock+">')}else{if(typeof g!==typeof undefined&&g!==false){$(this).after(out_of_stock)}else{$(this).after('<span class="out-of-stock">'+out_of_stock+"</span>")}}$(this).parents("tr").attr("data-plan-stock","no");$(this).remove()}else{$(this).next("a").show();$(this).parents("tr").attr("data-plan-stock","yes");$(this).remove()}});$(".compare-dedi").each(function(c){yes=$(this).find('tr[data-plan-stock="yes"]');no=$(this).find('tr[data-plan-stock="no"]');$(this).attr("data-available",yes.length);$(this).attr("data-not-available",no.length);group_table=$(this).data("group");if(no.length<=1||yes.length<=1){$("."+group_table+".switch input").prop("disabled",true);$("."+group_table+".switch .stock-switch").addClass("disabled")}else{$("."+group_table+".switch .stock-switch").addClass("checked");yes.show();no.hide()}})}else{$(".achtung").achtung("close")}},"json")}function GetCookie(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+f;if(document.cookie.substring(e,c)==b){return"here"}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null}flowplayer.conf={engine:"html5",loading:false,swf:"/js/flowplayer.swf"};$("a").filter(function(){return this.href===document.location.href}).addClass("active");$("#domain-search").keypress(function(){});function autoScrollTo(a,b){var c="";if($("#"+a).length!=0){c=$("#"+a)}else{if($("."+a).length!=0){c=$("."+a)}}if(c.length!=0){if(b==="accordion"){$(".accordion-navigation."+a).addClass("active").children(".content").addClass("active")}$("html,body").animate({scrollTop:c.offset().top-50},"slow")}};