function doEqualColumns(){var columns=['left-big-container','center-big-container','right-big-container'];var maxColSize=0;var styleName=(Browser.Engine.trident&&(Browser.Engine.version<5))?'height':'min-height';columns.each(function(col){if($chk($(col))&&($(col).getSize().y>maxColSize)){maxColSize=$(col).getSize().y;}});columns.each(function(col){if($chk($(col))){$(col).setStyle(styleName,maxColSize+'px');}});}
function doMenu(){var menuCookie=new Hash.Cookie('menu',{autoSave:true,duration:2678400,path:'/'});var openedMenu='1';var closedMenu='0';$$('li.has_submenu').each(function(el){$(el).addEvent('click',function(ev){Event(ev).stop();var ul=$(el).getNext('li').getFirst('ul');if($chk(ul)){ul.toggle();}
$(el).toggleClass('down');if($(el).hasClass('down')){menuCookie.set($(el).getProperty('rel'),openedMenu);}else{menuCookie.set($(el).getProperty('rel'),closedMenu);}});if($(el).getProperty('rel').contains(menuCategory,'_')){var ulliul=$(el).getNext('li').getFirst('ul');if($chk(ulliul)){ulliul.show();}
$(el).addClass('down');menuCookie.set($(el).getProperty('rel'),openedMenu);}else{if(menuCookie.get($(el).getProperty('rel'))===openedMenu){$(el).addClass('down');var ulliul=$(el).getNext('li').getFirst('ul');if($chk(ulliul)){ulliul.show();}}else{if(!$chk(menuCookie.get($(el).getProperty('rel')))){menuCookie.set($(el).getProperty('rel'),openedMenu);$(el).addClass('down');var ulliul=$(el).getNext('li').getFirst('ul');if($chk(ulliul)){ulliul.show();}}else{$(el).removeClass('down');var ulliul=$(el).getNext('li').getFirst('ul');if($chk(ulliul)){ulliul.hide();}}}}});}
function doDomainSearch(searchedDom,tlds){$$('.register-error-tld').hide();$$('.register-error-domain').hide();if(!$chk(searchedDom)||searchedDom.length<3){$$('.register-error-domain').reveal();}
if(!$chk(tlds)||tlds.length<1){$$('.register-error-tld').reveal();}
if(searchedDom.length>2&&tlds.length>0){tlds.each(function(el){var tld=$type(el)=='element'?$(el).get('value'):el;var id=escape(searchedDom.clean().stripScripts().replace(tld,'').replace(/./,''))+'.'+tld;var row=new Element('tr',{'class':'odd'});domainHtmlRow.each(function(item){var td=new Element('td',{'class':'odd'});td.set('html',item.substitute({index:id,searchedDom:searchedDom,price:'',currency:'',loadImgSrc:baseImgUrl+'ajax-loader.gif'}));row.adopt(td);});if(!$chk($('searched-dom-name-'+id))){$('domains-search-result-table-tbody').adopt(row);$('domains-search-result-cnt').show();var domJson=new Request.JSON({url:baseLangUrl+'register/search-domains',onSuccess:function(domainInfo){$('searched-dom-name-'+id).set('text',domainInfo[0].nameReal);$('searched-dom-name-input-'+id).set('value',domainInfo[0].name);if(domainInfo[0].statusID!=domainStatusFree){$('searched-dom-select-'+id).set('text',domainInfo[0].statusText);$('searched-dom-cks-'+id).empty();}else{var products=new Hash(domainInfo[0].products);var baseId=products.get(products.getKeys()[0]).ID;var baseDescription=products.get(products.getKeys()[0]).description;var basePrice=products.get(products.getKeys()[0]).Value;var currency=products.get(products.getKeys()[0]).Currency;$('searched-dom-price-'+id).set('text',basePrice);$('searched-dom-currency-'+id).set('text',currency);var select=new Element('select',{name:'service['+id+']','class':'product-drop-down'});var options='';products.each(function(item){options+='<option rel="{value}" value="{id}">{description}</option>'.substitute({value:item.Value,id:item.ID,description:item.description});});select.set('html',options);$('searched-dom-select-'+id).empty().adopt(select);doPriceDropDowns(select);}}}).post({'domain':searchedDom,'id':id,'tlds':tld});}});}}
function doPriceDropDowns(el){var drops=el?$$(el):$$('.product-drop-down');drops.each(function(el){$(el).addEvent('change',function(){var priceNode=$(el).getParent('td').getNext('td').getChildren('span[class="product-price"]').getLast();if($chk($(priceNode))){var itemNewPrice=$(el).getSelected().getLast().getProperty('rel');if($chk($('totalPrice'))){var totalPrice=$('totalPrice').get('text');var itemOldPrice=$(priceNode).getProperty('rel');totalPrice=totalPrice.toFloat()-itemOldPrice.toFloat()+itemNewPrice.toFloat();$('totalPrice').set('text',totalPrice.toFixed(2));$(priceNode).setProperty('rel',itemNewPrice);}
$(priceNode).set('text',itemNewPrice);}});});}
function answer(el,nr){$('a'+nr).get('reveal').toggle();$(el).getParent('p').toggleClass('selected-faq');return false;}
function doLanguageSelect(selectId){$(selectId).addEvent('change',function(){window.location=$(selectId).getSelected().getLast().getProperty('rel');});}
function doButtonPressEfect(){var clickEv=function(){myEl=$(this);try{if(oldPad){var timeoutFunction=function(){$(myEl).setStyle('margin-top',oldPad)};setTimeout(timeoutFunction,100);}}catch(err){}};var mouseDownEv=function(){oldPad=$(this).getStyle('padding-top');$(this).setStyle('margin-top',(oldPad.toInt()+1+'px'));};$$('button','.abtn').each(function(el){$(el).addEvent('click',clickEv);$(el).addEvent('mousedown',mouseDownEv);});}
function confirmLinkPress(link,winTitle,confirmMsg,action){var doAction=$chk(action)?action:function(){window.location=$(link).get('href');};StickyWin.confirm(winTitle,confirmMsg,doAction,{baseHref:clientcideBaseHref,uiOptions:{width:'400px',baseHref:clientcideBaseHref,buttons:[{text:'Nu'},{text:'Da'}]}});return false;}
function doToolTips(){var tips=new Tips('.tips',{fixed:true,showDelay:100,hideDelay:1000,offset:{'y':30},className:'help-tip',text:false});}
var countryPhonePrefixes={'AX':'+358','AT':'+43','BE':'+32','BG':'+359','CY':'+357','CZ':'+420','DK':'+45','EE':'+372','FI':'+358','FR':'+33','GF':'+594','DE':'+49','GI':'+350','GB':'+44','GR':'+30','GP':'+590','HU':'+36','IE':'+353','IT':'+39','LV':'+371','LT':'+370','LU':'+352','MT':'+356','MQ':'+596','PL':'+48','PT':'+351','RO':'+40','SI':'+386','RE':'+262','SK':'+421','ES':'+34','SE':'+46'};var domainHtmlRow=['<div id="searched-dom-cks-{index}"><input type="hidden" name="ck_domain[{index}]" value="0" /><input type="checkbox" name="ck_domain[{index}]" value="1" checked="checked" /></div>','<span id="searched-dom-name-{index}">{searchedDom}</span><input type="hidden" name="domain_name[{index}]" value="{searchedDom}" id="searched-dom-name-input-{index}" />','<div  id="searched-dom-select-{index}"><img src="{loadImgSrc}" alt="Loading..." /></div>','<span class="product-price"  id="searched-dom-price-{index}">{price}</span> <span class="product-currency"  id="searched-dom-currency-{index}">{currency}</span>'];
