function IsMSIE6older(){return(($.browser.msie)&&(navigator.appVersion.indexOf("MSIE 6.0;")>=0||navigator.appVersion.indexOf("MSIE 5.5;")>=0));}function AjaxUPbeginRequest(evt,request,settings){try{window.status=sLoadingData;$(document.body).addClass("ajaxwait");$("#pagehourglass").show();if(IsMSIE6older()){HideIframe.Apply("pagehourglass",'popupbody');}}catch(e){}}function AjaxUPendRequest(evt,request,settings){try{if(IsMSIE6older()){HideIframe.Discard("pagehourglass",'popupbody');}window.status="";$(document.body).removeClass("ajaxwait");$("#pagehourglass").hide();}catch(e){}}function IsAJAXResultOK(sResult){if(sResult==null){return false}if(sResult.indexOf("<error>")>=0){var s=sResult.replace(/<inner>/g,"").replace(/<\/inner>/g,"").replace(/<message>/g,"").replace(/<\/message>/g,"").replace(/<error>/g,"").replace(/<\/error>/g,"").replace(/\r\n\r\n/g,"\r\n").replace(/\r\n\r\n/g,"\r\n");while(s.indexOf('\r\n')==0)s=s.substr(2);alert(s);return false;}else{return true;}}function LoadRaz(){if(!oBaseParams.get_Results()){if($("#stationk")[0]){$("#stationk")[0].focus();}else if($("#stationt")[0]){$('#stationt').focus();}else if($("#cmdInfoPanel")[0]){$("#cmdInfoPanel")[0].focus();}}else{$(document).mousemove(function(event){oAdvTooltip.Position(event)});if($("#cmdGenPdftop")[0]){$("#cmdGenPdftop")[0].focus();}}}function HelpPopup(event,Anchor){var w=800;var h=700;var left=(window.screen.width-(w+60))/2;var top=(window.screen.height-(h+80))/2;var oWin=window.open(Anchor.href,"Help","height="+h+",width="+w+",left="+left+",top="+top+", location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes");oWin.focus();event.preventDefault();return false;}function ErrLoad(){var oEl=document.getElementById("CmdErrorPage");if(oEl)oEl.focus();}BaseParams=function(sAppLangDefault,bResults){var me=this;this._Lang=sAppLangDefault;this._Results=bResults;$("a.helpsell").click(function(event){HelpPopup(event,this)});$('a.setlng').click(function(event){me._setLng(event,this)});$("a.selclass").click(function(event){me.submitAnchor(event,this)});if(this.get_Results()){$("table.coachtbl tr.trimg a").click(function(event){PopupOpen(event,'coach')});}else{$("a.ico-invert").click(function(event){me._invertTrainTypes(event)});$("select.sourceselclass").change(function(event){oAjaxDiv.changeTrTypes(event,this);});$('a.btn-remove').click(function(event){me._replaceCombo(event)});$("#dtcheckbox").click(function(event){me._changeDateEnabled(event,this);})}this._razeniCookie=new Cookie(document,'Razeni',null,'/');this._razeniCookie.load();if(this._razeniCookie.pf){this._PageFlags=this._razeniCookie.pf*1;};if(this._razeniCookie.lng){this._Lang=this._razeniCookie.lng;};this._PageFlags=this._PageFlags&~1;this._storeCookie();}BaseParams.prototype={get_Lang:function(){return this._Lang;},set_Lang:function(value){this._Lang=value;this._storeCookie();},get_Results:function(){return this._Results;},set_Results:function(value){this._Results=value;},checkForm:function(){try{var sError='';if($('#stationt')[0].value==''){if($('#stationk')[0]){}else{$('#stationt')[0].focus();if(sError!=''){sError+=', ';}sError+=sNoStat;}}var bRes=false;var aoTrTypes=$("input[id*=traintypes]");for(i=0;i<aoTrTypes.length;i++){if(aoTrTypes[i].checked){bRes=true;break;}}if(!bRes){if(sError==''){aoTrTypes[0].focus();}else{sError+="\n";}sError+=sNoTrType;}if(sError==''){return true;}else{alert(sError);return false}}catch(err){alert(err);}return false;},submitAnchor:function(event,Anchor){var oCmd=$("#cmd")[0];var oP=$("#p")[0];var oForm=$("#aspnetForm")[0];if(Anchor&&oCmd&&oP&&oForm){var sUrl=Anchor.href;oCmd.value=this._getParam(sUrl,"cmd");oP.value=this._getParam(sUrl,"p");oForm.action=this._getScriptName(sUrl);oForm.submit();event.preventDefault();return false;}},_changeDateEnabled:function(event,Checkbox){var oTxt=$("#form-datet")var oDateTimeDiv=$("span.datetimediv");if(Checkbox&&oTxt[0]&&oDateTimeDiv[0]){oTxt[0].disabled=Checkbox.checked;if(Checkbox.checked){oDateTimeDiv[0].style.visibility='hidden';}else{oDateTimeDiv[0].style.visibility='visible';}}},_storeCookie:function(){this._razeniCookie.pf=this._PageFlags;this._razeniCookie.lng=this._Lang;this._razeniCookie.store();},_invertTrainTypes:function(event){try{$("input[id*=traintypes]").each(function(){this.checked=!this.checked;});}catch(err){alert(err);}event.preventDefault();return false;},_replaceCombo:function(event){var sObjectType=event.target.id.substr(0,event.target.id.length-1);$('#'+sObjectType+'k').remove();$('#'+sObjectType+'d').remove();$('#'+sObjectType+'e').remove();$('#'+sObjectType+'t').removeClass('hide');$('#'+sObjectType+'t')[0].focus();event.preventDefault();return false;},_setLng:function(event,Anchor){try{if(Anchor){var lng=this._getParam(Anchor.href,"lng");if(lng!=''){oBaseParams.set_Lang(lng);return this.submitAnchor(event,Anchor);}}}catch(err){alert(err);}},_getScriptName:function(sUrl){var aoParams=sUrl.match(new RegExp("[^/]*\.aspx","i"))if(aoParams!=null&&aoParams.length>0){return aoParams[0];}return"";},_getParam:function(sUrl,sParam){try{var aoParams=sUrl.match(new RegExp(sParam+"=[^&]*","i"))if(aoParams!=null&&aoParams.length>0){return aoParams[0].replace(new RegExp(sParam+"=","i"),"");}}catch(err){}return"";}}Cookie=function(document,name,hours,path){this._document=document;this._name=name;if(hours)this._expiration=new Date((new Date()).getTime()+hours*3600000);else this._expiration=null;if(path)this._path=path;else this._path=null;}Cookie.prototype={store:function(){var cookieval='';for(var prop in this){if((prop.charAt(0)=='_')||((typeof this[prop])=='function'))continue;if(cookieval!='')cookieval+='&';cookieval+=prop+'='+this[prop];}var cookie=this._name+'='+cookieval;if(this._expiration)cookie+='; expires='+this._expiration.toGMTString();if(this._path)cookie+='; path='+this._path;this._document.cookie=cookie;},load:function(){var allcookies=this._document.cookie;if(allcookies=='')return false;var start=allcookies.indexOf(this._name+'=');if(start==-1)return false;start+=this._name.length+1;var end=allcookies.indexOf(';',start);if(end==-1)end=allcookies.length;var cookieval=allcookies.substring(start,end);var a=cookieval.split('&');for(var i=0;i<a.length;i++){a[i]=a[i].split('=');}for(var i=0;i<a.length;i++){this[a[i][0]]=a[i][1];}return true;}}function GetKeyCodeBase(e){try{var keyCode=-1;if(window.event){if(window.event.keyCode>-1&&!window.event.ctrlKey&&!window.event.altKey)return window.event.keyCode;}keyCode=-1;if(e&&keyCode<=0){keyCode=e.charCode;if(keyCode<=0){keyCode=e.keyCode;}if(keyCode>-1&&!e.ctrlKey&&!e.altKey)return keyCode;}return-1;}catch(err){}}function PopupOpen(event,sPage){var w=700;var h=700;var sUrl="";switch(sPage){case"coach":w=1060;h=750;sUrl=event.target.parentNode.href;break;}var left=(window.screen.width-(w+60))/2;var top=(window.screen.height-(h+80))/2;var oWin=window.open(sUrl,sPage,"height="+h+",width="+w+",left="+left+",top="+top+", location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes");oWin.focus();event.preventDefault();return false;}function LoadPopupPage(){document.onkeypress=PopupKeyPress;if(typeof($)!='undefined')$("a.helpsell").click(function(event){HelpPopup(event,this)});}function PopupKeyPress(e){var keyCode;keyCode=GetKeyCodeBase(e);if(keyCode==27){WClose();return false;}return;}function WClose(){window.close();}DateTimeCal=function(){var me=this;$("input.w-inp-date").keydown(function(event){me.onDtKeydown(event)});$("#date-up").click(function(event){me.getDateCal(event,"+")});$("#date-up").dblclick(function(event){me.getDateCal(event,"+")});$("#date-down").click(function(event){me.getDateCal(event,"-")});$("#date-down").dblclick(function(event){me.getDateCal(event,"-")});}DateTimeCal.prototype={onDtKeydown:function(event){try{var ikeyCode=event.keyCode;if(ikeyCode===38){JourneyDateFore();refJourneyDate.select();event.returnValue=false;event.cancel=true;return false;}else if(ikeyCode===40){JourneyDateBack();refJourneyDate.select();event.returnValue=false;event.cancel=true;return false;}else{return true;}}catch(e){}},getDateCal:function(event,sOperation){if(sOperation=="-"){JourneyDateBack();}else{JourneyDateFore();}event.preventDefault();}}InputObject=function(objectName,platiOd,serviceUrl,itemHistoryName){this._objectName=objectName;this._platiOd=platiOd;this._serviceUrl=serviceUrl;this._itemHistoryName=itemHistoryName;this._history=null;}InputObject.prototype={_textBoxId:function(){return'#'+this._objectName+'t';},_hiddenId:function(){return'#'+this._objectName+'h';},_platiOdId:function(){return'#'+this._platiOd+'h';},init:function(){this._initAutocomplete();},_initAutocomplete:function(){var me=this;var options={selectFirst:false,dataType:"json",max:20,delay:200,scroll:false,matchSubset:false,highlight:false,cacheLength:0,extraParams:{platiod:function(){if($(me._platiOdId()).size()==0){return"";}return $(me._platiOdId()).val();}},formatItem:function(data,i,max,value,term){return data.text;},parse:function(data){var array=new Array();if(data.d){for(var i=0;i<data.d.length;i++){array[array.length]={data:data.d[i],value:data.d[i].text,result:data.d[i].text};}}return array;},getEmptySelectionData:function(){if(this._history){return this._history;}var cookie=new Cookie(document,'RazeniHistory'+me._itemHistoryName,null,null);cookie.load();this._history=[];for(i=1;i<=6;i++){var item=decodeURIComponent(eval("cookie.o"+i));if(item!=undefined&&item!="undefined"){this._history[i-1]={data:{text:item},value:item,result:item};}}return this._history;}}$(this._textBoxId()).autocomplete(this._serviceUrl,options);$(this._textBoxId()).result(function(event,data,formatted){$(me._hiddenId()).val(data.value);});}}AjaxDiv=function(){this._aoBalloonCache=new Array();this._sActDiv="";this._sBalloonDiv="balloondiv";this._position={x:0,y:0};this._bodyposition={top:0,down:0,left:0,right:0};var me=this;$(document.body).click(function(event){me._bodyClick(event)});$(document).keydown(function(event){me._keyDown(event)});$("a.btn-help").click(function(event){me._showHideDiv(event)});$("a.fixedclass").click(function(event){me._showHideFixedDiv(event)});}AjaxDiv.prototype={_showHideDiv:function(event){try{var sCmd=event.target.id;var oEl1=$("#"+this._sBalloonDiv)[0];if(oEl1){if(sCmd!=this._sActDiv){this._sActDiv=sCmd;this._setItemPosition(event.target);this._doDivAjax(oEl1.id,sCmd,'');}else{this._hideDiv();}}}catch(err){}event.preventDefault();return false;},_showHideFixedDiv:function(event){try{var sCmd="fixlink";var oEl1=$("#"+this._sBalloonDiv)[0];if(oEl1){if(sCmd!=this._sActDiv){this._sActDiv=sCmd;this._setItemPosition(event.target);if(this._aoBalloonCache['fixlink']){if(this._aoBalloonCache['fixlink'].indexOf('##fixlink##')>-1){var sHref=$(event.target).parent(".fixedclass")[0].href;this._aoBalloonCache['fixlink']=this._aoBalloonCache['fixlink'].replace('##fixlink##',sHref).replace('##fixlink##',sHref);}this._ajaxDivReplace(this._sBalloonDiv,this._aoBalloonCache['fixlink']);}else{return true;}}else{this._hideDiv();}}}catch(err){}event.preventDefault();return false;},_setItemPosition:function(oEl){this._position=this._itemToMotherInPos(oEl,'mother-inner');this._itemToBody(oEl,'mainbody');},_itemToMotherInPos:function(oEl,sToID){if(oEl){return this._getAbsolutePos(oEl,sToID);}else{return{x:0,y:0};}},_itemToBody:function(oEl,sToID){if(oEl){var pos=this._getAbsolutePos(oEl,sToID);var scroll=this._getScrollXY();this._bodyposition.top=pos.y-scroll.y;this._bodyposition.down=this._getBody().clientHeight-this._bodyposition.top;this._bodyposition.left=pos.x-scroll.x;this._bodyposition.right=this._getBody().clientWidth-this._bodyposition.left;}else{this._bodyposition.left=0;this._bodyposition.top=0;this._bodyposition.right=0;this._bodyposition.bottom=0;}},_getBody:function(){if(document.compatMode&&document.compatMode!="BackCompat"){return document.documentElement;}else{return document.body;}},_getScrollXY:function(){var iX=0;var iY=0;if(typeof(window.pageYOffset)=='number'){iY=window.pageYOffset;iX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){iY=document.body.scrollTop;iX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){iY=document.documentElement.scrollTop;iX=document.documentElement.scrollLeft;}return{x:iX,y:iY};},changeTrTypes:function(event,oSelect){try{var sUnchecked='';var aoArray=$("input[id*=traintypes]");for(i=0;i<aoArray.length;i++){if(!aoArray[i].checked){if(sUnchecked!='')sUnchecked+=',';sUnchecked+=aoArray[i].value;}}var sKey="trtype"+oSelect.value;AjaxUPbeginRequest();var me=this;$.ajax({dataType:'json',url:'AJAXService.svc/GetTrTypes',timeout:3*1000,data:{iLang:oBaseParams.get_Lang(),sPlatiOd:oSelect.value,sUnchecked:sUnchecked},success:function(data){me._onAjaxDivComplete(data.d,me._getObjectParams(oSelect.id,sKey,true),'GetTrTypes');},error:function(xhr,status,exception){me._onAjaxDivFailed(xhr,status,exception);}});}catch(e){}},_getAbsolutePos:function(el,sStopID){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent&&el.offsetParent.id!=sStopID){var tmp=this._getAbsolutePos(el.offsetParent,sStopID);r.x+=tmp.x;r.y+=tmp.y;}return r;},_bodyClick:function(event){try{if(event.target.id.indexOf(this._sBalloonDiv)==-1&&!$(event.target).hasClass("btn-help")&&$(event.target).parent(".fixedclass").length==0){this._hideDiv();}}catch(err){alert(err);}},_keyDown:function(event){if(event.keyCode==27){this._hideDiv();}if(oBaseParams.get_Results()){if(this._isMetaKey(event))return true;switch(event.keyCode){case 90:case 122:if($("a.changeclass")[0])oBaseParams.submitAnchor(event,$("a.changeclass")[0]);return false;break;case 79:case 111:if($("a.newclass")[0])oBaseParams.submitAnchor(event,$("a.newclass")[0]);return false;break;}}},_isMetaKey:function(e){try{if(window.event){if(window.event.metaKey)return true;}if(e){if(e.metaKey)return true;}}catch(err){}return false;},_hideDiv:function(){$("#"+this._sBalloonDiv).hide();this._sActDiv="";if(IsMSIE6older()){HideIframe.Discard(this._sBalloonDiv,'mother-inner');}},_doDivAjax:function(control,sCmd,params){var me=this;var sKey=sCmd+params;if(this._aoBalloonCache[sKey]){this._onAjaxDivComplete(this._aoBalloonCache[sKey],this._getObjectParams(control,sKey,false),'GetDiv');}else{AjaxUPbeginRequest();$.ajax({dataType:'json',url:'AJAXService.svc/GetDiv',timeout:3*1000,data:{iLang:oBaseParams.get_Lang(),sControl:control,sCmd:sCmd,sParam:''},success:function(data){me._onAjaxDivComplete(data.d,me._getObjectParams(control,sKey,true),'GetDiv');},error:function(xhr,status,exception){me._onAjaxDivFailed(xhr,status,exception);}});}},_getObjectParams:function(sControl,sKey,bIsPostback){var aoArray=new Array();aoArray['control']=sControl;aoArray['key']=sKey;aoArray['postback']=bIsPostback;return aoArray;},_onAjaxDivComplete:function(result,aoParams,methodName){try{if(aoParams['postback']==true){AjaxUPendRequest();}if(IsAJAXResultOK(result)){switch(methodName){case"GetDiv":try{if(aoParams['postback']==true&&result!=''&&aoParams['key']!=''){this._aoBalloonCache[aoParams['key']]=result;}if(aoParams['control']!='')this._ajaxDivReplace(aoParams['control'],result);}catch(err){}break;case"GetTrTypes":try{if(aoParams['control']!='')this._ajaxTrTypeReplace(aoParams['control'],result);}catch(err){}break;}}}catch(err){alert(err);}},_ajaxDivReplace:function(sId,sResult){if(sId==this._sBalloonDiv){var oNewElemContainer=$("<div></div>")[0];var oOldNode=$("#"+sId)[0];if(oOldNode){oNewElemContainer.innerHTML=sResult;$(oNewElemContainer.childNodes[0]).show();oOldNode.parentNode.replaceChild(oNewElemContainer.childNodes[0],oOldNode);oOldNode=document.getElementById(sId);if(oOldNode){this._setDivPosition(oOldNode)}}if(IsMSIE6older()){HideIframe.Apply(this._sBalloonDiv,'mother-inner');}oDragDrop.StartDragElAjax($("#"+this._sBalloonDiv)[0]);var me=this;$("a.btn-delete").click(function(event){me._hideDiv(event);event.preventDefault();return false;});}},_setDivPosition:function(oEl){var iShiftLeft=50;var iDownAux=0;var iLeft=0;if(this._sActDiv=='fixlink'){iDownAux=28;iLeft=10;}else{iDownAux=20;if(iShiftLeft>this._bodyposition.left){iLeft=this._position.x-this._bodyposition.left;}else{var iDiffX=this._bodyposition.left-this._position.x;iLeft=this._position.x-iShiftLeft;var iDiffXLeft=iDiffX+iLeft;if((iDiffXLeft+oEl.offsetWidth)>=this._getBody().clientWidth){var bOK=false;while(iDiffXLeft>0&&!bOK){iDiffXLeft-=1;if((iDiffXLeft+oEl.offsetWidth)<this._getBody().clientWidth){bOK=true;}}if(IsMSIE6older()){iDiffXLeft-=20;}if(iDiffXLeft<0){iDiffXLeft=0;}iLeft=(iDiffXLeft-iDiffX);}}}oEl.style.left=iLeft+"px";var iTopAux=5;if(this._bodyposition.down>0&&this._bodyposition.down<(oEl.offsetHeight+iDownAux)&&this._bodyposition.top>0&&this._bodyposition.top>=(oEl.offsetHeight-iTopAux)){oEl.style.top=(this._position.y-oEl.offsetHeight-iTopAux)+"px";}else{oEl.style.top=(this._position.y+iDownAux)+"px";}},_ajaxTrTypeReplace:function(sId,sResult){var oNewElemContainer=$("<div></div>")[0];var oOldNode=$("div.trains-box")[0];if(oOldNode){eval(sResult);oNewElemContainer.innerHTML=sHtml;oOldNode.parentNode.replaceChild(oNewElemContainer.childNodes[0],oOldNode);oOldNode=$("div.trains-box")[0];this._addHlpClick();}},_addHlpClick:function(){var me=this;$("a.btn-help").unbind('click');$("a.btn-help").click(function(event){me._showHideDiv(event)});},_onAjaxDivFailed:function(xhr,status,exception){try{AjaxUPendRequest();if(xhr.status==0){return;}if(status=='timeout'){alert(sTimeOut);}else{alert(sNoData1+xhr.StatusText+sNoData2+xhr.status+")");}}catch(err){}}}function AjaxDefaultSettings(){return{contentType:"application/json; charset=utf-8",dataType:'json',error:function(xhr,status,exception){oAjaxDiv._onAjaxDivFailed(xhr,status,exception);}}}DragDrop=function(){this._dragobj=null;}DragDrop.prototype={StartDragElAjax:function(oEl){oEl1=document.getElementById("lista_"+oEl.id);if(oEl!=null){oEl.ondragdrop=function(posunx,posuny){this.style.left=(this.left+posunx)+"px";this.style.top=(this.top+posuny)+"px";}this._startDrag(oEl,oEl1,1);}},_startDrag:function(what,oEl1){var me=this;$(oEl1).mousedown(function(event){me._m_down(event,what);});},_m_down:function(event,object){var me=this;this._dragobj=object;this._dragobj.style.zIndex="100";if(!this._dragobj.style.left)this._dragobj.style.left=this._dragobj.offsetLeft;if(!this._dragobj.style.top)this._dragobj.style.top=this._dragobj.offsetTop;this._dragobj.clickX=event.clientX;this._dragobj.clickY=event.clientY;this._dragobj.left=parseInt(this._dragobj.offsetLeft);this._dragobj.top=parseInt(this._dragobj.offsetTop);$(document).mousemove(function(event){me._m_move(event)});$(document).mouseup(function(event){me._m_up(event)});event.preventDefault();return false;},_m_move:function(event){this._dragobj.ondragdrop(event.clientX-this._dragobj.clickX,event.clientY-this._dragobj.clickY,event);event.preventDefault();return false;},_m_up:function(event){var me=this;$(document).unbind('mousemove');$(document).unbind('mouseup');if(oBaseParams.get_Results())$(document).mousemove(function(event){oAdvTooltip.Position(event)});if(this._dragobj.ondragend)this._dragobj.ondragend(event);if($.browser.msie){if(this._dragobj.ondragend)this._dragobj.ondragend(event);oEl1=$("#WCHhider"+this._dragobj.id)[0];if(oEl1!=null){oEl1.style.left=this._dragobj.style.left;oEl1.style.top=this._dragobj.style.top;oEl1.style.width=this._dragobj.offsetWidth+"px";oEl1.style.height=this._dragobj.offsetHeight+"px";}}event.preventDefault();return false;}}var HideIframe_Constructor=function(){if(!(document.all&&document.getElementById&&!window.opera&&navigator.userAgent.toLowerCase().indexOf("mac")==-1)){this.Apply=function(){};this.Discard=function(){};return;}var _bIE55=false;var _bIE6=false;var _oRule=null;var _bSetup=true;var _oSelf=this;this.Apply=function(vLayer,vContainer,bResize){if(_bSetup)_Setup();if(_bIE55&&(oIframe=_Hider(vLayer,vContainer,bResize))){oIframe.style.visibility="visible";}else if(_oRule!=null){_oRule.style.visibility="hidden";}};this.Discard=function(vLayer,vContainer){if(_bIE55&&(oIframe=_Hider(vLayer,vContainer,false))){oIframe.style.visibility="hidden";}else if(_oRule!=null){_oRule.style.visibility="visible";}};function _Hider(vLayer,vContainer,bResize){var oLayer=_GetObj(vLayer);var oContainer=((oTmp=_GetObj(vContainer))?oTmp:document.getElementsByTagName("body")[0]);if(!oLayer||!oContainer)return;if(oLayer.id=="")oLayer.id="WCHid"+(new Date()).getTime();var oIframe=document.getElementById("WCHhider"+oLayer.id);if(!oIframe){var sFilter=(_bIE6)?"filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);":"";var zIndex=oLayer.style.zIndex;if(zIndex=="")zIndex=oLayer.currentStyle.zIndex;zIndex=parseInt(zIndex);if(isNaN(zIndex))return null;if(zIndex<2)return null;zIndex--;var sHiderID="WCHhider"+oLayer.id;oContainer.insertAdjacentHTML("BeforeEnd",'<iframe class="WCHiframe" src="javascript:false;" id="'+sHiderID+'" scroll="no" frameborder="0" style="position:absolute;visibility:hidden;'+sFilter+'border:0;top:0;left;0;width:0;height:0;background-color:#ccc;z-index:'+zIndex+';"></iframe>');oIframe=document.getElementById(sHiderID);_SetPos(oIframe,oLayer);}else if(bResize){_SetPos(oIframe,oLayer);}return oIframe;};function _SetPos(oIframe,oLayer){oIframe.style.width=oLayer.offsetWidth+"px";oIframe.style.height=oLayer.offsetHeight+"px";oIframe.style.left=oLayer.offsetLeft+"px";oIframe.style.top=oLayer.offsetTop+"px";};function _GetObj(vObj){var oObj=null;switch(typeof(vObj)){case"object":oObj=vObj;break;case"string":oObj=document.getElementById(vObj);break;}return oObj;};function _Setup(){_bIE55=(typeof(document.body.contentEditable)!="undefined");_bIE6=(typeof(document.compatMode)!="undefined");if(!_bIE55){if(document.styleSheets.length==0)document.createStyleSheet();var oSheet=document.styleSheets[0];oSheet.addRule(".WCHhider","visibility:visible");_oRule=oSheet.rules(oSheet.rules.length-1);}_bSetup=false;};};var HideIframe=new HideIframe_Constructor();function STp(iID){if(typeof oAdvTooltip=='object'){return oAdvTooltip.delayShowTip(iID);}}function HTp(){if(typeof oAdvTooltip=='object'){return oAdvTooltip.HideTip();}}AdvancedToolTip=function(aoItems){this._offsetxpoint=-3;this._offsetypoint=25;this._tipobj=$('#advtooltip')[0];this._showTip=false;this._ns6=document.getElementById&&!document.all;this._aoAdvTitleItem=aoItems;this._delayID=-1;this._delayEvent=null;this._delay=null;}AdvancedToolTip.prototype={Position:function(e){if(this._showTip){var curX=(this._ns6)?e.pageX:e.clientX+this._getBody().scrollLeft;var curY=(this._ns6)?e.pageY:e.clientY+this._getBody().scrollTop;var rightedge=document.all&&!window.opera?this._getBody().clientWidth-e.clientX-this._offsetxpoint:window.innerWidth-e.clientX-this._offsetxpoint-20;var bottomedge=document.all&&!window.opera?this._getBody().clientHeight-e.clientY-this._offsetypoint:window.innerHeight-e.clientY-this._offsetypoint-20;var leftedge=(this._offsetxpoint<0)?this._offsetxpoint*(-1):-1000;if(rightedge<this._tipobj.offsetWidth){this._tipobj.style.left=document.all?this._getBody().scrollLeft+e.clientX-this._tipobj.offsetWidth+"px":window.pageXOffset+e.clientX-this._tipobj.offsetWidth+"px"}else if(curX<leftedge){this._tipobj.style.left="5px";}else{this._tipobj.style.left=curX+this._offsetxpoint+"px";}if(bottomedge<this._tipobj.offsetHeight){this._tipobj.style.top=document.all?this._getBody().scrollTop+e.clientY-this._tipobj.offsetHeight-this._offsetypoint+"px":window.pageYOffset+e.clientY-this._tipobj.offsetHeight-this._offsetypoint+"px";}else{this._tipobj.style.top=curY+this._offsetypoint+"px";}this._tipobj.style.visibility="visible";}else if(this._delayEvent){this._delayEvent.pageX=e.pageX;this._delayEvent.pageY=e.pageY;this._delayEvent.clientX=e.clientX;this._delayEvent.clientY=e.clientY;}},delayShowTip:function(iID){this._delayID=iID;this._delayEvent=new ATIEvent;setTimeout("oAdvTooltip.ShowTip("+iID+")",500);},ShowTip:function(iID){if(iID==this._delayID&&this._delayEvent&&this._delayEvent.pageX>-1){if(this._ns6||document.all){this._tipobj.innerHTML=this._aoAdvTitleItem[iID].Show();this._showTip=true;this.Position(this._delayEvent);return false;}}},HideTip:function(){if(this._ns6||document.all){clearTimeout(this._delay);this._showTip=false;this._tipobj.style.visibility="hidden";this._tipobj.style.left="-500px";this._delayID=-1;this._delayEvent=null;}},_getBody:function(){if(document.compatMode&&document.compatMode!="BackCompat"){return document.documentElement;}else{return document.body;}}}ATI=function(sInfo,sDruh){this._sInfo=sInfo;this._sDruh=sDruh;}ATI.prototype={Show:function(){var sText='';if(this._sInfo!=''){sText+='<div class="advtiphead"><h2>Řada: '+this._sDruh+'</h2></div>';}if(this._sDruh!=''){sText+='<div class="advtipbody">'+this._sInfo+'</div>';}sText+='<div class="advtipclick">Kliknutím zobrazíte detail vozu.</div>';return sText;}}ATIEvent=function(){this.pageX=-1;this.pageY=0;this.clientX=0;this.clientY=0;}