function trim(string)
{return string.replace(/(^\s+)|(\s+$)/g,"");}
$(function(){var changeTooltipPosition=function(event){var tooltipX=event.pageX-8;var tooltipY=event.pageY+8;$('.tooltips').css({top:tooltipY,left:tooltipX});}
var showTooltip=function(event){$('.tooltips').remove();$('body').prepend('<div class="tooltips">'+$("#curTooltipNow").attr("alt")+'</div>');changeTooltipPosition(event);}
var hideTooltip=function(){$('.tooltips').remove();}
$('*[rel*=tooltip]').mouseenter(function(event){$(this).attr('id','curTooltipNow');showTooltip(event);}).mouseleave(function(){hideTooltip();$(this).removeAttr('id')}).mousemove(function(){changeTooltipPosition(event);});});$(function(){var allClients=0;var curPosition=0;var curClient=6;$('.hts-carousel li').each(function(){allClients++;});$('.hts-carousel-arrow-left,.hts-carousel-arrow-right').click(function(){if($(this).attr('class')=='hts-carousel-arrow-right'){if((curClient+1)==allClients){$('.hts-carousel-arrow-right').attr('disabled','disabled').css({'background-image':'url("/img/arrow-right-off.gif")','cursor':'default'});}
if(curClient!=allClients){curClient++;myWidth=$('.hts-carousel li:eq('+(curClient-1)+') a img').width();myWidth=myWidth+17;curPosition=curPosition+myWidth;$('.hts-carousel-arrow-left').removeAttr('disabled').css({'background-image':'url("/img/arrow-left-on.gif")','cursor':'pointer'});}}else{if((curClient-1)==6){$('.hts-carousel-arrow-left').attr('disabled','disabled').css({'background-image':'url("/img/arrow-left-off.gif")','cursor':'default'});}
if(curClient!=6){curClient--;myWidth=$('.hts-carousel li:eq('+(curClient-1)+') a img').width();myWidth=myWidth+17;curPosition=curPosition-myWidth;$('.hts-carousel-arrow-right').removeAttr('disabled').css({'background-image':'url("/img/arrow-right-on.gif")','cursor':'pointer'});}}
$('.hts-carousel').animate({'marginLeft':-curPosition},150);});});$(function(){nb=0;$('div.special-bonus span').each(function(){nb++;shownb(nb);});if(jQuery('#clientsbot').jcarousel!==undefined){jQuery('#clientsbot').jcarousel({scroll:5});}
var currClientsHeight=$('ul#clientsbot').height();$('ul#clientsbot li').each(function(){var myClientsHeight=$(this).height();myClientsHeight=(currClientsHeight-myClientsHeight)/2;$(this).css('margin-top',myClientsHeight+'px');});});function shownb(num){num--;$('div.special-bonus span:eq('+num+')').fadeIn().css('display','block');}
(function($){$.fn.equalHeight=function(){var group=this;$(window).bind('resize',function(){var tallest=0;$(group).height('auto').each(function(){tallest=Math.max(tallest,$(this).height());}).height(tallest);}).triggerHandler('resize');}})(jQuery)
function getPopupWindow(title,data,width){if(title!=undefined&&data!=undefined){var content='';content+='<div class="popup-window">';content+='<table cellspacing="0" cellpadding="0" border="0">';content+='<tbody>';content+='<tr>';content+='<td class="tl"><img src="/img/transp.gif" alt="" title="" width="39" height="39" /></td>';content+='<td class="t"><img src="/img/transp.gif" alt="" title="" width="1" height="39" /></td>';content+='<td class="tr"><img src="/img/transp.gif" alt="" title="" width="39" height="39" /></td>';content+='</tr>';content+='<tr>';content+='<td class="l"><img src="/img/transp.gif" alt="" title="" width="39" height="1" /></td>';content+='<td class="c" valign="top"><a href="javascript:" onclick="getPopupWindow()"><img src="/img/popup-close.gif" alt="Закрыть" title="Закрыть" class="popup-close" /></a><h1>'+title+'</h1><br /><br />'+data+'</td>';content+='<td class="r"><img src="/img/transp.gif" alt="" title="" width="39" height="1" /></td>';content+='</tr>';content+='<tr>';content+='<td class="bl"><img src="/img/transp.gif" alt="" title="" width="39" height="39" /></td>';content+='<td class="b"><img src="/img/transp.gif" alt="" title="" width="1" height="39" /></td>';content+='<td class="br"><img src="/img/transp.gif" alt="" title="" width="39" height="39" /></td>';content+='</tr>';content+='</tbody>';content+='</table>';content+='</div>';$('body').prepend(content);var top=($('div.popup-window table').height())/2;var left=($('div.popup-window table').width())/2;$('div.popup-window table').attr('style','margin-top:-'+top+'px;margin-left:-'+left+'px');if(width!=undefined){left=width/2;$('div.popup-window table').attr('style','width:'+width+'px;margin-left:-'+left+'px;margin-top:-'+top+'px');}}else{$('div.popup-window').remove();}}
$(document).ready(function(){$('div.action>p').css('margin-top',function(){$(this).css('margin-top','-'+$(this).height()/2+'px');});$("div.tariffs").equalHeight();$("div.services").equalHeight();$("div.nextstep").equalHeight();$('div.ht-whois [name=domainname], div.chblock [name=domainname], [name=q],[name=register_new_domain]').focus(function(){if($(this).val()=='введите домен'||$(this).val()=='Введите поисковый запрос'||$(this).val()=='Зарегистрировать новый домен'){$(this).val('').css({'color':'#000'});}}).blur(function(){if($(this).val()==''){if($(this).attr('name')=='login'){$(this).val('логин');}else if($(this).attr('name')=='domainname'){$(this).val('введите домен');}else if($(this).attr('name')=='q'){$(this).val('Введите поисковый запрос');}else if($(this).attr('name')=='register_new_domain'){$(this).val('Введите имя домена');}
$(this).css({'color':'#696969'});}});});function getPopup(name,height,path,width){if(name==''){$('div.popup').fadeOut('slow',function(){$(this).html('');});}else{var thisImg="<a href=\"javascript:\" onclick=\"getPopup('')\"><img src=\"";if(path==null){thisImg+="/img/"+name+"_big";}else{thisImg+=path+name;}
thisImg+=".jpg\" border=\"0\" alt=\"Закрыть\" title=\"Закрыть\" /></a>";$('div.popup').html(thisImg);var thisheight=parseInt(height)/2;if(width==null){$('div.popup').css('margin-top','-'+thisheight+'px')}else{var thiswidth=parseInt(width)/2;$('div.popup').css({'margin-top':'-'+thisheight+'px','margin-left':'-'+thiswidth+'px'});}
$('div.popup').fadeIn('slow');}}