var chanReload = 702; var isDigiHut = null;var digiRepID = null;class mkyUloc { constructor(){ this.scope = 'world' this.action = 'locProf' this.icon = '' this.banr = '' this.link = '' this.country = '' this.state = '' this.city = '' this.continent = 0 this.countryID = 0 this.stateID = 0 this.cityID = 0 this.region = 0 this.metro = 0 } setLoc(cont,country,state,region,metro,city){ this.continent = cont; this.countryID = country; this.stateID = state; this.cityID = city; this.region = region; this.metro = metro; } setNames(country,state,city){ this.country = country; this.state = state; this.city = city; } setScope(inScope) {this.scope = inScope;} setAction(inAction){this.action = inAction;} setBanner(banner) {this.banr = banner;} setIcon(icon) {this.icon = icon;} setLink(link) {this.link = link;} }; var uloc = new mkyUloc() var ulocs = []; function mkyPushDest(){ ulocRemoveDup(uloc); ulocs.push(uloc); if (ulocs.length > 5) ulocs.shift() uloc = new mkyUloc; } function ulocRemoveDup(ul){ for (var i = ulocs.length - 1; i >= 0; --i) { var loc = ulocs[i]; var str1 = loc.scope + loc.cityID; // + loc.action var str2 = ul.scope + ul.cityID; // + ul.action var res = str1.localeCompare(str2) console.log('comparing: ',res) if (res == 0){ console.log('They are the same') ulocs.splice(i,1) return; } } } console.log('App Scope Tracking',ulocs); const mkyCrypt = (salt, text) => { const textToChars = (text) => text.split("").map((c) => c.charCodeAt(0)); const byteHex = (n) => ("0" + Number(n).toString(16)).substr(-2); const applySaltToChar = (code) => textToChars(salt).reduce((a, b) => a ^ b, code); return text .split("") .map(textToChars) .map(applySaltToChar) .map(byteHex) .join(""); }; const mkyDecrypt = (salt, encoded) => { const textToChars = (text) => text.split("").map((c) => c.charCodeAt(0)); const applySaltToChar = (code) => textToChars(salt).reduce((a, b) => a ^ b, code); return encoded .match(/.{1,2}/g) .map((hex) => parseInt(hex, 16)) .map(applySaltToChar) .map((charCode) => String.fromCharCode(charCode)) .join(""); }; var mkyUState = { muid : '' } var actv_msgNum = 0; var actv_msgs = [ "
[|]
- Initializing Brain", "
[/]
- Scaning Neural Network", "
[-]
- Activating All Neurons ", "
[\\]
- Collecting Market Data", "
[|]
- Shaking The Tree Of Money", "
[/]
- Ready To Earn Some BMGP!" ]; function mkySanitize(input) { const map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', "/": '/' }; const regex = /[&<>"'/]/g; return input.replace(regex, match => map[match]); } function saveUState(){ var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = '/whzon/safeUState.php?wzID=0&state='+encodeURIComponent(JSON.stringify(mkyUState)) divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { console.log('userStateSaved: '+JSON.stringigy(mkyUState)); } }; divxml.send(null); } function hutRefer(wsID,hutID){ var wzID = '0'; var url = 'https://www.bitmonky.com/whzon/adMgr/clickHutRefer.php?wzID='+wzID+'&wsID='+wsID+'&hutID='+hutID; window.open(url,'bitHutRef'); } function quickSellGold(){ hideDiv('spotBuyOrders'); var edUrl = '/whzon/gold/mbrPFrmSellOrder.php?wzID=0'; var edDiv = 'spotSellOrders'; var spot = document.getElementById('spotSellOrders'); if (spot){ spot.innerHTML = ""; } updateDivHTML(edUrl,edDiv); showDiv('spotSellOrders'); } var cpTextAlertSpot = null; var cpTextTextarea = null; function copyText(id,indoc) { var textarea = findDiv(id); var spot = findDiv('alertSpot_'+id); cpTextTextarea = textarea; cpTextAlertSpot = spot; textarea.disabled = false; textarea.focus(); textarea.select(); try { var successful = indoc.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; console.log('Fallback: Copying text command was ' + msg); } catch (err) { console.error('Fallback: Oops, unable to copy', err); } spot.style.color = 'white'; spot.innerHTML = ' ... Copied!'; setTimeout('clearAlert()',1000); } function clearAlert(){ cpTextTextarea.disabled = true; var text = cpTextTextarea.innerHTML; cpTextTextarea.innerHTML = ''; cpTextTextarea.innerHTML = text; cpTextAlertSpot.innerHTML = ''; } function quickBuyGold(amt=null){ hideDiv('spotSellOrders'); if (amt){ amt = '&amt='+amt; } else{ amt = ''; } var edUrl = '/whzon/gold/mbrPFrmBuyOrder.php?wzID=0'+amt; var edDiv = 'spotBuyOrders'; var spot = document.getElementById(edDiv); if (spot){ spot.innerHTML = ""; } updateDivHTML(edUrl,edDiv); showDiv('spotBuyOrders'); } function hideMkyDisclaimer(){ var d = document.getElementById('siteMonkDisclaimer'); if (d){ d.style.display = 'none'; } } function showMkyDisclaimer(){ var d = document.getElementById('siteMonkDisclaimer'); if (d){ d.style.display = 'block'; } } function joinBusinessGroup(){ wzGetPage("/whzon/public/homepg.php?wzID=0&fhQry=BusinessNetworkingGroup"); } function showMainLoadProgress(){ //return; var spot = document.getElementById('wzMainLoader'); console.log('showing progress',actv_msgs); if (spot){ spot.style.display = 'block'; spot.style.background = '#222222'; spot.style.color = 'darkKhaki'; spot.style.fontSize = '3vw'; spot.style.fontWeight = 'bold'; spot.style.padding = '1em'; spot.innerHTML = "
" + "

" + actv_msgs[actv_msgNum] + "...

"; actv_msgNum += 1; if (actv_msgNum <= actv_msgs.length){ setTimeout('showMainLoadProgress()',8*100); } else { spot.style.display = 'none'; } } } function getSpinner(msg){ return "
" + msg + "...
"; } function getInvitePg(group,muid){ var url = 'https://www.bitmonky.com/whzon/adMgr/joinMyChan.php?grp='+group+'&muid='+muid+'&rfm=webr'; window.open(url,'mkyGrpInvite'); } function testYouTubeIFail(vidId,img=null){ var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = img.src; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 404) { console.log('YT Video: '+vidId+' Marked For Delete'); logYouTubeImgFail(vidId,img); } }; divxml.send(null); } function logYouTubeImgFail(vidId,img){ if (img){ img.style.display = 'none'; } var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = '/whzon/mbr/vidView/logYouTubeImgFail.php?vidID=' + vidId + '&xm=' + ranTime ; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { console.log('YT Video: '+vidId+' Marked For Delete'); return; } }; divxml.send(null); } function checkUrlExists(url){ var http = new XMLHttpRequest(); http.open('HEAD', url, false); http.send(); return http.status!=404; } function checkImgURL(url,id){ if (checkUrlExists(url)){ return true; } adImgFail(id,1); } var searching = false; var lastMkyResponse=null; var lastQry = null; function doAskTheMonkey(ecQry=null){ //return; if (!ecQry) { return; } if (ecQry == ''){ return; } var spot = findDiv('monkeyQryResponseSpot'); if (spot){ spot.style.display='block'; spot.innerHTML = "Thinking About That... Please wait!"; } else {return;} var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = '/whzon/talk/oaiSiteMonkyQry.php?vmode=mobile&msg='+ecQry+'&xr='+ranTime; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var htm = divxml.responseText; if (spot){ spot.style.display='block'; spot.innerHTML = htm.replace('',''); return; } } }; divxml.send(null); } function chkYouTubeImage(){ } function newuloadHashQry(id,q){ if (q.trim() != ''){ searching = true; lastQry = encodeURI(q.trim()); wzGetPage('/whzon/bitMiner/newMemQry.php?search='+encodeURI(q.trim())+'&mode=mobile'); window.scrollTo({ top: 0, left: 0, behavior: "smooth", }); //scrollTopFramePg('pgViewerFrame'); } } function onPgViewerLoad(){ console.log('onPgViewerLoad::',searching); if (searching){ doAskTheMonkey(encodeURI(lastQry)); searching = false; } } function scrollTopFramePg(frameID){ var appframe = findDiv(frameID); if (appframe){ divh = appframe.contentWindow; if (divh) { divh.scrollTo({ top: 0, left: 0, behavior: "smooth", }); } } } console.log('gsoftFURL','');console.log('isDigiHut',isDigiHut); var monkyIsSet = true; //false; if (window.self !== window.parent){ if (window.parent.document.location.href.indexOf('wzMblp.php') !== -1){ window.parent.document.location.href = window.self.document.location.href; } } function gotoApp() { var store = location.hash.substr(1); if (store) { window.location.href = '/whzon/store/fetchStore.php?ftag=' + store; } } function claimAccount(id,celeb){ alert('Feature Pending... Any '+celeb+' owner or representative can contact peter@bitmonky.com for info on claiming ownership of this account including any crypto earnings'); } function moveDredge() { var dxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var vport = { width : window.innerWidth, height : window.innerHeight } var url = '/whzon/dredge/dredgeCreateJobs.php?wzID='+sID+ '&vport=' + encodeURIComponent(JSON.stringify(vport)) + '&xr=' + ranTime; dxml.open("GET", url, true); dxml.onreadystatechange = doNothingMsg; dxml.send(null); } function hideImageID(id){ var img = document.getElementById(id); if (img){ img.style.display = 'none'; } } function isFrameFocused(id){ const fr = document.getElementById(id); if (fr) if (fr.contentWindow) return fr.contentWindow.document.hasFocus(); return false } function isAppFocused() { if (document.hasFocus()){ return true; } return false; } function closeBitMiner() { } function mkdshare(pID,mkdID){ wzGetPage('/whzon/apps/dating/mbrViewPhotos.php?vPhotoID=' + pID + '&mkdID=' + mkdID); } function mkyClip(textID) { var copyText = document.getElementById(textID); if (copyText){ copyText.select(); copyText.setSelectionRange(0, 999999) document.execCommand("copy"); alert("Copied -> " + copyText.value); } } function popImpLoto(){ _client.stop(); window.open('/lotoMiner.php?pMUID=&wzID=0','wzImpMiner'); } function popBGImp(prev=null){ _client.stop(); if(!prev) window.open('/whzon/bitMiner/impMinerBG.php?MUID=&pre=pre','wzImpMiner'); else window.open('/fanPool.php?MUID=&wzID=0','wzImpMiner'); } function checkSurfncLoaded(){ console.log('checking serfnc '); if (!surfncLoaded){ console.log('surfncaht not loaded'); wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID=' + wzChanID); } } function reloadPageFrame(withID){ if (findDiv(withID)){ var appframe = document.getElementById('pgViewFrame'); if (appframe){ appframe.contentWindow.document.location.reload(); } } } function lcGoTop(){ window.scrollTo(0,0); var appframe = document.getElementById('pgViewFrame'); if (appframe){ appframe.contentWindow.scrollTo(0,0); } appframe = document.getElementById('mbrVideoViewer'); if (appframe){ appframe.contentWindow.scrollTo(0,0); } } function lcGoSearch(mode=null,hwzID=0){ console.log('gsoftServe','www.bitmonky.com'); lcGoTop(); hideRootPg(); wzAPI_closeMenu(); wzAPI_hideVideoPage(); wzAPI_hideMosh(); wzAPI_hidePVC(); hideChatWidget(); hideTop(); if(mode === null) mode = false; else mode = true; wzGetPage('/whzon/mblp/selFindMbrAutoT.php?wzID='+sID,mode); var spot = document.getElementById('lcSearchSpot'); if (spot && !mode){ spot.focus(); } } function lcMenu(){ lcGoTop(); wzAPI_closeMenu(); wzAPI_hideMosh(); wzAPI_hideVideoPage(); wzAPI_hidePVC(); hideChatWidget(); if (!topInView){ touchTop(); } else { hideTop(); } } function lcGoHome(){ console.log('lcGoHome'); wzChangeChannel(1); // wzGetPage('/whzon/mytown/myTown.php?wzID=0&franCID=2&fmyMode=mshare&fscope=myWorld&fwzUserID=0'); wzGetPage('/whzon/mblp/mytown/myTownProfile.php?franCID=2&wzID=0&fscope=myCity&fcatID=&fwzUserID=0'); } function lcShowChat(){ console.log('lcShowChat:'+wzChanID,surfncLoaded); lcGoTop(); if (chatSpaceStatus == null){ wzAPI_closeMenu(); wzAPI_hideMosh(); wzAPI_hideVideoPage(); wzAPI_hidePVC(); if (!surfncLoaded){ wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID=' + wzChanID); } doShowChatRoom(); } else { hideChatWidget(); } } //*********************************************** // Begin One Alert Functionality //*********************************************** var oneAlertT = null; function doOneAlert() { console.log('oneAlert: ',pvChatFocused); if (oneAlertT) {clearTimeout(oneAlertT);} var onexml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/oneAlert.php?wzID=' + sID + '&fcount=' + chanReload + '&nCount=' + audAlertCnt + '&xr=' + ranTime; onexml.timeout = 20*1000; onexml.ontimeout = doOneAlert; onexml.onerror = function (){ oneAlertT = setTimeout('doOneAlert()',20*1000); } onexml.open("GET", url, true); onexml.onreadystatechange = function(){ if (onexml.readyState == 4){ if(onexml.status == 200){ var jdata = mkyTrim(onexml.responseText); var j = null; try {j = JSON.parse(jdata); } catch(err) { dbug("JSON fail: oneAlert fail -> " + urldecode(jdata)); j = null; } if (j){ //console.log(j); excWriteAlert(j); excRoomEmPopAlert(j); excRoomPVChatAlert(j); excNotificationAlerts(j); excUserAccMsg(j); excCheckChannelReload(j); excCitySaleAlert(j); } oneAlertT = setTimeout('doOneAlert()',30*1000); } } }; onexml.send(null); } function excUserAccMsg(j){ return; var op = document.getElementById('userAccNotice'); if (op){ if(j.sysn.nMsg){ if (j.sysn.html){ op.innerHTML = j.sysn.html; } if (j.sysn.jhtml){ op.innerHTML = j.sysn.jhtml; } } } } function adImgFail(id,def=null){ var img = document.getElementById(id); if (img){ if (def){ img.src = '//image.bitmonky.com/img/monkyTalkfbCard.png'; } else { img.style.display = 'none'; } } } function excCheckChannelReload(j){ if (j.ccr.reload == 'yes'){ chanReload = jobj.counter; wzReloadChannel(); } } function excNotificationAlerts(j){ var jobj = j.newUserAlerts; console.log('excNotifcations: ',j.newUserAlerts); var imgELID = document.getElementById('wzNotifyAlerts'); if (imgELID){ imgELID.innerHTML = j.uam.html + jobj.html; if (!notifyMenuIsOpen){ if (jobj.nCount > audAlertCnt ){ var maBut = document.getElementById('mainActButton'); if (maBut){ maBut.style.background = 'fireBrick'; } } if (jobj.nCount > audAlertCnt && jobj.sound == 'yes' && notifyTone ){ var snd = new Audio("/whzon/sounds/quiteTone.wav"); if (snd){ snd.play(); } } } audAlertCnt = jobj.nCount; } } function excWriteAlert(j){ console.log('excWriteAlert: ',j.uam); var gdiv = document.getElementById("wzHeadNotify"); if (gdiv != null ) { if (j){ if (j.uam.sessStat == "ENDSESS"){ document.location.reload(); } else { gdiv.innerHTML = j.uam.fronline; } } else { gdiv.innerHTML = ""; } } if(pageOBJstart){ dbug(pageOBJstart); wzGetPage(pageOBJstart); pageOBJstart = null; } } function excRoomPVChatAlert(j){ var alertID = null; if (j){ //alert('check pvChatFocuse start' + j.sentBy); alertID = j.sentBy; } else { //alert('J not found'); alertID = 0; } var gdiv = document.getElementById("pvChatAlertSpot"); if (gdiv != null ) { if (alertID){ //alert('check pvChatFocuse'+ pvChatFocused + alertID); if (alertID == pvcCurUID && pvChatFocused){ return; } var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'inline-block';} gdiv.innerHTML = "
Chat Alert!
|
"; var snd = new Audio("/sounds/quiteTone.wav"); if(snd) snd.play(); } } } function excRoomEmPopAlert(j){ eAlert = j.emAlerts; if(eAlert.msgID == 0){ return; } var gdiv = document.getElementById("pvChatAlertSpot"); if (gdiv != null ) { if (eAlert){ var mtype = eAlert.msgType; var pimg = 'getMbrImg.php'; var bgc = '#222222'; if (mtype == 2){ showAtMemberNotice(eAlert); return; } if (mtype == 1){ pimg = 'getDProfThm.php'; bgc = 'fireBrick' } var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) { cdiv.style.display = 'inline-block'; gdiv.innerHTML = "
New Email!
|
"; } } else { /* var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'none';} gdiv.innerHTML = ""; */ } } } function excCitySaleAlert(j){ var div = document.getElementById('citySaleAlert'); if (!div){ alert('div: citySaleAlert - not found'); return; } div.innerHTML = j.citySale.html; } //*************************** // End OneAlert Functionality function logoff(){ var conf = confirm('Log Out Now?'); if (conf){ document.location.href = "/whzon/mbr/mbrLogoff.php"; } } function imgFail(i){ img = findDiv('revImg' + i); //document.getElementById('revImg'+i); console.log('image fail revImg'+ i,img); if (img){ img.style.display = 'none' } } function setMonky(){ monkyIsSet = true; } function fixImageSizeMax(id,max){ } var chatMsgEL = null; var chatELTimer = null; var zoomImgEL = null; var touchTimer = null; function wzGetNewChannel(id,tag){ wzGetPage('/whzon/mblp/homepg.php?wzID=' + sID + '&fhQry=' + tag); wzChangeChannel(id); } function viewStoreItem(storeID,id){ wzGetPage('/whzon/store/storeProfile.php?wzID=' + sID + '&fstoreID=' + storeID + '&fitemID=' + id); } function zoomChannelConversation(id,chanID){ var imgELID = document.getElementById('wzBrowser'); var xoff = document.getElementById('wzBrowser').offsetLeft; wzAPI_showFrame("/whzon/talk/zoomConversation.php?wzID=" + sID + "&fmbrID=" + id + '&fchanID=' + chanID,maxw,1850,0,0); window.scrollTo(1, 0); } function zoomConversation(id){ var imgELID = document.getElementById('wzBrowser'); var xoff = document.getElementById('wzBrowser').offsetLeft; wzAPI_showFrame("/whzon/talk/zoomConversation.php?wzID=" + sID + "&fmbrID=" + id,maxw,850,0,0); window.scrollTo(1, 0); } function mkyBSendAction(bid,gto){ var mkyBSend = findDiv('parent.' + bid); if (!mkyBSend){ mkyBSend = findDiv(bid); } if (mkyBSend){ mkyBSend.mkySButton.disabled = true; mkyBSend.mkySButton.value = 'Sending... Please Wait'; mkyBSend.mkySButton.style.color = 'red'; mkyBSend.mkySButton.style.background = 'orange'; wzGetPage(gto); } else { alert('Error : ' + bid + ' Not Found...'); } } function highlightChatMsg(id){ normalizeChatMsg(); chatELTimer = setTimeout('normalizeChatMsg()',3800); chatMsgEL = document.getElementById('cmsgEL' + id); zoomImgEL = document.getElementById('zimgEL' + id); chatMsgEL.style.borderRadius = '.3em'; chatMsgEL.style.background = 'Gray'; chatMsgEL.style.color = 'white'; zoomImgEL.style.visibility = "visible"; } function normalizeChatMsg(){ if (chatMsgEL){ chatMsgEL.style.background = 'none'; chatMsgEL.style.color = 'inherit'; } if (chatELTimer){ clearTimeout(chatELTimer); chatELTimer = null; } if (zoomImgEL){ zoomImgEL.style.visibility = "hidden"; } } function ownerRemoveChatMsg(msgID,sKey){ window.scrollTo(1, 0); wzAPI_showFrame('/whzon/talk/popConfirmDelChat.php?wzID=0&fchatID=' + msgID, 300, maxw, 0,0); } function touchChanPost(){ var maBut = document.getElementById('mainActButton'); if (maBut){ maBut.style.background = mainButHolder; //'#151515'; } resetCancelPage(); showChanPost(); } function touchTop(){ var maBut = document.getElementById('mainActButton'); if (maBut){ maBut.style.background = mainButHolder; //'#151515'; } resetCancelPage(); showTop(); } function gotoFranChan(){ wzChangeChannel(302140); doShowChatRoom(); } function gotoDatingChan(){ wzChangeChannel(302057); doShowChatRoom(); showChatWidgetSpace(); } function gotoBuyFranchise(){ wzGetPage("/whzon/mblp/franMgr/franMgr.php?mode=reRead&wzID=" + sID); wzChangeChannel(302140); } function goToMemberChat(pid){ var edUrl = '/whzon/mbr/fetchProfChat.php?wzID=' + parent.sID + '&profUID=' + pid; var edDiv = 'parent.mbrChatRoomSpot'; updateDivJSON(edUrl,edDiv); } function jsonHandler(j){ if (j.chanID){ var conf = confirm('Confirm Go To This Members Channel?'); if (conf){ wzChangeChannel(j.chanID); } } } function setCookie(name, value, days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function getCovidPg(pg,qry=null){ var edUrl = '/whzon/public/covidData.php?wzID=0&newPg=' + pg; var edDiv = 'covid19SPOT'; updateDivHTML2(edUrl,edDiv); } function mkyShowMkyAccept(){ if (isDigiHut){ return; } var maDiv = document.getElementById('mkyCookie'); //alert(maDiv); if (maDiv){ maDiv.style.display = 'block'; //maDiv.style.zIndex = 99999999; } } function doAcceptCookie() { var pgtrackxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/mkyAccept.php?xr=' + ranTime; pgtrackxml.open("GET", url, true); pgtrackxml.onreadystatechange = doNothingMsg; pgtrackxml.send(null); } function mkyAcceptCKY(){ var maDiv = document.getElementById('mkyCookie'); doAcceptCookie(); if (maDiv){ maDiv.style.display = 'none'; } } function mkyLeaveSite(){ document.location.href='//google.com'; } var chanPostInView = null; var chanPostTimer = null; function showChanPost(){ hideChatWidget(); chanPostInView = true; if (chanPostTimer){ clearTimeout(chanPostTimer); } var nt = document.getElementById('newTop'); var cd = document.getElementById('topChatDiv'); var md = document.getElementById('chanPostDiv'); if (cd){ cd.style.display = 'inline'; } if (md){ md.style.display = 'inline'; } if (nt){ nt.style.display = 'none'; } adjustViewerTops(); chanPostInView = setTimeout(hideChanPost,120*1000); } function hideChanPost(){ chanPostInView = false; var nt = document.getElementById('newTop'); var cd = document.getElementById('topChatDiv'); var md = document.getElementById('chanPostDiv'); if (nt){ nt.style.display = 'block'; } if (cd){ cd.style.display = 'none'; } if (md){ md.style.display = 'none'; } adjustViewerTops(); } var topInView = null; function showTop(){ topInView = true; if (touchTimer){ clearTimeout(touchTimer); } var nt = document.getElementById('newTop'); var cd = document.getElementById('topChatDiv'); var md = document.getElementById('menuDiv'); if (cd){ cd.style.display = 'inline'; } if (md){ md.style.display = 'inline'; } if (nt){ nt.style.display = 'none'; } adjustViewerTops(); touchTimer = setTimeout(hideTop,120*1000); } function showRecentDest(){ var spot = document.getElementById('recentDestinations'); htm = ''; if (moshStatus){ htm = htm + '
'; htm = htm + ''; htm = htm + ' Return To MoshBox '; htm = htm + '
'; } var htm = htm + '

Recent Destinations

'; for (var i = ulocs.length - 1; i >= 0; --i) { var loc = ulocs[i]; htm = htm + '
'; htm = htm + '' htm = htm + ''; htm = htm + '' htm = htm + '
' htm = htm + '
' + loc.city + ', ' + loc.country + ' | ' + loc.scope.replace('my','') + '
' htm = htm + '
'; } if (spot){ spot.innerHTML = htm; } } function hideTop(){ hideChanPost(); topInView = false; var nt = document.getElementById('newTop'); var cd = document.getElementById('topChatDiv'); var md = document.getElementById('menuDiv'); if (nt){ nt.style.display = 'block'; } if (cd){ cd.style.display = 'none'; } if (md){ md.style.display = 'none'; } adjustViewerTops(); } function dbug(msg){ return; console.log('dbug: ' + msg); } function qpScoreToLow(qps,min){ alert ('Your Quality Score Of : ' + qps + ' Is To Low For This Task. You need a ' + min + ' or higher. Check the Video Guide for more infor on quality score'); } function goToJail(){ document.location.reload(); } var photoIDApp = ''; var lngTxt = 'Lounge🍹'; var chanFilter = null; var mblAdCnt = null; var mblAdDivID = null; var audAlertCnt = null; var modSeeAll = null; var myRFilters = null; var winWRTCChat = null; var winWRTCCtrl = null; var wzAppXML = null; var timeout = null; var closetimer = null; var refreshPg = null; var noreload = null; var nativeLang = null; var BadWords = null; var wzStartUp = null; var wzCleanUpOn = null; var mainInputHTML = null; var hideTopicTimer = null; var topicDiv = null; var hideSysMsgTimer = null; var sysMsgDiv = null; var docBody = null; var pgNbr = null; var pgTop = null; var pgHist = null; var isMobile = null; var isFocused = null; var wzAPI_ALxml = null; var wzAPI_VCxml = null; var lstrmCon = null; var blockLCon = null; var webRTCCon = null; var eVerified = null; var chanCheck = null; var uNOTIFxml = null; var uNOTFCon = null; var moshNFCon = null; var alertNotifyTimer = null; var mlikesxml = null; var mkdID = null; var browsDiv = null; var wzSessUPD = null; var inThisRoom = null; var inRoomCon = null; var roomTimer = null; var talkTimer = null; var alertTimer = null; var emAlertTimer = null; var emAlertcon = null; var rAlertTimer = null; var rAlertcon = null; var pvcDeclcon = null; var pvcCurUID = null; var sessConn = null; var chStoryCon = null; var wzBrowser = null; var wzNetView = null; var wzStream = null; var rmStream = null; var synchCon = null; var readxml = null; var wzUserID = null; var sID = 0; var wzUserName = null; var sessDiv = null; var strmDiv = null; var pvcDiv = null; var pvcMode = null; var vidDiv = null; var vchatControl = null; var pvchatControl = null; var mainCtrls = null; var pgViewer = null; var popViewer = null; var wzChanID = null; var moshStatus = null; var pageStatus = null; var netViewURL = null; var moshOP = null; var mineOP = null; var sendmgsxml = null; var adspotxml = null; var boostAdxml = null; var dxOff = null; var dyOff = null; var wzWRTCon = null; var vidwControl = null; var vidViewer = null; var alertLayer = null; var brwzLayer = null; var moszLayer = null; var bmnzLayer = null; var pgvzLayer = null; var pvczLayer = null; var vidzLayer = null; var topzLayer = null; var popzLayer = null; var chatLayer = null; var vdvwLayer = null; var chatDiv = null; var vChatStarted = null; var pvChatStarted = null; var pvChatFocused = null; var bitMineIsOpen = null; var pgw = null; var maxw = null; var marg = null; var pgViewXW = null; var chatXW = null; var margn = 0; var mainTable = null; var ifrm = null; var cptr = null; var refresh = null; var lastMsgID = null; var blockList = null; var fwarnings = null; var updDivxml = null; var winxml = null; var uAccxml = null; var uAccMsgDiv = null; var cancelPageLoad = null; // tones var notifyTone = null; var notes = null; var dsMode = null; var pvchatTone = null; // slow poll variables var rollMsgs = null; var rollCnt = null; var rollRefresh = null; var rollnNew = null; var mblAdMax = null; var mblAdsServed = null; var rollTimer = null; var chanHasChanged = null; var isRolling = null; var surfncLoaded = null; var pageOBJloaded = null; var pageOBJframe = null; var pageOBJdoc = null; var pageOBJvisible = null; var pageOBJcreated = null; var pageOBJstart = null; var pageOBJlastPg = null; var pageOBJinitCnt = null; var doHideFranNotice = null; // Add Swipe Listner for main chat window.addEventListener('load',function(){ var el = document.getElementById('wzStreamDisplay'); if (el){ swipedetect(el, function(swipedir){ if (swipedir == 'left'){ doShowChatRoom(); //wzGetPage('/whzon/mblp/mobileMenu.php?wzID='+sID); } if (swipedir == 'right'){ doShowPageOBJ(); //wzGetPage('/'); } }); } }, false); // Add Drag Listner for main chat window.addEventListener('load',function(){ var el = document.getElementById('pvChatAlertSpotCon'); if (el){ el.style.zIndex = 999999; dragDIVListen(el, function(distX,distY){ var ex = pxToInt(percentToPx(el.style.left,'left')); var ey = pxToInt(percentToPx(el.style.top,'top')); el.style.top = ey + distY + 'px'; el.style.left = ex + distX + 'px'; }); el.style.display = 'none'; } }, false); function hideAd(id){ var spot = findDiv(id); if (spot){ spot.style.display = 'none'; } } function closeTopic(){ var edUrl = '/whzon/topics/closeHashTopic.php?wzID=' + sID; var edDiv = 'hashTopicSpot'; updateDivHTML2(edUrl,edDiv); } function doPurgeList() { var wzoutput = document.getElementById("chatDiv"); purgeList(wzoutput); } var mainButHolder = null; function wzStartApp(){ gotoApp(); if(typeof parent.digiBG != 'undefined'){ var hutCSS = document.getElementById('gsoftCSS'); if (hutCSS){ console.log('hut css found',hutCSS.href); if (hutCSS.href.endsWith('phoneCSS.php')){ hutCSS.href = '/whzon/mblp/phoneCSS.php?&bColor='+parent.digiBG+'&color='+parent.digiCO+parent.digiTheme; } } } //window.scrollTo(0,1000); window.scrollTo(0,1); var goodMky = document.getElementById('isBadMonky'); if (!goodMky || !monkyIsSet){ //alert('Turn Ad Block Off To Access MonkyTalk'); //document.location.href = '/whzon/gold/adBlockJail.php'; } notifyTone = 1;pvchatTone = 1;mkyShowMkyAccept(); mblAdCnt = 2; mblAdDivID = 1; wzStartUp = 1; doLoginInit(); BadWords = ['fuck','slut','biteme','sluts','blowme','piss','fcku','sexchat','pussy','fukyou','fukeu','fukeyou','fackyou','fukin','fukyou','whore','gotohell','asshole','asshole','sonofbitch','suckmydick','fock','fvck']; wzAppXML = getHttpConnection(); timeout = 500; closetimer = 0; refreshPg = 0; noreload = 0; pgNbr = 0; pgTop = 0; pgHist = new Object(); isMobile = true; nativeLang = 0; pvcMode = null; bitMineIsOpen = null; winxml = getHttpConnection(); wzSessUPD = getHttpConnection(); sessConn = getHttpConnection(); wzBrowser = getHttpConnection(); wzStream = getHttpConnection(); rmStream = getHttpConnection(); readxml = getHttpConnection(); synchCon = getHttpConnection(); sendmgsxml = getHttpConnection(); adspotxml = getHttpConnection(); boostAdxml = getHttpConnection(); wzAPI_ALxml = getHttpConnection(); wzAPI_VCxml = getHttpConnection(); chStoryCon = getHttpConnection(); inRoomCon = getHttpConnection(); rAlertcon = getHttpConnection(); emAlertcon = getHttpConnection(); pvcDeclcon = getHttpConnection(); lstrmCon = getHttpConnection(); blockLCon = getHttpConnection(); chanCheck = getHttpConnection(); uNOTIFxml = getHttpConnection(); uNOTFCon = getHttpConnection(); moshNFCon = getHttpConnection(); webRTCCon = getHttpConnection(); mlikesxml = getHttpConnection(); uAccxml = getHttpConnection(); uAccMsgDiv = document.getElementById("userAccNotice"); sessDiv = document.getElementById("wzSessionDisplay"); browsDiv = document.getElementById("wzBrowser"); strmDiv = document.getElementById("wzStreamDisplay"); moshOP = document.getElementById("wzMoshContainer"); mineOP = document.getElementById("wzMineContainer"); pgViewer = document.getElementById("wzPageContainer"); popViewer = document.getElementById("wzPopContainer"); wzNetView = document.getElementById("wzNetView"); mainCtrls = document.getElementById("wzMainControls"); pvcDiv = document.getElementById("wzPVCContainer"); vidDiv = document.getElementById("wzVidContainer"); chatDiv = document.getElementById("wzStreamDisplay"); vchatControl = document.getElementById("vchatControl"); pvchatControl = document.getElementById("pvchatControl"); mainTable = document.getElementById("mainTable"); docBody = document.getElementById("wzAppBody"); vidwControl = document.getElementById("wzVidViewControl"); vidViewer = document.getElementById("wzVidViewContainer"); winWRTCCtrl = document.getElementById("wzWRTCctrl"); if (winWRTCCtrl){ setInterval(checkWRTCCtrl,300); } dbug('wzNetView is: ' + wzNetView); if(pvchatControl){ pvchatControl.innerHTML=""; } chatLayer = 2; brwzLayer = 3; bmnzLayer = 1001; moszLayer = 1000; pgvzLayer = 1; pvczLayer = 14; vidzLayer = 9996; vdvwLayer = 9997; topzLayer = 999; popzLayer = 1001; alertLayer = 99999999; audAlertCnt = 0; laySetLayers(); var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'none';} vChatStarted = false; pvChatStarted = false; netViewURL = "/" cptr = ""; refresh = 8; rollRefresh = 24; mblAdMax = 3; mblAdsServed = 0; lastMsgID = 0; wzChanID = 1; mkdID = null; blockList = new Object(); moshStatus = 0; pageStatus = ""; window.onresize = function() {wzSetPageMargins();} //wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID=' + wzChanID); //wzLoadStream('/whzon/siteClosing.php?wzID=' + sID + '&fchanID=' + wzChanID); readBlockList(); displaySession(); wzSetPageMargins(); rotateAdSpot(); if (sID != 0) { roomPVChatAlert(); wzAPI_ChatAlert(); doOneAlert(); } var startURL= "/whzon/mblp/selFindMbrAutoT.php?wzID=0&mblGetPg=on"; pageOBJstart = null;console.log('rCode:','');pageOBJstart = startURL; // '/whzon/mblp/mytown/myTownProfile.php?wzID=0&fscope=myWorld&fcatID=&fwzUserID=0'; createPageOBJ(); // if (sID) checkChannelMove(); if (window.self !== window.top) {alert('page not found'); parent.wzGetPage('/');} //window.scrollTo(1, 1); wzStartUp = null; alertNotifyTimer = setTimeout( checkNotificationAlerts, 500); if (navigator.webkitGetUserMedia) { //console.log("This appears to be Chrome"); setUserWebRTC('on'); } else { //console.log("wz webRTC Not Available"); setUserWebRTC('off'); } if (vcontest){ vcontest = null; wzGetVideoPage('/whzon/mbr/vidView/gotoContest.php?wzID=' + sID); } var join = null; initGigBox(1); console.log('wzMblJS.init.wzGetPage: ',pageOBJstart); var holdMainBut = document.getElementById('mainActButton'); if (holdMainBut){ mainButHolder = holdMainBut.style.background; } const showRootPg = true; wzGetPage(pageOBJstart,showRootPg); if (typeof setDigiHut === 'function'){ console.log('setDigiHut:set'); setDigiHut(); } if (join && 0 < 1){ wzQuickReg(join); } doShowLastPage(); } // ************************************** // url auto share code // ************************************** function atsUrlRemoveIt(url){ var inp = document.getElementById('typeBox'); var txt = inp.value.toString(); txt = txt.replace(url,''); inp.value = txt; } function scanInput(send){ var el = document.getElementById('typeBox'); var txt = el.value.toString(); var url = null; if (send){ txt = txt + ' '; el.value = txt; } var lnkpos = txt.search(/https:\/\//i); var isHttp = false; if (lnkpos == -1){ lnkpos = txt.search(/http:\/\//i); if (lnkpos > -1){ isHttp = true; } } var lnkend = txt.length; if (lnkpos > -1 && (txt.substring(lnkend-1,lnkend) == ' ' || txt.substring(lnkend-1,lnkend) == '\n')){ url = txt.substring(lnkpos,lnkend); atsUrlRemoveIt(url); if (isHttp){ url = 'https' + url.substring(4,url.length); } doGetShareData(url); return true; } lnkpos = txt.search(/www\./i); if (lnkpos > -1 && (txt.substring(lnkend-1,lnkend) == ' ' || txt.substring(lnkend-1,lnkend) == '\n')){ url = txt.substring(lnkpos,lnkend); atsUrlRemoveIt(url); doGetShareData('https://' + url); return true; } return false; } function showShare(){ var spot = document.getElementById('showShareSpot'); if (spot){ spot.style.display = 'inline-block'; } } function hideShare(){ var spot = document.getElementById('showShareSpot'); if (spot){ spot.style.display = 'none'; } } function doShareLinkNow(url){ var inp = document.getElementById('typeBox'); var txt = inp.value.toString(); var edUrl = '/whzon/mbr/showUrlShare.php?mode=share&wzID=' + parent.sID + '&inURL=' + url + '&com=' + txt; var edDiv = 'parent.showShareSpot'; parent.updateDivHTML2(edUrl,edDiv); setTimeout(hideShare,3*1000); return; } function doGetShareData(url){ showShare(); var edUrl = '/whzon/mbr/showUrlShare.php?wzID=' + parent.sID + '&inURL=' + url; var edDiv = 'parent.showShareSpot'; parent.updateDivHTML2(edUrl,edDiv); return; } // ********* End Auto Share Code *********** function setDigiHut(){ var img = document.getElementById('digiHUT_img'); console.log('digHut:finding',img); if (img){ rfi = 'Not Found'; if (document.referrer && document.referrer != ""){ rfi = document.referrer; } console.log('digiHut:rfi',rfi); //img.src = 'https://image.bitmonky.com/getHutImg.php?mid=efc6d1ba446e229536dd1f7f51923d87&hut=on&rfi='+encodeURIComponent(rfi); img.src = 'https://image.bitmonky.com/img/hutOwner.webp'; } } function doGoToChatRoom(id){ hideTop(); wzAPI_hidePage(); } function resetCancelPage(){ cancelPageLoad = false; } function doShowChatRoom(){ cancelPageLoad = true; setTimeout('resetCancelPage()',3*1000); hidePageOBJLoading('doShowChatRoom'); console.log('canceling PGL',cancelPageLoad); hideRootPg(); hideTop(); wzAPI_hideVideoPage(); wzAPI_hidePage(); } function doShowLastPage(){ cancelPageLoad = null; console.log('canceling PGL cancel',cancelPageLoad); hideTop(); doShowPageOBJ(); } function setWikiMode(to){ alert('Sorry Wiki Mode Only Available On PC or Laptop'); } function hideFranOp(){ var spot = document.getElementById('tycoonInfoCard'); if (spot){ spot.style.display = 'none'; doHideFranNotice = '&fhide=on'; } } function dragDIVListen(el, callback){ var touchsurface = el, startX, startY, distX, distY, dragDiv = callback || function(distX,distY){} touchsurface.addEventListener('touchstart', function(e){ var touchobj = e.changedTouches[0] startX = touchobj.pageX startY = touchobj.pageY }, false) touchsurface.addEventListener('touchend', function(e){ startX = null; //e.preventDefault() // prevent scrolling when inside DIV }, false) touchsurface.addEventListener('touchmove', function(e){ var touchobj = e.changedTouches[0] if (startX){ distX = touchobj.pageX - startX // get horizontal dist traveled by finger while in contact with surface distY = touchobj.pageY - startY // get vertical dist traveled by finger while in contact with surface dragDiv(distX,distY); startX = touchobj.pageX startY = touchobj.pageY } e.preventDefault() }, false) } function percentToPx(str,cord){ if (str.indexOf('%') < 0) {return str;} str = str.replace('%',''); var si = parseInt(str); var d = window.innerHeight; if (cord == 'left'){ d = window.innerWidth; } return (si/100.0) * d + 'px'; } function pxToInt(str){ str = str.replace('px',''); var si = parseInt(str); return si; } function swipedetect(el, callback){ var touchsurface = el, swipedir, startX, startY, distX, distY, threshold = 150, //required min distance traveled to be considered swipe restraint = 100, // maximum distance allowed at the same time in perpendicular direction allowedTime = 300, // maximum time allowed to travel that distance elapsedTime, startTime, handleswipe = callback || function(swipedir){} touchsurface.addEventListener('touchstart', function(e){ var touchobj = e.changedTouches[0] swipedir = 'none' dist = 0 startX = touchobj.pageX startY = touchobj.pageY startTime = new Date().getTime() // record time when finger first makes contact with surface //e.preventDefault() }, false) touchsurface.addEventListener('touchmove', function(e){ //e.preventDefault() // prevent scrolling when inside DIV }, false) touchsurface.addEventListener('touchend', function(e){ var touchobj = e.changedTouches[0] distX = touchobj.pageX - startX // get horizontal dist traveled by finger while in contact with surface distY = touchobj.pageY - startY // get vertical dist traveled by finger while in contact with surface elapsedTime = new Date().getTime() - startTime // get time elapsed if (elapsedTime <= allowedTime){ // first condition for awipe met if (Math.abs(distX) >= threshold && Math.abs(distY) <= restraint){ // 2nd condition for horizontal swipe met swipedir = (distX < 0)? 'left' : 'right' // if dist traveled is negative, it indicates left swipe } else if (Math.abs(distY) >= threshold && Math.abs(distX) <= restraint){ // 2nd condition for vertical swipe met swipedir = (distY < 0)? 'up' : 'down' // if dist traveled is negative, it indicates up swipe } } handleswipe(swipedir) //e.preventDefault() }, false) } function fetchAdvPkg(amt){ var edUrl = '/whzon/franMgr/advInvestPkg.php?wzID=0&pkgAmt=' + amt; var edDiv = 'advInvestPkg'; updateDivHTML2(edUrl,edDiv); } function advLockPkg(){ var conf = confirm("Lock In Your Investment Rate Now? This can not be changed after you lock it!"); if (conf){ var edUrl = '/whzon/franMgr/lockAdvInvest.php?wzID=0'; var edDiv = 'advInvestPkg'; updateDivHTML2(edUrl,edDiv); } return false; } function sendMbrWelcome(mbr){ wzGetPage('/whzon/mblp/mail/sendMbrWelcomForm.php?wzID=0&fwzUserID='+ mbr); } function sayToMember(name){ if (name == 'Agent.SiteMonkey.AI'){ showMkyDisclaimer(); } else { hideMkyDisclaimer(); } var id = null;showChatWidget(name,id);return; var chatb = document.getElementById("chTxtBox").elements["typeBox"]; if (chatb){ window.scrollTo(1, 0); chatb.value = ''; chatb.value = '@' + name + ' - '; chatb.focus(); } return false; } function sayToMemberCW(name,id){ if (name == 'Agent.SiteMonkey.AI'){ showMkyDisclaimer(); } else { hideMkyDisclaimer(); } showChatWidget(name,id);return; var chatb = document.getElementById("chTxtBox").elements["typeBox"]; if (chatb){ window.scrollTo(1, 0); chatb.value = ''; chatb.value = '@' + name + ' - '; chatb.focus(); } return false; } function getPgViewFrame(){ var appframe = document.getElementById('pgViewFrame'); if (appframe){ return appframe.contentWindow; } return null; } function findDiv(updDivName){ var div = updDivName; if (div.indexOf('parent.') == 0){ div = div.replace('parent.',''); var divh = document.getElementById(div); if (divh){ return divh; } } if (!pageOBJdoc){ pageOBJonload(); } console.log('findDiv',pageOBJdoc); if (pageOBJdoc){ var divh = pageOBJdoc.getElementById(updDivName); if (divh){ return divh; } } var appframe = document.getElementById('mbrVideoViewer'); if (appframe){ var divh = appframe.contentWindow.document.getElementById(updDivName); if (divh){ return divh; } } return null; } function urldecode(url) { return decodeURIComponent(url.replace(/\+/g, ' ')); } function updateDivJSON(inUrl,div){ showLoading("Fetching",div); var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = inUrl + '&xm=' + ranTime ; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { doUpdateDivJSON(this,div); } }; divxml.send(null); } function doUpdateDivJSON(xml,div){ var output = null; var appframe = null; var jdata = mkyTrim(xml.responseText); if (jdata == '') {jdata = '{}';} try {j = JSON.parse(jdata); } catch(err) { dbug("JSON fail: upDateDivJSON fail -> " + urldecode(jdata)); j = null; } if (div.indexOf('parent.') == 0){ div = div.replace('parent.',''); output = document.getElementById(div); output.innerHTML = htm; if (typeof(jsonHandler) != "undefined") { jsonHandler(j); } return; } else { appframe = document.getElementById('pgViewFrame'); if (appframe){ output = appframe.contentWindow.document.getElementById(div); } } if (!output){ appframe = document.getElementById('mbrVideoViewer'); if (appframe){ output = appframe.contentWindow.document.getElementById(div); } } if (output){ if (appframe){ if (typeof(appframe.contentWindow.jsonHandler) != "undefined") { appframe.contentWindow.jsonHandler(j); } } var htm = "JSON Error - trying again"; if (j){ var htm = urldecode(j.htm); } output.innerHTML = htm; } else { dbug('Like doUpdateDivJSON ' + div + 'Div Not Fount'); } } function updateDivHTML2(inUrl,div){ showLoading("Fetching",div); var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = inUrl + '&xm=' + ranTime ; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { doUpdateDivHTML2(this,div); } }; divxml.send(null); } function doUpdateDivHTML2(xml,div){ var output = null var appframe = null; if (div.indexOf('parent.') == 0){ div = div.replace('parent.',''); output = document.getElementById(div); } else { if (pageOBJdoc){ output = pageOBJdoc.getElementById(div); } } if (!output){ appframe = document.getElementById('mbrVideoViewer'); if (appframe){ output = appframe.contentWindow.document.getElementById(div); } } if (output){ output.innerHTML = xml.responseText; if (appframe){ if (typeof appframe.contentWindow.wzMblReDrawPage === 'function') { appframe.contentWindow.wzMblReDrawPage(); } } else { if (!pageOBJframe){ hidePageOBJLoading('doUpDivHTM2'); return; } if (typeof pageOBJframe.contentWindow.wzMblReDrawPage === 'function'){ pageOBJframe.contentWindow.wzMblReDrawPage(); } if (typeof pageOBJframe.contentWindow.mblReDrawPage === 'function'){ pageOBJframe.contentWindow.mblReDrawPage(); } } } } function tagThisPost(id){ var edUrl = '/whzon/mbr/vidView/frmACTagBonus.php?wzID=' + sID + '&acID=' + id; var edDiv = 'tagThisPost' + id; updateDivHTML2(edUrl,edDiv); return; } function submitACTagBonus(id){ var tagFrm = findDiv("tagBonusFrm"+id); var tloc = tagFrm.elements["ftagloc"].value; var tOwn = tagFrm.elements["ftagOwn"].value; var tWord = encodeURIComponent(tagFrm.elements["tword"].value); var edDiv = 'likeACTV' + id; var edUrl = '/whzon/mbr/vidView/addACTags.php?acType=Photos&acID=' + id + '&wzID=' + sID + '&floc=' + tloc + '&fown=' + tOwn + '&tword=' + tWord; updateDivHTML(edUrl,edDiv); } function doChanSkipBoost(id){ var con = confirm("Skip Commenting On This Boosted Post"); if (con){ var edUrl = '/whzon/public/skipBoostById.php?wzID=' + sID + '&fboostID=' + id; var edDiv = 'noDiv'; updateDivHTML2(edUrl,edDiv); readNextBoostAd(); reloadPageFrame('myTownBoosts'); } return; } function doSkipBoost(id){ var con = confirm("Skip Commenting On This Boosted Post"); if (con){ var edUrl = '/whzon/public/skipBoost.php?wzID=' + sID + '&facID=' + id; var edDiv = 'noDiv'; updateDivHTML2(edUrl,edDiv); parent.wzAPI_hidePage(); readNextBoostAd(); } return; } function doCancelLReply(id){ //var conf = confirm('Cancel This Reply?'); //if (conf){ var edUrl = '/whzon/mbr/cancelLikeReply.php?wzID=' + sID + '&likeID=' + id; var edDiv = 'LkVote' + id; updateDivHTML2(edUrl,edDiv); //} return; } function doRefreshLikes(id){ dbug('Like doRefreshLikeReplies ' + id); var edUrl = '/whzon/public/refreshLikes.php?wzID=' + sID + '&acID=' + id; var edDiv = 'likeACTV' + id; updateDivHTML2(edUrl,edDiv); return; } function doRefreshLikeReplies(id){ var edUrl = '/whzon/mbr/refreshLikeReplies.php?wzID=' + sID + '&likeID=' + id; var edDiv = 'lkReplies' + id; updateDivHTML2(edUrl,edDiv); return; } function doSendLikeReply(id){ frm = findDiv('txbReplylike' +id); var reply = ''; if (frm){ reply = encodeURIComponent(frm.value); } var edUrl = '/whzon/mbr/replyToLike.php?wzID=' + sID + '&likeID=' + id + '&repTxt=' + reply; var edDiv = 'lkReplies' + id; updateDivHTML2(edUrl,edDiv); doCancelLReply(id); return; } function doCancelRReply(id){ //var conf = confirm('Cancel This Reply?'); //if (conf){ var edUrl = '/whzon/mbr/cancelReplyReply.php?wzID=' + sID + '&replyID=' + id; var edDiv = 'RpVote' + id; updateDivHTML2(edUrl,edDiv); //} return; } function doSendReplyReply(id,lid){ frm = findDiv('txbReplyReply' +id); var reply = ''; if (frm){ reply = encodeURIComponent(frm.value); } var edUrl = '/whzon/mbr/replyToReply.php?wzID=' + sID + '&replyID=' + id + '&repTxt=' + reply; var edDiv = 'lkReplies' + lid; updateDivHTML2(edUrl,edDiv); doCancelRReply(id); return; } function doReplyReply(id){ var edUrl = '/whzon/mbr/getFrmReplyReply.php?wzID=' + sID + '&replyID=' + id; var edDiv = 'RpVote' + id; updateDivHTML2(edUrl,edDiv); return; } function doUpdateLikeTxt(id){ var eBox = findDiv('txbEditLike' + id); if (eBox){ var txt = encodeURIComponent(eBox.value); var edUrl = '/whzon/mbr/updateLikeTxt.php?wzID=' + sID + '&likeID=' + id + '&likeTxt=' + txt; var edDiv = 'likeTxtSpot' + id; updateDivHTML2(edUrl,edDiv); } return; } function doGetLikeEditFrm(lid){ var edUrl = '/whzon/mbr/getEditLikeTxt.php?wzID=' + sID + '&likeID=' + lid; var edDiv = 'likeTxtSpot' + lid; updateDivHTML2(edUrl,edDiv); return; } function doCancelEditLikeTxt(id){ dbug('doCanceleEditReply : ' + id); var edUrl = '/whzon/mbr/cancelEditLikeTxt.php?wzID=' + sID + '&likeID=' + id; var edDiv = 'likeTxtSpot' + id; updateDivHTML2(edUrl,edDiv); return; } function doUpdateLikeReply(id){ var eBox = findDiv('txbEditReply' + id); dbug('looking for edit data :' + id + eBox); if (eBox){ var txt = encodeURIComponent(eBox.value); dbug('value found ' + txt); var edUrl = '/whzon/mbr/updateLikeReply.php?wzID=' + sID + '&lRplyID=' + id + '&repTxt=' + txt; var edDiv = 'repTxtSpot' + id; updateDivHTML2(edUrl,edDiv); } return; } function doGetReplyEditFrm(id,lid){ var edUrl = '/whzon/mbr/getEditLikeReply.php?wzID=' + sID + '&lRplyID=' + id + '&likeID=' + lid; var edDiv = 'repTxtSpot' + id; updateDivHTML2(edUrl,edDiv); return; } function doCancelEditLReply(id){ dbug('doCanceleEditReply : ' + id); var edUrl = '/whzon/mbr/cancelEditLReply.php?wzID=' + sID + '&lRplyID=' + id; var edDiv = 'repTxtSpot' + id; updateDivHTML2(edUrl,edDiv); return; } function doLikeReply(id){ var edUrl = '/whzon/mbr/getFrmLikeReply.php?wzID=' + sID + '&likeID=' + id; var edDiv = 'LkVote' + id; updateDivHTML2(edUrl,edDiv); return; } function doReplyVote(id,vote){ var edUrl = '/whzon/mbr/voteReply.php?wzID=' + sID + '&replyID=' + id + '&lv=' + vote; var edDiv = 'RpVote' + id; updateDivHTML2(edUrl,edDiv); return; } function doLikeVote(id,vote){ //alert('Comming Soon'); var edUrl = '/whzon/mbr/voteLike.php?wzID=' + sID + '&lkID=' + id + '&lv=' + vote; var edDiv = 'LkVote' + id; updateDivHTML(edUrl,edDiv); return; } // **************************** // user Account Messages // **************************** var checkUserAccMgsT = null; function checkUserAccMsg(){ return; if (checkUserAccMgsT ){clearTimeout(checkUserAccMgsT);} if (wzUserID != 0){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/mblp/userSysNotices.php?wzID=0&xm=' + ranTime ; uAccxml.timeout = 20*1000; uAccxml.ontimeout = checkUserAccMsg; uAccxml.onerror = function (){ checkUserAccMgsT = setTimeout('checkUserAccMsg()',20*1000); }; uAccxml.open("GET", url,true); uAccxml.onreadystatechange = doUserAccMsg; uAccxml.send(null); } } function doUserAccMsg(){ if (uAccxml.readyState == 4){ if(uAccxml.status == 200){ var htm = mkyTrim(uAccxml.responseText); var op = document.getElementById('userAccNotice'); if (op){ op.innerHTML = htm; } checkUserAccMgsT = setTimeout('checkUserAccMsg()',20*1000); } } } // **************************** // Accept Instant Win Alerts // **************************** var clTimer = null; var clDiv = null; function runClock(){ clDiv = document.getElementById('clock'); if (!clTimer) { clTimer = 60; } if (clDiv){ clDiv.innerHTML = 'Time Remaining: 0: ' + clTimer; } clTimer = clTimer - 1; if (clTimer < 1) { alertWinClose(); return; } setTimeout(runClock,1000); } function declineInstantWin() { var con = confirm("Confirm Decline Payment"); if (con) { alertWinClose(); } } function showLoading(msg,div){ console.log('showLoading: ',div); var spot = findDiv(div); if (spot){ spot.innerHTML = "
" + msg + "...
"; } } function acceptInstantWin(isWinID) { var msg = document.getElementById('wzAlertMsg'); if (msg){ msg.innerHTML = " Accepting Earnings..."; } var edUrl = '/whzon/gold/acceptInstantWin.php?wzID=0&isWinID=' + isWinID; var edDiv = 'wzAlertMsg'; updateDivHTML(edUrl, edDiv); setTimeout(alertWinClose,5000); } function alertWinner(htm,action) { clTimer = null; runClock(); var alert = document.getElementById('wzAlertContainer'); var msg = document.getElementById('wzAlertMsg'); if (alert) { msg.innerHTML = htm + '
' + action + '
'; alert.style.display = "inline-block"; alert.style.visibility = 'visible'; alert.style.zIndex = alertLayer; var tone = document.getElementById('monkyBonusTone'); if (tone){ //tone.play(); } } } function alertWinClose() { var alert = document.getElementById('wzAlertContainer'); if (alert) { alert.style.display = "none"; } } function doAlertInstantWinner(isWinID){ var msg = 'View Profile'; msg = msg + '

Revenue Share Payment!


Hello ... '; msg = msg + 'Here is your share of yesterdays site revenues! You have 60 seconds to accept your payment. Click accept now.'; var action = 'accept payment | decline' alertWinner(msg,action); } var chatSpaceTry = 0; var chatSpaceTimer = null; var chatSpaceStatus = null; // **************************************** // Public Chat Widget Controls // **************************************** function showChatWidgetSpace(){ console.log('chatSpaceTry first: ',chatSpaceTry); hideTop(); var cwspace = document.getElementById('chatWidgetSpace'); if (cwspace){ console.log('chatSpaceTry is set: ',chatSpaceTry); chatSpaceTry = 0; cwspace.style.display = 'block'; return; } else { chatSpaceTry = chatSpaceTry + 1; console.log('chatSpaceTry: ',chatSpaceTry); if (chatSpaceTry < 4){ if (chatSpaceTimer){clearTimeout(chatSpaceTry);} chatSpaceTimer = setTimeout('showChatWidgetSpace()',500); } else { chatSpaceTry = 0; } } } function hideChatWidgetSpace(){ console.log('Try hideChatWidgetSpace: '); var cwspace = document.getElementById('chatWidgetSpace'); if (cwspace && chatSpaceStatus != 'open'){ cwspace.style.display = 'none'; chatSpaceStatus = null; } } function atMChangeChannel(atm){ console.log('atMChangeChanel',atm); wzChangeChannel(atm.chanID); doShowChatRoom(); showChatWidget(null,null,atm); } function showChatWidget(name,id,atm=null) { if (name == 'Agent.SiteMonkey.AI'){ showMkyDisclaimer(); } else { hideMkyDisclaimer(); } console.log('showChatWidget',atm); if (!surfncLoaded){ console.log('surfncaht not loaded'); wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID=' + wzChanID); } chatSpaceStatus = 'open'; var obut = document.getElementById('openForMChatBut'); if (obut){ obut.style.display = 'none'; } if (atm){ name = atm.nic; id = atm.mbrID; var toChanID = document.getElementById('postToChan'); if (toChanID){ toChanID.value = atm.chanID; } var toCName = document.getElementById('postToCName'); if (toCName){ toCName.value = atm.chan; } } var gto = id; if (!gto){gto = 0;} hidePVChatWidget(); hidePVDChatWidget(); showChatWidgetSpace(); hideMoreWidget(); if (id){ if (id != wzUserID){ doWidgetShowMore(id); } } else { id = wzUserID; gto = id; } var chatW = document.getElementById('chatWidget'); var chatT = document.getElementById('chatWidgetT'); if (chatW) { wzAPI_closeMenu(); chatW.style.width = "100%"; chatW.style.display = 'block'; chatW.style.zIndex = 20; var chatb = document.getElementById("chatWidgetBox"); var cimg = document.getElementById('chatWhoImg'); var cmsg = document.getElementById('chatWhoMsg'); if (cmsg){ if (atm){ var clink = "

" + atm.nic + "
"; cmsg.innerHTML = '
' + doEmotes(atm.msg) + clink + '

'; } else { cmsg.innerHTML = ''; } } if (cimg && gto){ if (wzChanID == 302057){ cimg.src = '//image.bitmonky.com/getDProfThm.php?id=' + gto; } else { cimg.src = '//image.bitmonky.com/getMbrImg.php?id=' + gto; } } if (chatb){ chatb.value = ''; if (name){ chatb.value = '@' + name + ' - '; } //chatb.focus(); } var goPV = document.getElementById("goPrivate"); dbug('div goPrivate found'); if (goPV){ goPV.onclick = function() { if (wzChanID == 302057){ wzPopDChat(gto); } else { wzPopChat(gto); } dbug('wzPop installed'); }; } var goMor = document.getElementById("goMoreWid"); dbug('div goMore found'); if (goMor){ hideJobNews(); if (gto == wzUserID){ goMor.value = ' More '; goMor.onclick = function() { doWidgetShowMore(id); }; } else { goMor.value = ' Show Less '; goMor.onclick = function() { hideMoreWidget(id); }; } } } return false; } function changeMoreFuncMore(id){ var goMor = document.getElementById("goMoreWid"); dbug('div goMore found'); if (goMor){ goMor.value = ' More '; goMor.onclick = function() { doWidgetShowMore(id); }; } } function changeMoreFuncLess(id){ var goMor = document.getElementById("goMoreWid"); dbug('div goMore found'); if (goMor){ goMor.value = ' Show Less '; goMor.onclick = function() { hideMoreWidget(id); }; } } function doWidgetShowMore(id){ var chatW = document.getElementById('chatWidgetMore'); if (chatW) { chatW.style.display = "inline-block"; chatW.style.borderRadius = ".5em"; var edUrl = '/whzon/mblp/mbr/showMoreInWidget.php?wzID=' + sID + '&mbrID=' + id; var edDiv = 'parent.chatWidgetMore'; updateDivHTML2(edUrl,edDiv); changeMoreFuncLess(id); } return; } function hideMoreWidget(id) { var chatW = document.getElementById('chatWidgetMore'); if (chatW) { chatW.style.display = "none"; chatW.innerHTML = ""; changeMoreFuncMore(id) } } function hideChatWidget() { chatSpaceStatus = null; var obut = document.getElementById('openForMChatBut'); if (obut){ obut.style.display = 'inline'; } console.log('Try Hide ChatWidget'); hideChatWidgetSpace(); var chatW = document.getElementById('chatWidget'); if (chatW) { chatW.style.display = "none"; } } // **************************************** // Private Chat Widget Controls // **************************************** function showPVChatWidget(name,id) { hideChatWidget(); hidePVDChatWidget(); var chatW = document.getElementById('pvChatWidget'); var chatT = document.getElementById('pvChatWidgetT'); if (chatW) { wzAPI_closeMenu(); chatW.style.width = "98%"; if (chatT){ chatT.style.width = "98%"; } chatW.style.display = 'block'; chatW.style.zIndex = 20; var chatb = document.getElementById("pvChatWidgetBox"); var cimg = document.getElementById('pvChatWhoImg'); if (cimg && id){ cimg.src = '//image.bitmonky.com/getMbrTmn.php?id=' + id; } if (chatb){ chatb.value = ''; if (name){ chatb.value = '@' + name + ' - '; } //chatb.focus(); } } return false; } function hidePVChatWidget() { var chatW = document.getElementById('pvChatWidget'); if (chatW) { chatW.style.display = "none"; } } // **************************************** // Private DChat Widget Controls (dating App) // **************************************** function showPVDChatWidget(name,id) { hideChatWidget(); hidePVChatWidget(); var chatW = document.getElementById('pvDChatWidget'); var chatT = document.getElementById('pvDChatWidgetT'); if (chatW) { wzAPI_closeMenu(); chatW.style.width = "98%"; if (chatT){ chatT.style.width = "98%"; } chatW.style.display = 'block'; chatW.style.zIndex = 20; var chatb = document.getElementById("pvDChatWidgetBox"); var cimg = document.getElementById('pvDChatWhoImg'); if (cimg && id){ cimg.src = '//image.bitmonky.com/getDProfThm.php?id=' + id; } if (chatb){ chatb.value = ''; if (name){ chatb.value = '@' + name + ' - '; } //chatb.focus(); } } return false; } function hidePVDChatWidget() { var chatW = document.getElementById('pvDChatWidget'); if (chatW) { chatW.style.display = "none"; } } function getMoreMkdPosts(pg,qry,cpCity){ var hq = ''; var loc = findDiv('CitiesFound' + (pg -1)); if (loc){ loc.style.display = 'none'; } //if (qry){ // hq = '&hQry=' + encodeURIComponent(doSetHashQry(qry)); //} window.scrollTo(1,500); var head = findDiv('pgHeader'); if (head){ head.style.display = 'none'; } var pgNews = findDiv('pgNewsSpot'); if (pgNews){ pgNews.style.display = 'none'; } var edUrl = '/whzon/apps/dating/mkdActivityFeed.php?wzID=0&fro=on' + cpCity + '&pg=' + pg + '&pgLen=15' + hq + '&scrMaxw=' + parent.maxw; var edDiv = 'acPageSpot' + pg; updateDivHTML2(edUrl,edDiv); var spt = findDiv(edDiv); spt.style = 'padding:0px;'; } function getMoreMkdMbrPosts(pg,id){ window.scrollTo(1,500); var hq = ''; var loc = findDiv('CitiesFound' + (pg -1)); if (loc){ loc.style.display = 'none'; } var head = findDiv('pgHeader'); if (head){ head.style.display = 'none'; } var pgNews = findDiv('pgNewsSpot'); if (pgNews){ pgNews.style.display = 'none'; } var edUrl = '/whzon/apps/dating/mkdActivityFeed.php?wzID=0&fro=on&viewUID=' + id + '&pg=' + pg + '&pgLen=15' + hq + '&scrMaxw=' + parent.maxw; var edDiv = 'acPageSpot' + pg; updateDivHTML2(edUrl,edDiv); var spt = findDiv(edDiv); spt.style = 'padding:0px;'; } function popPurchaseCity(cityID) { alert("Members Only... Please login or join"); } // **************************** // DIV html update xml handlers // **************************** function updateVidDivHTML(inUrl,div){ updDivName = div; if (!updDivxml){ updDivxml = getHttpConnection(); } var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = inUrl + '&xm=' + ranTime ; updDivxml.open("GET", inUrl,true); updDivxml.onreadystatechange = doVidUpdateDivHTML; updDivxml.send(null); } function doVidUpdateDivHTML(){ if (updDivxml.readyState == 4){ if(updDivxml.status == 200){ var appframe = document.getElementById('mbrVideoViewer'); if (appframe){ var output = appframe.contentWindow.document.getElementById(updDivName); dbug('pageFrameDivFound:' + updDivName); if (output){ output.innerHTML = updDivxml.responseText; if (typeof appframe.contentWindow.onDivLoaded === "function") { appframe.contentWindow.onDivLoaded(); } if (typeof appframe.contentWindow.wzMblReDrawPage === 'function'){ appframe.contentWindow.wzMblReDrawPage(); } } } } } } function updateDivHTML(inUrl,div){ console.log('updateDivHTML',div); showLoading("Fetching",div); var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = inUrl + '&xm=' + ranTime ; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { doUpdateDivHTML2(this,div); } }; divxml.send(null); } // *********************************** // **** Go to city auction in progress // ********************************** function goCityAuction(id){ wzGetPage('/whzon/franMgr/franSelectCity.php?wzID=0&bidCityID=' + id); } // Tone settings function setNotifyToneON(){notifyTone = 1;} function setNotifyToneOFF(){notifyTone = null;} function setPChatToneON(){pvchatTone = 1;} function setPChatToneOFF(){pvchatTone = null;} function togleDSMode(){ var conf = null; if (dsMode){ nMode = 'off'; conf = confirm('Turn Data Save Mode Off?'); } else { nMode = 'on'; conf = confirm('Turn Data Save Mode On?'); } if (!conf){ return; } var spot = document.getElementById('dsModeStat'); var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/mbr/mail/updateDataSaveMode.php?fdsmode=' + nMode + '&wzID=' + sID + '&xm=' + ranTime ; divxml.open("GET", url,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { try { nMode = JSON.parse(this.responseText); } catch(err) { dbug("JSON fail: doNotifications"); return; } console.log(nMode); if (nMode.mode == 'off'){ spot.innerHTML = 'Off'; spot.style.color = '#777777'; dsMode = null; } else { spot.innerHTML = 'On'; spot.style.color = 'red'; dsMode = 1; } } }; divxml.send(null); } function togleAlertTones(){ var ntone = null; if (notifyTone){ ntone = 'off'; } else { ntone = 'on'; } var spot = document.getElementById('tonesStat'); var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/mbr/mail/updateNotifyTone.php?fntone=' + ntone + '&wzID=' + sID + '&xm=' + ranTime ; divxml.open("GET", url,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { try { ntone = JSON.parse(this.responseText); } catch(err) { dbug("JSON fail: doNotifications"); return; } console.log(ntone); if (ntone.tone == 'fail'){ return; } if (ntone.tone == '1'){ spot.innerHTML = 'Off'; setNotifyToneOFF(); } else { spot.innerHTML = ''; setNotifyToneON(); } } }; divxml.send(null); } function redirectToAd(url){ window.open(url,'_blank'); } function formatHashTags(txt){ txt = txt.replace('#',' #'); var re = /(?:^|\W)#(\w+)(?!\w)/g, match, matches = []; while (match = re.exec(txt)) { matches.push(match[1]); } for (var i in matches){ var str = matches[i]; str = str.replace('#',''); var sstr = Left(str,20); var ank = "#" + sstr + ""; txt = txt.replace('#' + str,ank); } return txt; } function wzDocumentHeight(){ var body = document.body; var html = document.documentElement; var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); return height; } function wzScrollXis(){ return window.pageYOffset || document.documentElement.scrollTop; } function checkWRTCCtrl(){ if (!winWRTCCtrl){ return; } if (winWRTCChat){ winWRTCCtrl.innerHTML = ''; } else { winWRTCCtrl.innerHTML = ''; } } function setUserWebRTC(to){ if (wzUserID != 0){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/wzWRTC/setUserWebRTC.php?wzID=' + sID + '&fWTRC=' + to + '&xm=' + ranTime ; webRTCCon.open("GET", url,true); webRTCCon.onreadystatechange = function(){}; webRTCCon.send(null); } } function popUpNear(url,id,h) { wzAPI_showFrame(url, maxw, h, 0,0); } function adminDelLike(likeID) { var appframe = document.getElementById('pgViewFrame'); var locID = null; if (appframe){ locID = appframe.contentWindow.document.getElementById('likeNbr' + likeID); } if (!locID){ appframe = document.getElementById('mbrVideoViewer'); dbug('appframe is now vid: ' + appframe); } locID = appframe.contentWindow.document.getElementById('likeNbr' + likeID); var yoff = wzAPI_getOffset(locID).top; dbug('Remove Like yoff: ' + yoff); if (yoff < 0) {yoff = 0;} var URL = "/whzon/mbr/popConfirmDelLike.php?wzID=0&flikeID=" + likeID; parent.wzAPI_showFrame(URL, maxw, 180, 0, yoff); } function checkLikeStatus(msg){ msg = mkyTrim(msg); var s3 = msg.substr(0,3); var sR = msg.substr(3); dbug('check like: ' + s3 + ' ' + sR); if (msg == 'max'){ alert('Sorry you have given to many likes in the last 24 hours... Please wait and try again later.'); } if (s3 == 'dup'){ alert('That opinion has been used ' + sR + ' times already... Give an honest and meaningful opinion if you want to get paid!'); } } function readMoreLikes(acID,pg) { dbug("readMoreLikes"); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/mbr/readMoreLikes.php?wzID=' + sID + '&facID=' + acID + '&fpg=' + pg + '&xm=' + ranTime; mlikesxml.open("GET", url, true); mlikesxml.onreadystatechange = writeMoreLikes; mlikesxml.send(null); } function writeMoreLikes() { if (mlikesxml.readyState == 4) { if (mlikesxml.status == 200) { //dbug("write more Likes" + mkyTrim(mlikesxml.responseText)); var jlikes = JSON.parse(mkyTrim(mlikesxml.responseText)); var appframe = document.getElementById('pgViewFrame'); dbug("appframe: " + appframe); var wzoutput = null; if(appframe){ var wzoutput = appframe.contentWindow.document.getElementById('likesList' + jlikes.acID); } if (!wzoutput){ appframe = document.getElementById('mbrVideoViewer'); dbug("appframe Try two : " + appframe); } wzoutput = appframe.contentWindow.document.getElementById('likesList' + jlikes.acID); var morediv = appframe.contentWindow.document.getElementById('likesMore' + jlikes.acID); if (wzoutput) { gdiv = appframe.contentWindow.document.createElement('DIV'); gdiv.id = 'mlikes' + jlikes.acID + 'pg' + jlikes.pg; gdiv.innerHTML = doEmotes(jlikes.htm); if (wzoutput.childNodes.length == 0){ wzoutput.appendChild(gdiv); } else { wzoutput.insertBefore(gdiv, wzoutput.firstChild); } if (typeof wzMblReDrawPage === 'function') {wzMblReDrawPage();} if (typeof fhReDrawFrame === 'function') {fhReDrawFrame();} } if (morediv){ if (jlikes.nRead < jlikes.nLikes){ morediv.innerHTML = 'View More Likes...'; } else { morediv.innerHTML = ''; } } } } } function loadHashQry(acID,qry){ wzGetPage('/whzon/mblp/homepg.php?wzID=' + sID + '&fhQry=' + qry); } function videoShare(id){ wzGetVideoPage('/whzon/mblp/vidView/viewVideoPg.php?wzID=0&videoID=' + id); } function wzOpenFanReq(mbrID){ alert("you must login or become a member to follow this member"); } function wzhashBrowser(str) { var num = 0; n = 1; hstr = ""; for (var i = 0; i < str.length; i++) { num = num + str.charCodeAt(i); if (n > str.length / 4) { hstr = hstr + num; n = 1; } else n = n + 1; } return (num + "H" + hstr); } function trackPage(){ return; } function hash(str){ var num=0; n=1; hstr=""; for (var i=0;istr.length/4){ hstr=hstr + num; n=1; } else n=n+1; } return (num + "H" + hstr); } function hideMainInput(){ var wzctrl = document.getElementById('wzMainInputBox'); mainInputHTML = wzctrl.innerHTML; wzctrl.innerHTML = ''; } function showMainInput(){ if (!wzStartUp && mainInputHTML){ var wzctrl = document.getElementById('wzMainInputBox'); if (wzctrl) { wzctrl.innerHTML = mainInputHTML ; } } } function hideDiv(div){ var d = findDiv(div); if (d){ d.style.display = 'none'; } } function showDiv(div){ var d = findDiv(div); if (d){ d.style.display = 'block'; } } function chanMinimize(){ hideDiv('parent.chanTop'); hideDiv('parent.inThisRoomNow'); showDiv('parent.chanRestore'); hideDiv('parent.chanMin'); } function chanRestorMinimize(){ showDiv('parent.chanTop'); showDiv('parent.inThisRoomNow'); hideDiv('parent.chanRestore'); showDiv('parent.chanMin'); } function chanStartSchedBroadcast(cstrID){ var notice = document.getElementById('userAccNotice'); if (notice){ notice.innerHTML = ''; } window.open('/whzon/live/schedGoLiveNow.php?wzID=' + sID + '&cstrID=' + cstrID,'_liveStream'); } function chanGoLive(){ var edUrl = '/whzon/live/getBrodStream.php?wzID=' + sID + '&inChanID=' + wzChanID; var edDiv = 'parent.liveStream'; updateDivHTML2(edUrl,edDiv); chanShowSCTRLs(); } var cstrTimer = null; function chanBroadCastLive(){ alert ('Not available'); return; if (wzWRTCon == 1 && 1 == 2){ //alert('chrome'); var edUrl = '/whzon/live/getBroadCastStream.php?mode=nf&wzID=' + sID; window.open(edUrl); } else { var edUrl = '/whzon/live/getBrodMetaData.php?wzID=' + sID; var edDiv = 'parent.liveStream'; updateDivHTML2(edUrl,edDiv); chanShowSCTRLs(); cstrTimer = setTimeout(chanForceShutdown,2.5*60*1000); } } function chanCleanUpStream(){ var edUrl = '/whzon/live/cleanUp.php?wzID=' + sID; var edDiv = 'noDiv'; updateDivHTML2(edUrl,edDiv); } function chanForceShutdown(){ chanCloseStream(); } function chanShowBCTRLs(){ var edDiv = findDiv('parent.liveBCtrls'); if (edDiv){ edDiv.style.display = 'inline-block'; } } function chanShowSCTRLs(){ var edDiv = findDiv('parent.liveSCtrls'); if (edDiv){ edDiv.style.display = 'inline-block'; } } function chanMoreStreams(){ wzGetVideoPage('/whzon/live/chan/chanLiveStreams.php?wzID=' + sID); chanCloseStream(); chanMinimize(); } function chanCloseStream(){ var edDiv = findDiv('parent.liveStream'); if (cstrTimer){ clearTimeout(cstrTimer); } if (edDiv){ var htm = ""; htm = htm + " "; edDiv.innerHTML = htm; } var edDiv = findDiv('parent.liveSCtrls'); if (edDiv){ edDiv.style.display = 'none'; } chanCleanUpStream(); } function checkSession(){ if (wzUserID != 0 && 1==1){ //*** Disabled for now. var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/sessionStatusWC.php?wzID=0&xm=' + ranTime ; sessConn.open("GET", url,true); sessConn.onreadystatechange = doCheckSession; sessConn.send(null); } } function doCheckSession(){ if (sessConn.readyState == 4){ setTimeout(checkSession,55*1000); if(sessConn.status == 200){ var status = mkyTrim(sessConn.responseText); if (status == "inJail"){ goToJail(); } if (status == "offline"){ //window.location.href = '/whzon/sessExpNotice.php'; } } } } function runSearchQry(){ var mQry = escape(document.getElementById("headerSearch").elements["fqry"].value); mQry = mkyTrim(mQry); if (mQry != "") wzGetPage('/whzon/mytown/myTown.php?fmyMode=qry&fwzUserID=&fqry=' + mQry); return false; } function wzWindowSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return { 'x': myWidth, 'y': myHeight} } function wzSetPageMargins(){ pgw = wzWindowSize().x; if (document.body.clientWidth) {pgw = document.body.clientWidth;} maxw = pgw; chatXW = 370; var marg = 0; mainTable.style.width = "100%"; pgViewXW = mainTable.style.width; document.body.style.marginLeft = marg; document.body.style.marginRight = marg; wzAPI_reSizePage(pgViewXW); } function hideJoinLink(){ if (mainCtrls){ mainCtrls.innerHTML = ''; } var bar = document.getElementById("mainControlBar") if (bar) bar.style.height = '60px'; } function displaySession() { if (wzUserID){ //sessDiv.innerHTML = 'Options'; sessDiv.innerHTML = ''; mainCtrls.innerHTML = ''; document.getElementById("mainControlBar").style.height = '60px'; setTimeout(checkSession,30*1000); } else{ //sessDiv.innerHTML = 'Login'; sessDiv.innerHTML = ''; } } function wzOwnerEditChan(id){ wzAPI_showFrame("/whzon/talk/frmEditChannel.php?wzID=" + sID + "&fchanID="+id,400,300,50,100); } function wzChangeChannelNoClose(chanID) { if (wzChanID == chanID && surfncLoaded){ return; } wzChanID = chanID; chanHasChanged = true; isRolling = null; lastMsgID = 0; wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID='+chanID); rotateAdSpot(); if (findDiv('postToChanSpot')){ var appframe = document.getElementById('pgViewFrame'); if (appframe){ appframe.contentWindow.document.location.reload(); } } } function wzReloadChannel() { lastMsgID = 0; isRolling = null; wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID='+ wzChanID); rotateAdSpot(); } function wzChangeChannel(chanID,nofocus=null) { wzAPI_closeMenu(); if (wzChanID == chanID && surfncLoaded){ lcShowChat(); return; } wzChanID = chanID; chanHasChanged = true; isRolling = null; lastMsgID = 0; wzLoadStream('/whzon/mblp/surfnchat.php?wzID=' + sID + '&fchanID='+chanID,nofocus); rotateAdSpot(); if (findDiv('postToChanSpot')){ var appframe = document.getElementById('pgViewFrame'); if (appframe){ appframe.contentWindow.document.location.reload(); } } } // General system controls function showEmoteInfo(){ wzGetPage("/whzon/mblp/emoteInfo.php"); } function myBlockList(){ wzAPI_showFrame("/whzon/talk/myBlockList.php?wzID=" + sID,380,550,250,100); } function wzQuickReg(mode=null){ if (mode){ wzGetPage("/whzon/mblp/signup/frmQuickLogin.php?rMode="+mode); return; } wzGetPage("/whzon/mblp/signup/frmQuickLogin.php"); return; if (pageStatus == '//www.bitmonky.com/whzon/franMgr/franMgr.php'){ wzGetPage("/whzon/mblp/signup/frmQuickLogin.php?fmode=franMgr"); } else { if (pageStatus == '//www.bitmonky.com/whzon/adMgr/adMgr.php'){ wzGetPage("/whzon/mblp/signup/frmQuickLogin.php?fmode=AdMgr"); } else { wzGetPage("/whzon/mblp/signup/frmQuickLogin.php"); } } } function setCleanUpOn(){ wzCleanUpOn = 1; } function setCleanUpOff(){ wzCleanUpOn = null; } function startPShare(){ var URL = "/whzon/mblp/photoMgr/frmQuickPhotos.php?wzID=" + sID + "&fmode=1"; wzGetPage(URL); } function pshare(pID,uID){ wzGetPage('/whzon/mblp/mbr/mbrViewPhotos.php?wzID=0&fwzUserID=' + uID + '&vPhotoID=' + pID); } function wzOpenSiteLOG(URL,wsID){ wzGetPage(URL); } // Public Chat Controls function fillChars(chr,cnt) { var s = ''; for (var i = 0; iDismiss All[o] | "; htm = htm + "Close[x]"; htm = htm + "

"; htm = htm + ""; popViewer.innerHTML = htm; popViewer.style.width = '100%'; popViewer.style.height = '650px'; popViewer.style.left = '0px'; popViewer.style.top = yoff+'px'; popViewer.style.display = "inline-block"; } function sendMoshBoxNotification(id){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/moshbox/sendNotify.php?wzID=' + sID + '&fboxID=' + id + '&xm=' + ranTime ; moshNFCon.open("GET", url,true); moshNFCon.onreadystatechange = doNothingMsg; moshNFCon.send(null); } function pullDwnChannels(){ var imgELID = document.getElementById('wxpulldwn'); var xoff = wzAPI_getOffset(imgELID).left; var yoff = wzAPI_getOffset(imgELID).top + 17; var mURL = '/whzon/mblp/menuTalkChannels.php?wzID='+sID + '&fchanID=' + wzChanID; if (chanFilter == 'history'){ mURL = mURL + '&history=on'; } wzGetPage(mURL); } function vshare(URL){ var winName = "wzGigBox"; var winVS = window.open(URL,winName,"target=new,width=600,height=350,resizable=no,scrollbars=no"); winVS.focus(); } function changeChanStory(id){ if (id != 1){ wzChangeChannel(id); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/talk/getChanStory.php?wzID=' + sID + '&fchan=' + id + '&xm=' + ranTime ; chStoryCon.open("GET", url,true); chStoryCon.onreadystatechange = doChangeChanStory; chStoryCon.send(null); } } function doChangeChanStory(){ if (chStoryCon.readyState == 4){ if(chStoryCon.status == 200){ var curl = mkyTrim(chStoryCon.responseText); wzGetPageOS(curl); } } } function readInThisRoom(){ if (roomTimer) clearTimeout(roomTimer); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); // var url = '/whzon/mblp/inThisRoomNowWC.php?wzID=' + sID + doHideFranNotice + '&fchanID=' + wzChanID + '&xwidth=' + maxw + '&xm=' + ranTime ; var url = '/whzon/mblp/inThisRoomNowWC.php?wzID=' + sID + '&fchanID=' + wzChanID + '&xwidth=' + maxw + '&xm=' + ranTime ; inRoomCon.timeout = 30*1000; inRoomCon.ontimeout = readInThisRoom; inRoomCon.onerror = function(){ roomTimer = setTimeout('readInThisRoom()',50*1000); }; inRoomCon.open("GET", url,true); inRoomCon.onreadystatechange = writeInThisRoom; inRoomCon.send(null); } function writeInThisRoom(){ if (inRoomCon.readyState == 4){ if(inRoomCon.status == 200){ if (roomTimer) {clearTimeout(roomTimer);} roomTimer = setTimeout(readInThisRoom,50*1000); console.log('xbuginThisRoom:',inRoomCon.responseText); var rhtml = mkyTrim(inRoomCon.responseText); inThisRoom = document.getElementById("inThisRoomNow"); if (inThisRoom) { inThisRoom.innerHTML = rhtml; } } } } function rotateAdSpot(){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/adMgr/srvAd.php?wzID=' + sID + '&fh=75&fw=&fqry=&xm=' + ranTime ; adspotxml.open("GET", url,true); adspotxml.onreadystatechange = doRotateAdSpot; adspotxml.send(null); } function clickBoostLS(url){ wzGetPage(url); rotateAdSpot(); chanCloseStream(); chanMinimize(); } function clickAdSpot2(url){ wzGetPage(url); rotateAdSpot(); } function readNextBoostAd(){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/adMgr/srvBoostAd.php?wzID=' + sID + '&mode=mblp&xm=' + ranTime ; boostAdxml.open("GET", url,true); boostAdxml.onreadystatechange = writeNextBoostAd; boostAdxml.send(null); } function writeNextBoostAd(){ if (boostAdxml.readyState == 4){ if(boostAdxml.status == 200){ var rhtml = mkyTrim(boostAdxml.responseText); var wzoutput = document.getElementById("wzSysMsgDiv"); if (wzoutput){ wzoutput.innerHTML = ""; wzoutput.innerHTML = rhtml; } } } } function doRotateAdSpot(){ if (adspotxml.readyState == 4){ if(adspotxml.status == 200){ var rhtml = mkyTrim(adspotxml.responseText); var wzoutput = document.getElementById("wzMainAd"); if(wzoutput){ wzoutput.innerHTML = ""; wzoutput.innerHTML = rhtml; } } readNextBoostAd(); } } function optionMenu(){ //hideAllLayers(); wzGetPage("/whzon/mblp/mobileMenu.php?wzID=" + sID); //document.getElementById('mainButton').style.display = 'none'; //innerHTML = 'Lounge'; document.getElementById('typeBox').style.visibility = "hidden"; } function wzAPI_closeMChat() { } function wzAPI_hideMChat() { } function wzAPI_focusMChat() { hideAllLayers(); window.scrollTo(1, 1); document.getElementById('typeBox').focus(); } function wzAPI_focusMChatBlur() { hideAllLayers(); window.scrollTo(1, 1); document.getElementById('typeBox').blur(); } function wzAPI_focusMChatOnlyRoom() { hideAllLayers(); window.scrollTo(1, 1); document.getElementById('typeBox').blur(); wzChangeChannel(293174); } function hideSysMsg() { sysMsgDiv = document.getElementById("wzSysMsgDiv"); if (sysMsgDiv){ sysMsgDiv.innerHTML = ""; } } function hideTopic() { topicDiv = document.getElementById("wzTopicDiv"); if (topicDiv){ topicDiv.innerHTML = ""; } } function wzLoadStream(urlpath,nfocus=null) { var hideTime = 15000; // if (hideTopicTimer) {clearTimeout(hideTopicTimer);} // hideTopicTimer = setTimeout(hideTopic,hideTime); // if (hideSysMsgTimer) {clearTimeout(hideSysMsgTimer);} // hideSysMsgTimer = setTimeout(hideSysMsg,hideTime); if(!nfocus){ wzAPI_focusMChat(); } var xm = new Date(); var url = urlpath + '&xv=' + xm.getMilliseconds(); wzStream.open("GET", url, true); wzStream.onreadystatechange = wzWriteStream; wzStream.send(null); } function doConfirmRoomTerms() { var xm = new Date(); var url = '/whzon/talk/confirmRoomTerms.php?wzID=' + sID + '&xv=' + xm.getMilliseconds(); rmStream.open("GET", url, true); rmStream.onreadystatechange = finishRoomTerms; rmStream.send(null); } function finishRoomTerms(){ if (rmStream.readyState == 4){ if(rmStream.status == 200){ wzChangeChannel(1); } } } function wzWriteStream() { if (wzStream.readyState == 4){ if(wzStream.status == 200){ var htmResult = wzStream.responseText; if (htmResult.indexOf('wzAcceptTerms:') != -1){ if (confirm('*** TERMS OF SERVICE ***\n\nThe Main Channel Is A Langauge Specific Room... The Language Spoken in this room is English. Confirm that you agree to speak in english while using this channel. If you do not agree you will be moved to a mix language channel.')){ doConfirmRoomTerms(); } else { wzChangeChannel(271924); } return 0; } if (chatDiv != null ) { if (htmResult != "") { chatDiv.innerHTML = htmResult; clearTimeout(talkTimer); setTimeout(ReadMsg,0.4*1000); } else chatDiv.innerHTML = ""; } //chanGoLive(); readInThisRoom(); surfncLoaded = true; } } } function updateBlockList(){ readBlockList(); wzReloadChannel(); } function readCountryFilters(){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/talk/getCountryFilters.php?wzID=' + sID + '&xm=' + ranTime ; blockLCon.open("GET", url,true); blockLCon.onreadystatechange = doReadCountryFilters; blockLCon.send(null); } function doReadCountryFilters(){ if (blockLCon.readyState == 4){ if(blockLCon.status == 200){ var msg = mkyTrim(blockLCon.responseText); try { var j = JSON.parse(msg); dbug('j is ' + j); myRFilters = j.myFilters; dbug('reading country filters'); } catch (e) { } } } } function countryIsBlocked(id){ //dbug('checking country filters' + myRFilters); if (myRFilters){ dbug('filters found'); for (var i in myRFilters){ if (myRFilters[i] == id){ return true; } } } return false; } function readBlockList(ID){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/talk/getBlockList.php?wzID=' + sID + '&xm=' + ranTime ; blockLCon.open("GET", url,true); blockLCon.onreadystatechange = doReadBlockList; blockLCon.send(null); } function doReadBlockList(){ if (blockLCon.readyState == 4){ if(blockLCon.status == 200){ var msg = mkyTrim(blockLCon.responseText); if ( msg != "" && msg != "0;") { cptr = msg; prevL = 0; blockList.length = 0; while (cptr.length > 0 && cptr.length != prevL) { prevL = cptr.length; var blockID = parsmsg(";"); blockList[blockID] = 1; } } readCountryFilters(); } } } function loadStreamFrame() { var url = 'chatFrame.htm'; lstrmCon.open("GET", url,true); lstrmCon.onreadystatechange = doLoadStreamFrame; lstrmCon.send(null); } function doLoadStreamFrame(){ if (lstrmCon.readyState == 4) { if (lstrmCon.status == 200) { var html = mkyTrim(lstrmCon.responseText); ReadMsg(); } } } function doUserActionLog(){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = "/whzon/userOnlineUpdate.php?wzID=" + sID + "&xm=" + ranTime; wzSessUPD.open("GET", url,true); wzSessUPD.onreadystatechange = doNothingMsg; wzSessUPD.send(null); } function doSendMsgToServer(url){ sendmgsxml.open("GET", url,true); sendmgsxml.onreadystatechange = doNothingMsg; sendmgsxml.send(null); } function doMuteSelf(){ var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var URL = '/whzon/mbr/mods/muteSelf.php?wzID=' + sID + '&fpen=30&xm=' + ranTime; if (fwarnings<10) { URL = '/whzon/mbr/mods/muteSelf.php?wzID=' + sID + '&fpen=5&xm=' + ranTime; } mutexml.open("GET", URL,true); mutexml.onreadystatechange = doNothingMsg; mutexml.send(null); } function doNothingMsg(){ } function doWarnMsg(msg){ if (msg.indexOf('@')>0 ) { msg = ''; alert('Please Send Contact Info Only In Private Conversations'); } if (msg.indexOf('http') >-1 || msg.indexOf('.com') >-1 || msg.indexOf('www') > -1 ) { msg = ''; alert('Please do not list URL`s in Public Chat'); } return msg; } function setMkdID(id){ mkdID = id; } function sendMsg(){ hideMkyDisclaimer(); if (wzUserID == 0){ var conf = confirm('You Must Join To Chat With Our Members'); if (conf){ document.location.href = '/whzon/mblp/signup/frmQuickLogin.php?wzID=' + sID; } return; } if (wzChanID == 302057 && !mkdID){ alert('Please Register A Dating Profile To Use This Channel'); wzGetPage('/whzon/apps/dating/appDating.php?wzID=' + sID); return; } //document.getElementById('mainButton').innerHTML = 'Send'; document.getElementById('typeBox').style.visibility = "visible"; var msg = document.getElementById("chatWidgetBox").value; msg = mkySanitize(mkyTrim(msg)); var pchan = document.getElementById('postToChan'); var pcname = document.getElementById('postToCName'); if (pchan){ if (pchan.value != ''){ pchan = '&pchan=' + pchan.value; } else { pchan = ''; } } if (pcname){ if (pcname.value != ''){ pcname = "

Channel " + pcname.value + "
"; } else { pcname = ''; } } hideChatWidget(); window.scrollTo(1,1); //wzAPI_focusMChatBlur(); if (1==2 && parent.eVerified != 1 && parent.wzUserID > 402959 ) { wzAPI_setRefreshPg(1); wzAPI_showFrame("/whzon/signup/fastJoin.php?mode=v&wzID=0",400,450,50,100); } else { doUserActionLog(); msg = mkyTrim(msg); msg = doWarnMsg(msg); var chkMsg = msg; if (ProfanityUsed(stripToAlpha(chkMsg))){ doMuteSelf(); alert("You Can't Talk Like That Here!"); } else{ if (msg != '') { var hutID = ''; if (isDigiHut !== null){ hutID = '&digiHut='+isDigiHut; var hutMsg = ' says: '+msg; gsoftDoLog(hutMsg); } console.log('hutID: '+isDigiHut,hutID); msg = stripToLowerCase(msg); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/talk/sendChatOpt.php?wzID=' + sID + '&fshout=' + escape(msg) + pchan + hutID + "&xm=" + ranTime; doSendMsgToServer(url); msg = doEmotes(msg); msg = formatHashTags(msg); // ifrm.scrollTo(1,1); var wzoutput = document.getElementById("chatDiv"); gdiv = document.createElement('DIV'); var formatDiv = "
"; gdiv.innerHTML = formatDiv + "
I Said:
" + msg + pcname + "
"; if (wzoutput){ if (wzoutput.childNodes.length == 0) wzoutput.appendChild(gdiv); else wzoutput.insertBefore(gdiv,wzoutput.firstChild); } } document.getElementById("chTxtBox").elements["fmsg"].value = ''; } //writeGglAd(); rotateAdSpot(); } return false; } function checkForInstantWinner() { var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); var url = '/whzon/talk/checkForInstantWin.php?wzID=' + sID + '&xm=' + ranTime; winxml.open("GET", url, true); winxml.onreadystatechange = DoCheckForInstantWinner; winxml.send(null); } function DoCheckForInstantWinner(){ if (winxml.readyState == 4) { if (winxml.status == 200) { var isWinID = parseInt(winxml.responseText); if (isWinID > 0){ //dbug("winner found!" + isWinID); doAlertInstantWinner(isWinID); } } } } function ReadMsg() { if (isRolling){ if (talkTimer){clearTimeout(talkTimer);} talkTimer = setTimeout(ReadMsg,rollRefresh * 1000); return; } if (talkTimer) clearTimeout(talkTimer); if (chanHasChanged){ chanHasChanged = null; lastMsgID = 0; mblAdCnt = 1; mblAdsServed = 0; } var streamDiv = document.getElementById("chatLoading"); if (streamDiv){streamDiv.style.visibility = "visible";} var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); if (!wzChanID || wzChanID == 'undefined'){ wzChanID = 1; } if (mblAdCnt == 3){ mblAdsServed = mblAdsServed + 1; } var url = '/whzon/mblp/mbrChatGetJOBWC.php?fcu=' + wzUserID + '&xwidth=' + maxw + '&wzID=' + sID + '&fchanID=' + wzChanID + '&flmsgID=' + lastMsgID + '&adNbr=' + mblAdCnt + '&xm=' + ranTime; readxml.open("GET", url, true); readxml.onreadystatechange = writeMsg; readxml.onerror = function(){ clearTimeout(talkTimer); talkTimer = setTimeout('ReadMsg()',rollRefresh * 1000); } readxml.onerror = function(){ clearTimeout(talkTimer); talkTimer = setTimeout(ReadMsg,1000); } readxml.send(null); //checkForInstantWinner(); } function writeMsg() { if (readxml.readyState == 4) { if (readxml.status == 200) { var streamDiv = document.getElementById("chatLoading"); if (streamDiv){streamDiv.style.visibility = "hidden";} rollnNew = 0; clearTimeout(talkTimer); talkTimer = setTimeout(ReadMsg, rollRefresh * 1000); var jdata = mkyTrim(readxml.responseText); jdata = jdata.replace(/gsoftADJ/g,""); console.log('gsoftADJ',jdata); if (jdata == '') {jdata = '{"myMsgs":[]}';} try {j = JSON.parse(jdata); } catch(err) { dbug("JSON fail: writeMsgs fail"); return; } rollMsgs = j.myMsgs; if (mblAdsServed < mblAdMax && mblAdCnt > mblAdMax){ mblAdCnt = 0; } mblAdCnt = mblAdCnt + 1; rollCnt = 0; if(rollTimer){clearTimeout(rollTimer)} rollOut(); } } } function mobileLogin(){ wzGetPage('/whzon/mblp/frmLogin.php'); } function handleEmptyChannel(){ var spot = document.getElementById('chatChanEmpty'); if (spot){ htm = "
"; htm += "

Join Our Community To View

";htm += "
";htm += " ";htm += " ";htm += "
"; htm += "
"; spot.innerHTML= htm; spot.style.display = 'block'; } } function rollOut(){ console.log('emptyRoll',rollMsgs.length+':'+lastMsgID); if (wzUserID == 0 && wzChanID != 1){ handleEmptyChannel(); return; } if (rollMsgs.length == 0){ if (lastMsgID == 0 || wzUserID == 0){ handleEmptyChannel(); } return; } hideDiv('chatChanEmpty'); var rate = Math.floor(rollRefresh * 1000 / rollMsgs.length); if (rollMsgs.length > 12){ rate = 10; } //dbug('rollout rate is now: ' + rate + ' length: ' + rollMsgs.length + ' Count: ' + rollCnt); if (rollCnt < rollMsgs.length){ //dbug('rolling: ' + rollCnt + ' of: ' + rollMsgs.length); rollMessage(rollMsgs,rollCnt); rollTimer = setTimeout(rollOut,rate); isRolling = true; } else { isRolling = null; } rollCnt = rollCnt + 1; } function rollMessage(msgs,i){ var curScrollX = wzScrollXis(); var msgID = msgs[i].msgID; var blockID = msgs[i].crUserID; var blkCntry = msgs[i].country; var readChan = msgs[i].chanID; if (msgID != 0) {lastMsgID = msgID;} if (!msgs[i].msg){ //dbug('null message found: ' + msgID); msgs[i].msg = ''; } if (readChan != wzChanID && readChan != 0){ //parent.dbug('channel has change from: ' + readChan); return; } if ((blockList[blockID] != 1 && !countryIsBlocked(blkCntry)) || modSeeAll == 1) { var msg = msgs[i].msg; msg = unescape(msg.replace(/[+]/g,' ')); msg = unescape(msg); msg = msg.replace(/:300px;/g, ':99%;'); msg = msg.replace(/width:40px;height:32px/g, 'width:105px;height:78px;border-radius:0.4em;'); var wzoutput = document.getElementById("chatDiv"); var divflg = document.getElementById(msgID); if (divflg == null) { gdiv = document.createElement('DIV'); if (msgID == 0){ gdiv.id = 'ad' + mblAdDivID; mblAdDivID = mblAdDivID + 1; clearTimeout(talkTimer); setTimeout(ReadMsg,2000); } else { gdiv.id = msgID; } gdiv.innerHTML = doEmotes(msg); rollnNew = rollnNew + 1; if (wzoutput.childNodes.length == 0){ wzoutput.appendChild(gdiv); } else { wzoutput.insertBefore(gdiv, wzoutput.firstChild); } } document.documentElement.scrollTop = document.body.scrollTop = curScrollX; } } function doEmotes(msg){ msg = msg.replace(/~q/g,''); msg = msg.replace(/:Q/g,''); msg = msg.replace(/~u/g,''); msg = msg.replace(/:U/g,''); msg = msg.replace(/:\)/g,''); msg = msg.replace(/:\(/g,''); msg = msg.replace(/:C/g,''); msg = msg.replace(/:A/g,''); msg = msg.replace(/:W/g,''); msg = msg.replace(/:R/g,''); msg = msg.replace(/:Y/g,''); msg = msg.replace(/:L/g,''); msg = msg.replace(/:M/g,''); msg = msg.replace(/:F/g,''); msg = msg.replace(/~m/g,''); msg = msg.replace(/~a/g,''); msg = msg.replace(/~c/g,''); msg = msg.replace(/~r/g,''); msg = msg.replace(/~w/g,''); msg = msg.replace(/~y/g,''); msg = msg.replace(/~l/g,''); msg = msg.replace(/~f/g,''); msg = msg.replace(/~\)/g,''); msg = msg.replace(/~\(/g,''); msg = msg.replace(/~k/g,''); msg = msg.replace(/:K/g,''); msg = msg.replace(/~b/g,''); msg = msg.replace(/:B/g,''); msg = msg.replace(/~d/g,''); msg = msg.replace(/:D/g,''); msg = msg.replace(/~g/g,''); msg = msg.replace(/:G/g,''); msg = msg.replace(/~h/g,''); msg = msg.replace(/:H/g,''); msg = msg.replace(/~e/g,''); msg = msg.replace(/:E/g,''); msg = msg.replace(/~i/g,''); msg = msg.replace(/:I/g,''); msg = msg.replace(/:O/g,''); msg = msg.replace(/~o/g,''); msg = msg.replace(/~s/g,''); msg = msg.replace(/:S/g,''); msg = msg.replace(/~x/g,''); msg = msg.replace(/:X/g,''); msg = msg.replace(/~t/g,''); msg = msg.replace(/:T/g,''); msg = msg.replace(/~z/g,''); msg = msg.replace(/:Z/g,''); msg = msg.replace(/~j/g,''); msg = msg.replace(/:J/g,''); msg = msg.replace(/~0/g,''); msg = msg.replace(/:V/g,''); msg = msg.replace(/~v/g,''); msg = msg.replace(/~p/g,''); msg = msg.replace(/:P/g,''); msg = msg.replace(/~n/g,''); msg = msg.replace(/:N/g,''); return msg.replace(/~/g,':'); } function getUrl(url) { synchCon.open("GET", url, false); synchCon.send(null); return synchCon.responseText; } function getHttpConnection() { var xmlhttp = null; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } // utility functions function stripToLowerCase(txt){ var words = txt.split(" "); txt = ""; for(i = 0; i < words.length-1; i++){ txt = txt+ doFixWord(words[i],i) + " "; } txt = txt+doFixWord(words[words.length-1]); return txt.replace(":","~"); } function doFixWord(txt,i){ if (i == 0) { txt = txt.toLowerCase(); txt = txt.substring(0,1).toUpperCase() + txt.substring(1,txt.length); } else { txt = txt.substring(0,1) + txt.substring(1,txt.length).toLowerCase(); } return txt; } function stripTxtSpam(str){ if (!str) return " "; prevL = str[0]; Lcount = 1; var newStr = "" + prevL; for (i = 1; i < str.length;i++){ var l = str[i]; if (l == prevL) Lcount++; else Lcount = 1; if (Lcount<3) newStr = newStr+l; prevL = l; } return newStr; } function parsmsg(term) { var sword = ''; var endw = cptr.indexOf(term); if (endw > 0) sword = Left(cptr, endw); cptr = Right(cptr, cptr.length - endw - 1); return sword; } function Left(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0, n); } function Right(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function mkyTrim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g, ""); } function stripToAlpha(txt) { return txt.replace(/\W/g, ''); } function purgeList(d) { if (d){ nn = d.childNodes.length; var nmax = 50; for (i = nn - 1; i >= nmax; i -= 1) { d.childNodes[i].innerHTML = ""; // d.childNodes[i] = null; } } } // layer manager function laySetLayers(){ wzNetView.style.zIndex = brwzLayer; moshOP.style.zIndex = moszLayer; mineOP.style.zIndex = bmnzLayer; pvcDiv.style.zIndex = pvczLayer; vidDiv.style.zIndex = vidzLayer; chatDiv.style.zIndex = chatLayer; chatDiv.style.display = 'inline-block'; vidViewer.style.zIndex = vdvwLayer; pgViewer.style.zIndex = 1; //pgvzLayer; popViewer.style.zIndex = alertLayer -1; } function wzFocuslayer(){ return 1; wzNetView.style.zIndex = brwzLayer; moshOP.style.zIndex = moszLayer; mineOP.style.zIndex = bmnzLayer; pvcDiv.style.zIndex = pvczLayer; vidDiv.style.zIndex = vidzLayer; chatDiv.style.zIndex = chatLayer; vidViewer.style.zIndex = vdvwLayer; pgViewer.style.zIndex = 1; //pgvzLayer; popViewer.style.zIndex = alertLayer -1; return topzLayer; } function hideAllLayers(){ console.log('Try hideAlllayers Activated'); wzAPI_hideVideoPage(); wzAPI_hidePVC(); wzAPI_hideMosh(); hideBitMine(); wzAPI_hidePage(); hideChatWidget(); wzAPI_closeMenu(); } // Private Controls function wzPopGroupChat(groupID) { wzAPI_closeMenu(); hideMainInput(); doUserActionLog(); var pvc = "/whzon/mpvchatp/groupChat.php?wzID=" + sID + "&fgroupID=" + groupID; dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; wzAPI_showPVC(pvc, browsDiv.clientWidth, 730, dxOff, dyOff); var gdiv = document.getElementById("pvChatAlertSpot"); gdiv.innerHTML = ""; window.scrollTo(1,1); } function setPvcMode(m){ pvcMode = m; } function wzPopDChat(inMkdID) { if (wzUserID == 0){ alert('Please Login In Or Join To Use Private Chat'); } if (!mkdID){ alert('You Must Create A Dating Profile To Contact Others'); wzGetPage('/whzon/apps/dating/joinDating.php?wzID=' + sID); return; } pvcMode = 'mkd'; hideMainInput(); wzAPI_closeMenu(); doUserActionLog(); var pvc = "/whzon/mkdMChat/pvchatApp.php?wzID=" + sID + "&fmbrID=" + inMkdID; dxOff = wzAPI_getOffset(browsDiv).left; dyOff = 180; //wzAPI_getOffset(browsDiv).top; wzAPI_showPVC(pvc, browsDiv.clientWidth, 730, dxOff, dyOff); var gdiv = document.getElementById("pvDChatAlertSpot"); gdiv.innerHTML = ""; window.scrollTo(1,1); } function wzPopChat(mbrID) { if (wzUserID == 0){ alert('Please Login In Or Join To Use Private Chat'); return; } /* if (photoIDApp == 'Spam'){ // || photoIDApp == 'New'){ url = '/whzon/gold/goldMgr.php?wzID=' + sID; wzGetPage(url); return; } */ cancelPageLoad = true; console.log('canceling PGL',cancelPageLoad); pvcMode = null; hideMainInput(); wzAPI_closeMenu(); doUserActionLog(); var pvc = "/whzon/mpvchatp/pvchatApp.php?wzID=" + sID + "&fmbrID=" + mbrID; dxOff = wzAPI_getOffset(browsDiv).left; dyOff = 180; //wzAPI_getOffset(browsDiv).top; wzAPI_showPVC(pvc, browsDiv.clientWidth,browsDiv.clientHeight, dxOff, dyOff); var gdiv = document.getElementById("pvChatAlertSpot"); gdiv.innerHTML = ""; window.scrollTo(1,1); } function wzAPI_showPVC(URL, w, h, xoff, yoff) { wzAPI_hideMosh(); hidePVChatWidget(); pvcDiv.innerHTML = ""; pvcDiv.style.background = '#333333'; pvcDiv.style.width = w+'px'; pvcDiv.style.height = '100%'; pvcDiv.style.left = xoff+'px'; pvcDiv.style.top = '0px'; //yoff+'px'; pvcDiv.style.display = "inline-block"; pvchatControl.style.paddingLeft = "5px"; pvchatControl.style.paddingRight = "0px"; pvchatControl.style.paddingBottom = "0px"; pvchatControl.innerHTML = ""; pvChatStarted = true; pvChatFocused = true; } function wzAPI_closePVC() { pvcDiv.style.display = "none"; pvChatStarted = false; pvchatControl.innerHTML=""; pvchatControl.style.padding = "0px"; pvChatFocused = null; hidePVChatWidget(); hidePVDChatWidget(); showMainInput(); } function toglePVSideBar(){ var pvc = document.getElementById('pgPVCFrame'); if (pvc){ if (typeof pvc.contentWindow.togleSideBar === 'function'){ pvc.contentWindow.togleSideBar(); } } } function sendPVCmsg(){ var pvc = document.getElementById('pgPVCFrame'); if (pvc){ if (typeof pvc.contentWindow.sendMsg === 'function'){ pvc.contentWindow.sendMsg(); } } } function sendPVDCmsg(){ var pvc = document.getElementById('pgPVCFrame'); if (pvc){ if (typeof pvc.contentWindow.sendMsg === 'function'){ pvc.contentWindow.sendMsg(); } } } function wzAPI_hidePVC() { showMainInput(); hidePVChatWidget(); hidePVDChatWidget(); pvChatFocused = null; pvcDiv.style.display = "none"; if (pvChatStarted) pvchatControl.innerHTML = ""; else{ pvchatControl.innerHTML = ""; pvchatControl.style.padding = "0px"; } } function wzAPI_focusPVC() { cancelPageLoad = true; console.log('canceling PGL',cancelPageLoad); hideMainInput(); wzAPI_hideMosh(); var pvc = document.getElementById('pgPVCFrame'); if (pvc){ if (typeof pvc.contentWindow.showWidget === 'function'){ if (wzChanID == 302057){ pvc.contentWindow.showWidget(); } else { pvc.contentWindow.showWidget(); } } } pvcDiv.style.display = "inline-block"; pvcDiv.style.height = "100%"; pvchatControl.style.paddingLeft = "5px"; pvchatControl.style.paddingRight = "0px"; pvchatControl.style.paddingBottom = "0px"; pvchatControl.innerHTML = ""; pvChatFocused = true; } // MoshBox Controls function closeGigBox(){ moshOP.style.display = "none"; moshOP.style.zIndex = moszLayer; var moshEL = document.getElementById('showMoshFrame'); if (moshEL) moshEL.contentWindow.closeMosh(); moshStatus = 0; } function fetchGigBox(boxID){ wzAPI_closeVideoPage(); moshOP.style.display = "inline-block"; moshOP.style.visibility = "visible"; moshOP.style.zIndex = wzFocuslayer(); var moshEL = document.getElementById('showMoshFrame'); if (moshEL) moshEL.contentWindow.startMosh(boxID); moshStatus = boxID; window.scrollTo(1,1); showRecentDest(); } function initGigBox(boxID) { if (boxID == 0) boxID = 1; dbug('mosh: initGigBox ' + boxID); var mosh = "/whzon/mblmosh/moshBox2.php?wzID=" + sID + "&fboxID=" + boxID; dxOff = document.getElementById('wzBrowser').offsetLeft; dyOff = wzAPI_getOffset(browsDiv).top -7; createNewMosh(mosh, browsDiv.clientWidth, 2910, dxOff, dyOff, boxID); moshStatus = boxID; } function createNewMosh(URL, w, h, xoff, yoff,boxID) { if (moshStatus != boxID) { var fh = h - 23; moshOP.innerHTML = "
Hide[-] Close[x]
"; moshOP.style.left = xoff+'px'; moshOP.style.top = yoff+'px'; } moshOP.style.width = '100%'; moshOP.style.height = h+'px'; moshOP.style.display = "none"; moshOP.style.overflow = "hidden"; } function OpenGigBox(boxID) { wzAPI_closeVideoPage(); hidePageOBJ(); hideTop(); hideChatWidget(); window.scrollTo(1,1); doUserActionLog(); if (boxID != moshStatus) {sendMoshBoxNotification(boxID);} if (boxID == 0) boxID = moshStatus; if (boxID == 0) boxID = 1; fetchGigBox(boxID); } function wzAPI_showMosh(URL, w, h, xoff, yoff,boxID) { if (moshStatus != boxID) { var fh = h - 23; moshOP.innerHTML = "
hide[-] close[x]
"; moshOP.style.left = xoff+'px'; moshOP.style.top = yoff+'px'; } moshOP.style.width = '100%'; moshOP.style.height = h+'px'; moshOP.style.display = "inline-block"; moshOP.style.overflow = "hidden"; } function wzAPI_closeMosh() { if (!moshOP) { return; } moshOP.style.display = "none"; var moshEL = document.getElementById('showMoshFrame'); if (moshEL) moshEL.contentWindow.leaveShow(); showRecentDest(); closeGigBox();return; moshOP.innerHTML = ""; moshStatus = 0; } function wzAPI_hideMosh() { moshOP.style.display = "none"; } // DigiHut Internal Tracker function gsoftDoLog(action,pg){ var divxml = getHttpConnection(); var currentTime = new Date(); var ranTime = currentTime.getMilliseconds(); inUrl = '/whzon/adMgr/gsoftLogAction.php?hut='+parent.digiHutID+'&rep='+parent.digiRepID+'&action='+action+'&pg='+ encodeURIComponent(pg) + '&xm=' + ranTime ; divxml.open("GET", inUrl,true); divxml.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //doUpdateDivJSON(this,div); } }; divxml.send(null); } function gsoftLog(action){ var pg = null; var doc = null; if (action == 'hutVideoPg'){ doc = document.getElementById('mbrVideoViewer'); } if (action == 'hutPg'){ doc = document.getElementById('pgViewFrame'); } if (doc){ pg = doc.contentWindow.location.href; gsoftDoLog(action,pg); } } // video viewer page controls function onVideoFrameLoad(){ rotateAdSpot(); gsoftLog('hutVideoPg'); // doUserVideoActionLog(); // scrollTo(1,1); } function wzGetVideoPage(url) { wzAPI_closeMosh(); //hidePageOBJ(); dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; wzAPI_showVideoPage(url,pgViewXW , 4350, dxOff, dyOff); } //function onVideoFrameLoad(){ // dbug('video obj created: ' + document.getElementById('mbrVideoViewer').contentWindow.innerHeight); //} function wzAPI_showVideoPage(vURL, w, h, xoff, yoff) { scrollTo(1,1); xoff = 0; var URL = vURL; var onCtrl = ""; if (wzUserID){ onCtrl = " | My Account[+]"; onCtrl = onCtrl + " | My Profile[+]"; } var fh = h - 23; vidViewer.innerHTML = "
Hide[-] Close[x]
"; vidViewer.style.background = '#222322'; vidViewer.style.width = '100%'; vidViewer.style.height = h+'px'; vidViewer.style.left = xoff+'px'; vidViewer.style.top = yoff - 5 +'px'; vidwControl.innerHTML = "Video Viwer"; vidViewer.style.display = "inline-block"; //document.getElementById('mainButton').innerHTML = lngTxt; //'Lounge'; document.getElementById('typeBox').style.visibility = "hidden"; } function wzAPI_reSizeVideoPage(w) { vidViewer.style.width = w+'px'; } function wzAPI_closeVideoPage() { vidwControl.innerHTML = ""; vidViewer.style.display = "none"; vidViewer.innerHTML = ""; } function wzAPI_hideVideoPage() { vidViewer.style.display = "none"; } function wzAPI_focusVideoPage() { hideTop(); vidViewer.style.display = "inline-block"; } // function wzPopBitMiner() { if (isImpMining){ _client.stop(); } if (bitMineIsOpen){ focusBitMine(); return; } dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; openBitMine('/whzon/bitMiner/browserMiner.php?wzID=0',pgViewXW , 4350, dxOff, dyOff); } function openBitMine(vURL, w, h, xoff, yoff) { bitMineIsOpen = true; scrollTo(1,1); xoff = 0; var URL = vURL; var onCtrl = ""; var fh = h - 23; var htm = "
Hide[-]"; htm = htm + " Close[x]"; htm = htm + "
"; htm = htm + ""; mineOP.innerHTML = htm; mineOP.style.background = '#222322'; mineOP.style.width = '100%'; mineOP.style.height = h+'px'; mineOP.style.left = xoff+'px'; mineOP.style.top = yoff - 5 +'px'; mineOP.style.display = "inline-block"; /* chtml = "Video Viwer"; mineControl.innerHTML = chtml; vidViewer.style.display = "inline-block"; document.getElementById('typeBox').style.visibility = "hidden"; */ } function closeBitMine() { //mineControl.innerHTML = ""; mineOP.style.display = "none"; mineOP.innerHTML = ""; bitMineIsOpen = false; } function hideBitMine() { mineOP.style.display = "none"; } function focusBitMine() { hideTop(); mineOP.style.display = "inline-block"; } // PgViewr Controls function wzGetApp(dname,appkey,ukey,chanID){ wzGetPage('//' + dname + '.icdirect.com/whzon/mkyAPI/index.php?wzID=' + sID + '&mky=' + appkey + '&UKey=' + ukey); wzChangeChannel(chanID); } function injectThemeStr(url){ if (!isDigiHut){ return url; } var theme = parent.digiTheme.replace('&',''); url = url.replace('?','?'+theme+'&'); return url; } function wzGetPageBG(url) { url = injectThemeStr(url); dbug('wzGetPage: ' + url); hideTop(); if (url.indexOf("viewVideoPg.php") > -1) { hideTop(); wzGetVideoPage(url); return; } if (vcontest){ hideTop(); vcontest = null; wzGetVideoPage('/whzon/mbr/vidView/gotoContest.php?wzID=' + sID); return; } if (!pageOBJcreated){ createPageOBJ(); } //showPageOBJ(url); return; } function showRootPg(){ var spot = document.getElementById('homepgWidget'); if (spot){ spot.style.display = 'block'; } } function hideRootPg(){ var spot = document.getElementById('homepgWidget'); if (spot){ spot.style.display = 'none'; } } function wzGetPage(url,rootPg=null) { url = injectThemeStr(url); moveDredge(); if (!url){ url = '/'; } console.log('wzGetPage',url); if (rootPg){ console.log('wzGetPagezpage',rootPg); showRootPg(); } else { hideRootPg(); } if (photoIDApp == 'Spam'){ // || photoIDApp == 'New'){ //url = '/whzon/mblp/gold/goldMgr.php?wzID=' + sID; } hideTop(); if (url.indexOf("viewVideoPg.php") > -1) { wzGetVideoPage(url); return; } if (vcontest){ vcontest = null; wzGetVideoPage('/whzon/mbr/vidView/gotoContest.php?wzID=' + sID); return; } if (!pageOBJcreated){ createPageOBJ(); } console.log('wzGetPage.showPageOBJ: ',url); showPageOBJ(url); return; doUserActionLog(); dbug('wzGetPage: ' + url); window.scrollTo(1,1); dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; dbug('x,y, ' + dxOff + ',' + dyOff + ',cw=' + browsDiv.clientWidth); wzAPI_showPage(url,browsDiv.clientWidth , 2950, dxOff, dyOff); pageStatus = url; rotateAdSpot(); } function wzGetPageOS(url) { wzGetPage(url); if (url.indexOf("viewVideoPg.php") > -1) { wzGetVideoPage(url); return; } if (url.indexOf('/') == 0) url = '//whzon.com' + url; doUserActionLog(); window.scrollTo(1,1); dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; wzAPI_showPage(url,browsDiv.clientWidth , 2950, dxOff, dyOff); pageStatus = url; rotateAdSpot(); } function doShowPageOBJ(){ if(cancelPageLoad){ cancelPageLoad = null; console.log('canceling PGL Done:',cancelPageLoad); hidePageOBJLoading('cancelPageLoad'); return; } cancelPageLoad = null; console.log('canceling PGL else Done:',cancelPageLoad); wzAPI_hideVideoPage(); wzAPI_hidePVC(); wzAPI_hideMosh(); console.log('Try doShowPage'); hideChatWidget(); //hidePageOBJLoading(); hideMChatControls(); wzAPI_closeMenu(); pgViewer.style.display = "inline-block"; pgViewer.style.zIndex = 14; pageOBJvisible = true; scrollTo(1,1); hidePageOBJLoading('doShowPage'); } function pageOBJonload(){ pageOBJframe = document.getElementById('pgViewFrame'); if (pageOBJframe){ pageOBJdoc = pageOBJframe.contentWindow.document; pageOBJloaded = true; pageOBJlastPg = pageOBJframe.contentDocument.location.href; dbug('last page is: ' + pageOBJlastPg); //doShowPageOBJ(); } hidePageOBJLoading('doShowPage'); } function showPageOBJLoading(){ window.scrollTo(1,1); var lDiv = document.getElementById('pageOBJloading'); if (lDiv){ console.log('popViewer',popViewer.style.zIndex); console.log('popViewer+',parseInt(popViewer.style.zIndex)+110); lDiv.style.zIndex = parseInt(popViewer.style.zIndex) +11000; lDiv.style.display = 'block'; lDiv.style.border = '0px'; console.log('showPageOBJLoading: ' + lDiv.style.display,lDiv); lDiv.style.top = wzAPI_getOffset(browsDiv).top + 'px'; } } function hidePageOBJLoading(src){ var lDiv = document.getElementById('pageOBJloading'); if (lDiv){ console.log('hidingPageOBJLoading:' + src + ' ',lDiv); lDiv.style.display = 'none'; } } function setPageOBJready(){ pageOBJframe = document.getElementById('pgViewFrame'); pageOBJdoc = pageOBJframe.contentWindow.document; //pageOBJcreated = true; var userID = 0; if(pageOBJstart && userID === 0){ dbug(pageOBJstart); //wzGetPage(pageOBJstart); } } function mkPageOnload(){ onPgViewerLoad(); gsoftLog('hutPg'); fr = document.getElementById('pgViewFrame'); if (fr){ fr.contentWindow.document.querySelector('body').style.color = ''; } if (typeof document.getElementById('pgViewFrame').contentWindow.mblReDrawPage === 'function'){ document.getElementById('pgViewFrame').contentWindow.mblReDrawPage(); setTimeout(document.getElementById('pgViewFrame').contentWindow.mblReDrawPage,1*1000); } if (pageOBJcreated){ pageOBJonload(); } pageOBJcreated = true; } function createPageOBJ(){ pageOBJvisible = false; pageOBJcreated = false; var fh = 2800; var HTML = "
"; pgViewer.innerHTML = HTML; dbug('created pageOBJ ' + HTML); pgViewer.style.width = browsDiv.clientWidth + 'px'; pgViewer.style.height = fh+'px'; pgViewer.style.left = '0px'; pgViewer.style.top = wzAPI_getOffset(browsDiv).top -5 + 'px'; pgViewer.style.display = "none"; pgViewer.style.zIndex = 1; pgViewer.style.overflowY = "hidden"; pgViewer.style.overflowX = "hidden"; pgViewer.style.border = "0px solid #bbbbbb"; pgViewer.style.borderBottomRightRadius = "0.5em"; pgViewer.style.borderBottomLeftRadius = "0.5em"; } function doFetchPageOBJ(thsURL){ var fh = 2800; if (thsURL.indexOf('?') < 0){ thsURL = thsURL + '?'; } thsURL = thsURL + '&mblGetPg=on'; var dofetch = document.getElementById('pgViewFrame'); console.log('fetching page: ',thsURL); if (dofetch) { console.log(dofetch); if (typeof dofetch.contentWindow.framePageGO === 'function'){ dofetch.contentWindow.framePageGO(thsURL); dbug('self loaded : ' + thsURL); } else { document.getElementById('pgViewFrame').contentDocument.location.href = thsURL; } } return; var HTML = ""; pgViewer.innerHTML = HTML; dbug('created pageOBJ ' + HTML); } function adjustViewerTops(){ var viewTop = wzAPI_getOffset(browsDiv).top -5 + 'px'; if (!pgViewer){ return; } pgViewer.style.top = viewTop; vidViewer.style.top = viewTop; moshOP.style.top = viewTop; mineOP.style.top = viewTop; popViewer.style.top = viewTop; } function hidePageOBJ(){ pgViewer.style.display = "none"; pgViewer.style.zIndex = 1; pageOBJvisible = false; } function getPageOBJInBG(inURL){ //showPageOBJLoading('getInBG'); if (!inURL){ return; } if (inURL == "/"){ inURL = "/whzon/mblp/homepg.php?wzID=" + sID; } if (inURL != pageOBJlastPg ){ doFetchPageOBJInBG(inURL); } } function showPageOBJ(inURL){ pgViewer.style.top = wzAPI_getOffset(browsDiv).top -5 + 'px'; hidePageOBJ(); showPageOBJLoading(); dbug('inURL is: ' + inURL); if (!inURL){ return; } if (inURL == "/"){ inURL = "/whzon/mblp/mbr/mbrProfile.php?fwzUserID=0&wzID=" + sID; } var lpg = "null"; if (pageOBJlastPg){ lpg = pageOBJlastPg.toString(); } if (lpg.indexOf(inURL) === -1){ dbug('showPageOJ : fetching' + lpg.indexOf(inURL) + inURL + lpg); doFetchPageOBJ(inURL); doShowPageOBJ(); } else { dbug('page already loaded just display:'); doShowPageOBJ(); hidePageOBJLoading('page reloaded'); } } function wzAPI_showPage(URL, w, h, xoff, yoff) { hideAllLayers(); if (URL == "/") URL = "/whzon/mblp/homepg.php?wzID=" + sID; var fh = h - 23; dbug('Starting To Show Page: ' + URL); console.log('homepgzero',URL); if (URL == 'homepgzero'){ html = "
"; html += "
"; } else { html = ""; } pgViewer.style.width = w+'px'; pgViewer.style.height = h+'px'; pgViewer.style.left = xoff+'px'; pgViewer.style.top = yoff -5 +'px'; pgViewer.style.display = "inline-block"; pgViewer.style.overflowY = "hidden"; pgViewer.style.overflowX = "hidden"; pgViewer.style.border = "0px solid #bbbbbb"; pgViewer.style.borderBottomRightRadius = "0.5em"; pgViewer.style.borderBottomLeftRadius = "0.5em"; pgViewer.innerHTML = html; //document.getElementById('mainButton').innerHTML = lngTxt; //'Lounge'; document.getElementById('typeBox').style.visibility = "hidden"; } function wzAPI_reLoadPage(){ var page = pgViewer.innerHTML; //pgViewer.innerHTML = ""; pgViewer.innerHTML = page; } function wzAPI_reSizePage(w) { pgViewer.style.width = w+'px'; wzNetView.style.width = w+'px'; } function getPgViewHandle(){ var appframe = document.getElementById('pgViewFrame'); if (appframe){ return appframe.contentWindow; } return null; } function hideMChatControls(){ var mc =document.getElementById('mainButton'); if (mc){ mc.innerHTML = lngTxt; //'Lounge'; } var tb = document.getElementById('typeBox'); if (tb){ tb.style.visibility = "hidden"; } } function showMChatControls(){ var mb = document.getElementById('mainButton'); if (mb){ mb.innerHTML = 'Send'; } var tb = document.getElementById('typeBox'); if (tb){ tb.style.visibility = "visible"; } } function wzAPI_hidePage() { var mb = document.getElementById('mainButton'); if (mb){ mb.innerHTML = 'Send'; } var tb = document.getElementById('typeBox'); if (tb){ tb.style.visibility = "visible"; } dbug('start hidepage'); window.scrollTo(1,1); var cleanResult = null; var doNotHide = null; dbug('cleanup=' + wzCleanUpOn); if (wzCleanUpOn){ if (pageOBJframe){ if (typeof pageOBJframe.contentWindow.wzcleanUp === 'function') { wzCleanUpOn = null; cleanResult = pageOBJframe.contentWindow.wzcleanUp(); doNotHide = 1; } else { wzCleanUpOn = null; } } else { wzCleanUpOn = null; } } dbug('hidding visibility'); pgViewer.style.display = "none"; pgViewer.style.zIndex = 1; pageOBJvisible = false; return doNotHide; } // wzNet View Web Browser Controls function wzSurfTo(url) { window.scrollTo(1, 1); dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; wzAPI_showURL(url,browsDiv.clientWidth , 2450, dxOff, dyOff+20); netViewURL = url; } function wzAPI_showURL(URL, w, h, xoff, yoff) { if (netViewURL != URL || URL== "/") { if (URL == "/") URL = "//whzon.com/whozon/clone/talk/talkAboutThis.asp"; var fh = h - 28; var htm = "
"; htm = htm + "
Browse To: "; htm = htm + " - hide[+]
"; wzNetView.innerHTML = htm; wzNetView.style.width = w+'px'; wzNetView.style.height = h+'px'; wzNetView.style.left = xoff+'px'; wzNetView.style.top = yoff+'px'; } wzNetView.style.display = "inline-block"; } function wzAPI_fetchURL() { var url = document.getElementById("wzNetSearch").elements["furl"].value; url = mkyTrim(url); if (url.indexOf('http://')!= 0 && url.indexOf('https://')!= 0){ url = '//' + url; } wzSurfTo(url); return false; } function wzAPI_closeURL() { wzNetView.style.display = "none"; wzNetView.innerHTML = ""; } function wzAPI_hideURL() { wzNetView.style.display = "none"; } // Video Chat Controls function wzEnterVC(roomNbr,VCname) { doUserActionLog(); var pvc = "/vChat/2wvideochat.php?r=" + roomNbr + "&fusername=" + VCname; window.scrollTo(1, 1); dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; wzAPI_showVChat(pvc, browsDiv.clientWidth, 800, dxOff, dyOff+20); } function wzStartVChat(ID,fname) { window.scrollTo(1, 1); dxOff = wzAPI_getOffset(browsDiv).left; dyOff = wzAPI_getOffset(browsDiv).top; var url="//whzon.com/whozon/vChat/vPhonet.asp?fname=" + fname + "&wzUserID=" + wzUserID; wzAPI_showVChat(url,browsDiv.clientWidth , 800, dxOff, dyOff+20); } function wzAPI_showVChat(URL, w, h, xoff, yoff) { if (!vChatStarted) { var fh = h - 28; var htm = "
"; htm=htm + "hide[+] | End[x]
"; vidDiv.innerHTML = htm; vidDiv.style.width = w+'px'; vidDiv.style.height = h+'px'; vidDiv.style.left = xoff+'px'; vidDiv.style.top = yoff+'px'; vChatStarted = true; vchatControl.innerHTML = "Video Chat:[-][+]"; } vidDiv.style.display = "inline-block"; } function wzAPI_closeVChat() { vidDiv.style.display = "none"; vidDiv.innerHTML = ""; vChatStarted = false; vchatControl.innerHTML = ""; } function wzAPI_hideVChat() { vidDiv.style.display = "none"; } function wzAPI_focusVChat() { vidDiv.style.display = "inline-block"; } // wzAPI functions function wzAPI_setRefreshPg(inV){ refreshPg = inV; } function mblPop(yOff, h, url){ wzAPI_showWin(url,browsDiv.clientWidth, 1, 1,yoff ); } function wzAPI_showWin(URL,w,h,xoff,yoff){ wzAPI_getHTML(URL); var wzoutput = document.getElementById("wzPopContainer"); wzoutput.style.width = w+'px'; wzoutput.style.height = h+'px'; wzoutput.style.left = xoff+'px'; wzoutput.style.top = yoff+'px'; wzoutput.style.display = "inline-block"; } function wzAPI_showFrameInfoP(URL,w,h,xoff,yoff){ noreload = 1; mcancelclosetime(); var fh = h-33; var wzoutput = document.getElementById("wzPopContainer"); wzoutput.innerHTML = "
close[x]
"; wzoutput.style.position = 'fixed'; wzoutput.style.width = w+'px'; wzoutput.style.height = h+'px'; wzoutput.style.left = xoff+'px'; wzoutput.style.top = yoff+'px'; wzoutput.style.display = "inline-block"; } function wzAPI_showFrameR(URL,w,h,xoff,yoff){ var fh = h-33; var wzoutput = document.getElementById("wzPopContainer"); wzoutput.innerHTML = "
close[x]
"; wzoutput.style.width = '100%'; wzoutput.style.height = h+'px'; wzoutput.style.left = '0px'; wzoutput.style.top = yoff+'px'; wzoutput.style.position = 'fixed'; wzoutput.style.display = "inline-block"; } function wzAPI_showFrame(URL,w,h,xoff,yoff){ var fh = h-33; popViewer; popViewer.innerHTML = "
close[x]
"; popViewer.style.width = '100%'; popViewer.style.height = h+'px'; popViewer.style.left = '0px'; popViewer.style.top = '0px'; popViewer.style.display = "inline-block"; popViewer.style.position = 'fixed'; } function wzAPI_showMenu(URL,w,h,xoff,yoff){ mcancelclosetime(); var fh = h; popViewer.innerHTML = ""; popViewer.style.width = w+'px'; popViewer.style.height = h+'px'; popViewer.style.left = xoff+'px'; popViewer.style.top = yoff+'px'; popViewer.style.display = "inline-block"; } function mcloseInfoPtime() { closetimer = window.setTimeout(wzAPI_closeWin, timeout); } function mclosetime() { closetimer = window.setTimeout(wzAPI_closeMenu, timeout); } function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } function wzAPI_closeMenu(){ notifyMenuIsOpen = false; popViewer.style.display = "none"; popViewer.innerHTML = ""; } function wzAPI_closeWin(){ var appframe = document.getElementById('test134'); var cleanResult = null; if (wzCleanUpOn){ if (appframe){ if (typeof appframe.contentWindow.wzcleanUp === "function") { wzCleanUpOn = null; cleanResult = appframe.contentWindow.wzcleanUp(); } else { wzCleanUpOn = null; } } else { wzCleanUpOn = null; } } if (!cleanResult) { popViewer.style.display = "none"; popViewer.innerHTML = ""; if (refreshPg ==1 && noreload == 0){ noreload = 0; document.location.reload(); } noreload = 0; } } function wzAPI_Left(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } function wzAPI_Right(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function wzAPI_mkyTrim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function wzAPI_prepUrl(url,inxml){ var xm = new Date(); if (url.indexOf("?") != -1) url = url+ "&xv=" + xm.getMilliseconds(); else url = url+ "?xv=" + xm.getMilliseconds(); inxml.open("GET", url,true); } function wzAPI_getHTML(srcURL){ var url = srcURL; wzAPI_prepUrl(url,wzAppXML); wzAppXML.onreadystatechange = wzAPI_writeHTML; wzAppXML.send(null); } function wzAPI_writeHTML(){ if (wzAppXML.readyState == 4){ var srcHTML = wzAppXML.responseText; var wzoutput = document.getElementById("wzPopContainer"); wzoutput.innerHTML = srcHTML; } } function wzAPI_declineChat(){ var xm = new Date(); var url = '/whzon/talk/declineVChat.php?wzID=' + sID + '&xm=' + xm.getTime(); wzAPI_VCxml.open("GET", url,true); wzAPI_VCxml.onreadystatechange = wzAPI_VCdeclineDone; wzAPI_VCxml.send(null); } function wzAPI_VCdeclineDone(){ if (wzAPI_VCxml.readyState == 4){ if (wzAPI_VCxml.status == 200) { wzAPI_ChatAlert(); } } } function wzAPI_DoNothing(){ } function wzAPI_ChatAlert(){ return; } function roomAcceptPVC(id){ var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'none';} var gdiv = document.getElementById("pvChatAlertSpot"); gdiv.innerHTML = ""; wzPopChat(id); } function roomDeclinePVC(id){ var xm = new Date(); var url = '/whzon/talk/pvcDecline.php?wzID=' + sID + '&fmbrID=' + id + '&xm=' + xm.getTime(); pvcDeclcon.open("GET", url,true); pvcDeclcon.onreadystatechange = doRoomDeclinePVC; pvcDeclcon.send(null); } function doRoomDeclinePVC(){ if (pvcDeclcon.readyState == 4){ if (pvcDeclcon.status == 200) { var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'none';} var gdiv = document.getElementById("pvChatAlertSpot"); gdiv.innerHTML = ""; } } } function roomPVChatAlert(){ return; } function roomAcceptEM(id,uid,mtype){ var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'none';} var gdiv = document.getElementById("pvChatAlertSpot"); gdiv.innerHTML = ""; if(mtype == 0){ wzGetPage('/whzon/mblp/mail/replyForm.php?wzID=' + sID + '&fmsgID=' + id + '&fwzUserID=' + uid); } else { wzGetPage('/whzon/apps/dating/mail/replyForm.php?wzID=' + sID + '&fmsgID=' + id + '&fwzUserID=' + uid); } } function roomDeclineEM(id,uid){ var xm = new Date(); var url = '/whzon/mblp/mail/emAlertDecline.php?wzID=' + sID + '&fmsgID=' + id + '&xm=' + xm.getTime(); pvcDeclcon.open("GET", url,true); pvcDeclcon.onreadystatechange = doRoomDeclinePVC; pvcDeclcon.send(null); } function roomAcceptAtM(atm){ hideTop(); showChatWidget(null,null,atm); roomDeclineAtM(atm.msgID,atm.mbrID); } function roomDeclineAtM(id,uid){ var xm = new Date(); var url = '/whzon/mblp/mail/atAlertDecline.php?wzID=' + sID + '&fmsgID=' + id + '&xm=' + xm.getTime(); pvcDeclcon.open("GET", url,true); pvcDeclcon.onreadystatechange = doRoomDeclinePVC; pvcDeclcon.send(null); } function doRoomDeclineEM(){ if (pvcDeclcon.readyState == 4){ if (pvcDeclcon.status == 200) { var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) {cdiv.style.display = 'none';} var gdiv = document.getElementById("pvChatAlertSpot"); gdiv.innerHTML = ""; } } } function showAtMemberNotice(atm){ var gdiv = document.getElementById("pvChatAlertSpot"); if (gdiv != null ) { var mtype = 2; var pimg = 'getMbrImg.php'; var bgc = '#333333' var cdiv = document.getElementById("pvChatAlertSpotCon"); if (cdiv) { cdiv.style.display = 'inline-block'; } gdiv.innerHTML = "
New Message
|
"; } } var wzAPI_phxml; function wzAPI_photoMgrBar(albumID,wzUserID,nPics,pg){ wzAPI_phxml = getHttpConnection(); var xm = new Date(); var url = '/whozon/photos/xmlphotoBar.asp?fpg=' + pg + '&fn=' + nPics + '&falbumID=' + albumID + '&fwzUserID=' + wzUserID + '&xm=' + xm.getMilliseconds(); wzAPI_phxml.open("GET", url,true); wzAPI_phxml.onreadystatechange = wzAPI_photoBarWrite; wzAPI_phxml.send(null); } function wzAPI_photoBar(albumID,wzUserID,nPics,pg){ wzAPI_phxml = getHttpConnection(); var xm = new Date(); var url = '/whozon/xmlphotoBar.asp?fpg=' + pg + '&fn=' + nPics + '&falbumID=' + albumID + '&fwzUserID=' + wzUserID + '&xm=' + xm.getMilliseconds(); wzAPI_phxml.open("GET", url,true); wzAPI_phxml.onreadystatechange = wzAPI_photoBarWrite; wzAPI_phxml.send(null); } function wzAPI_photoBarWrite(){ if (wzAPI_phxml.readyState == 4){ if(wzAPI_phxml.status == 200){ var rHTML = wzAPI_phxml.responseText; var gdiv = document.getElementById("wzPhotoBar"); if (gdiv != null ) { if (rHTML != "") gdiv.innerHTML = rHTML; else gdiv.innerHTML = ""; } } } } function wzAPI_videoMgrBar(albumID,wzUserID,nPics,pg){ wzAPI_phxml = getHttpConnection(); var xm = new Date(); var url='/whzon/mbr/vidView/xmlVideoSBar.php?wzID=' + sID + '&fpg=' + pg + '&fn=' + nPics + '&falbumID=' + albumID + '&fwzUserID=' + wzUserID + '&xm=' + xm.getMilliseconds(); wzAPI_phxml.open("GET", url,true); wzAPI_phxml.onreadystatechange = wzAPI_videoBarWrite; wzAPI_phxml.send(null); } function wzAPI_videoBarWrite(){ if (wzAPI_phxml.readyState == 4){ if(wzAPI_phxml.status == 200){ var rHTML = wzAPI_phxml.responseText; var gdiv = document.getElementById("wzVideoBar"); if (gdiv != null ) { if (rHTML != "") gdiv.innerHTML = rHTML; else gdiv.innerHTML = ""; } } } } function wzAPI_getOffset( el ) { var _x = 0; var _y = 0; while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) { _x += el.offsetLeft - el.scrollLeft; _y += el.offsetTop; el = el.offsetParent; } var wzb = document.getElementById('wzBrowser'); return { top: _y, left: _x }; }