var openpopupWindow = null; var IEScrollTop = null; var checkMessage = null; var messengerIsActive = false; function openPopup(mypage, myname, mywidth, myheight, pos, scrolling, resizable, closeOld) { if (openpopupWindow && closeOld == "yes") { openpopupWindow.close(); } if (mywidth == 'max') { mywidth = screen.width; } if (myheight == 'max') { myheight = screen.height; } if (pos == 'center') { LeftPosition = (screen.width) ? (screen.width - mywidth) / 2 : 100; TopPosition = (screen.height) ? (screen.height - myheight) / 2 : 100; } else { LeftPosition = 0; TopPosition = 0; } settings = 'width=' + mywidth + ',height=' + myheight + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=' + scrolling + ',resizable=' + resizable + ',dependent=no'; openpopupWindow = window.open('', myname, settings); openpopupWindow.focus(); openpopupWindow.location = mypage; return false; } function maximizeWindow() { window.moveTo(0, 0); window.resizeTo(screen.width, screen.height); } function confirmThis(msg) { if (confirm(msg) == false) { return false; } } function external_init() { var a; if (!document.getElementsByTagName) { return; } a = document.getElementsByTagName("a") || []; for (i = 0; i < a.length; i++) { if (!a[i].getAttribute("href")) { continue; } else if (a[i].getAttribute("rel") == "top") { a[i].target = "_top"; } else if (a[i].getAttribute("rel") == "external") { a[i].target = "_blank"; } else if (typeof(a[i].getAttribute("rel")) == "string") { a[i].target = a[i].getAttribute("rel"); } } } function textLimiter(myarea, myIndicator, maxlimit) { x = (document.getElementById(myarea) || {value: ''}).value; if (x.length > maxlimit) { (document.getElementById(myarea) || {}).value = x.substring(0, maxlimit); } else if (myIndicator) { (document.getElementById(myIndicator) || {}).value = maxlimit - x.length; } } function submitProcedure() { (document.getElementById('submitButton') || {style: {}}).style.display = 'none'; (document.getElementById('loadBar') || {style: {}}).style.display = 'inline'; return true; } function markAllCheckboxes(trigger, target) { newStatus = (document.getElementById(trigger) || {checked: false}).checked; myFields = document.getElementsByName(target) || []; for (i = 0; i < myFields.length; i++) { myFields[i].checked = newStatus; } } myToolTipp = null; activeTimeOut = null; var bump = null; var docEl = ( typeof document.compatMode != "undefined" && document.compatMode != "BackCompat" ) ? "documentElement" : "body"; function imageDescription(mymode, mytarget) { myToolTipp = document.getElementById(mytarget) || {style: {}}; myToolTipp.style.display = (mymode == 1) ? "block" : "none"; if (document.getElementById(mytarget + "image")) { document.getElementById(mytarget).style.width = document.getElementById(mytarget + "image").width + "px"; bump = document.getElementById(mytarget + "image").height - 10; } else { bump = null; } } function loadImageDescription(mytarget, myimage) { myToolTipp = document.getElementById(mytarget) || {style: {}}; if (document.getElementById(mytarget + "image")) { document.getElementById(mytarget + "image").src = myimage; bump = document.getElementById(mytarget + "image").height - 10; } myToolTipp.style.display = "block"; } function hideImageDescription(mytarget) { myToolTipp = document.getElementById(mytarget) || {style: {}}; myToolTipp.style.display = "none"; bump = null; } function updateMousePos(e) { var xPos = e ? e.pageX : window.event.x; var yPos = e ? e.pageY : window.event.y; if (!myToolTipp) { return; } if (myToolTipp.style.display === "none") { return; } if (document.all && !document.captureEvents) { xPos += document[docEl].scrollLeft; yPos += (IEScrollTop != null) ? IEScrollTop : document[docEl].scrollTop; } if (myToolTipp != null && bump == null) { myToolTipp.style.left = (xPos + 10) + "px"; myToolTipp.style.top = (yPos + 10) + "px"; } else if (myToolTipp != null) { myToolTipp.style.left = (xPos + 10) + "px"; myToolTipp.style.top = (yPos - bump) + "px"; } } function simpleTooltipDelayed(mymode, mytarget) { activeTimeOut = window.setTimeout("simpleTooltip(" + mymode + ", '" + mytarget + "');", 250); } function simpleTooltip(mymode, mytarget) { (document.getElementById(mytarget) || {style: {}}).style.display = (mymode == 1) ? "block" : "none"; if (activeTimeOut) { window.clearTimeout(activeTimeOut); } } function markAndInsertInTextarea(starttag, endtag, textid) { var mypointer = document.getElementById(textid) || {value: ''}; var mycontent = mypointer.value; if (window.getSelection) { var myselection = mycontent.substring(mypointer.selectionStart, mypointer.selectionEnd); } else if (document.selection) { var myselection = document.selection.createRange().text; } else if (document.getSelection) { var myselection = document.getSelection(); } var mystart = mycontent.substring(0, mycontent.indexOf(myselection)); var myend = mycontent.substring(mycontent.indexOf(myselection) + myselection.length, mycontent.length); myselection = starttag + myselection + endtag; mycontent = mystart + myselection + myend; (document.getElementById(textid) || {}).value = mycontent; return false; } var eventteasercounter = 1; var eventteasershow = 1; var eventteasernumber; function eventteaserbox_initiate() { eventteasernumber = 0; for (i = 1; i <= 3; i++) { if (document.getElementById('eventBox' + i)) { eventteasernumber++; } } eventteaserinterval = window.setInterval("eventteaserbox_switch()", 3000); } function eventteaserbox_switch(mynumber) { for (i = 1; i <= eventteasernumber; i++) { (document.getElementById('eventBox' + i) || {}).className = "hidden"; } (document.getElementById('eventBox' + eventteasercounter) || {}).className = "image"; eventteasercounter += 1; if (eventteasercounter > eventteasernumber) { eventteasercounter = 1; } } function eventteaserbox_point(mytarget) { eventteasercounter = mytarget; eventteaserbox_stop(); eventteaserbox_switch(); } function eventteaserbox_stop() { window.clearInterval(eventteaserinterval); } function openPayment(popup, title, params) { var url = '/clearing/index.html' if (params) { url = url + '?' + params } if (popup) { openInlinePopup(url, 960, 620, 'payment', title, 0); return false; } return true; } function openSignup() { openInlinePopup('/signup/simple.html', 600, 450, '', '', 0); return false; } function openInlinePopup(mylink, mywidth, myheight, mymode, mytitle, myclosetarget) { window.clearInterval(checkMessage); var show; var myframetag; var outerCloseTag = ' onclick="return closeInlinePopup(' + myclosetarget + ');"'; if (mymode == 'fullImage') { myheight = (window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight; myheight = myheight - 60; mywidth = Math.round(myheight / 3 * 4) - 10; myframetag = ' scrolling="no"'; } else if (mymode == "no_close_no_scroll") { outerCloseTag = ""; myframetag = ' scrolling="no"'; } else if (mymode == "closeRestricted") { outerCloseTag = ""; } else if (mymode == "messenger") { messengerIsActive = true; outerCloseTag = ' onclick="return minimizeMessenger();"'; } else if (mymode == 'fullVideo') { myframetag = 'webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen="true"'; } show = '
'; mylink += (mylink.indexOf('?') === -1 ? '?' : '&') + 'isPopup=true'; (document.getElementById('inlinePopupTerritory') || {}).innerHTML = show; (document.getElementById('inlinePopupContent') || {style: {}}).style.width = mywidth + 'px'; (document.getElementById('inlinePopupContent') || {style: {}}).style.height = myheight + 'px'; (document.getElementById('inlinePopupContent') || {style: {}}).style.margin = '-' + Math.ceil(parseInt(myheight) / 2 + 10) + 'px 0 0 -' + Math.ceil((parseInt(mywidth) / 2)) + 'px'; (document.getElementById('inlinePopupiframe') || {}).width = parseInt(mywidth) - 15; (document.getElementById('inlinePopupiframe') || {}).height = parseInt(myheight) - 15; (document.getElementById('inlinePopupiframe') || {}).allowfullscreen = true; (document.getElementById('inlinePopupBackground') || {style: {}}).style.opacity = .7; (document.getElementById('inlinePopupBackground') || {style: {}}).style.filter = 'Alpha(opacity=70, finishopacity=70, style=1)'; (document.getElementById('inlinePopupiframe') || {}).src = mylink; (document.getElementById('inlinePopupArea') || {style: {}}).style.zIndex = 999999; $('body').addClass('camopen'); return false; } function closeInlinePopup(myclosetarget, newurl) { if (document.getElementById('actionslider')) { actionslider = document.getElementById('actionslider'); actionslider.style.display = 'block'; } if (myclosetarget == 0) { (document.getElementById('inlinePopupTerritory') || {}).innerHTML = " "; checkMessageInit(); (document.getElementsByTagName('body') || [{}])[0].className = (document.getElementsByTagName('body') || [{classname: ''}])[0].className.replace("camopen", ""); return false; } if (typeof myurl !== 'undefined') { newurl = myurl; } if (newurl || false) { location.href = newurl; } else { location.reload(); } return false; } function resizeFullImage() { var img = new Image(); img.src = (document.getElementById('fullImage') || {}).src; w = img.width; h = img.height; if (window.innerWidth) { myheight = window.innerHeight; mywidth = window.innerWidth; } else { myheight = document.documentElement.clientHeight; mywidth = document.documentElement.clientWidth; } nh = myheight + 10; nw = nh / h * w; if (nw - 100 > mywidth) { nw = mywidth; nh = nw / w * h; } (document.getElementById('fullImage') || {}).width = nw; (document.getElementById('fullImage') || {}).height = nh; (document.getElementById('fullImage') || {style: {}}).style.display = "block"; } function checkMessageInit() { checkNewMessage(); checkMessage = window.setInterval("checkNewMessage()", 60000); } function checkNewMessage() { var req = null; try { req = new XMLHttpRequest(); } catch (ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { req = null; } } } req.open("GET", '/request/ac/globalCheck.php', true); req.onreadystatechange = function () { if (req.readyState == 4) { if (req.status == 200 && req.responseText && req.responseText != "false") { switch (req.responseText) { case "force_hello": openInlinePopup('/signup/hello.html', 750, 505, '', 'AC Messenger', 0); break; case "force_signup": openInlinePopup('/signup/quick.html', 600, 435, 'no_close_no_scroll', '', 0); break; case "force_external_update": openInlinePopup('/signup/external.update.html', 600, 530, 'no_close_no_scroll', '', 0); break; // case "trigger_promo_popup": // openSpecialPromoRegard(410, 'Amateur Star 2019', 'https://c1.ac-data.com/resources/global/regards/images/raffle/amateurstar_150.png', 'Ich wähle Dich zum Amateur Star 2019', '', '', 'Wähle Deinen Amateur zum Star!') // break; case "force_nickname_update": openInlinePopup('/signup/nickname.update.html', 600, 300, 'no_close_no_scroll', '', 0); break; case "force_doi_notification": openInlinePopup('/signup/doi.notification.html', 750, 480, '', '', 0); break; case "force_avcheck_notification": openInlinePopup('/account/avcheck.notification.html', 750, 330, '', '', 0); break; case "force_exclusive_cam_overlay": openInlinePopup('/account/exclusive.cam.overlay.html', 750, 400, '', '', 0); break; case "force_payttachments_overlay": openInlinePopup('/account/payttachments.overlay.html', 750, 400, '', '', 0); break; case 'force_UTM_setup_overlay': openInlinePopup('/account/utm.setup.html', 1000, 750, 'no_close_no_scroll', '', 0); break; default: var command = req.responseText.split("|"); switch (command[0]) { case "postcounter": (document.getElementById('topmsgcounterTarget') || {}).innerHTML = parseInt(command[1], 10) > 0 ? "" + command[1] + "" : ""; break; case "buddycounter": (document.getElementById('topbuddycounterTarget') || {}).innerHTML = parseInt(command[1], 10) > 0 ? "" + command[1] + "" : ""; break; } break; } } } } req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(null); } function minimizeMessenger() { (document.getElementById('messengerMaximize') || {style: {}}).style.display = 'block'; closeInlinePopup(0); } function maximizeMessenger() { openInlinePopup('/account/messenger.html', 750, 505, 'messenger', '', 0); (document.getElementById('messengerMaximize') || {style: {}}).style.display = 'none'; (document.getElementById('messengerMaximize') || {}).className = 'none'; return false; } function composeMsgViaAS(myrecipient) { if (messengerIsActive == true) { openInlinePopup('/account/messenger.html?forceRecipient=' + myrecipient, 750, 505, 'messenger', '', 0); (document.getElementById('messengerMaximize') || {style: {}}).style.display = 'none'; (document.getElementById('messengerMaximize') || {}).className = 'none'; } else { openMessenger(myrecipient); } return false; } function locationHrefViaAS(mytarget) { location.href = mytarget; } function buddyrequestViaAS(mytarget) { openInlinePopup('/account/buddy.action.html?buddy=' + mytarget, 550, 140, '', DEFAULT_BUDDY_REQ, 0); } function init_all() { sidebar_init(); external_init(); if (self == top) { checkMessageInit(); } if (typeof(startMessenger) == "boolean" && startMessenger == true) { messengerInit(); } if (typeof(startLivecamsCounter) == "boolean" && startLivecamsCounter == true) { livecamsCounterInit(); } } function playMessengerAlert(mysound) { if (mysound == '') { return; } var sc = ''; (document.getElementById('actionContainer') || {}).innerHTML = ''; (document.getElementById('actionContainer') || {}).innerHTML = sc; } function sidebar_init() { if (typeof(globalScreenWidth) != "undefined" && globalScreenWidth == null) { var reqres = null; try { reqres = new XMLHttpRequest(); } catch (ms) { try { reqres = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { reqres = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { reqres = null; } } } reqres.open("GET", '/request/ac/firstCheck.php?screenWidth=' + screen.width + '&screenHeight=' + screen.height, true); reqres.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); reqres.send(null); if (screen.width > 1024) { (document.getElementById('sidebar') || {style: {}}).style.display = 'block'; if (screen.width <= 1280) { (document.getElementById('top') || {style: {}}).style.margin = '20px 0 0 20px'; (document.getElementById('desktop') || {style: {}}).style.margin = '0 0 0 20px'; } } } } var achievement_report; function start_achievement_report() { achievement_report = 0.1; set_achievement_report(); (document.getElementById('achievementReport') || {style: {}}).style.display = "block"; window.setTimeout('fade_achievement_report()', 500); } function fade_in_achievement_report() { } function fade_achievement_report() { achievement_report_interval = window.setInterval('step_achievement_report(-0.1, 5)', 15); } function step_achievement_report(step, stop) { achievement_report = achievement_report - step; if (step < 0 && achievement_report >= stop) { clearInterval(achievement_report_interval); achievement_report_interval = window.setInterval('step_achievement_report(0.1, 0.1)', 15); } else if (step > 0 && achievement_report <= stop) { clearInterval(achievement_report_interval); (document.getElementById('achievementReport') || {style: {}}).style.display = "none"; } else { set_achievement_report(); } } function set_achievement_report() { (document.getElementById('achievementReport') || {style: {}}).style.top = Math.floor(achievement_report * 18) + "px"; (document.getElementById('achievementReport') || {style: {}}).style.webkitTransform = "scale(" + achievement_report + ")"; (document.getElementById('achievementReport') || {style: {}}).style.msTransform = "scale(" + achievement_report + ")"; (document.getElementById('achievementReport') || {style: {}}).style.MozTransform = "scale(" + achievement_report + ")"; (document.getElementById('achievementReport') || {style: {}}).style.OTransform = "scale(" + achievement_report + ")"; (document.getElementById('achievementReport' || {style: {}})).style.transform = "scale(" + achievement_report + ")"; } function addSlashes(string) { return (string + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); } function stripSlashes(string) { return (string + '').replace(/\\(.?)/g, function (s, n1) { switch (n1) { case '\\': return '\\'; case '0': return '\u0000'; case '': return ''; default: return n1; } }); } function supportChatClose() { req = supportReqSend('?supportAction=close'); return false; } function supportChatOpen() { req = supportReqSend('?supportAction=open'); return false; } function supportChatSend(r) { var c = (document.getElementById('supportChatMessage') || {value: ''}).value; if (c != '') { req = supportReqSend('?supportAction=send&recipient=' + r + '&message=' + encodeURIComponent(c)); } return false; } function supportReqSend(param) { var req = null; try { req = new XMLHttpRequest(); } catch (ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { req = null; } } } req.open("POST", '/request/ac/supportchat.php' + param, true); req.onreadystatechange = function () { if (req.readyState == 4 && req.status == 200) { switch (req.responseText) { case 'closed': (document.getElementById('supportchat') || {style: {}}).style.display = 'none'; (document.getElementById('supporttrigger') || {style: {}}).style.display = 'block'; break; case 'open': (document.getElementById('supportchat') || {style: {}}).style.display = 'block'; (document.getElementById('supporttrigger') || {style: {}}).style.display = 'none'; break; case 'sent': msg = ' '; (document.getElementById('supportchat') || {}).innerHTML = msg; break; default: alert(req.responseText); break; } } } req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(null); } function supportChatHide() { if (parent && parent.parent && parent.parent.document) { (parent.parent.document.getElementById('supportchat') || {style: {}}).style.display = 'none'; (parent.parent.document.getElementById('supporttrigger') || {style: {}}).style.display = 'none'; } } function moviePreviewHover(target, label) { moviePreviewReset(target); target.innerHTML = label; target.className = 'moviePreview'; } function moviePreviewReset(target) { var alltags = document.getElementsByTagName('a'); var counttag = alltags.length; for (i = 0; i < counttag; i++) { if (alltags[i].className == 'moviePreview') { alltags[i].className = ''; alltags[i].innerHTML = ''; } } } var lastIdentifier = null; function openMessenger(identifier, _return) { lastIdentifier = identifier; window.setTimeout(function () { if (lastIdentifier !== null) { openMessenger(lastIdentifier); } }, 1000); if ( typeof _return !== 'undefined' && _return === true) { return false; } } function toolTipSwitchOn(mytarget) { allToolTips = document.getElementsByTagName('span'); for (i = 0; i < allToolTips.length; i++) { if (allToolTips[i].className == 'infoToolTipArea') { toolTipSwitchOff(allToolTips[i].id); } } document.getElementById(mytarget).style.display = 'block'; return false; } function toolTipSwitchOff(mytarget) { document.getElementById(mytarget).style.display = 'none'; return false; } $(document).ready(function () { $('.ac-password-switch').click(function () { $(this).toggleClass('unblocked') var input = $('#password') if (input.attr('type') === 'password') { input.attr('type', 'text') } else { input.attr('type', 'password') } }) }) window.onload = init_all; document.onmousemove = updateMousePos;