var bIsMobil = false; RapidPAGE.showOn = function(sDiv, sTarget) { if((typeof(sDiv) != 'undefined')&&(typeof(sTarget) != 'undefined')) { try { var iHeightPx = 0; if((iHeightPx = Math.max(E(sTarget).getHeight(),E(sDiv).getHeight())) > 0) { E(sDiv).setHeight(iHeightPx); E(sTarget).setHeight(iHeightPx); } } catch(e) { } E(sDiv).show(); return true; } return false; }; RapidPAGE.blink = function(sElements, iRepeat, iSpeed) { $(sElements).each(function(iInx) { $(this).toggleClass('blink'); }); if((iSpeed > 0)&&((iRepeat-1 > 0)||(iRepeat == -1))) { setTimeout(function () { RapidPAGE.blink(sElements, (iRepeat == -1) ? -1:iRepeat - .5, iSpeed); }, iSpeed); } }; RapidPAGE.updateDynamic = function() { // Hier sollen die JQuery Updates rein if(!bIsMobil) { // $("[data-toggle='tooltip']").tooltip(); $("[data-toggle='tooltip']").each(function() { var sTitle = null; if((sTitle = $(this).attr('data-original-title'))&&(!$(this).attr('title'))&&(sTitle.length > 0)) { $(this).attr('title', sTitle); } }); } else { // $("[data-toggle='tooltip']").tooltip('destroy'); } $(window).resize(function() { $('.preis_leistung').hide(); RapidPAGE.updateMerchandising(); }); $(".masonry-wrapper").masonry({ itemSelector: '.item' }); if(typeof(RC_ScreenShot) != 'undefined') { $('div.VideoImage, div.kachel_sedcard_video').each(function() { if(typeof($(this).attr('data-loaded')) == 'undefined') { RC_ScreenShot.createScreenShotInstance(this); $(this).attr('data-loaded', true); } }); } return true; }; RapidPAGE.updateMerchandising = function(aArguments) { $('.merchandising').each(function(){ var sDiv = null; var iCodeId = 0; if(($(this).css('display') !== 'none')&&(sDiv = $(this).attr('id'))&&(iCodeId = $(this).attr('data-merchandising'))&&(iCodeId > 0)&&($(this).attr('data-merchandising', 0))) { var aArgs = (typeof(aArguments) != 'undefined') ? aArguments:{}; aArgs.codeId = iCodeId; X(sDiv).loadOnce('merchandising_ajax.html', { method: 'POST', scriptsfirst: false, globaleval: false, arguments: aArgs, onFinish: function(pAjax) { if(((sText = pAjax.getResponseText()) != null)&&(sText.length > 0)) { E(sDiv).setText(sText); } } }); } }); }; function redirectTo(sLocation, bNewWindow) { if(typeof(sLocation) != 'undefined') { try { if(!window.location.href.match(/.*-([0-9{1}]+)\.html/)) { C().setCookie('HTTP_REFERER', window.location.href, 60); } } catch(e) { } if((typeof(bNewWindow) != 'undefined')&&(bNewWindow == true)) { window.open(sLocation); return true; } window.location.href = sLocation; return true; } return false; } function layerConfirm(pArguments) { return RapidPAGE.showLayer('layer_confirm.html', pArguments); } function layerPrompt(pArguments) { return RapidPAGE.showLayer('layer_prompt.html', pArguments); } function fadeoutAndDestroy(sFade, sElement) { if(typeof(sElement) == 'undefined') { sFade = sElement; } $('#'+sFade).fadeOut(300, function() { $('#'+sElement).remove(); }); } function scrollToAnger(sAnger, bAnimate) { try { if(typeof(sAnger) != 'undefined') { if((pPageContent = E(sAnger).get()) != null) { if((typeof(bAnimate) == 'undefined')||(bAnimate == false)) { if((sAnger == 'searchForm')&&($('#mobil_head').is(':visible'))) { var pOffset = $('#'+sAnger).offset(); $(window).scrollTop(pOffset.top - $('#mobil_head').height()); } else { pPageContent.scrollIntoView(true); } return true; } var iScrollPosX = W().getScrollPositionX(); var iScrollPosY = W().getScrollPositionY(); var pOffset = E(pPageContent).getCumulativeOffset(); if(Math.abs(iScrollPosY - pOffset.top) >= 80) { var iScrollToPosY = pOffset.top - 30; var pTweener = new RapidTWEENER({ from: iScrollPosY, to: iScrollToPosY, tweentype: 'over', delay: 20, onTween: function(iValue) { W().scrollToPosition(iScrollPosX, iValue - 30); } }); return pTweener.start(); } } } return false; } catch(e) { return false; } } function showWait(sParentID) { if(typeof sParentID == 'undefined') { sParentID = 'content_middle'; } var pPosition = null; if((pPosition = E(sParentID).getCumulativeOffset(null,null)) != null) { E('pleaseWait').setPos(pPosition.left, pPosition.top); E('pleaseWait').setSize(E(sParentID).getWidth(), E(sParentID).getHeight()); } else { E('pleaseWait').maximize(); } $('#pleaseWait').css('padding-top', Math.ceil((E(sParentID).getHeight() - E('pleaseWaitText').getHeight()) / 2)); return E('pleaseWait').show(); } function hideWait() { E('pleaseWait').hide(); } function setSuchergebnisMessage(sMessage, sTitle) { try { var sTemp = null; var sOriginalMessage = null; if(sTemp = $('#suchergebnis_message').attr('data-message')) { sOriginalMessage = sTemp; } else { $('#suchergebnis_message').attr('data-message', sOriginalMessage = $('#suchergebnis_message').html()); } var sOriginalTitle = null; if(sTemp = $('#suchergebnis_title').attr('data-message')) { sOriginalTitle = sTemp; } else { $('#suchergebnis_title').attr('data-message', sOriginalTitle = $('#suchergebnis_title').html()); } E('suchergebnis_message').setText(((typeof(sMessage) == 'undefined')||(sMessage == null)) ? sOriginalMessage:sMessage); E('suchergebnis_title').setText(((typeof(sTitle) == 'undefined')||(sTitle == null)) ? sOriginalTitle :sTitle); } catch(e) {} } function sendCommand(sUrl, aArguments, onFinish) { if(typeof(sUrl) != 'undefined') { var aArgs = (typeof(aArguments) != 'undefined') ? aArguments:{}; var sDiv = (typeof(aArgs.div) != 'undefined') ? aArgs.div:'commandDiv'; var bAsyncron = (typeof(aArgs.asyncron) != 'undefined') ? aArgs.asyncron:false; return X(sDiv).loadOnce(sUrl.toString(), { method: 'POST', scriptsfirst: false, globaleval: true, asyncron: bAsyncron, arguments: aArgs, onFinish: function(pAjax) { if(((sText = pAjax.getResponseText()) != null)&&(sText.length > 0)) { E(sDiv).setText(sText); } if(typeof(onFinish) == 'function') { onFinish(); } } }); } return false; } function openPopup(sUrl, sTitle, iWidth, iHeight) { if(typeof(iWidth) == 'undefined') { iWidth = 680; } if(typeof(iHeight) == 'undefined') { iHeight = 800; } var pWindow = window.open(sUrl, sTitle, "width="+iWidth+",height="+iHeight+",status=yes,scrollbars=yes,resizable=yes"); pWindow.focus(); } function sortVIPGirls(sContainer, sElementClass, sElementInfoClass) { try { var pContainer = null; if((typeof(sContainer) != 'undefined')&&(typeof(sElementClass) != 'undefined')&&((pContainer = E(sContainer).get()) != null)) { var pElements = null; if(((pElements = pContainer.getElementsByClassName(sElementClass)) != null)&&(pElements.length > 0)) { var iSeconds = Math.floor(Date.now()/1000); // Sortieren der Unterelemente/Girls nach dem Timestamp //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// for(var m = pElements.length - 1,c=0; m>0; m--) { for(var n=0; n 0)) { for(var m = 0; m 0) ? getMinutenText(Math.floor((iSeconds - pValue1)/60)):''); } } } return true; } return false; } catch(e) { return false; } } function getMinutenText(iMinutes) { var sHTML = ""; if(iMinutes >= 1440) { // Nicht erreichbar wenn länger von 6h letzte SMS return null; } if(iMinutes < 1) { return 'weniger als 1 Minute'; } if(iMinutes > 1440) { var iTagen = Math.floor(iMinutes/1440); iMinutes -= iTagen*1440; sHTML += ' '+iTagen+' '+((iTagen > 1) ? 'Tagen':'Tag'); } if(iMinutes > 60) { var iStunden = Math.floor(iMinutes/60); iMinutes -= iStunden*60; sHTML += ' '+iStunden+' '+((iStunden > 1) ? 'Stunden':'Stunde'); } if(iMinutes > 0) { sHTML += ' '+iMinutes+' '+((iMinutes > 1) ? 'Minuten':'Minute'); } return ((sHTML = sHTML.trim())&&(sHTML.length > 0)) ? 'vor'+' '+sHTML:''; } function playAccountGallery(iGalerieId, iAccountId, onFinish) { if((typeof(iGalerieId) == 'undefined')||(iGalerieId <= 0)||(typeof(iAccountId) == 'undefined')||(iAccountId <= 0)) { alert('Cant play gallery '+iGalerieId+'from account '+iAccountId); return false; } if(typeof(PhotoSwipe) == 'undefined') { alert('PhotoSwipe not loaded and undefined'); return false; } var pArguments = { galerieId: iGalerieId, accountId: iAccountId }; return RapidPAGE.sendCommand('layer_galerie.html', 'galleryPlayer', pArguments, 'get', function() { if(typeof(onFinish) == 'function') { onFinish(); } }); } function playSedcardGallery(iGalerieId, bPreview, onFinish) { if((typeof(iGalerieId) == 'undefined')||(iGalerieId <= 0)) { alert('Cant play gallery '+iGalerieId); return false; } if(typeof(PhotoSwipe) == 'undefined') { alert('PhotoSwipe not loaded and undefined'); return false; } bPreview = (typeof(bPreview) == 'undefined') ? false:bPreview; var pArguments = { galerieId: iGalerieId, bPreviewMode: bPreview ? 'true':'false' }; return RapidPAGE.sendCommand('layer_galerie.html', 'galleryPlayer', pArguments, 'get', function() { if(typeof(onFinish) == 'function') { onFinish(); } }); } function playVideo(iVideoId, bPreview, onFinish) { if((typeof(iVideoId) == 'undefined')||(iVideoId <= 0)) { alert('Cant play video '+iVideoId); return false; } if(typeof(RC_Player) == 'undefined') { alert('rc player not loaded and undefined'); return false; } bPreview = (typeof(bPreview) == 'undefined') ? false:bPreview if($('#videoPlayer').is(':visible')) { return hideVideo(function() { playVideo(iVideoId, bPreview, onFinish); }); } var pArguments = { videoId: iVideoId, sInstance: 'LayerVideoPlayer'+iVideoId, bPreviewMode: bPreview ? 'true':'false' }; return RapidPAGE.sendCommand('layer_video.html', 'videoPlayerPlayer', pArguments, 'get', function() { $('#videoPlayer').show(0, function() { if(typeof(onFinish) == 'function') { onFinish(); } }); }); } function hideVideo(onFinish) { if($('#videoPlayer').is(':visible')) { $('#videoPlayer').hide(0, function() { var sInstance = null; if(sInstance = $('#videoPlayer').attr('data-player-instance')) { var pInstance = null; if(pInstance = RC_Player.getInstanceById(sInstance)) { try { pInstance.stop(); pInstance.destroy(); } catch(pException) { // console.log(pException); } } $('#videoPlayer').removeAttr('data-player-instance'); } if(typeof(onFinish) == 'function') { onFinish(); } // $('#videoPlayerPlayer').html(''); }); } } function installVideo(sID, bVIP, bFsk18, onFinish) { var pContainer = null; var sInstance = null; if((typeof(pContainer = document.getElementById(sID)) !== 'undefined')&&(sInstance = RC_Player.createPlayerInstance(pContainer))) { if((pInstance = RC_Player.getInstanceById(sInstance))&&($('#videoPlayer').attr('data-player-instance', sInstance))) { var bTouch = ('ontouchstart' in document.documentElement); var bFullscreen = ((bTouch)||($(document).width() <= 768)) ? true:false; // Fullscreen wenn Touch device oder kleines Device if(bFullscreen) { $('#videoPlayer').off('click'); pInstance.addEventListener('Ready', function() { try { pInstance.enterFullscreen(); } catch (pException) { } }); pInstance.addEventListener('ExitedFullScreen', function() { hideVideo(); }); } else { $('#videoPlayer').on('click', function() { hideVideo(); }); } pInstance.addEventListener('Done', function() { hideVideo(); }); if((bVIP !== true)&&(20 > 0)) { // ... nach > 10 Sekunden immer stoppen ... pInstance.addEventListener('TimeUpdate', function() { if(pInstance.currentTime > 20) { hideVideo(function() { RapidPAGE.showLayer('layer_update_vip.html'); }) } }); return true; } if(typeof(onFinish) == 'function') { onFinish(); } return true; } } return false; } function installLazyWindowUserAjaxRequest(sContainerId, aArguments, onFinish, iOffsetOptional, iLimitOptional) { var iOffset = parseInt(typeof(iOffsetOptional) == 'undefined' ? 0:iOffsetOptional); var iLimit = parseInt(typeof(iLimitOptional) == 'undefined' ? 48:iLimitOptional); var pContainer = $('#'+sContainerId); if((typeof(aArguments) !== 'object')||(aArguments === null)) { aArguments = {}; } if(typeof(pContainer) == 'undefined') { return false; } if((typeof(pContainer.attr('data-lazy-state')) == 'undefined')) { pContainer.attr('data-lazy-state', 'running'); pContainer.attr('data-lazy-error', 0); pContainer.attr('data-lazy-offset', iOffset); pContainer.attr('data-lazy-limit', iLimit); pContainer.find('.moreLazy').remove(); $(window).on('scroll resize orientationchange', function(pEvent) { var pContainer = $('#'+sContainerId); var iHeight = $(this).scrollTop() + $(this).height(); var iBottom = pContainer.offset().top + pContainer.height(); if(iBottom < iHeight + ($(this).height()/2)) { switch(pContainer.attr('data-lazy-state')) { case 'running': return installLazyWindowUserAjaxRequest(sContainerId, aArguments, onFinish, iOffsetOptional, iLimitOptional); } } }); } else { iOffset = parseInt(pContainer.attr('data-lazy-offset')); iLimit = parseInt(pContainer.attr('data-lazy-limit')); } if($('#'+sContainerId).attr('data-lazy-state', 'locked')) { aArguments.offset = iOffset; aArguments.limit = iLimit; return X(sContainerId).loadOnce(location.href, { method: 'post', scriptsfirst: false, globaleval: true, asyncron: false, arguments: aArguments, onPrepare: function(pAjax) { }, onFailed: function(pAjax) { var pContainer = $('#'+sContainerId); var iError = $('#'+sContainerId).attr('data-lazy-error'); if(((typeof(iError) == 'undefine')||(iError < 5))&&(pContainer.attr('data-lazy-error', iError + 1))) { setTimeout(function() { installLazyWindowUserAjaxRequest(sContainerId, aArguments, onFinish, iOffsetOptional, iLimitOptional); }, 250); } }, onFinish: function(pAjax) { var pContainer = $('#'+sContainerId); if(((sText = pAjax.getResponseText()) != null)&&(sText.length > 0)) { pContainer.append(sText); pContainer.attr('data-lazy-offset', iOffset + iLimit); pContainer.attr('data-lazy-error', 0); pContainer.attr('data-lazy-state', 'running'); if(typeof(onFinish) == 'function') { onFinish(); } if($(window).height() > pContainer.height()) { setTimeout(function() { installLazyWindowUserAjaxRequest(sContainerId, aArguments, null, iOffsetOptional, iLimitOptional); }, 50); } } else { pContainer.attr('data-lazy-state', 'stopped'); } } }); } return false; }; function installSortable(sContainerDiv, sUrl, sCommandDiv, pArguments, sSortHandle, sPlaceHolder, onStart, onFinish) { if((typeof(sContainerDiv) == 'undefined')||(typeof(sUrl) == 'undefined')||(typeof(sCommandDiv) == 'undefined')) { return false; } try { $('#' + sContainerDiv).sortable({ opacity: 0.8, cursor: 'move', helper: 'clone', cancel: '.TeasUpload', scroll: true, scrollSensitivity: 250, scrollSpeed: 10, handle: (typeof(sSortHandle) == 'undefined') ? '.sortHandle':'.'+sSortHandle, placeholder: (typeof(sPlaceHolder) == 'undefined') ? 'col-md-3 col-sm-6 col-xs-12 TeasGal':sPlaceHolder, start: function (pEvent, pInterface) { if(typeof(onStart) == 'function') { onStart(); } }, stop: function(pEvent, pInterface) { if(typeof(onFinish) == 'function') { onFinish(); } var aOrder = []; var iOrder = 0; $(pEvent.target).children().each(function() { var sDataId = null; if((sDataId = $(this).attr("data-id")) != null) { aOrder.push(sDataId); } }); if(typeof(pArguments) == 'undefined') { pArguments = {}; } pArguments.sortorder = aOrder.join(','); X(sCommandDiv).loadOnce(sUrl, { method: 'POST', scriptsfirst: false, arguments: pArguments, onFinish: function(pAjax) { if(((sText = pAjax.getResponseText()) != null)&&(sText.length > 0)) { E(sCommandDiv).setText(sText); if(typeof(RapidPAGE.updateDynamic) != 'undefined') { RapidPAGE.updateDynamic(); } } } }); } }); return true; } catch(exception) { return false; } } // Stadt und Sedcard Detailseite //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var pDetailMap = null; var pDetailLatLng = null; var bDetailMapGoogle = null; RapidPAGE.mapRefresh = function(pMap) { if(typeof(pMap) != 'undefined') { pDetailMap = pMap; pDetailLatLng = pMap.getCenter(); bDetailMapGoogle = (typeof(pMap.mapTypeId) == 'undefined') ? false:true; } if(pDetailMap) { if(bDetailMapGoogle) { google.maps.event.trigger(pDetailMap, 'resize'); } if(pDetailLatLng) { if(bDetailMapGoogle) { google.maps.event.addDomListener(window, 'resize', function() { pDetailMap.setCenter(pDetailLatLng); }); } pDetailMap.setCenter(pDetailLatLng); } } } RapidPAGE.getGeoLocation = function(sForm) { var __errorFunc = function(pError) { RapidPAGE.showErrorNotify( ((typeof(pError) != 'object')||(typeof(pError.message) == 'undefined')) ? 'Standort konnte nicht automatisch ermittelt werden.':pError.message); } try { F(sForm).setValue('geodata[longitude]', ''); F(sForm).setValue('geodata[latitude]', ''); if(navigator.geolocation) { var __successFunc = function(pPosition) { F(sForm).setValue('geodata[adress]', ''); F(sForm).setValue('geodata[longitude]', pPosition.coords.longitude); F(sForm).setValue('geodata[latitude]', pPosition.coords.latitude); F(sForm).submit(); } navigator.geolocation.getCurrentPosition(__successFunc, __errorFunc); // { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 } return true; } __errorFunc(sErrorText); return false; } catch(e) { __errorFunc(sErrorText); return false; } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function drawTopBoxes(sContainer, aArgs, iSecs, iFailed) { if(typeof(iFailed) == 'undefined') { iFailed = 10; } X(sContainer).loadOnce('drawtopboxes.html', { method: 'POST', predelay: Math.max(3, aArgs.secs = iSecs) * 1000, showerrors: true, scripts: true, scriptsfirst: false, globaleval: true, asyncron: true, arguments: aArgs, onFailed: function(pAjax) { if(iFailed < 10) { drawTopBoxes(sContainer, aArgs, iSecs, iFailed+1); } }, onFinish: function(pAjax) { var sText = pAjax.getResponseText(); if(sText.length > 0) { $('#'+sContainer).html(sText); /* $('#'+sContainer).fadeOut(50, function() { $(this).html(sText); $(this).fadeIn(50); }); */ } } }); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////