var chatCycleFlag = false; var inChatFlag = false; var soundsFlag = true; var isBodyFocus = true; var isFlipping = false; var sendTo2 = false; var typingStatus = false; var chatSearching = false; function AJAX(url,params,div,OR) { var xmlHttp=GetXmlHttpObject(); if(xmlHttp==null){return;} xmlHttp.onreadystatechange= function() { if (xmlHttp.readyState==4) { if(xmlHttp.responseText=="") return; if(div==false) return; if(OR) document.getElementById(div).innerHTML=xmlHttp.responseText; else document.getElementById(div).innerHTML = document.getElementById(div).innerHTML + xmlHttp.responseText; } }; xmlHttp.open("POST",url,true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(params); } function GetXmlHttpObject() { var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function doWork(num) { AJAX('/ajax/ajax.php','num='+num,'work'+num,true); } function getShare() { loadWork('viewMiniProfile'); } function keypressed(e) { if(e.keyCode==13 || e.which==13) { var txt = $('#chatInput').val(); $('#chatInput').val( txt.slice(0, -1) ); sendMessage(); } checkTyping(); } function toggleBox(el) { if( $('#'+el).css('display')=='block' ) $('#'+el).css('display','none'); else $('#'+el).css('display','block'); } function updateAd() { return false; AJAX('/ajax/ad.php','','rightBanner',true); } function closeFlyers() { $('#flyBox').css('display','none'); $('#flyBox2').css('display','none'); $('#feedback').css('display','none'); $('#prefBox').css('display','none'); $('#imageBox').css('display','none'); $('#userRegister').css('display','none'); $('#userSignin').css('display','none'); $('#userAccount').css('display','none') } var favicon = { // -- "PUBLIC" ---------------------------------------------------------------- change: function(optionalIconURL, optionalDocTitle) { if (optionalIconURL) { clearTimeout(this.animateTimer); this.addLink(optionalIconURL, true); } if (optionalDocTitle) { clearTimeout(this.scrollTimer); document.title = optionalDocTitle; } }, animate: function(iconSequence, options) { this.unanimate(); options = options || {}; options["delay"] = parseInt(options["delay"]) || 2000; this.preloadIcons(iconSequence); this.iconSequence = iconSequence; favicon.index = 0; favicon.change(iconSequence[0]); this.animateTimer = setInterval(function() { favicon.index = (favicon.index+1) % favicon.iconSequence.length; favicon.addLink(favicon.iconSequence[favicon.index], false); }, options["delay"]); }, unanimate: function() { clearTimeout(this.animateTimer); }, scrollTitle: function(title, options) { this.unscroll(); options = options || {}; options["delay"] = options["delay"] || 250; options["gap"] = options["gap"] || " "; title = title+options["gap"]; document.title = title; titleOffset = 0; this.scrollTimer = setInterval(function() { var startPos = (titleOffset++) % title.length; var newTitle = title.substr(startPos); newTitle += title.substr(0,startPos); document.title = newTitle; }, options["delay"]); }, unscroll: function() { clearTimeout(this.scrollTimer); }, changeTitle: function(title) { document.title = title; }, // -- "PRIVATE" --------------------------------------------------------------- scrollTimer: null, animateTimer: null, preloadIcons: function(iconSequence) { var dummyImageForPreloading = document.createElement("img"); for (var i=0; i'); } else { alert('You must be 18 and agree to the terms.'); } } function checkReg2() { if ($('#18cb').attr('checked')) { $('#frmReg2').submit(); } else { alert('You must be 18 and agree to the terms.'); } } function loginMe() { $.ajax({ type: "POST", url: "/ajax/login.php", data: "userEmail="+$('#loginFormUserEmail').val()+"&userPassword="+$('#loginFormUserPassword').val(), success: function(data){ loginResponse(data); } }); $('#loginFormDiv').html('
'); } function loginResponse(txt) { if(txt==200) { loginWork(); return; } $('#loginFormDiv').html(txt); } function regResponse(txt) { if(txt==200) { loginWork(); return; } $('#registerFormDiv').html(txt); } function loginWork() { closeFlyers(); $.ajax({ type: "POST", url: '/ajax/getLogin.php', success: function(data){ loginUpdate(data); } }); $('#shareButton').css('display','block'); updateFloatMenu(); } function updateFloatMenu() { closeFlyers(); $.ajax({ type: "GET", url: "/floatMenu.php?part=1", success: function(data){ $('#floatingMenu').html(data); } }); } function loginUpdate(txt) { if(txt!=400) { $('#rightMenuNav2').html(txt); $('#rightMenuNav').html(txt); } } function opac(div,value) { $(div).css('opacity', (value/10) ); $(div).css('filter', 'alpha(opacity=' + value*10 + ')' ); } function editImageChange(x) { AJAX('/ajax/swapImage.php','w=350&h=105&img='+x,'defaultImageEdit',true); } function saveEditForm() { $('#editResponse').innerHTML = "Saving..."; var fName = $('#editFormuserFirstName').val(); var lName = $('#editFormuserLastName').val(); var age = $('#editFormuserAge').val(); var location = $('#editFormuserLocation').val(); var hobbies = $('#editFormuserHobbies').val(); var about = $('#editFormuserAbout').val(); var params = 'userFirstName='+fName; params+= '&userLastName='+lName; params+= '&userAge='+age; params+= '&userLocation='+location; params+= '&userHobbies='+hobbies; params+= '&userAbout='+about; AJAX('/ajax/editProfile.php',params,'editResponse',true); } function loadWork(where) { if(where=='editProfile') { closeFlyers();toggleBox('flyBox2') var div = 'flyContent2'; var url = '/ajax/updateProfileEdit.php'; } if(where=='viewMiniProfile') { closeFlyers();toggleBox('flyBox2') var div = 'flyContent2'; var url = '/ajax/getShare.php'; } $(div).html('
'); AJAX(url,'',div,true); } function loadWork2(which) { $('#flyCont').html(''); if(which=='moreFriends') { toggleBox('flyBox'); AJAX('/ajax/allFriends.php','','flyCont',true); } } function report(id){ AJAX('/ajax/report.php','id='+id,'report-'+id,true); } function report2(id){ AJAX('/ajax/report2.php','id='+id,'report-'+id,true); } function expandBox(el,start,h) { el = '#'+el; if($(el).val()==start) $(el).val(''); $(el).css('height', h+'px'); $(el).css('color','#111111'); $(el+'-open').css('display','block'); } function unExpandBox(el,start,h) { el = '#'+el; if($(el).val()=="" || $(el).val()==start ) { $(el).val(start); $(el).css('height', h+'px'); $(el).css('color','#666'); $(el+'-open').css('display','none'); } } function postComment(el,replyTo) { if(replyTo) replyBox = 'newResponseComment-'+replyTo; else replyBox = 'newComments'; var comment = $('#'+el).val(); $('#'+el).val(''); $.ajax({ type: "POST", url: "/ajax/postComment.php", data: "text="+comment+"&replyTo="+replyTo , success: function(data){ if(data=='601') { //$('.IM-Text').html('IM will not be sent. You must verify you are human.'); spamCaptchaAlert(); } else if(data=='602') { //$('.IM-Text').html('IM will not be sent. You must verify you are human.'); spamCaptchaAlert(); } else { $('#'+replyBox).html( data + $('#'+replyBox).html() ); } } }); } function deleteComment(id,t) { $('#comment-'+id).css('display','none'); $.ajax({ type: "POST", url: "/ajax/deleteComment.php", data: "id="+id+"&t="+t }); } function postInbox() { var text = $('#inbox-input').val(); $('#inbox-input').val(''); $.ajax({ type: "POST", url: "/ajax/postInbox.php", data: "text="+text , success: function(data){ if(data=='601') { //$('.IM-Text').html('IM will not be sent. You must verify you are human.'); spamCaptchaAlert(); } else if(data=='602') { //$('.IM-Text').html('IM will not be sent. You must verify you are human.'); spamCaptchaAlert(); } else { $('#inbox-new').html( data + $('#inbox-new').html() ); } } }); } function deleteInbox(id) { $('#inbox-'+id).css('display','none'); $.ajax({ type: "POST", url: "/ajax/deleteInbox.php", data: "id="+id }); } function moreWall(last,userID) { $('#profileMoreWall-'+last).html('
'); $.ajax({ type: "POST", url: "/ajax/moreWall.php", data: "last="+last+"&userID="+userID , success: function(data){ $('#profileMoreWall-'+last).html(data); } }); } function req(id,dec) { if(dec=='y') $('#req-'+id).html('
Friend Request Approved.
'); else $('#req-'+id).html('
Friend Request Denied.
'); $.ajax({ type: "POST", url: "/ajax/req.php", data: "id="+id+"&dec="+dec }); } function moreFriends(last,userID) { $('#profileMoreFriends-'+last).html('
'); $.ajax({ type: "POST", url: "/ajax/allFriends.php", data: "last="+last+"&userID="+userID, success: function(data) { $('#profileMoreFriends-'+last).html(data); } }); } function uhoh(id) { $('#uhoh').html('Done deal...'); $.ajax({ type: "POST", url: "/ajax/uhoh.php", data: "id="+id, }); } function updateLocale(range,quad) { $.ajax({ type: "POST", url: "/ajax/updateChatLocation.php", data: "quad="+quad+'&range='+range, }); } function shareProfile() { if(!(inChatFlag==true)) return; var c = confirm('Are you sure you wish to share your profile with this person?'); if(c) { var msg = ':::share:::'; $.ajax({ type: "POST", url: "/ajax/send.php", data: "message="+msg, }); $('#chat').html( $('#chat').html() + 'Your profile has been sent.
'); } } function postLike(id,profile) { $.ajax({ type: "POST", url: "/ajax/winning.php", data: "postID="+id+"&pID="+profile, success: function(data) { $('#winning-'+id).html(data); $('#winning-'+id).css('display',"block"); $('#winningLink-'+id).html("Losing"); } }); } function postUnlike(id,profile) { $.ajax({ type: "POST", url: "/ajax/winning.php", data: "postID="+id+"&losing=1&pID="+profile, success: function(data) { if(data==401) { $('#winning-'+id).html(''); $('#winning-'+id).css('display',"none"); } else { $('#winning-'+id).html(data); $('#winning-'+id).css('display',"block"); } $('#winningLink-'+id).html( "Winning"); } }); } function winningPop(id,profile) { $('#flyCont').html(''); toggleBox('flyBox'); $.ajax({ type: "POST", url: "/ajax/winningList.php", data: "postID="+id+"&losing=1&pID="+profile, success: function(data){ $('#flyCont').html(data); } }); } function updateUserStatus() { $.ajax({ type: "POST", url: "/ajax/onlineStatus.php" }); setTimeout('updateUserStatus()',60000); } function reportSpamUser(id) { var con = confirm('Are you sure you want to report this user?'); if(con) { $.ajax({ type: "POST", data: "id="+id, url: "/ajax/im/report.php" }); } } $(document).ready(function() { $('#mainSearchCountry').change( function(){ search_country( $(this).val() ); }); $('#mainSearchCity').change( function(){ search_range( $(this).val() ); }); $('#mainSearchState').change( function(){ search_state( $(this).val() ); }); }); function search_country(id) { $('#searchState-fill').html(''); $('#searchCity-fill').html(''); $('#search-range').css('display','none'); if(id==0) return; $('#searchState-fill').html(''); $.ajax({ type: "POST", url: "/ajax/search/country.php", data: "id="+id, success: function(data){ $('#searchState-fill').html(data); $('#mainSearchState').change( function(){ search_state( $(this).val() ); }); } }); } function search_state(id) { $('#search-range').css('display','none'); $('#searchCity-fill').html(''); if(id==0) return; $('#searchCity-fill').html(''); $.ajax({ type: "POST", url: "/ajax/search/state.php", data: "id="+id+"&code="+$('#mainSearchCountry').val(), success: function(data){ $('#searchCity-fill').html(data); $('#mainSearchCity').change( function(){ search_range( $(this).val() ); }); } }); } function search_range(id) { if(id>0) $('#search-range').css('display','block'); else $('#search-range').css('display','none'); } function spamCaptchaAlert() { //alert('test spam'); $('body').prepend('
We have detected some spam related activity from your account. If this is your first offense, no ban will be issued. If this happens over and over you will have bans planced on your account. For more information please visit our spam rules page. Please enter the words from the picture below to verify you are a human. You will not be able to send messages until you have done so.
SUBMIT CODE | CLOSE
'); /*$.ajax({ type: "POST", url: "/ajax/captcha.php", success: function(data){ if( data ){ alert(data); $('#captchaInsert').html(data); } } }); */ Recaptcha.create("6LctB9ASAAAAAPWaWjmY_NS9tV1SuYEMT6sjTBea", "captchaInsert", { theme: "red", callback: Recaptcha.focus_response_field } ); $('a.captchaSubmit').click( function(){ submitCaptcha(); }); $('a.cancelSubmit').click( function(){ $('.flyBoxSpam').hide(); }); } function submitCaptcha() { var f1 = $('#recaptcha_challenge_field').val(); var f2 = $('#recaptcha_response_field').val(); $.ajax({ type: "POST", data: "recaptcha_challenge_field="+f1+"&recaptcha_response_field="+f2, url: "/ajax/captcha/ajax.php", success: function(data){ if(data==200) $('.flyBoxSpam').hide(); else $('#captchaResult').html(data); } }); } document.write('');