var site_const = {mt:0.952381, max_dobitak:300000, max_sist_dobitak:500000, max_koeff:1000000, valuta:'Kn', min_uplata:5, min_uplata_sistem:0.01, default_uplata:10, grupa_komb_default_uplata:5, max_br_dogadjaja:30, max_br_sistemskih_dog:18, loto_sportID:20, superprognoza_sportID:18, superprognoza_naziv_dativ:'super prognozi', superprognoza_naziv_genitiv:'super prognoze', ispisRezultata:0, sSiteTitle:'Germania Sport', sSiteURL:'www.germaniasport.hr', ttxRefreshRateOverlay:10000, ttxRefreshRateDetached:10000, ttxRefreshRateEmbedded:10000, ttxDefaultPage:731, ttxDefaultSubPage:1, ttxStartPage:730, ttxEndPage:736, provListRefreshRate:30000, menuRefreshRate:180000, sGoogleAnalyticsCode:'UA-305909-6' };
function createHTTPRequest()
{/*@cc_on @*/ /*@if (@_jscript_version >= 5)try {return(new ActiveXObject("Msxml2.XMLHTTP"));}catch (e){try {return(new ActiveXObject("Microsoft.XMLHTTP"));}catch (E){return(false);}}@end @*/ try {return(new XMLHttpRequest());}catch (e){return(false);}try {return(window.createRequest());}catch (e){return(false);}}
function eventCenter_class()
{this.moveHandlers = null;this.downHandlers = null;this.upHandlers   = null;this.blurHandlers = null;this.resizeHandlers = null;this.keyDownHandlers = null;
this.register = function(inEventType, inObject)
{switch(inEventType){case 'mousemove': if(this.moveHandlers == null) this.moveHandlers = new Array();this.moveHandlers.push(inObject);break;case 'mousedown': if(this.downHandlers == null) this.downHandlers = new Array();this.downHandlers.push(inObject);break;case 'mouseup': if(this.upHandlers == null) this.upHandlers = new Array();this.upHandlers.push(inObject);break;case 'blur': if(this.blurHandlers == null) this.blurHandlers = new Array();this.blurHandlers.push(inObject);break;case 'resize': if(this.resizeHandlers == null) this.resizeHandlers = new Array();this.resizeHandlers.push(inObject);break;case 'keydown': if(this.keyDownHandlers == null) this.keyDownHandlers = new Array();this.keyDownHandlers.push(inObject);break;}}
this.unregister = function(inEventType, inObject)
{switch(inEventType){case 'mousedown': for(var i in this.downHandlers){if(this.downHandlers[i] == inObject){this.downHandlers.splice(i,1);break;}}break;case 'mouseup': for(var i in this.upHandlers){if(this.upHandlers[i] == inObject){this.upHandlers.splice(i,1);break;}}break;case 'mousemove': for(var i in this.downHandlers){if(this.downHandlers[i] == inObject){this.downHandlers.splice(i,1);break;}}break;case 'blur': for(var i in this.blurHandlers){if(this.blurHandlers[i] == inObject){this.blurHandlers.splice(i,1);break;}}break;case 'resize': for(var i in this.resizeHandlers){if(this.resizeHandlers[i] == inObject){this.resizeHandlers.splice(i,1);break;}}break;case 'keydown': for(var i in this.keyDownHandlers){if(this.keyDownHandlers[i] == inObject){this.keyDownHandlers.splice(i,1);break;}}break;}}
this.handle_mouseMove = function(inEvent)
{for(var i in this.moveHandlers)this.moveHandlers[i].handle_mouseMove(inEvent);}
this.handle_mouseDown = function(inEvent)
{for(var i in this.downHandlers)this.downHandlers[i].handle_mouseDown(inEvent);}
this.handle_mouseUp = function(inEvent)
{for(var i in this.upHandlers)this.upHandlers[i].handle_mouseUp(inEvent);}
this.handle_blur = function(inEvent)
{for(var i in this.blurHandlers)this.blurHandlers[i].handle_Blur(inEvent);}
this.handle_onresize = function(inEvent)
{for(var i in this.resizeHandlers)this.resizeHandlers[i].handle_onresize(inEvent);}
this.handle_onkeydown = function(inEvent)
{if(window.event)var iKeyCode = window.event.keyCode;else if(inEvent.which)var iKeyCode = inEvent.which;for(var i in this.keyDownHandlers)this.keyDownHandlers[i].handle_onkeydown(inEvent,iKeyCode);}};var eventCenter = new eventCenter_class();
document.onmousemove = function(inEvent)
{eventCenter.handle_mouseMove(inEvent);}
document.onmousedown = function(inEvent)
{eventCenter.handle_mouseDown(inEvent);}
document.onmouseup = function(inEvent)
{eventCenter.handle_mouseUp(inEvent);}
document.onblur = function(inEvent)
{eventCenter.handle_blur(inEvent);}
window.onresize = function(inEvent)
{eventCenter.handle_onresize(inEvent);}
document.onkeydown = function(inEvent)
{eventCenter.handle_onkeydown(inEvent);}
function nextFocus(e, inID)
{if(KeyDownCode(e)==13) document.getElementById(inID).focus();return(true);}
function KeyDownCode(e)
{var iKeyCode;if(window.event) {return(e.keyCode);} else {return(e.which);}}
function debug(inString, inClear)
{var objDebugDIV;objDebugDIV = document.getElementById('debug_div');if(objDebugDIV == null){objDebugDIV = document.createElement("DIV");document.body.appendChild(objDebugDIV);objDebugDIV.id = 'debug_div';objDebugDIV.style.position = 'absolute';objDebugDIV.style.zIndex	 = '500';objDebugDIV.style.padding = '5px';objDebugDIV.style.top = '20px';objDebugDIV.style.right = '20px';objDebugDIV.style.border = '2px solid #FF0000';objDebugDIV.style.backgroundColor = '#FFFFFF';objDebugDIV.style.color = '#000000';objDebugDIV.style.display = 'none';objDebugDIV.style.overflow = 'auto';objDebugDIV.style.fontSize = '10px';objDebugDIV.innerHTML = '<p style="margin:0px;text-align:right;font-weight:bold;"><a href="javascript:debug(\'\');">x close</a></p>';}if(inString == ''){objDebugDIV.style.display = 'none';objDebugDIV.innerHTML = '<p style="margin:0px;text-align:right;color:red;font-weight:bold;"><a href="javascript:debug(\'\');">x close</a></p>';return;}else objDebugDIV.style.display = 'block';inClear = inClear || false;if(inClear)objDebugDIV.innerHTML = inString;else objDebugDIV.insertAdjacentHTML('beforeEnd', '<br>' + inString);}var lastRandomID = 0;
function getRandomID()
{return('randomid_'+(lastRandomID++));}
function timer_class(inInstanceName)
{this.timerData = new Array();this.timerIDCounter = -1;this.instanceName = inInstanceName;
this.add = function(inObject,
inInterval, inAutoRewind){if(!inAutoRewind) inAutoRewind = false;this.timerData['id'+(++this.timerIDCounter)] = {listener:inObject, interval:inInterval, intervalID:null, autoRewind:inAutoRewind};return(this.timerIDCounter);}
this.remove = function(inTimerID)
{this.stop(inTimerID);this.timerData.splice('id'+inTimerID,1);}
this.start = function(inTimerID)
{if(this.timerData['id'+inTimerID].intervalID==null)this.timerData['id'+inTimerID].intervalID = setTimeout(this.instanceName+'.trigger('+inTimerID+')',this.timerData['id'+inTimerID].interval);}
this.stop = function(inTimerID)
{if(typeof(inTimerID)=='undefined')return;if(this.timerData['id'+inTimerID].intervalID!=null)clearTimeout(this.timerData['id'+inTimerID].intervalID);this.timerData['id'+inTimerID].intervalID = null;}
this.set_Listener = function(inTimerID, inObject)
{this.timerData['id'+inTimerID].listener = inObject;}
this.set_Interval = function(inTimerID, inInterval)
{this.timerData['id'+inTimerID].interval = inInterval;}
this.trigger = function(inTimerID)
{if(typeof(this.timerData['id'+inTimerID])=='undefined')return;if(this.timerData['id'+inTimerID].autoRewind)this.timerData['id'+inTimerID].intervalID = setTimeout(this.instanceName+'.trigger('+inTimerID+')',this.timerData['id'+inTimerID].interval);else this.timerData['id'+inTimerID].intervalID = null;this.timerData['id'+inTimerID].listener.timerTimeout();}}var globalTimer = new timer_class('globalTimer');
ticker_class = function(inDomContainer,
inOrientation, inScrollStep, inScrollTime){this.domContainer = inDomContainer;this.domSlider = document.createElement('div');this.domSlider.style.overflow='hidden';this.domSlider.style.height='20px';this.domSlider.style.position='absolute';this.domSlider.style.display='block';this.domSlider.style.left='0px';this.domSlider.style.top='0px';this.domContainer.appendChild(this.domSlider);this.containerHeight = inDomContainer.style.height;this.orientation = inOrientation;this.timerID = globalTimer.add(this,inScrollTime,true);if(this.orientation == 'H')this.domSlider.style.whiteSpace='nowrap';this.content = null;this.contentSize = null;this.containerSize = null;this.scrollOffset = null;this.scrollStep = inScrollStep;
this.setContent = function(inText)
{this.content = inText;if(this.orientation == 'H'){this.domSlider.innerHTML = inText;this.containerSize = this.domContainer.clientWidth;this.contentSize = this.domSlider.scrollWidth;}else {this.domContainer.innerHTML = inText;this.containerSize = this.domContainer.clientHeight;this.contentSize = this.domSlider.scrollHeight;}if(this.scrollStep > 0){this.startPosition = -this.contentSize;this.endPosition = this.containerSize;}else {this.startPosition = this.containerSize;this.endPosition = -this.contentSize;}this.scrollOffset = 0;}
this.start = function()
{globalTimer.start(this.timerID);}
this.pause = function()
{globalTimer.stop(this.timerID);}
this.timerTimeout = function()
{this.scrollOffset+=this.scrollStep;if(this.scrollStep > 0){if(this.scrollOffset >= this.endPosition)this.scrollOffset = this.startPosition;}else if(this.scrollOffset <= this.endPosition)this.scrollOffset = this.startPosition;if(this.orientation == 'H')this.domSlider.style.left = this.scrollOffset+'px';else this.domSlider.style.top = this.scrollOffset+'px';}
this.terminate = function()
{globalTimer.remove(this.timerID);this.domContainer.removeNode(this.domSlider);this.domSlider = null;this.domContainer = null;};};
function m_ShowPopup(in_file, in_width, in_height, in_settings)
{if(!in_width)in_width = 630;if(!in_height)in_height = 360;var LeftPosition = (screen.width)?(screen.width-in_width)/2:100;var TopPosition = (screen.height)?(screen.height-in_height)/2:100;if(!in_settings)in_settings = 'scrollbars=1,toolbar=0,menubar=0,status=0,location=0,resizable=0,height='+in_height+',width='+in_width+',top='+TopPosition+',left='+LeftPosition;else in_settings+= ',height='+in_height+',width='+in_width+',top='+TopPosition+',left='+LeftPosition;var tmpWindow = window.open(in_file, '', in_settings);return(tmpWindow);}
function openNewWindow(inURL, inWindowTitle)
{return(window.open(inURL,inWindowTitle,'fullscreen=no,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'));}
function getSilverlightVersion() {
var version = '';var container = null;try {var control = null;if (window.ActiveXObject) {control = new ActiveXObject('AgControl.AgControl');}else {if (navigator.plugins['Silverlight Plug-In']) {container = document.createElement('div');document.body.appendChild(container);container.innerHTML= '<embed type="application/x-silverlight" src="data:," />';control = container.childNodes[0];}}if (control) {if (control.isVersionSupported('2.0')) { version = 'Silverlight/2.0'; }else if (control.isVersionSupported('1.0')) { version = 'Silverlight/1.0'; }else if (control.isVersionSupported('3.0')) { version = 'Silverlight/3.0'; }else { version = 'Silverlight/unknown version' }}else {version = 'NO Silverlight';}}catch (e) { version = "Silverlight Error"; }if (container) {document.body.removeChild(container);}return version;}
function ttx_class(inWindowType, inActivePage, inActiveSubpage)
{this.refreshTimerID = null;this.refreshCounter = 0;this.request = null;this.dataSource = '/rpc/teletext.asp';this.domFullscreen = null;this.buttonContainer=null;this.checkingVersion=false;this.window_type = inWindowType;switch(this.window_type){case 0: this.refreshTimeout = site_const.ttxRefreshRateOverlay;this.scrollMaxCount = 9;this.scrollCount = 7;break;case 1: this.refreshTimeout = site_const.ttxRefreshRateDetached;this.scrollMaxCount = 9;this.scrollCount = 7;break;case 2: this.refreshTimeout = site_const.ttxRefreshRateDetached;this.scrollMaxCount = 9;this.scrollCount = 7;break;case 3: this.refreshTimeout = site_const.ttxRefreshRateEmbedded;this.scrollMaxCount = 9;this.scrollCount = 7;break;}this.buttonUp = null;this.buttonDown = null;this.scrollTop = 0;this.scrollBottom = null;this.scrollDirection = 1;eventCenter.register('keydown', this);if(!inActivePage)this.activePage = 0;else this.activePage = inActivePage - site_const.ttxStartPage;if(this.activePage < 0)this.activePage = 0;if(!inActiveSubpage)this.activeSubPage = 0;else this.activeSubPage = inActiveSubpage-1;this.domLoading = document.createElement('img');this.domLoading.src = '/img/teletext/tx_loading.gif';var sTemplate =  '<div id="ttx_fullscreen">&nbsp;</div>' +'<div id="ttx_banner">Teletext OnLine omogućuje Vam kladionica <a href="http:/'+'/'+site_const.sSiteURL+'/" title="Posjetite naše web stranice" onclick="openNewWindow(\'http:/'+'/'+site_const.sSiteURL+'\',\''+site_const.sSiteTitle+'\');return(false);" target="_blank">'+site_const.sSiteTitle+'</a></div>' +'<div id="ttx_pages"><ul></ul></div>' +'<div id="ttx_subpages"><ul></ul></div>' +'<div id="ttx_picture"><img src="/img/teletext/tx_loading.gif" /></div>';switch(this.window_type){case 0: this.trackerURL = '/teletext/windowed/';this.windowObj = new window_class(wrapper_div, 'Teletext', false, false, true, true);this.windowObj.parentObj = this;this.windowObj.domContainer.id = 'ttx';this.windowObj.queryUnload = this.queryUnload;this.windowObj.addContent(sTemplate);break;case 1: this.trackerURL = '/teletext/fullscreen/';document.write(sTemplate);break;case 2: this.trackerURL = '/teletext/detached/';document.write(sTemplate);break;case 3: this.trackerURL = '/teletext/embedded/';document.write(sTemplate);break;}this.ttxPages = new Array();
this.loadData = function(inPageIndex, inSubpageIndex)
{if(this.refreshTimerID != null)window.clearTimeout(this.refreshTimerID);this.refreshTimerID = null;if(this.activePage != null && this.activePage != inPageIndex)this.ttxPages[this.activePage].deactivate();this.activePage = inPageIndex;if(this.request == null)this.request = createHTTPRequest();else if(this.request.readyState != 4)this.request.abort();this.request.open("GET", this.dataSource + '?activePage='+this.ttxPages[this.activePage].pageNo+'&activeSubpage='+(inSubpageIndex+1), true);try { this.request.onload = this.receiveData; }catch(error){
this.request.onreadystatechange = function()
{if(ttx.request.readyState == 4)ttx.receiveData();}}this.request.send(null);}
this.receiveData = function()
{if(ttx.request.status != 404){ttx.ttxPages[ttx.activePage].loadData(ttx.request.getResponseHeader("subpagesCount"), ttx.request.getResponseHeader("imageVersion"));ttx.checkingVersion=false;}}
this.queryUnload = function()
{this.terminate();if(this.window_type == 0)center_div.hideOverlay();return(true);}
this.maximize = function()
{this.showFullscreen();}
this.detach = function()
{this.showDetached();}
this.show = function()
{switch(this.window_type){case 0: center_div.showOverlay();this.windowObj.open(100,150,520,361);this.windowObj.hideScrollbar();this.buttonContainer = this.windowObj.domContainer.getElementsByTagName('ul')[0];this.domImage = this.windowObj.domContainer.getElementsByTagName('img')[0];this.domFullscreen = this.windowObj.domContainer.getElementsByTagName('div')[0];this.domFullscreen.parentObj = this;this.domFullscreen.title = 'Prikaži teletext preko cijelog ekrana';
this.domFullscreen.onclick = function() { this.parentObj.showFullscreen(); };
break;case 1: this.buttonContainer = document.getElementsByTagName('ul')[0];this.domImage = document.getElementsByTagName('img')[0];this.domFullscreen = document.getElementsByTagName('div')[0];this.domFullscreen.parentObj = this;this.domFullscreen.title = 'Zatvori teletext preko cijelog ekrana';
this.domFullscreen.onclick = function() { this.parentObj.terminate(); };
this.domImage.style.height = (document.body.clientHeight - 40) + 'px';break;case 2: case 3: this.buttonContainer = document.getElementsByTagName('ul')[0];this.domImage = document.getElementsByTagName('img')[0];this.domFullscreen = document.getElementsByTagName('div')[0];this.domFullscreen.title = 'Posjetite naše web stranice';
this.domFullscreen.onclick = function() { openNewWindow('http:/'+'/'+site_const.sSiteURL,site_const.sSiteTitle); };
break;}var j=0;for(var i = site_const.ttxStartPage; i <= site_const.ttxEndPage; i++, j++)this.ttxPages.push(new ttx_page_class(this, this.buttonContainer, j, i));this.setupScroll();this.ttxPages[this.activePage].activate(this.activeSubPage);}
this.setupScroll = function()
{if(this.ttxPages.length > this.scrollMaxCount){this.scrollBottom = this.scrollCount-1;var aLeft = document.createElement('a');aLeft.href = "#";aLeft.innerHTML = '&laquo;';
aLeft.onclick = function() { return(false); }
this.buttonLeft = document.createElement('li');this.buttonLeft.appendChild(aLeft);var aRight = document.createElement('a');aRight.href = "#";aRight.innerHTML = '&raquo;';
aRight.onclick = function() { return(false); }
this.buttonRight = document.createElement('li');this.buttonRight.appendChild(aRight);this.buttonLeft.ownerObj = this;this.buttonRight.ownerObj = this;var aDown = document.createElement('a');aDown.innerHTML = '&nbsp;';aDown.href = '#';this.buttonContainer.appendChild(this.buttonRight);this.buttonContainer.insertBefore(this.buttonLeft, this.buttonContainer.firstChild);
this.buttonRight.onmousedown = function() { this.ownerObj.onScrollClick(1); return(false);}
this.buttonLeft.onmousedown  = function() { this.ownerObj.onScrollClick(0); return(false);}
}else this.scrollBottom = this.ttxPages.length-1;for(var i=0; i<=this.scrollBottom; i++)this.ttxPages[i].unhide();}
this.showFullscreen = function()
{var sWinSize='';try {sWinSize = 'screenX=0,screenY=0,height='+(screen.height)+',width='+(screen.width)+',';} catch(err) {};var sDebugMode = '';if(debugMode)sDebugMode = '_debugMode';var child_prozor = window.open('/teletext/fullscreen/'+this.ttxPages[this.activePage].pageNo+'_'+(this.activeSubPage+1)+sDebugMode, '_blank', sWinSize+'fullscreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');parent.blur();child_prozor.window.focus();}
this.showDetached = function()
{var sDebugMode = '';var iWidth = 520, iHeight=390;var LeftPosition = (screen.width)?(screen.width-iWidth)/2:100;var TopPosition = (screen.height)?(screen.height-iHeight)/2:100;if(debugMode)sDebugMode = '_debugMode';var child_prozor = window.open('/teletext/detached_internal/'+this.ttxPages[this.activePage].pageNo+'_'+(this.activeSubPage+1)+sDebugMode, '_blank', 'height='+iHeight+',width='+iWidth+',fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top='+TopPosition+',left='+LeftPosition);parent.blur();child_prozor.window.focus();}
this.loadImage = function(inPageIndex, inSubpageIndex, inImageVersion)
{this.activePage    = inPageIndex;this.activeSubPage = inSubpageIndex;this.domImage.src = '/img/tx/' + this.ttxPages[inPageIndex].pageNo + '-' + (inSubpageIndex+1) + '.png?v=' + inImageVersion;if(this.refreshTimerID == null)this.refreshTimerID = window.setTimeout("ttx.refresh()", this.refreshTimeout);try {if(!debugMode && !this.checkingVersion)pageTracker._trackPageview(this.trackerURL+this.ttxPages[inPageIndex].pageNo+'_'+(inSubpageIndex+1));} catch(err) {};}
this.showLoadingImage = function(inShowPreviousImage)
{if(inShowPreviousImage)this.domImage.src = this.domImage.src;else this.domImage.src = '/img/teletext/tx_loading.gif';}
this.refresh = function()
{this.refreshTimerID = null;this.checkingVersion=true;this.loadData(this.activePage, this.activeSubPage);if(this.refreshTimerID == null)this.refreshTimerID = window.setTimeout("ttx.refresh()", this.refreshTimeout);}
this.handle_onkeydown = function(inEvent, iKeyCode)
{switch(iKeyCode){case 39: if(this.activePage+1 == this.ttxPages.length) break;this.ttxPages[this.activePage+1].activate();if(this.scrollBottom != null)if(this.scrollBottom < this.activePage)this.scrollRight();break;case 37: if(this.activePage == 0) break;this.ttxPages[this.activePage-1].activate();if(this.scrollTop != 0)if(this.scrollTop > this.activePage)this.scrollLeft();break;case 40: if(this.activeSubPage+1 == this.ttxPages[this.activePage].subpages.length) break;this.ttxPages[this.activePage].subpages[this.activeSubPage+1].handleOnClick();if(this.ttxPages[this.activePage].scrollBottom != null)if(this.ttxPages[this.activePage].scrollBottom < this.activeSubPage)this.ttxPages[this.activePage].scrollDown();break;case 38: if(this.activeSubPage == 0) break;this.ttxPages[this.activePage].subpages[this.activeSubPage-1].handleOnClick();if(this.ttxPages[this.activePage].scrollTop != 0)if(this.ttxPages[this.activePage].scrollTop > this.activeSubPage)this.ttxPages[this.activePage].scrollUp();break;}return(true);}
this.onScrollClick = function(inDirection)
{this.scrollDirection = inDirection;switch(inDirection){case(0): this.scrollLeft();break;case(1): this.scrollRight();break;}}
this.scrollRight = function()
{if(this.scrollBottom == this.ttxPages.length-1) return(false);this.ttxPages[this.scrollTop++].hide();this.ttxPages[++this.scrollBottom].unhide();return(true);}
this.scrollLeft = function()
{if(this.scrollTop == 0) return(false);this.ttxPages[--this.scrollTop].unhide();this.ttxPages[this.scrollBottom--].hide();return(true);}
this.terminate = function()
{if(this.refreshTimerID != null)window.clearTimeout(this.refreshTimerID);for(var i in this.ttxPages){this.ttxPages[i].terminate();this.ttxPages[i] = null;}eventCenter.unregister('keydown', this);this.domLoading = null;this.ttxPages = null;this.domImage = null;try { this.request.onload = null; } catch(err) {}try { this.request.onreadystatechange = null; } catch(err) {}this.request = null;this.windowObj = null;this.domFullscreen.parentObj = null;this.domFullscreen.onclick = null;this.domFullscreen = null;if(this.window_type == 1){if(opener && !opener.closed)opener.window.focus();window.close();}}}
function showTTX(inWindowType)
{if(!inWindowType) inWindowType = 0;if(ttx != null)if(ttx.domImage==null)ttx=null;else return;ttx = new ttx_class(inWindowType, site_const.ttxDefaultPage, site_const.ttxDefaultSubPage);ttx.show();}
function ttx_page_class(inParent, inDomContainer, inPageIndex, inPageNo)
{this.parent = inParent;this.pageNo = inPageNo;this.pageIndex = inPageIndex;this.domContainer = inDomContainer;switch(this.parent.window_type){case 0: this.subpageContainer = this.parent.windowObj.domContainer.getElementsByTagName('ul')[1];this.scrollMaxCount = 17;this.scrollCount = 15;this.aDown_className = 'ttx_arrow_down';this.aUp_className = 'ttx_arrow_up';break;case 1: this.subpageContainer = document.getElementsByTagName('ul')[1];this.scrollMaxCount = 16;this.scrollCount = 14;this.aDown_className = 'ttx_arrow_right';this.aUp_className = 'ttx_arrow_left';break;case 2: case 3: this.subpageContainer = document.getElementsByTagName('ul')[1];this.scrollMaxCount = 17;this.scrollCount = 15;this.aDown_className = 'ttx_arrow_down';this.aUp_className = 'ttx_arrow_up';break;}this.buttonUp = null;this.buttonDown = null;this.scrollTop = 0;this.scrollBottom = null;this.scrollDirection = 1;this.domA = document.createElement('a');this.domA.href = "#";this.domA.innerHTML = inPageNo;this.domA.parentObj = this;
this.domA.onclick = function() { this.parentObj.activate(); return(false);}
this.domLI = document.createElement('li');this.domLI.style.display = 'none';this.domLI.appendChild(this.domA);this.domContainer.appendChild(this.domLI);this.active = false;this.subpages = null;this.subpagesCount = null;this.activeSubpage = 0;this.imageVersion = null;
this.activateSubpage = function(inSubpageIndex)
{this.parent.showLoadingImage(false);this.subpages[this.activeSubpage].deactivate();this.activeSubpage = inSubpageIndex;this.parent.loadImage(this.pageIndex, this.activeSubpage, this.imageVersion, true);}
this.activate = function(inActiveSubpage)
{if(this.active) return;this.parent.showLoadingImage(false);this.subpagesCount = null;if(!inActiveSubpage)this.activeSubpage = 0;else this.activeSubpage = inActiveSubpage;this.imageVersion = null;this.parent.loadData(this.pageIndex, this.activeSubpage);this.domLI.className = 'active';this.active = true;}
this.deactivate = function()
{this.unloadSubpages();this.domLI.className = '';this.active = false;}
this.loadData = function(inSubpagesCount, inImageVersion)
{if(this.subpagesCount != inSubpagesCount){this.unloadSubpages();this.subpagesCount = inSubpagesCount;this.loadSubpages();if(this.activeSubpage == null || this.activeSubpage+1 > this.subpagesCount){this.activeSubpage = 0;this.imageVersion = null;}}this.subpages[this.activeSubpage].activate();if(this.imageVersion != inImageVersion){if(this.imageVersion != null)this.parent.showLoadingImage(true);else this.parent.showLoadingImage(false);this.imageVersion = inImageVersion;this.parent.loadImage(this.pageIndex, this.activeSubpage, this.imageVersion);}}
this.unloadSubpages = function()
{if(this.buttonUp!=null){this.buttonUp.onmousedown = null;this.buttonUp.getElementsByTagName('a')[0].onclick = null;this.buttonDown.onmousedown = null;this.buttonDown.getElementsByTagName('a')[0].onclick = null;this.buttonUp.ownerObj = null;this.buttonDown.ownerObj = null;this.subpageContainer.removeChild(this.buttonUp);this.subpageContainer.removeChild(this.buttonDown);this.buttonUp = null;this.buttonDown = null;this.scrollTop = 0;this.scrollBottom = null;this.scrollDirection = 1;}for(var i = 0 in this.subpages){this.subpages[i].terminate();this.subpages[i] = null;}this.subpages = new Array();}
this.loadSubpages = function()
{for(var i = 0; i<this.subpagesCount; i++)this.subpages.push(new ttx_subpage_class(this, this.subpageContainer, i));this.setupScroll();}
this.setupScroll = function()
{if(this.subpagesCount > this.scrollMaxCount){this.scrollBottom = this.scrollCount-1;var aUp = document.createElement('a');aUp.innerHTML = '&nbsp;';aUp.href = '#';
aUp.href.onclick = function() { return(false); }
this.buttonUp = document.createElement('li');this.buttonUp.ownerObj = this;this.buttonUp.className=this.aUp_className;this.buttonUp.appendChild(aUp);var aDown = document.createElement('a');aDown.innerHTML = '&nbsp;';aDown.href = '#';
aDown.href.onclick = function() { return(false); }
this.buttonDown = document.createElement('li');this.buttonDown.ownerObj = this;this.buttonDown.className=this.aDown_className;this.buttonDown.appendChild(aDown);this.subpageContainer.appendChild(this.buttonDown);this.subpageContainer.insertBefore(this.buttonUp, this.subpageContainer.firstChild);
this.buttonDown.onmousedown = function() { this.ownerObj.onScrollClick(1); return(false);}
this.buttonUp.onmousedown = function() { this.ownerObj.onScrollClick(0); return(false);}
}else this.scrollBottom = this.subpagesCount-1;for(var i=0; i<=this.scrollBottom; i++)this.subpages[i].unhide();}
this.scrollDown = function()
{if(this.scrollBottom == this.subpages.length-1) return(false);this.subpages[this.scrollTop++].hide();this.subpages[++this.scrollBottom].unhide();return(true);}
this.scrollUp = function()
{if(this.scrollTop == 0) return(false);this.subpages[--this.scrollTop].unhide();this.subpages[this.scrollBottom--].hide();return(true);}
this.onScrollClick = function(inDirection)
{this.scrollDirection = inDirection;switch(inDirection){case(0): this.scrollUp();break;case(1): this.scrollDown();break;}}
this.unhide = function()
{this.domLI.style.display = 'block';}
this.hide = function()
{this.domLI.style.display = 'none';}
this.terminate = function()
{if(this.active) this.unloadSubpages();this.domA.onclick = null;this.domA.parentObj = null;this.domContainer.removeChild(this.domLI);this.domContainer = null;this.domA = null;this.domLI = null;this.parent = null;this.subpages = null;}}
function ttx_subpage_class(inParent, inDomContainer, inSubpageIndex)
{this.parent = inParent;this.subpageIndex = inSubpageIndex;this.domContainer = inDomContainer;this.domA = document.createElement('a');this.domA.href = "#";this.domA.innerHTML = inSubpageIndex+1;this.domA.parentObj = this;
this.domA.onclick = function() { this.parentObj.handleOnClick(); return(false); }
this.domLI = document.createElement('li');this.domLI.className = 'ttx_subpages_inactive';this.domLI.style.display = 'none';this.domLI.appendChild(this.domA);this.domContainer.appendChild(this.domLI);this.active = false;
this.handleOnClick = function()
{if(this.active) return;this.activate();this.parent.activateSubpage(this.subpageIndex);}
this.activate = function()
{this.domLI.className = 'ttx_subpages_active';this.active = true;}
this.deactivate = function()
{this.domLI.className = 'ttx_subpages_inactive';this.active = false;}
this.hide = function()
{this.domLI.style.display = 'none';}
this.unhide = function()
{this.domLI.style.display = 'block';}
this.terminate = function()
{this.domA.onclick = null;this.domA.parentObj = null;this.domContainer.removeChild(this.domLI);this.domContainer = null;this.domA = null;this.domLI = null;this.parent = null;}}var enumMeni = {title:0, prvi_id:1, drugi_id:2, submenu:3 };var enumSport = {tip_paketa:0, naziv_sporta:1, id_sporta:2, datum:3 };var enumGrupaDogadjaja = {tip_paketa:0, naziv_grupe:1, id_grupe:2, id_seta:3, napomena:4, polje_dogadjaja:5, polje_seta_tipova:6 };var enumPonDogadjaj = {id:0, broj:1, prvi_tim:2, drugi_tim:3, vrijeme:4, min_br:5, max_br:6, min_uplata:7, max_uplata:8, kod:9 };var enumRezDogadjaj = {id:0, broj:1, prvi_tim:2, drugi_tim:3, vrijeme:4 };var enumSetTipova = {id:0, naziv:1, napomena:2, polje_varijanti:3, polje_tipova:4, polje_dogadjaj_koef:5 };var enumPoljeVarijanti = {id_varijante:0, prikazi_prvi_tim:1, prikazi_drugi_tim:2, prefix_prvog_tima:3, sufix_prvog_tima:4, delimiter:5, prefix_drugog_tima:6, sufix_drugog_tima:7 };var enumTip = {id_tip:0, naziv:1 };var enumPonDogadjajKoef = {id_dogadjaja:0, id_varijante:1, min_br:2, max_br:3, min_uplata:4, max_uplata:5, kod_specijalke:6, polje_koef:7 };var enumRezDogadjajKoef = {id_dogadjaja:0, id_varijante:1, rezultat:2, polje_koef:3 };var enumPonKoef = {id_tip:0, koef:1 };var enumRezKoef = {id_tip:0, koef:1, koeficijent_1:2, dobitni:3 };var enumTickerUzivo = {broj:0, ime:1, vrijeme:2, rezultat:3 };var enumTickerUskoro = {broj:0, ime:1, vrijeme:2 };var enumMenuItem = {title:0, page_title:1, page_type:2, rpc_data:3, submenu:4 };var enumTipPaketa = {sport:0, grupa_dogadjaja:1 };var enumSkripta = {ponuda:0, rezultati:1, loto:2 };var enumStatusBar = {idle:0, loading:1, processing:2 };var enumPageType = {ponuda:0, rezultati:1, poslovnice:2, upute:3, tjednici:4, listici:5, kontakt:6, teletext:7, naslovnica:8, pravila:9, loto_izvlacenje:10, loto_ponuda:11, loto_rezultati:12, trazilica:13, arhiva_open:14, arhiva_close:15, sms:16, statistike:17, sistemi:18, listic_tjedna:19, tjednik:20, vijest:21, proizvoljni_url:22 };var enumLoadStatus = {ready:0, loading:1, loaded:2 };var enumWinType = {overlay:0, fullscreen:1, detached:2, embedded:3 };var enumProvList = {br_list:0, br_poslovnice:1, ime_poslovnice:2, adresa_poslovnice:3, grad_poslovnice:4, datum_uplate:5, varijanta:6, tip_igre_ID:7, tip_sistema:8, koef:9, uplata:10, mt:11, ulog:12, moguci_dobitak:13, stvarni_dobitak:14, ishod_listica:15, popis_dogadjaja:16 };var enumProvListDogadjaj = {br_dogadjaja:0, oznaka_sistema:1, naziv:2, datum_i_vrijeme:3, tip:4, koef:5, ishod:6, k1:7, rezultat:8 };var enumProvList_refresh = {stvarni_dobitak:0, ishod_listica:1, popis_dogadjaja:2 };var enumProvListDogadjaj_refresh = {datum_i_vrijeme:0, ishod:1, k1:2, rezultat:3 };