$(document).ready(function(){$.fn.extend({customStyle:function(options){if(!$.browser.msie||($.browser.msie&&$.browser.version>6)){return this.each(function(){var currentSelected=$(this).find(':selected');$(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute',opacity:0,fontSize:$(this).next().css('font-size')});var selectBoxSpan=$(this).next();var selectBoxWidth=parseInt($(this).width())-parseInt(selectBoxSpan.css('padding-left'))-parseInt(selectBoxSpan.css('padding-right'));var selectBoxSpanInner=selectBoxSpan.find(':first-child');selectBoxSpan.css({display:'inline-block'});selectBoxSpanInner.css({width:selectBoxWidth,display:'inline-block'});var selectBoxHeight=parseInt(selectBoxSpan.height())+parseInt(selectBoxSpan.css('padding-top'))+parseInt(selectBoxSpan.css('padding-bottom'));$(this).height(selectBoxHeight).change(function(){selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed')})})}}});$(window).scroll(function(){if($(this).scrollTop()!=0){$('#top').fadeIn()}else{$('#top').fadeOut()}});$('#top').click(function(){$('body, html').animate({scrollTop:0},400)});$("a.tooltip, input.tooltip").easyTooltip({xOffset:-10,yOffset:10});$("a.frame").fancybox({'overlayColor':'#000','overlayOpacity':0.8,'width':'80%','height':'94%','autoScale':false,'transitionIn':'elastic','transitionOut':'elastic','type':'iframe','titleShow':false,'hideOnContentClick':false});$("a[rel=group],a[rel=single_image]").fancybox({'transitionIn':'elastic','transitionOut':'elastic','titlePosition':'over','overlayColor':'#000','overlayOpacity':0.8,'titleFormat':function(title,currentArray,currentIndex,currentOpts){return'<span id="fancybox-title-over">'+(currentIndex+1)+' / '+currentArray.length+(title.length?' &nbsp; '+title:'')+'</span>'}});$('a[rel*=external]').click(function(){window.open(this.href);return false});var ticker=function(){setTimeout(function(){$('#ticker li:first').animate({marginTop:'-78px'},1000,function(){$(this).detach().appendTo('ul#ticker').removeAttr('style')});ticker()},4000)};ticker();$(".paging").show();$(".paging a:first").addClass("active");var imageWidth=$(".window").width();var imageSum=$(".bg_img li").size();var imageReelWidth=imageWidth*imageSum;$(".bg_img").css({'width':imageReelWidth});rotate=function(){var triggerID=$active.attr("rel")-1;var bg_imgPosition=triggerID*imageWidth;$(".paging a").removeClass('active');$active.addClass('active');$(".bg_img").fadeOut(600);$(".bg_img").animate({left:-bg_imgPosition},0);$(".bg_img").fadeIn(600)};rotateSwitch=function(){play=setInterval(function(){$active=$('.paging a.active').next();if($active.length===0){$active=$('.paging a:first')}rotate()},9900)};rotateSwitch();$(".paging a").click(function(){$active=$(this);clearInterval(play);rotate();return false});function addSpace(nStr){nStr+='';x=nStr.split(',');x1=x[0];x2=x.length>1?','+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+' '+'$2')}return x1+x2}function update(){var cpu=$('#cpu').slider('value')*100;var ram=$('#ram').slider('value')/256*100-100;var hdd=$('#hdd').slider('value')*20-100;var total=(cpu+ram+hdd);var total_tax=(cpu+ram+hdd)*1.2;$("#total").text(addSpace(total));$("#total_tax").text(addSpace(total_tax.toFixed(2).toString().replace(/\./g,','))+' Kč')}$("#cpu").slider({value:1,min:1,max:4,step:1,animate:true,slide:function(event,ui){$("#cpu_value").text(ui.value+' x 2.00 GHz')},stop:function(event,ui){update()}});$("#cpu_value").text($("#cpu").slider('value')+' x 2.00 GHz');$("#ram").slider({value:256,min:256,max:2048,step:256,animate:true,slide:function(event,ui){$("#ram_value").text(ui.value+' MB')},stop:function(event,ui){update()}});$("#ram_value").text($("#ram").slider('value')+' MB');$("#hdd").slider({value:5,min:5,max:50,step:5,animate:true,slide:function(event,ui){$("#hdd_value").text(ui.value+' GB')},stop:function(event,ui){update()}});$("#hdd_value").text($("#hdd").slider('value')+' GB')});

