function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } function setCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } var lookfor_messages_every = 15000; var lookfor_messages_every2 = 5000; //var messages2_perpage=30; var messages2_addatatime=10; var ajax_pipes=new Array(); ajax_pipes[1]='faces'; ajax_pipes[2]='pm'; ajax_pipes[3]='_heartbeat_ofjoy'; ajax_pipes[4]='checkonln'; ajax_pipes[5]='hitprofile'; ajax_pipes[6]='pm2'; ajax_pipes[7]='new_set_onlinness'; for (xol in ajax_pipes) { var joystring = 'var req' + ajax_pipes[xol] + '; function loadXMLDoc' + ajax_pipes[xol] + '(url) {if (window.XMLHttpRequest) {req' + ajax_pipes[xol] + ' = new XMLHttpRequest(); req' + ajax_pipes[xol] + '.onreadystatechange = processReqChange' + ajax_pipes[xol] + '; req' + ajax_pipes[xol] + '.open("GET", url, true); req' + ajax_pipes[xol] + '.send(null);} else if (window.ActiveXObject){req' + ajax_pipes[xol] + ' = new ActiveXObject("Microsoft.XMLHTTP"); if (req' + ajax_pipes[xol] + ') {req' + ajax_pipes[xol] + '.onreadystatechange = processReqChange' + ajax_pipes[xol] + ';req' + ajax_pipes[xol] + '.open("GET", url, true);req' + ajax_pipes[xol] + '.send();}}}'; eval(joystring); } var body_is_loaded = 0; function letusknowthatbodisloaded() { body_is_loaded = 1; } // function showtext(button_left, button_top, wanted_text, textdiv_id) // { // if(body_is_loaded == 1) // { // newdiv_innerHTML = '
 ' + wanted_text + " 
"; // newdiv_top = Math.abs(button_top) - 5; // newdiv_left = Math.abs(button_left) + 30; // pop_div(textdiv_id,"absolute",140,'none','none',newdiv_innerHTML,newdiv_top,newdiv_left,'no'); // document.getElementById(textdiv_id).onmouseout=function(){ // remove_element_by_id(textdiv_id); // } // } // } function hitprofile(u) { var urlz = "xmlhit?u=" + u; loadXMLDochitprofile(urlz); } function processReqChangehitprofile() { //do nothing... } // function putfaces(wantcode) // { // var pagewidth = screen.width; // var spacefor1face = 103; // var howmanyputfaces = Math.floor(pagewidth/spacefor1face); // var urlz = "xmlfaces?want=" + wantcode + "&boxes=" + howmanyputfaces; // loadXMLDocfaces(urlz); // } // function processReqChangefaces() // { // if (reqfaces.readyState == 4) // { // if (reqfaces.status == 200) // { // var response = reqfaces.responseXML.documentElement; // var result = response.getElementsByTagName("result")[0].firstChild.data; // if(result=='ok') // { // var resultstring = '
'; // var howmanyfaces = response.getElementsByTagName("howmanyfaces")[0].firstChild.data; // var countfaceputting = 0; // while (countfaceputting < howmanyfaces) // { // countfaceputting++; // var userID_name = "userID_" + countfaceputting; // var screen_name_name = "screen_name_" + countfaceputting; // var official_picID_name = "official_picID_" + countfaceputting; // var official_picserver_name = "official_picserver_" + countfaceputting; // var userID = response.getElementsByTagName(userID_name)[0].firstChild.data; // var screen_name = response.getElementsByTagName(screen_name_name)[0].firstChild.data; // var official_picID = response.getElementsByTagName(official_picID_name)[0].firstChild.data; // var official_picserver = response.getElementsByTagName(official_picserver_name)[0].firstChild.data; // if(official_picID == '0' || official_picserver == '') // { // var picshown = ''; // } // else // { // var picshown = ''; // } // var arrangedscreen_name = screen_name; // var lenghtofthisbuddysname = screen_name.length; // var maxwantedlenghtfornames = 15; // if(lenghtofthisbuddysname>maxwantedlenghtfornames) // { // arrangedscreen_name = '' + screen_name.substring(0,(maxwantedlenghtfornames-2)) + '...'; // } // resultstring = resultstring + ''; // } // resultstring = resultstring + '
' + picshown + '
' + arrangedscreen_name + '
'; // document.getElementById('headcase').innerHTML = resultstring; // } // } // } // } function sho_profcomp_num_div() { document.getElementById("profcomp_num_div").style.visibility="visible"; document.getElementById("profcomp_num_div1").style.visibility="visible"; document.getElementById("profcomp_num_div2").style.visibility="visible"; document.getElementById("profcomp_num_div3").style.visibility="visible"; document.getElementById("profcomp_num_div4").style.visibility="visible"; } function hide_profcomp_num_div() { document.getElementById("profcomp_num_div").style.visibility="hidden"; document.getElementById("profcomp_num_div1").style.visibility="hidden"; document.getElementById("profcomp_num_div2").style.visibility="hidden"; document.getElementById("profcomp_num_div3").style.visibility="hidden"; document.getElementById("profcomp_num_div4").style.visibility="hidden"; } var lookformessagesisre = 0; function lookformessages() { if(lookformessagesisre == 0) { lookformessages_re(); lookformessagesisre = 1; } } function lookformessages_re() { var url = "xmllookfor_pm"; loadXMLDocpm(url); var t=setTimeout("lookformessages_re()",lookfor_messages_every); } var idsofdivtoflash = new Array(); function processReqChangepm() { if (reqpm.readyState == 4) { if (reqpm.status == 200) { response = reqpm.responseXML.documentElement; var result = response.getElementsByTagName("result")[0].firstChild.data; if(result == "ok") { var totalmessages = response.getElementsByTagName("totalmessages")[0].firstChild.data; var count = 0; var finalmessagesstring=''; while(count < totalmessages) { count++; var this_message_pubid_name = "message_pubid_" + count; var this_message_screen_name_name = "message_screen_name_" + count; var this_user_gender_name = "message_gender_" + count; var this_message_ip_name = "message_ip_" + count; var this_message_pubid = response.getElementsByTagName(this_message_pubid_name)[0].firstChild.data; var this_message_screen_name = response.getElementsByTagName(this_message_screen_name_name)[0].firstChild.data; var this_user_gender = response.getElementsByTagName(this_user_gender_name)[0].firstChild.data; var this_message_ip = response.getElementsByTagName(this_message_ip_name)[0].firstChild.data; var this_message_screen_name_forshow = wordwrap(this_message_screen_name, 18, ' ', true); var gender_icon = ''; var bulle = ''; var thismessagestring = '
' + gender_icon + this_message_screen_name_forshow + bulle + '
'; finalmessagesstring = finalmessagesstring + thismessagestring; idsofdivtoflash[this_message_pubid]='blinker_' + this_message_pubid; } if(totalmessages >= 1) { finalmessagesstring = '
' + finalmessagesstring + '
'; } document.getElementById('you_got_messages').innerHTML = finalmessagesstring; for (xu in idsofdivtoflash) { startblinker(idsofdivtoflash[xu]); } } } } } function openpm(pubid,screen_name,gender,ip) { var append_ip = ''; if(ip && ip != '') { append_ip = '&ip=' + ip; } var pm_windowname = 'pm_' + pubid; var gotostring = 'pm?pubid=' + pubid + '&screen_name=' + encodeURIComponent(unescape(screen_name)) + '&gender=' + gender + append_ip; window.open(gotostring,pm_windowname); } var startedblinkers = new Array(); function startblinker(div_id) { if(startedblinkers[div_id]!=div_id) { startedblinkers[div_id]=div_id; var execmystring = 'blinkz("' + div_id + '")'; var t=setTimeout(execmystring,blinkspeed); } } var blinkspeed = 500; function blinkz(div_id) { var mystupid_div = document.getElementById(div_id); if(mystupid_div != null) { if(mystupid_div.style.visibility=="hidden") { mystupid_div.style.visibility="visible"; } else { mystupid_div.style.visibility="hidden"; } var execmystring = 'blinkz("' + div_id + '")'; var t=setTimeout(execmystring,blinkspeed); } } function wordwrap( str, int_width, str_break, cut ) { // http://kevin.vanzonneveld.net // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + improved by: Nick Callen // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Sakimori // * example 1: wordwrap('Kevin van Zonneveld', 6, '|', true); // * returns 1: 'Kevin |van |Zonnev|eld' // * example 2: wordwrap('The quick brown fox jumped over the lazy dog.', 20, '
\n'); // * returns 2: 'The quick brown fox
\njumped over the lazy
\n dog.' // * example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); // * returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim \nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \ncommodo consequat.' // PHP Defaults var m = ((arguments.length >= 2) ? arguments[1] : 75 ); var b = ((arguments.length >= 3) ? arguments[2] : "\n" ); var c = ((arguments.length >= 4) ? arguments[3] : false); var i, j, l, s, r; str += ''; if (m < 1) { return str; } for (i = -1, l = (r = str.split("\n")).length; ++i < l; r[i] += s) { for(s = r[i], r[i] = ""; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : "")){ j = c == 2 || (j = s.slice(0, m + 1).match(/\S*(\s)?$/))[1] ? m : j.input.length - j[0].length || c == 1 && m || j.input.length + (j = s.slice(m).match(/^\S*/)).input.length; } } return r.join("\n"); } var heartbeetfreq = 10000; var restarted = 0; function send_heartbeat_ofjoy() { if(restarted == 0) { send_heartbeat_ofjoy_re(); restarted = 1; } } function send_heartbeat_ofjoy_re() { var url = "xmlheartbeat_ofjoy"; loadXMLDoc_heartbeat_ofjoy(url); var t=setTimeout("send_heartbeat_ofjoy_re()",heartbeetfreq); } function processReqChange_heartbeat_ofjoy() { //do nothing } // var checkfreq = 10000; // function set_onlinness(u_or_g,persons_numba,initial_on_or_off,screen_name,gender,showbubbleornot) // { // display_onlinness(u_or_g,persons_numba,screen_name,initial_on_or_off,gender,showbubbleornot) // var recallexrpss = "doonlinnesscheck('" + u_or_g + "','" + persons_numba + "','" + initial_on_or_off + "','" + escape(screen_name) + "','" + gender + "','" + showbubbleornot + "')"; // var gofortimewait = Math.ceil((Math.random() * 2) * checkfreq); // var t=setTimeout(recallexrpss,gofortimewait); // } // function doonlinnesscheck(u_or_g,persons_numba,initial_on_or_off,screen_name,gender,showbubbleornot) // { // var url = "xmlcheckifon?uorg=" + u_or_g + "&pn=" + persons_numba + "&sn=" + encodeURIComponent(unescape(screen_name)) + "&gen=" + gender + "&sb=" + showbubbleornot; // loadXMLDoccheckonln(url); // var recallexrpss = "doonlinnesscheck('" + u_or_g + "','" + persons_numba + "','" + initial_on_or_off + "','" + screen_name + "','" + gender + "','" + showbubbleornot + "')"; // var gofortimewait = Math.ceil((Math.random() * 2) * checkfreq); // var t=setTimeout(recallexrpss,gofortimewait); // } // function processReqChangecheckonln() // { // if (reqcheckonln.readyState == 4) // { // if (reqcheckonln.status == 200) // { // response = reqcheckonln.responseXML.documentElement; // var result = response.getElementsByTagName("result")[0].firstChild.data; // if(result == "ok") // { // var u_or_g = response.getElementsByTagName("u_or_g")[0].firstChild.data; // var persons_numba = response.getElementsByTagName("persons_numba")[0].firstChild.data; // var screen_name = response.getElementsByTagName("screen_name")[0].firstChild.data; // var gen = response.getElementsByTagName("gen")[0].firstChild.data; // var sb = response.getElementsByTagName("sb")[0].firstChild.data; // var state = response.getElementsByTagName("state")[0].firstChild.data; // display_onlinness(u_or_g,persons_numba,screen_name,state,gen,sb); // } // } // } // } // function display_onlinness(u_or_g,persons_numba,screen_name,on_or_off,gender,showbubbleornot) // { // shoscreen_name = unescape(screen_name); // var picname; // var word; // var showonliner; // if(on_or_off=='on') // { // picname = 'online.png'; // word = 'online'; // showonliner = '' + word; // } // else if(on_or_off=='off') // { // picname = 'offline.png'; // word = 'offline'; // showonliner = ''; // } // var bubblestring = ''; // if(showbubbleornot==1 && on_or_off=='on') // { // var goforpubid = u_or_g + '_' + persons_numba; // bubblestring = ' | PM send instant message'; // } // var rezu_string = showonliner + bubblestring; // var idofdivtodispl = 'onliner_' + u_or_g + '_' + persons_numba; // document.getElementById(idofdivtodispl).innerHTML = rezu_string; // } // function check_prereg_form() // { // var goodpic = ''; // var badpic = ''; // document.getElementById("rezu_gender").innerHTML = ""; // var errors = 0 // var currentgender = document.getElementById("gender").value; // if(currentgender == "man" || currentgender == "woman" || currentgender == "couple_man_and_woman" || currentgender == "couple_2_man" || currentgender == "couple_2_woman" || currentgender == "group" || currentgender == "ts_tv_tg") // { // document.getElementById("rezu_gender").innerHTML = goodpic; // } // else // { // errors++; // document.getElementById("rezu_gender").innerHTML = badpic; // } // var screen_name = document.getElementById("screen_name").value; // var screen_name_length = screen_name.length; // if(screen_name_length<2) // { // errors++; // document.getElementById("rezu_screen_name").innerHTML = badpic + " too short"; // } // else // { // if(nameisavailable!="ok") // { // errors++; // document.getElementById("rezu_screen_name").innerHTML = badpic + " this name is taken"; // } // } // var about_me = document.getElementById("about_me").value; // var about_me_length = about_me.length; // if(about_me_length<10) // { // errors++; // document.getElementById("rezu_about_me").innerHTML = badpic + " too short"; // } // else // { // document.getElementById("rezu_about_me").innerHTML = goodpic; // } // var currentbd_d = document.getElementById("bd_d").value; // if(currentbd_d == "?") // { // errors++; // document.getElementById("rezu_bd_d").innerHTML = badpic; // } // else // { // document.getElementById("rezu_bd_d").innerHTML = goodpic; // } // var currentbd_m = document.getElementById("bd_m").value; // if(currentbd_m == "?") // { // errors++; // document.getElementById("rezu_bd_m").innerHTML = badpic; // } // else // { // document.getElementById("rezu_bd_m").innerHTML = goodpic; // } // var currentbd_y = document.getElementById("bd_y").value; // if(currentbd_y < 2010 && currentbd_y > 1800) // { // document.getElementById("rezu_bd_y").innerHTML = goodpic; // } // else // { // errors++; // document.getElementById("rezu_bd_y").innerHTML = badpic; // } // if(errors>=1) // { // return false; // } // else // { // setCookie('invite_message',prereg_invite_message,50) // } // } // var globaltheme = 'nabolister'; // function set_thatheme(setted_theeme) // { // globaltheme = setted_theeme; // } // function pop_prereg_form() // { // if(body_is_loaded == 1) // { // do_pop_prereg(); // } // else // { // var t=setTimeout("do_pop_prereg()",2000); // } // } // var browser=navigator.appName; // var fade_level = 0; // var prereg_invite_message = ''; // function do_pop_prereg() // { // // if(mycity=='') // // {var saylocation="in your area";} // // else // // {var saylocation="in " + mycity;} // // // // var refereee_cookivalu = getCookie("refereee"); // // var prereg_invite_messages_array=new Array(); // // // // prereg_invite_messages_array[0] = 'Meet some people in ' + saylocation + ', 100% Free:'; // // if(refereee_cookivalu=="yassarafat") // // { // // //prereg_invite_messages_array[28] = 'Meet some people to watch movies with ' + saylocation + ' :P'; // // } // // // // // // var chosen_message_key = Math.floor(Math.random()*prereg_invite_messages_array.length); // // prereg_invite_message = prereg_invite_messages_array[chosen_message_key]; // var prereg_invite_message = "Create your account now:"; // //var maxmind = '
This product includes GeoLite data created by MaxMind, available from maxmind.com.
'; // var maxmind = ''; // var theformitself = '
' + // '

choose a name: (or login)

' + // '

tell us a little something about yourself:

' + // '

what is your gender?

i am/we are a:
' + // '

how old are you?

my birth date is:
day
month
year
' + // '' + // '*you must be 18 years of age or older.' + // '
Go
Go
' + maxmind + '
'; // var theformitself = '
' + // 'i am/we are a:

' + // 'my birth date is:
day
month
year
' + // '' + // '
a man
'+ // 'a woman
'+ // 'a couple (man and woman)
'+ // 'a couple (2 men)
'+ // 'a couple (2 women)
'+ // 'a group
'+ // 'ts/tv/tg
'+ // '
'+ // 'from years old
'+ // 'to years old
'+ // '
'+ // 'friends
'+ // '
' + // '

username: (or login)

' + // ''+ // ''+ // ''+ // '
Go
Go
' + maxmind + '
'; // var closediv = '
[x]
'; // var headerdiv = '
' + prereg_invite_message + '
'; // var formdiv = '
' + closediv + '
' + headerdiv + theformitself + '
'; // var thing_top = 200; // var thing_left = 240; // var form_html = '
 
' + // '
' + // '
' + formdiv + '
'; // if(document.getElementById('prereg_form_div')==null) // { // pop_div("prereg_form_div","absolute",140,'none','none',form_html,0,0,'no'); // } // else // { // document.getElementById('prereg_form_div').innerHTML = form_html; // } // //alert(browser); // //set opa to 0 and kickin fadein // fade_level = 0; // if(browser=="Microsoft Internet Explorer") // { // //document.getElementById('prereg_form_div').style.filter = 'Alpha(Opacity=50)'; // } // else // { // document.getElementById('prereg_form_div').style.opacity=0; // } // fade_in_prereg_windo(); // } // function fade_in_prereg_windo() // { // if(fade_level<1) // { // fade_level = fade_level + 0.1; // ie_fade_level = fade_level * 100; // if(browser=="Microsoft Internet Explorer") // { // //document.getElementById('prereg_form_div').style.filter = 'alpha(opacity='+ie_fade_level+')'; // } // else // { // document.getElementById('prereg_form_div').style.opacity=fade_level; // } // var to=setTimeout("fade_in_prereg_windo()",100); // } // } // function close_prereg() // { // var oldelem = document.getElementById('prereg_form_div'); // if(oldelem != null) // { // oldelem.innerHTML = ""; // //document.body.removeChild(oldelem); // var ti=setTimeout("pop_prereg_form()",60000); // } // } function findPosX(obj) { var curleft = 0; if(obj.offsetParent) while(1) { curleft += obj.offsetLeft; if(!obj.offsetParent) break; obj = obj.offsetParent; } else if(obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if(obj.offsetParent) while(1) { curtop += obj.offsetTop; if(!obj.offsetParent) break; obj = obj.offsetParent; } else if(obj.y) curtop += obj.y; return curtop; } function urlencode(str) { return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); } function urldecode(str) { return unescape(str.replace('+', ' ')); } function remove_element_by_id(element_id) { var oldelem = document.getElementById(element_id); oldelem.innerHTML = ''; document.body.removeChild(oldelem); } function pop_div(newdiv_id,newdiv_position,newdiv_zIndex,newdiv_width,newdiv_height,newdiv_innerHTML,newdiv_top,newdiv_left,makedraggable) { var newdiv = document.createElement("div"); newdiv.setAttribute("id",newdiv_id); document.body.appendChild(newdiv); newdiv.style.position = newdiv_position; newdiv.style.zIndex = newdiv_zIndex; if(newdiv_width!='none') { newdiv.style.width = newdiv_width + "px"; } if(newdiv_height!='none') { newdiv.style.height = newdiv_height + "px"; } newdiv.innerHTML = newdiv_innerHTML; newdiv.style.top = newdiv_top + "px"; newdiv.style.left = newdiv_left + "px"; if(makedraggable=='yes') { makeDraggable(newdiv); } } function makeDraggable(item){$(item).draggable()} var blink_memory = new Array(); function blink_newmess_num(id) //launcher { if(!blink_memory[id] || blink_memory[id]=='stopped') {do_blink_mess(id);} } function do_blink_mess(id) { var thisnumelem=document.getElementById(id); if(thisnumelem==null) {blink_memory[id]='stopped';} else { if(blink_memory[id]!='hidden') {blink_memory[id]='hidden';} else {blink_memory[id]='visible';} thisnumelem.style.visibility=blink_memory[id]; t=setTimeout("do_blink_mess('"+id+"')",1500); } } //var soundbox = document.createElement("div"); //soundbox.innerHMLT = ''; function playsound(soundname) { if(sound_on_or_off=='on') { var elsound = new Audio("/sounds/"+soundname); elsound.play(); } } var sound_on_or_off='on'; function togglesound() { var togglesound_button=document.getElementById("togglesound_button"); if(sound_on_or_off=='on') { sound_on_or_off='off'; //togglesound_button.className='soundcontrol soundoff'; togglesound_button.className='soundcontrol soundoff fa fa-volume-off'; setCookie('soundcontrol','off',365); } else { sound_on_or_off='on'; //togglesound_button.className='soundcontrol soundon'; togglesound_button.className='soundcontrol soundon fa fa-volume-up'; setCookie('soundcontrol','on',365); } } var cookie_soundcontrol=getCookie('soundcontrol'); if(cookie_soundcontrol=='off') {sound_on_or_off='off';} var lookformessagesisre2 = 0; function lookformessages2() { if(lookformessagesisre2 == 0) { lookformessages_re2(); lookformessagesisre2 = 1; } } var lookformessages_re2_timeout; function lookformessages_re2() { //var url = "xmllookfor_pm2?perpage="+messages2_perpage; var url = "xmllookfor_pm2"; //window.open(url); loadXMLDocpm2(url); lookformessages_re2_timeout=setTimeout("lookformessages_re2()",lookfor_messages_every2); } var totalnewmessages=0; var originaltitle=document.title; function set_title() { var respNewMess=document.getElementById("respNewMess"); if(totalnewmessages==0) { if(document.title!=originaltitle){document.title=originaltitle;} if(respNewMess!=null){respNewMess.innerHTML="";} } else { if(document.title=='...' || document.title==originaltitle) { var messagesS='s'; if(totalnewmessages==1) {messagesS='';} document.title='('+totalnewmessages+') new message'+messagesS; var unseens="
"+ ""+ "
"+totalnewmessages+"
"+ "
"; if(respNewMess!=null){respNewMess.innerHTML=unseens;} } else { document.title='...'; if(respNewMess!=null){respNewMess.innerHTML="";} } } t=setTimeout("set_title()",1500); } set_title(); function processReqChangepm2() { if (reqpm2.readyState == 4) { if (reqpm2.status == 200) { response = reqpm2.responseXML.documentElement; var result = response.getElementsByTagName("result")[0].firstChild.data; if(result == "ok") { var totalmessages = response.getElementsByTagName("totalmessages")[0].firstChild.data; var countnewmessages = 0; var thereismore = response.getElementsByTagName("thereismore")[0].firstChild.data; var beepfornew = response.getElementsByTagName("beepfornew")[0].firstChild.data; var count = 0; var finalmessagesstring=''; var todisplay_onlinness = new Array; while(count < totalmessages) { count++; var this_message_pubid = response.getElementsByTagName("message_pubid_" + count)[0].firstChild.data; var this_last_message_time = response.getElementsByTagName("last_message_time_" + count)[0].firstChild.data; var this_howmanynew = Math.abs(response.getElementsByTagName("howmanynew_" + count)[0].firstChild.data); countnewmessages+=this_howmanynew; //var this_message_seen_ornot = response.getElementsByTagName("message_seen_ornot_" + count)[0].firstChild.data; var this_message_start = response.getElementsByTagName("message_start_" + count)[0].firstChild.data; var this_u_or_g=this_message_pubid.substr(0,1); var this_userID=this_message_pubid.substr(2); //var this_screen_name = response.getElementsByTagName("screen_name_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; //var this_gender = response.getElementsByTagName("gender_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; //var this_official_picID = response.getElementsByTagName("official_picID_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; //var this_official_picserver = response.getElementsByTagName("official_picserver_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; var this_screen_name; var this_user_pic; var screen_name_tag=response.getElementsByTagName("screen_name_" + this_u_or_g + "_" + this_userID)[0]; if(typeof screen_name_tag!="undefined" && screen_name_tag!=null) { //alert(typeof screen_name_tag); this_screen_name=screen_name_tag.firstChild.data; var this_gender = response.getElementsByTagName("gender_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; var this_official_picID = response.getElementsByTagName("official_picID_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; var this_official_picserver = response.getElementsByTagName("official_picserver_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; var this_online = response.getElementsByTagName("online_" + this_u_or_g + "_" + this_userID)[0].firstChild.data; if(this_official_picID==0) {this_user_pic="new_pics/nopicface2_"+this_gender+".png";} else {this_user_pic="https://"+this_official_picserver+"."+this_top_domain+"/thumbs/"+this_official_picID+"_thumb.jpg";} set_onlinness_array[this_message_pubid]="yes"; todisplay_onlinness[this_message_pubid]=this_online; } else { if(this_u_or_g=='u') {this_screen_name="deleted user"} else {this_screen_name="deleted guest"} this_user_pic="new_pics/nopicface2_unknown.png"; this_online='off'; } var unseens = ""; if(this_howmanynew>0) { unseens_id="unseens_"+this_message_pubid; var visibility_clause=''; if(blink_memory[unseens_id]) {visibility_clause='visibility:'+blink_memory[unseens_id]+';';} //visibility_clause='visibility:hidden;'; //unseens=" 
"+this_howmanynew+"
"; unseens="
"+ ""+ "
"+this_howmanynew+"
"+ "
"; setTimeout("blink_newmess_num('"+unseens_id+"')",(Math.random()*1000)+1); } //var bgnum = (count%2)+1; //reverse that.. var bgnum = ((count-1)%2)+1; finalmessagesstring += ""+ ""+ ""+ "
"+ //chat bubble + pic "
"+ //user_pic ""+ //chat bubble "\"PM\""+ //online light "
"+ //unseens "
"+unseens+"
"+ "
"+ "
"+ "
"+ //persons name //""+this_screen_name+""+ ""+this_screen_name+""+ "
"+ //last message start "
"+this_message_start+"
"+ "
"+ //last message time "
"+maketimus(this_last_message_time)+"
"+ "
"+ "
"+ "
"; } if(thereismore==1) { //finalmessagesstring += ""; finalmessagesstring += "
messages history
"; } if(count==0) {finalmessagesstring+="no messages yet...";} document.getElementById("conversations_overview_box").innerHTML = finalmessagesstring; for(x in todisplay_onlinness) {new_display_onlinness(x,todisplay_onlinness[x]);} totalnewmessages=countnewmessages; if(beepfornew==1) {playsound("newmessage.wav");} } } } } // function addmoremessages() // { // clearInterval(lookformessages_re2_timeout); // messages2_perpage+=messages2_addatatime; // lookformessages_re2(); // } function maketimus(timestampz) { var linktime = new Date(timestampz * 1000); var linkday = linktime.getDate(); var freakingmonths=new Array(); freakingmonths[0]="jan"; freakingmonths[1]="feb"; freakingmonths[2]="mar"; freakingmonths[3]="apr"; freakingmonths[4]="may"; freakingmonths[5]="jun"; freakingmonths[6]="jul"; freakingmonths[7]="aug"; freakingmonths[8]="sep"; freakingmonths[9]="oct"; freakingmonths[10]="nov"; freakingmonths[11]="dec"; var linkmonthnum = linktime.getMonth(); var linkmonth = freakingmonths[linkmonthnum]; var linkyear = linktime.getFullYear(); var linkhour = linktime.getHours(); var linkminute = linktime.getMinutes(); if (linkminute < 10) {linkminute = "0" + linkminute;} var fomratedtime = linkday + linkmonth + linkyear + " " + linkhour + ":" + linkminute + "h"; return fomratedtime; } function toggle_save_search() { var saved_searchdiv = $("#saved_search_name_box"); var input = $('#saved_search_name'); var text = $('#saved_search_name_text').val(); if($('#saved_search_checkbox').is(":checked")) { input.val(text); saved_searchdiv.show(500); } else { input.val(""); saved_searchdiv.hide(500); } } function update_saved_search_name() { var input = $('#saved_search_name'); var text = $('#saved_search_name_text').val(); input.val(text); } function toggle_advanced() { var advanceddiv = $("#advanced_search_parameters"); var xpandbuttz=$("#advanced_search_parameters_xpandbuttz"); var input=$("#advanced_search_input"); if(advanceddiv.is(":hidden")) { xpandbuttz.html("-"); input.val("on"); } else { xpandbuttz.html("+"); input.val("off"); } advanceddiv.toggle(500); } function toggle_classquestio(question_name) { var advanceddiv = $("#classquestio_"+question_name); var xpandbuttz=$("#classquestio_input_"+question_name+"_xpandbuttz"); var input=$("#classquestio_input_"+question_name); if(advanceddiv.is(":hidden")) { xpandbuttz.html("-"); classquestio_setval(question_name); } else { xpandbuttz.html("+"); input.val("none"); } advanceddiv.toggle(500); } function classquestio_setval(question_name) { var checkstring="checkbox_"+question_name+"_"; var checkstringlen=checkstring.length; var allinputs=document.getElementsByTagName("input"); var resultz=new Array(); var alreadyseen=new Array(); var countchecked=0; var countunchecked=0; for(x in allinputs) { if(allinputs[x]!=null && allinputs[x].id!=null) { if(!alreadyseen[allinputs[x].id]) { alreadyseen[allinputs[x].id]='seen'; if(allinputs[x].id.indexOf(checkstring)!=-1) { var thisvalue = allinputs[x].id.substr(checkstringlen); if(allinputs[x].checked) { resultz.push(thisvalue); countchecked++; } else {countunchecked++;} } } } } if(countchecked==0) {finalrezult='none';} else if(countunchecked==0) {finalrezult='all';} else {finalrezult=resultz.join(",");} var input=$("#classquestio_input_"+question_name); input.val(finalrezult); } function writein_saved_searches(toggleafter) { $.get('saved_searches',function(data){ var buildstring = ''; var totalinpage=Math.abs($(data).find('totalinpage').text()); if(totalinpage==0) {buildstring='you have no saved searches';} else { $(data).find('saved_search').each(function(){ var $node = $(this); var ID = $node.find('searchID').text(); var name = $node.find('name').text(); var data = $node.find('data').text(); var time = $node.find('time').text(); buildstring+=''+name+'('+maketimus(time)+')x
'; }); } $('#saved_searches_box').html(buildstring); if(toggleafter=='yes') {$('#saved_searches_box').toggle(500);} }); } function toggle_saved_searches() { var donot_toggle=0; var saved_searches_box=$('#saved_searches_box'); var saved_searches_xpandbuttz=$('#saved_searches_xpandbuttz'); if(saved_searches_box.is(":hidden")) { saved_searches_xpandbuttz.html("-"); if(saved_searches_box.html()=='') { donot_toggle=1; writein_saved_searches('yes'); } } else {saved_searches_xpandbuttz.html("+");} if(donot_toggle==0) {saved_searches_box.toggle(500);} } function erase_saved_search(ID,name,time) { var r=confirm("Are you sure that you want to erased the saved search named "+name+" from "+maketimus(time)) if (r==true) { $.get('erase_saved_search?searchID='+ID,function(data){ var resultzz=$(data).find('resultzz').text(); if(resultzz=='ok') {writein_saved_searches();} }); } } function toggleLeftDiv(){ var theDiv=document.getElementById("leftDiv"); var theDiv2=document.getElementById("rightDiv"); var theToggle=document.getElementById("toggleLeftDiv"); var theToggle2=document.getElementById("toggleRightDiv"); // if(theDiv.style.display!="block"){ // theDiv.style.display="block"; // theDiv2.style.display="none"; // }else{ // theDiv.style.display="none"; // } // if(theDiv.style.width!="100%"){ // theDiv.style.width="100%"; // theDiv2.style.width="0"; // }else{ // theDiv.style.width="0"; // } if(theDiv.style.left!="0" && theDiv.style.left!="0px" && theDiv.style.left!="0%"){ theDiv.style.left="0"; theDiv2.style.right="-240px"; theToggle.className = theToggle.className + " toggleActive"; theToggle2.className = theToggle.className.replace(/toggleActive/g,''); }else{ theDiv.style.left="-240px"; theToggle.className = theToggle.className.replace(/toggleActive/g,''); } } function toggleRightDiv(){ var theDiv=document.getElementById("rightDiv"); var theDiv2=document.getElementById("leftDiv"); var theToggle=document.getElementById("toggleRightDiv"); var theToggle2=document.getElementById("toggleLeftDiv"); // if(theDiv.style.display!="block"){ // theDiv.style.display="block"; // theDiv2.style.display="none"; // }else{ // theDiv.style.display="none"; // } // if(theDiv.style.width!="100%"){ // theDiv.style.width="100%"; // theDiv2.style.width="0"; // }else{ // theDiv.style.width="0"; // } if(theDiv.style.right!="0" && theDiv.style.right!="0px" && theDiv.style.right!="0%"){ theDiv.style.right="0"; theDiv2.style.left="-240px"; theToggle.className = theToggle.className + " toggleActive"; theToggle2.className = theToggle.className.replace(/toggleActive/g,''); }else{ theDiv.style.right="-240px"; theToggle.className = theToggle.className.replace(/toggleActive/g,''); } } var set_onlinness_array=new Array(); function new_set_onlinness() { var gotsome = 0; var pubids = ""; for(x in set_onlinness_array) { if(gotsome==1){pubids+="|"} pubids+=x; gotsome = 1; } if(gotsome==1) { var url = "xmlcheckifon2?pubids=" + pubids; //window.open(url); loadXMLDocnew_set_onlinness(url); } var t=setTimeout("new_set_onlinness()",5000); } function processReqChangenew_set_onlinness() { if (reqnew_set_onlinness.readyState == 4) { if (reqnew_set_onlinness.status == 200) { response = reqnew_set_onlinness.responseXML.documentElement; var result = response.getElementsByTagName("result")[0].firstChild.data; if(result == "ok") { var totalresults = response.getElementsByTagName("totalresults")[0].firstChild.data; var count = 0; while(count < totalresults) { count++; var this_pubid = response.getElementsByTagName("pubid_" + count)[0].firstChild.data; var this_onliner = response.getElementsByTagName("onliner_" + count)[0].firstChild.data; new_display_onlinness(this_pubid,this_onliner); } } } } } function new_display_onlinness(pubid,on_or_off) { if(on_or_off=='on') { picname = 'online.png'; word = 'online'; showonliner = '' + word; showonliner_nowords = ''; showonliner_showoffline = '' + word; } else if(on_or_off=='off') { picname = 'offline.png'; word = 'offline'; showonliner = ''; showonliner_nowords = ''; showonliner_showoffline = '' + word; } var alldivs = document.getElementsByTagName("div"); for(x in alldivs) { //alert(alldivs[x].id); if(alldivs[x].id!=null) { if(alldivs[x].id.indexOf("onliner_"+pubid)!=-1) { if(alldivs[x].id.indexOf("_nowords_")!=-1) {alldivs[x].innerHTML=showonliner_nowords;} else if(alldivs[x].id.indexOf("_showoffline_")!=-1) {alldivs[x].innerHTML=showonliner_showoffline;} else {alldivs[x].innerHTML=showonliner;} } } } } var max_allowed_face_divs=1000; var auto_scroll_speed=70; //move face divs 1 px left every xx millisec var put_faces_container=false; var user_scroll_speed=0; //just a var to remember stuff var user_scroll_slower=5; //the higher this is the slower the user scroll will be var padding=0; var faces_pause_scroll=0; var faces_pause_scroll_button=0; var cookie_facespause=getCookie('facespause'); if(cookie_facespause=='1') {faces_pause_scroll_button=1;} //create array of face divs var face_divs=new Array(); var original_face_div; var original_face_div_width; var faces_willpause; var faces_timeout=5*60*1000; //font awesome icons var pause_button_html=''; var play_button_html=''; function newputfaces() { console.log('newputfaces()'); $('#put_faces').css({'height':'100px'}); //create original face div from ajax $.get('/newnewshowfaces',function(data){ var mysqlselect=Math.abs($(data).find('mysqlselect').text()); var buildstring = ''; var countpics=0; var count=0; var todisplay_onlinness = new Array; $(data).find('user').each(function(){ count++; var $node = $(this); var pubid = $node.find('pubid').text(); var screen_name = $node.find('screen_name').text(); var gender = $node.find('gender').text(); var official_picID = $node.find('official_picID').text(); var official_picserver = $node.find('official_picserver').text(); var online = $node.find('online').text(); countpics++; var showpic="https://"+official_picserver+"."+this_top_domain+"/thumbs/"+official_picID+"_thumb.jpg"; if(official_picID==0) {showpic="/new_pics/nopicface2_"+gender+".png"} var u_or_g=pubid.substr(0,1); var userID=pubid.substr(2); set_onlinness_array[pubid]="yes"; todisplay_onlinness[pubid]=online; var thisleft=(countpics-1)*(100+(padding*2)); var this_leads_vars=''; if (typeof force_harba_name !== 'undefined' && typeof force_harba_ref !== 'undefined') {this_leads_vars='&harba_name='+force_harba_name+'&harba_ref='+force_harba_ref;} buildstring+='
'; buildstring+=''; buildstring+=''; //buildstring+='
'+screen_name+'
'; //buildstring+='
'+screen_name+'
'; //buildstring+='
'+screen_name+'
'; //buildstring+='
'+screen_name+'
'; //buildstring+='
'+screen_name+'
'; buildstring+='
'+screen_name+'
'; buildstring+='
'; buildstring+="
"; buildstring+='
'; }); //to try to fix the empty ad bug: if(count==0) {buildstring+=mysqlselect;} original_face_div_width=(100+(padding*2))*countpics; //var play_pause_button_pic='/new_pics/pause.png'; var play_pause_button_icon=pause_button_html; if(faces_pause_scroll_button==1){ //var play_pause_button_pic='/new_pics/play.png'; var play_pause_button_icon=play_button_html; } //var play_pause_button=''; var play_pause_button='
'+play_pause_button_icon+'
'; $('#put_faces').html('
'+buildstring+'
'+play_pause_button); for(x in todisplay_onlinness) {new_display_onlinness(x,todisplay_onlinness[x]);} //add original face div to face_divs array original_face_div=document.getElementById("original_face_div"); face_divs.push(original_face_div); faces_auto_scroll(); faces_willpause = setTimeout(function(){faces_play_pause_toggle('pause',false)},faces_timeout); }); } function faces_play_pause_toggle(force_action,rememberwithcookie) { var togglebutton=document.getElementById("play_pause_toggle_button"); if((force_action=='pause' || faces_pause_scroll_button==0) && force_action!='play') { //pause it faces_pause_scroll_button=1; //togglebutton.src='/new_pics/play.png'; togglebutton.innerHTML=play_button_html; if(rememberwithcookie!=false){setCookie('facespause','1',365);} clearTimeout(faces_willpause); } else { //play faces_pause_scroll_button=0; faces_auto_scroll(); //togglebutton.src='/new_pics/pause.png'; togglebutton.innerHTML=pause_button_html; if(rememberwithcookie!=false){setCookie('facespause','0',365);} faces_willpause = setTimeout(function(){faces_play_pause_toggle('pause',false)},faces_timeout); } } function faces_auto_scroll() { if(faces_pause_scroll_button==0) { if(faces_pause_scroll==0) { var goforspeed=1; if(faces_user_scroll==1) {goforspeed=user_scroll_speed;} var count_face_divs=0; for(x in face_divs) { count_face_divs++; face_divs[x].style.left = face_divs[x].offsetLeft - goforspeed + "px"; } //run loop_it faces_loop_it(); } if(count_face_divs>max_allowed_face_divs) //if number of divs get too high, its bugging, just stop!! { //alert('number of face divs reached over '+max_allowed_face_divs+'. please warn the admin and make sure to mention also what browser/operating system you are on. Thank you!!'); } else {myVar = setTimeout(faces_auto_scroll,auto_scroll_speed);} } //$('#put_faces_debug').html(show_face_divs_array()); } // function show_face_divs_array() // { // var rezu=''; // for(x in face_divs) // {rezu+='
'+face_divs[x]+': x: '+x+', offsetLeft: '+face_divs[x].offsetLeft+'
';} // return rezu; // } function faces_loop_it() { //for every face div, find if they are fully outside of the container if(!put_faces_container) {put_faces_container=document.getElementById("put_faces");} var container_left_side=put_faces_container.offsetLeft; var container_right_side=put_faces_container.offsetLeft+put_faces_container.offsetWidth; ////if yes remove from page and face_divs array ////if not take note of zone covered of container in array var left_side_of_coverage=false; var right_side_of_coverage=null; var todelete=new Array; for(x in face_divs) { var face_div_left_side=face_divs[x].offsetLeft; var face_div_right_side=face_divs[x].offsetLeft+face_divs[x].offsetWidth; if( face_div_right_sidecontainer_right_side ) { //this face div is completely out of the zone... remove it! //put_faces_container.removeChild(face_divs[x]); todelete.push(face_divs[x]); //remove_object_from_array(face_divs,todelete); //put_faces_container.removeChild(todelete); } else { //calculate total coverage with leftest left and rightest right of all the face divs if(left_side_of_coverage===false || face_div_left_sideright_side_of_coverage) {right_side_of_coverage=face_div_right_side;} } } for(x in todelete) { put_faces_container.removeChild(todelete[x]); remove_object_from_array(face_divs,todelete[x]); } //$('#put_faces_debug2').html('left_side_of_coverage: '+left_side_of_coverage+', right_side_of_coverage: '+right_side_of_coverage+', original_face_div_width: '+original_face_div_width); //if not all container zone is covered add clone of original_face_div var leftofnewdiv=false; if(left_side_of_coverage>container_left_side) {leftofnewdiv=left_side_of_coverage-original_face_div_width;} if(right_side_of_coverageleft_side_of_coverage: '+left_side_of_coverage+', right_side_of_coverage: '+right_side_of_coverage+'
new face div added at position '+leftofnewdiv+'
'); } } function remove_object_from_array(array,object) { var countelements=0; //var debugstring=''; //debugstring+='
array before all: '+show_face_divs_array()+'
'; for(x in array) { //debugstring+='
'+array[x]+': x: '+x+', countelements: '+countelements+', id: '+array[x].id+'
'; if(array[x]==object) { //debugstring+='
array before: '+show_face_divs_array()+'
'; face_divs.splice(countelements,1); //debugstring+='
is same as object to be removed... remove....
'; //debugstring+='
array after: '+show_face_divs_array()+'
'; countelements--; } countelements++; } //debugstring+='
array after all: '+show_face_divs_array()+'
'; //$('#put_faces_debug3').html(debugstring); } //===========makeDraggable intercode.ca MODIFIED!!!================= var mouseX; var mouseY; var dragObject = null; var faces_user_scroll=0; //global variables that are needed if (document.addEventListener){document.addEventListener('mousemove',mouseMove,false);document.addEventListener('mouseup',mouseUp,false);} //event handlers else if (document.attachEvent){document.attachEvent('onmousemove',mouseMove);document.attachEvent('onmouseup',mouseUp);} //old ie fix!! function mouseMove(event) { if(dragObject) { //were dragging something var Xdifference=event.clientX-mouseX; var Ydifference=event.clientY-mouseY; //calculate movement dragObject.style.position = "absolute"; dragObject.style.left = dragObject.offsetLeft + Xdifference + "px"; dragObject.style.top = dragObject.offsetTop + Ydifference + "px"; //move the object that we are dragging } if(faces_user_scroll==1) { //faces user scroll, get needed speed!! if(!put_faces_container) {put_faces_container=document.getElementById("put_faces");} var put_faces_middle=(put_faces_container.offsetLeft+(put_faces_container.offsetLeft+put_faces_container.offsetWidth))/2; user_scroll_speed=Math.floor((event.clientX-put_faces_middle)/user_scroll_slower); } mouseX=event.clientX; mouseY=event.clientY; //update global variables about mouse position } function mouseUp(ev){dragObject = null;} //mouse up, stop dragging function makeDraggable_intercode(object){ //the function that makes an object draggable if (object.addEventListener){object.addEventListener('mousedown',function(){dragObject = object;},false);} else if (object.attachEvent){object.attachEvent('onmousedown',function(){dragObject = object;});} } //===========makeDraggable intercode.ca MODIFIED!!!=================