if(!Control)var Control={};Control.Slider=Class.create();Control.Slider.prototype={initialize:function(handle,track,options){var slider=this;if(handle instanceof Array){this.handles=handle.collect(function(e){return $(e)});}else{this.handles=[$(handle)];}
this.track=$(track);this.options=options||{};this.axis=this.options.axis||'horizontal';this.increment=this.options.increment||1;this.step=parseInt(this.options.step||'1');this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(s){return $(s)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||'0');this.alignY=parseInt(this.options.alignY||'0');this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled)this.setDisabled();this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max();}
this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(h,i){i=slider.handles.length-1-i;slider.setValue(parseFloat((slider.options.sliderValue instanceof Array?slider.options.sliderValue[i]:slider.options.sliderValue)||slider.range.start),i);Element.makePositioned(h);Event.observe(h,"mousedown",slider.eventMouseDown);});Event.observe(this.track,"mousedown",this.eventMouseDown);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);this.initialized=true;},dispose:function(){var slider=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(h){Event.stopObserving(h,"mousedown",slider.eventMouseDown);});},setDisabled:function(){this.disabled=true;},setEnabled:function(){this.disabled=false;},getNearestValue:function(value){if(this.allowedValues){if(value>=this.allowedValues.max())return(this.allowedValues.max());if(value<=this.allowedValues.min())return(this.allowedValues.min());var offset=Math.abs(this.allowedValues[0]-value);var newValue=this.allowedValues[0];this.allowedValues.each(function(v){var currentOffset=Math.abs(v-value);if(currentOffset<=offset){newValue=v;offset=currentOffset;}});return newValue;}
if(value>this.range.end)return this.range.end;if(value<this.range.start)return this.range.start;return value;},setValue:function(sliderValue,handleIdx){if(!this.active){this.activeHandleIdx=handleIdx||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles();}
handleIdx=handleIdx||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((handleIdx>0)&&(sliderValue<this.values[handleIdx-1]))
sliderValue=this.values[handleIdx-1];if((handleIdx<(this.handles.length-1))&&(sliderValue>this.values[handleIdx+1]))
sliderValue=this.values[handleIdx+1];}
sliderValue=this.getNearestValue(sliderValue);this.values[handleIdx]=sliderValue;this.value=this.values[0];this.handles[handleIdx].style[this.isVertical()?'top':'left']=this.translateToPx(sliderValue);this.drawSpans();if(!this.dragging||!this.event)this.updateFinished();},setValueBy:function(delta,handleIdx){this.setValue(this.values[handleIdx||this.activeHandleIdx||0]+delta,handleIdx||this.activeHandleIdx||0);},translateToPx:function(value){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(value-this.range.start))+"px";},translateToValue:function(offset){return((offset/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start);},getRange:function(range){var v=this.values.sortBy(Prototype.K);range=range||0;return $R(v[range],v[range+1]);},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX);},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignY);},isVertical:function(){return(this.axis=='vertical');},drawSpans:function(){var slider=this;if(this.spans)
$R(0,this.spans.length-1).each(function(r){slider.setSpan(slider.spans[r],slider.getRange(r))});if(this.options.startSpan)
this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));if(this.options.endSpan)
this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum));},setSpan:function(span,range){if(this.isVertical()){span.style.top=this.translateToPx(range.start);span.style.height=this.translateToPx(range.end-range.start+this.range.start);}else{span.style.left=this.translateToPx(range.start);span.style.width=this.translateToPx(range.end-range.start+this.range.start);}},updateStyles:function(){this.handles.each(function(h){Element.removeClassName(h,'selected')});Element.addClassName(this.activeHandle,'selected');},startDrag:function(event){if(Event.isLeftClick(event)){if(!this.disabled){this.active=true;var handle=Event.element(event);var pointer=[Event.pointerX(event),Event.pointerY(event)];var track=handle;if(track==this.track){var offsets=Position.cumulativeOffset(this.track);this.event=event;this.setValue(this.translateToValue((this.isVertical()?pointer[1]-offsets[1]:pointer[0]-offsets[0])-(this.handleLength/2)));var offsets=Position.cumulativeOffset(this.activeHandle);this.offsetX=(pointer[0]-offsets[0]);this.offsetY=(pointer[1]-offsets[1]);}else{while((this.handles.indexOf(handle)==-1)&&handle.parentNode)
handle=handle.parentNode;if(this.handles.indexOf(handle)!=-1){this.activeHandle=handle;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var offsets=Position.cumulativeOffset(this.activeHandle);this.offsetX=(pointer[0]-offsets[0]);this.offsetY=(pointer[1]-offsets[1]);}}}
Event.stop(event);}},update:function(event){if(this.active){if(!this.dragging)this.dragging=true;this.draw(event);if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);Event.stop(event);}},draw:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var offsets=Position.cumulativeOffset(this.track);pointer[0]-=this.offsetX+offsets[0];pointer[1]-=this.offsetY+offsets[1];this.event=event;this.setValue(this.translateToValue(this.isVertical()?pointer[1]:pointer[0]));if(this.initialized&&this.options.onSlide)
this.options.onSlide(this.values.length>1?this.values:this.value,this);},endDrag:function(event){if(this.active&&this.dragging){this.finishDrag(event,true);Event.stop(event);}
this.active=false;this.dragging=false;},finishDrag:function(event,success){this.active=false;this.dragging=false;this.updateFinished();},updateFinished:function(){if(this.initialized&&this.options.onChange)
this.options.onChange(this.values.length>1?this.values:this.value,this);this.event=null;}}
var LobbyTooltip=Class.create(CasinoTooltip,{_show:function(){$$('div.casino-tooltip').invoke('hide');if(this.options.content)
this.text=this.options.content;this.tooltip=new Element('div').addClassName('casino-tooltip').setStyle({position:'absolute',width:this.options.width+'px',display:'none',zIndex:999});if(this.options.className!='')
this.tooltip.addClassName(this.options.className);this.tooltip.update(this.options.template.evaluate({text:this.text,position:this.options.position}));$$('body').first().insert(this.tooltip);this._reposition();if(document.viewport.getHeight()-this.element.viewportOffset()[1]<150&&!Prototype.Browser.Opera){this.tooltip.setStyle({marginTop:'-170px'});}
if(Prototype.Browser.IE)
this.options.animateDuration=0;new Effect.Parallel([new Effect.Move(this.tooltip,{sync:true,y:this.moveTop,x:this.moveLeft,mode:'relative'}),new Effect.Appear(this.tooltip,{sync:true})],{duration:this.options.animateDuration,delay:this.options.delay});}});var lobbyjar=new CookieJar({expires:2592000,path:'/'});var casinoLobby=function(){return{translations:{locale:'en',sort1:undefined,sort2:undefined,sort3:undefined,specialgame:undefined,maxwin:undefined,newgame:undefined,minigames:undefined,links:{allgames:undefined,videoslots:undefined,slots:undefined,tablegames:undefined,classicvideopokers:undefined,othergames:undefined}},options:{groupUid:undefined,catUid:undefined,gameUid:undefined,gameSystem:undefined,gameDnm:undefined},_popup:function(element){var popWidth=320,popHeight=240,popDim=element.className.replace('popup ','').split('_');if(popDim.length==3){popWidth=popDim[1];popHeight=popDim[2];}
var frame=element.href+'&fullscreen=1';if(casinoLobby.translations.locale=='pl'||casinoLobby.translations.locale=='de')
frame=element.href.replace('/casino-games/','/fullscreen/')
window.open(frame,'CasinoEuro','width='+popWidth+', height='+popHeight+', resizable=no,scrollbars=no');},_toggleDenomination:function(){$$('#lobby div.list li.denomination > a:first').invoke('observe','click',function(e){Event.stop(e);var self=this;if(!self.hasClassName('block')){self.addClassName('block');if(self.hasClassName('expand')){self.removeClassName('expand');new Effect.BlindUp(self.next('ul'),{duration:0.5,afterFinish:function(effect){self.removeClassName('block')}});}else{self.addClassName('expand');new Effect.BlindDown(self.next('ul'),{duration:0.5,afterFinish:function(effect){self.removeClassName('block')}});}}
$$('div.casino-tooltip').invoke('hide');});},_tooltips:function(){$$('#lobby .list > ul > li > a').each(function(el){if(el.hasClassName('tooltip'))
return;el.addClassName('tooltip');el.observe('click',function(){var menuItemName=(el.innerHTML).unescapeHTML().replace(/^\s+|\s+$/,'').replace('&nbsp;','').replace(/\W+$/,'');var menuItemLink='link-click/casino-lobby/'+menuItemName.toLowerCase().replace(' ','-');dcsMultiTrack('DCS.dcsuri',menuItemLink,'WT.ti',menuItemLink,'WT.z_link_page','casino/play','WT.z_link_type','play','WT.z_link_place','casino-lobby','WT.z_link_name',menuItemName,'WT.z_link_event','clicked','WT.si_x','','WT.si_n','','WT.z_error_page','','WT.z_error_type','','WT.z_error_message','','WT.z_login','','WT.z_register','','WT.z_sorting','','WT.z_tab','');});var gameJackpot,gameBonus,gameTitle,gameLines,gameNew,left,jackpotValue;var parent=el.up('li');var lines=parent.getAttribute('title');parent.setAttribute('title','');var gameId=parent.id.replace('game_','');var categoryName=el.up('div.category').down('h3').innerHTML;if(parent.hasClassName('new')){gameTitle='<h3 class="new">'+el.innerHTML+'</h3>';gameNew='<p class="new">'+casinoLobby.translations.newgame+'</p>';}else{gameTitle='<h3>'+el.innerHTML+'</h3>';}
if(lines!=null)gameLines='<p>'+lines+'</p>';if(parent.hasClassName('bonus'))gameBonus='<p class="bonus">'+casinoLobby.translations.specialgame+'</p>';if(parent.getAttribute('rel')!=null&&parent.getAttribute('rel')!=''){jackpotValue=casinoLobby._formatValue(parseInt(parent.getAttribute('rel')));gameJackpot='<p class="jackpot">'+casinoLobby.translations.maxwin+' '+jackpotValue+'&euro;</p>';}
left=(el.up('ul:nth-child(4)')!=null||el.up('ul:nth-child(5)')!=null?-200:150);if(Prototype.Browser.IE6){if(el.up('ul:nth-child(3)')!=null||el.up('ul:nth-child(5)'))left-=210;else if((el.up('ul:nth-child(2)')!=null||el.up('ul:nth-child(4)')))left-=60;}
tooltipHTML=new Template('<div class="image"'+(Prototype.Browser.IE?'><img src="/images/games/#{id}.jpg" />':' style="background-image: url(/images/games/#{id}.jpg)">')+'</div>'+'<div class="info">'+'<p>#{category}</p>'+'#{title}#{lines}#{star}#{jackpot}#{bonus}'+'</div>');new LobbyTooltip(el,{template:'<div class="tooltip-content #{position}">#{text}</div>',position:'below',className:'lobbyTooltip',width:384,topOffset:0,leftOffset:left,delay:0.5,animateDuration:0.3,movement:0,content:tooltipHTML.evaluate({id:gameId,category:categoryName,title:gameTitle,lines:gameLines,star:gameNew,jackpot:gameJackpot,bonus:gameBonus})});});},_ajaxCall:function(catUID,gameSort){var request='/'+casinoLobby.translations.locale+'/json/newlobby/';if(catUID==''||catUID=='all-games'){var catsort=[2,1,0,5,4];}else if((catUID=='classicvideopokers'||catUID=='premiumvideopokers'||catUID=='videopokers')&&gameSort==false){var catsort=[0];request+='?catUID=classicvideopokers';}else{var catsort=[0];request+='?catUID='+catUID;}
var lobbyCategories=new Element('div',{id:'lobbyCategories'});if(gameSort&&catUID!='')
ajaxcasino.setLoading($('lobby'+catUID),'sort_'+catUID+'_loading');else
ajaxcasino.setLoading($('lobbyCategories'),'lobbyCategoriesLoading');new Ajax.Request(request,{method:'get',asynchronous:false,onSuccess:function(response){var respJSON=response.responseText.evalJSON();catsort.each(function(cat){var category=respJSON.categories;if(category.length>0)category=category[cat];var categoryWrap=new Element('div',{'class':'category',id:'lobby'+category.uid});var lobbyHeader=new Element('div',{'class':'header'}).update('<h3>'+category.name+'</h3>'+'<select name="'+category.uid+'_sort">'+'<option value="1">'+casinoLobby.translations.sort1+'</option>'+'<option value="2">'+casinoLobby.translations.sort2+'</option>'+'<option value="3">'+casinoLobby.translations.sort3+'</option>'+'</select>');lobbyList=new Element('div',{'class':'list'});var gameRow,gameWrap,gameClass,elements=1,rest=0,i=0,step=0,gameDnm;var gameCount=category.gameGroups.length;if(gameCount>5){elements=Math.floor(gameCount/5);rest=gameCount-(elements*5);step=rest;}
if(gameSort==2){category.gameGroups.sort(function(a,b){var x=a.name.toLowerCase();var y=b.name.toLowerCase();return((x<y)?-1:((x>y)?1:0));});}else if(gameSort==3){category.gameGroups.sort(function(a,b){var x=a.popularity;var y=b.popularity;return((x>y)?-1:((x<y)?1:0));});}
var ulWrap=[new Element('ul'),new Element('ul'),new Element('ul'),new Element('ul'),new Element('ul')];category.gameGroups.each(function(group,index){var gameClass='',popup='',jackpot=0;if(group.newGame)gameClass='new';else if(group.bonusFeature)gameClass='bonus';if(group.jackpot){gameClass=(gameClass=='')?'jackpot':gameClass;jackpot+=group.jackpotValue;}
if(group.games.length>1){gameRow=new Element('li',{id:group.uid,'class':'denomination'+(gameClass!=''?' '+gameClass:'')}).insert(new Element('a',{href:'#'}).update(group.name));if(jackpot>0)gameRow.setAttribute("rel",jackpot);gameWrap=new Element('ul',{style:"display: none"});gameDnm='';group.games.each(function(dnm){popup='';if(dnm.popup)
popup+='popup dim_'+dnm.width+'_'+dnm.height;gameWrap.insert(new Element('li').update(new Element('a',{href:casinoLobby._makeGameURL(group.formatedName,category.uid,dnm.formatedGameText,dnm.uid,dnm.systemUid),'class':popup}).update(dnm.gameText.replace('?','&euro;'))));gameDnm+="; "+dnm.gameText.replace('?','&euro;');});if(gameDnm!='')
gameRow.setAttribute('title',gameDnm.substr(2));ulWrap[i].insert(gameRow.insert(gameWrap));}else{if(group.games[0].popup)
popup+='popup dim_'+group.games[0].width+'_'+group.games[0].height;ulWrap[i].insert(new Element('li',{id:group.uid,'class':gameClass,rel:(jackpot>0)?jackpot:'',title:group.name.replace('?','&euro;')}).update(new Element('a',{href:casinoLobby._makeGameURL(group.formatedName,category.uid,null,group.games[0].uid,group.games[0].systemUid),'class':popup}).update(group.name)));}
if((index+1-(rest<1?step:0))%(elements+(rest>0?1:0))==0&&i<4){++i;--rest;}});categoryWrap.insert(lobbyHeader);ulWrap.each(function(col){lobbyList.insert(col);});if(gameSort){$$('#lobby'+category.uid+' .list').first().update(lobbyList);ajaxcasino.endLoading('sort_'+category.uid+'_loading');casinoLobby._liveUpdate();}else{categoryWrap.insert(lobbyList);lobbyCategories.insert(categoryWrap);ajaxcasino.endLoading('lobbyCategoriesLoading');}});if(!gameSort){$('lobbyCategories').replace(lobbyCategories);casinoLobby._liveUpdate();casinoLobby._sortGames();}},onFailure:function(){ajaxcasino.endLoading(gameSort?'sort_'+category.uid+'_loading':'lobbyCategoriesLoading');return null;}});},_switchMainTabs:function(self){if(!self.hasClassName('active')){var option=self.up().className;var id=option.replace('opt-','');if(lobbyHistory)lobbyHistory.setValue(0,id);self.up('ul').adjacent('.active').invoke('removeClassName','active');self.addClassName('active');lobbyjar.put("lobby-tab",option);var tabs=['all-games','videoslots','slots','tablegames','videopokers','othergames'];var currentTab=tabs[id-1];dcsMultiTrack('DCS.dcsuri','link-click/casino-lobby/'+currentTab,'WT.ti','link-click/casino-lobby/'+currentTab,'WT.z_link_page','casino/play','WT.z_link_type','play','WT.z_link_place','casino-lobby','WT.z_link_name','','WT.z_link_event','clicked','WT.si_x','','WT.si_n','','WT.z_error_page','','WT.z_error_type','','WT.z_error_message','','WT.z_login','','WT.z_register','','WT.z_sorting','','WT.z_tab',currentTab);if($$('#lobbyCategories .category').length>2){$('lobby').className='';$('lobby').addClassName(option);}else{$('lobby').className='';$('lobby').addClassName(currentTab);casinoLobby._ajaxCall(currentTab,false);}}},_sortGames:function(){$$('#lobby .category select').invoke('observe','change',function(el){var id=this.up('.category').id;var type=this.getValue();var option=id+'_'+type;if(lobbyjar.get("lobby-sort")!=null){var options=lobbyjar.get("lobby-sort").split(',');var edit=false;for(var i=0;i<options.length;i++){if(options[i].substr(0,options[i].length-2)==option.substr(0,option.length-2)){edit=true;if(type==1)
options.splice(i,1);else
options[i]=option;}}
if(type!=1&&!edit)options.push(option);option=options.join(",");}
var catName=id.replace('lobby','');dcsMultiTrack('DCS.dcsuri','sort-change/casino-lobby/'+catName+'-'+type,'WT.ti','sort-change/casino-lobby/'+catName+'-'+type,'WT.z_link_page','casino/play','WT.z_link_type','play','WT.z_link_place','casino-lobby','WT.z_link_name','','WT.z_link_event','clicked','WT.si_x','','WT.si_n','','WT.z_error_page','','WT.z_error_type','','WT.z_error_message','','WT.z_login','','WT.z_register','','WT.z_sorting',catName+'-'+type,'WT.z_tab','');casinoLobby._ajaxCall(catName,type);lobbyjar.put("lobby-sort",option);});},_switchWinnersTabs:function(){$$('#lobbyWinners li.empty').each(function(el){casinoLobby._loadJackpotsTab();el.removeClassName('empty');});$$('#lobbyWinners li.hide').each(function(el){var el2=el.siblings().first();[el,el2].invoke('toggleClassName','hide');new Effect.Appear(el2.down('table'),{duration:0.5,from:1.0,to:0});new Effect.Appear(el.down('table'),{duration:0.5,from:0,to:1.0});});},_loadWinnersTab:function(){ajaxcasino.setLoading($('lobbyWinners'),'lobbyWinners_loading');new Ajax.Request('/'+casinoLobby.translations.locale+'/xml/currentOverview.xml.jsp',{method:'get',asynchronous:false,onSuccess:function(response){var resp=response.responseXML.getElementsByTagName("latestwins")[0];var winNodes=resp.getElementsByTagName("win");var winnersWrapper=$$('#lobbyWinners li:nth-child(1)')[0];var winnersList='';for(var i=0;i<winNodes.length;i++){if(i>6)break;winnersList+='<tr class="'+(i%2==0?'even':'odd')+'">'+'<td class="col-1"><img src="/images/iso-flags/'+winNodes[i].getAttribute("countrycode")+'.gif" alt="'+winNodes[i].getAttribute("countrycode")+'" /></td>'+'<td class="col-2">'+(winNodes[i].getAttribute("name").length>15?winNodes[i].getAttribute("name").substring(0,15):winNodes[i].getAttribute("name"))+'</td>'+'<td class="col-3"><a href="'+winNodes[i].getAttribute("link")+'">'+winNodes[i].getAttribute("game")+'</a></td>'+'<td class="col-4">'+winNodes[i].getAttribute("value")+'&euro;</td>'+'</tr>';}
Element.insert(winnersWrapper,'<table cellpadding="0" cellspacing="0"><tbody>'+winnersList+'</tbody></table>');ajaxcasino.endLoading('lobbyWinners_loading');},onFailure:function(){ajaxcasino.endLoading('lobbyWinners_loading');return null;}});},_loadJackpotsTab:function(){ajaxcasino.setLoading($('lobbyWinners'),'lobbyWinners_loading');new Ajax.Request('/'+casinoLobby.translations.locale+'/json/newjackpots/',{method:'get',asynchronous:false,onSuccess:function(response){var respJSON=response.responseText.evalJSON();var resp=respJSON.gameGroupsWithJackpots;var jackpotsWrapper=$$('#lobbyWinners li:nth-child(2)')[0];var jackpotsList='';resp.sort(function(a,b){var x=a.jackpotValue;var y=b.jackpotValue;return((x>y)?-1:((x<y)?1:0));});resp.each(function(jackpot,i){if(i>4)return;jackpotsList+='<tr class="'+(i%2==0?'even':'odd')+'">'+'<td class="col-5"><a href="'+casinoLobby._makeGameURL(jackpot.formatedName,null,null,jackpot.games[0].uid,null)+'">'+jackpot.name+'</a></td>'+'<td class="col-6">'+casinoLobby._formatValue(jackpot.jackpotValue)+'&euro;</td>'+'</tr>';});Element.insert(jackpotsWrapper,'<table cellpadding="0" cellspacing="0"><tbody>'+jackpotsList+'</tbody></table>');ajaxcasino.endLoading('lobbyWinners_loading');},onFailure:function(){ajaxcasino.endLoading('lobbyWinners_loading');return null;}});},_formatValue:function(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;},_makeGameURL:function(name,group,dnm,game,system){var gameURL='/'+casinoLobby.translations.locale+'/casino-games';if(window.location.href.indexOf("casinoeuro")>0&&(casinoLobby.translations.locale=='pl'||casinoLobby.translations.locale=='de')){gameURL+='/'+casinoLobby.translations.links[(group==null?'allgames':group)]+'/'+name+(dnm==null?'':'/'+dnm);}else{gameURL+='?game='+game+(system==null?'':'&system='+system);}
return gameURL;},_liveUpdate:function(){casinoLobby._toggleDenomination();casinoLobby._tooltips();$$('#lobbyCategories a.popup').invoke('observe','click',function(e){Event.stop(e);casinoLobby._popup(this);});},_gameRules:function(){Modalbox.show($('gameRules'),{title:'',overlayClose:true,height:420,width:600});},_populateGameGroup:function(){var selector=$('gameSelector');if(selector.hasClassName('loaded'))
return;ajaxcasino.setLoading(selector,'gameSelector_loading');new Ajax.Request('/'+casinoLobby.translations.locale+'/json/newlobby/',{method:'get',asynchronous:false,onSuccess:function(response){var respJSON=response.responseText.evalJSON();var option=undefined,optgroup=undefined,dnmValues=0,dnmList=undefined,showDnm='';var gameSelect=new Element('select');var gameInfo=new Element('div',{id:'gameGroupInfo'});var dnmList=new Element('ul');var miniGames=new Element('optgroup',{label:casinoLobby.translations.minigames});Element.insert(gameSelect,miniGames);respJSON.categories.each(function(category,i){if(category.name[0]=='<'||category.id==5)
return;optgroup=new Element('optgroup',{label:category.name});category.gameGroups.each(function(group,index){if(group.name[0]=='<')
return;dnmList=new Element('ul',{id:'sel_'+dnmValues});group.games.each(function(dnm,dIndex){Element.insert(dnmList,'<li><a '+(dnm.popup?' class="popup dim_'+dnm.width+'_'+dnm.height+'"':'')+' href="'+casinoLobby._makeGameURL(group.formatedName,group.categoryUid,(dIndex==0?null:dnm.formatedGameText),dnm.uid,dnm.systemUid)+'">'+dnm.gameText+'</a></li>');});option=new Element('option',{value:dnmValues}).update(group.name);gameInfo.insert(dnmList);if(group.uid==casinoLobby.options.groupUid){option.selected='true';showDnm='sel_'+dnmValues;}
Element.insert((group.games[0].popup?miniGames:optgroup),option);dnmValues++;});Element.insert(gameSelect,optgroup);});gameSelect.observe('change',function(e){var element=$('sel_'+this.getValue());element.siblings().each(function(sibling){if(sibling.hasClassName('active'))sibling.removeClassName('active');});element.addClassName('active');element.select('.popup').invoke('observe','click',function(e){Event.stop(e);casinoLobby._popup(this);});var open=element.select('a');if(open.length==1){if(open[0].hasClassName('popup'))
casinoLobby._popup(open[0]);else
window.location=open[0].href;}});selector.update('');selector.insert(gameSelect);selector.insert(gameInfo);selector.addClassName('loaded');$(showDnm).addClassName('active');ajaxcasino.endLoading('gameSelector_loading');},onFailure:function(){ajaxcasino.endLoading('gameSelector_loading');return null;}});},gamepage:function(){if(document.viewport.getHeight()<650&&$('gameWrapper'))
new Effect.ScrollTo('contentWrapper',{duration:0.5,offset:105});['username','password'].each(function(el){if($(el))Element.observe(el,'focus',function(){this.value='';});});var btnMaximize=$('gIcon-maximise');if(btnMaximize){btnMaximize.observe('click',function(e){Event.stop(e);var frameURL=window.location.href.replace('/casino-games/','/fullscreen/');window.open(frameURL,'CasinoEuro','width='+document.viewport.getWidth()+', height='+document.viewport.getHeight()+', resizable=no,scrollbars=no,toolbar=0,menubar=0,location=0,resizable=0,directories=0,status=0,fullscreen=yes');window.location='/'+casinoLobby.translations.locale+'/casino-games';});}
var rulesBtn=$('gIcon-info');if(rulesBtn){$(rulesBtn).observe('click',function(e){Event.stop(e);casinoLobby._gameRules();});}
var liveChat=$('liveChat');if(liveChat){$(liveChat).observe('click',function(e){Event.stop(e);window.open('/'+casinoLobby.translations.locale+'/support/livechat/index.jsp','LiveChat','width=800,height=600,resizable=yes');});}
var gamePassword=$('gamePassword');if(gamePassword){gamePassword.observe('click',function(e){Event.stop(e);Modalbox.show('/'+casinoLobby.translations.locale+'/game/password.jsp',{title:'',overlayClose:true,height:420,width:600});});}
var flagsContainer=$('gameFlags');if(flagsContainer){flagsContainer.select('.active')[0].observe('click',function(e){Event.stop(e);if(flagsContainer.hasClassName('hover'))
flagsContainer.removeClassName('hover');else
flagsContainer.addClassName('hover');});Element.observe(document.body,'click',function(e){if(flagsContainer.hasClassName('hover'))
flagsContainer.removeClassName('hover');});}
var selector=$('gameSelector');if(selector)selector.observe('mouseover',this._populateGameGroup);$$('#gameThumbs a.popup').invoke('observe','click',function(e){Event.stop(e);casinoLobby._popup(this);});},init:function(){$$('#lobbyTabs li a').invoke('observe','click',function(e){Event.stop(e);casinoLobby._switchMainTabs(this);});var autoSwitch=setInterval(casinoLobby._switchWinnersTabs,5000);$$('#lobbyWinners li > a').invoke('observe','click',function(e){Event.stop(e);if(this.up().hasClassName('hide')){casinoLobby._switchWinnersTabs();clearInterval(autoSwitch);}});this._liveUpdate();this._sortGames();this._loadWinnersTab();}}}();var tmpGotoProduct;var tmpGotoLock;function gotoProduct(id){if(tmpGotoLock==undefined){tmpGotoLock=1;getMovieName('product_gallery').gotoProduct(id);$('Game'+id).toggleClassName('highlight');new Effect.toggle('gameLinks'+id,'Blind',{duration:0.7,afterFinish:function(){tmpGotoLock=undefined;}});if(tmpGotoProduct==undefined){tmpGotoProduct=id;}else if(tmpGotoProduct==id){tmpGotoProduct=undefined;}else{Effect.BlindUp('gameLinks'+tmpGotoProduct,{duration:0.7});$('gameLinks'+tmpGotoProduct).setStyle({'height':'auto'});$('Game'+tmpGotoProduct).removeClassName('highlight');tmpGotoProduct=id;}}}
function highlight(id){if(tmpGotoProduct!=id&&!$('Game'+id).hasClassName('highlight'))
gotoProduct(id);}
function getMovieName(movieName){if(navigator.appName.indexOf('Microsoft')!=-1){return window[movieName]}else{return document[movieName]}}
document.observe('dom:loaded',function(){carouselReady=function(){$$('div#divGameCategoryContainer div.gameGroupBox').each(function(el){if(Prototype.Browser.IE67){el.observe('mouseenter',function(){el.addClassName('hovered');});el.observe('mouseleave',function(){el.removeClassName('hovered');});}
el.observe('click',function(e){gotoProduct(el.id.replace("Game",""));Event.stop(e);});});$$('div#divGameCategoryContainer div.gameGroupBox').each(function(el){new CasinoTooltip(el,{position:'below',width:150,leftOffset:27,topOffset:14,pointerXPos:'36px',animateDuration:0.6});});}});var offsetxpoint=30
var offsetypoint=-50
var ie=document.all
var ns6=document.getElementById&&!document.all
var enabletip=false
if(ie||ns6){var tipobj=document.all?document.all["divToolTip"]:document.getElementById?document.getElementById("divToolTip"):""}
function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function showJackpot(thetext){offsetxpoint=10;offsetypoint=-30;return showToolTip(thetext);}
function showToolTip(thetext,thecolor,thewidth,xOffset,yOffset){if(ns6||ie){if(typeof thewidth!="undefined")tipobj.style.width=thewidth+"px";if(typeof xOffset!="undefined")offsetxpoint=xOffset;if(typeof yOffset!="undefined")offsetypoint=yOffset;if(typeof thecolor!="undefined"&&thecolor!="")tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false}}
function positiontip(e){if(enabletip){var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var rightedge=ie&&!window.opera?ietruebody().clientWidth-event.clientX-offsetxpoint:window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera?ietruebody().clientHeight-event.clientY-offsetypoint:window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)?offsetxpoint*(-1):-1000
if(rightedge<tipobj.offsetWidth)
tipobj.style.left=ie?ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px":window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if(curX<leftedge)
tipobj.style.left="5px"
else
tipobj.style.left=curX+offsetxpoint+"px"
if(bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie?ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px":window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"}}
function hideToolTip(){if(ns6||ie){enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''}}
document.onmousemove=positiontip