function gradient(id, level) { var box = document.getElementById(id); box.style.opacity = level; box.style.MozOpacity = level; box.style.KhtmlOpacity = level; box.style.filter = "alpha(opacity=" + level * 100 + ")"; box.style.display="block"; return; } function fadein(id) { var level = 0; while(level <= 1) { setTimeout( "gradient('" + id + "'," + level + ")", (level* 300) + 10); level += 0.01; } } // Open the lightbox function openbox(formtitle, fadin, boxname) { document.getElementById("log_in_dropdown").style.display="none"; var box = document.getElementById(boxname); document.getElementById('filter').style.display='block'; var btitle = document.getElementById('boxtitle'); btitle.innerHTML = formtitle; if(fadin) { gradient(boxname, 0); fadein(boxname); } else { box.style.display='block'; } } // Close the lightbox function closebox(boxname) { document.getElementById(boxname).style.display='none'; document.getElementById('filter').style.display='none'; } function openHomePage(type,obj) { var jqr = jQuery.noConflict(); if(type=="browse") { jqr("#browseArea").css('display', 'block'); jqr("#dv_home_dynamic").css('display', 'none'); jqr('.dv_home_rt_2 div').removeClass(); jqr(obj).addClass('dv_nav_active'); } else { jqr("#dv_home_dynamic").css('display', 'block'); jqr("#browseArea").css('display', 'none'); jqr("#dv_home_dynamic").html(""); jqr("#loadingIcon").css('display', 'block'); jqr('.dv_home_rt_2 div').removeClass(); jqr(obj).addClass('dv_nav_active'); url = jqr("#site_url").val(); var loadUrl = url + "/action.php?type=" + type; // alert(loadUrl); jqr.ajax({ url: loadUrl, method: 'POST', data: {"type": type}, success: function (data) { jqr("#loadingIcon").css('display', 'none'); jqr("#dv_home_dynamic").html(data); }, error: function (data) { jqr("#loadingIcon").css('display', 'none'); } }); } } function openRegistrationPanel(div,id) { var jqr = jQuery.noConflict(); jqr(".rgspanel").css('display','none'); jqr("#"+div).css('display','block'); jqr(".editmenu").removeClass("rgsactive"); jqr("#"+id).addClass("rgsactive"); jqr([document.documentElement, document.body]).animate({ scrollTop: jqr("#"+id).offset().top }, 2000); } function openPFPage(type,obj,userid) { var jqr = jQuery.noConflict(); jqr("#dv_home_dynamic").html(""); if(type=="about") { jqr("#dv_pf_fix").css('display', 'block'); jqr("#dv_pf_dynamic").html(""); jqr('.dv_home_rt_2 div').removeClass(); jqr(obj).addClass('dv_nav_active'); } else{ jqr("#dv_pf_fix").css('display', 'none'); jqr("#loadingIcon").css('display', 'block'); jqr('.dv_home_rt_2 div').removeClass(); jqr(obj).addClass('dv_nav_active'); url = jqr("#site_url").val(); var loadUrl = url + "/action.php?type=" + type+'&user_id='+userid; //alert(loadUrl); jqr.ajax({ url: loadUrl, method: 'POST', data: {"type": type}, success: function (data) { jqr("#loadingIcon").css('display', 'none'); jqr("#dv_pf_dynamic").html(data); }, error: function (data) { jqr("#loadingIcon").css('display', 'none'); } }); } } function openUrl(url) { window.location.href=url; } function blockMe(user_id,isblock,reloadme) { var jqr = jQuery.noConflict(); url = jqr("#site_url").val(); var loadUrl = url + '/action.php'; //alert(loadUrl); // var data='type=blockUser&user_id='+user_id+'&isblock='+isblock alert(loadUrl+'type=blockUser&user_id='+user_id+'&isblock='+isblock); jqr.ajax({ url: loadUrl, method: 'POST', data: {"type": "blockUser","user_id":user_id,"isblock":isblock}, success: function (data) { if(reloadme=='yes') { window.location.reload(); } else{ if(isblock=="yes"){ alert('User has been blocked'); } else { alert('User has been unblocked'); } } }, error: function (data) { jqr("#loadingIcon").css('display', 'none'); } }); } function displayAlert(msg){ alert(msg); } function updateOther(txtvalue,id) { var jqr = jQuery.noConflict(); jqr("#"+id).val(txtvalue); } function delMe(id) { var jqr = jQuery.noConflict(); jqr("#menurow"+id).remove(); } function delMeRight(id) { var jqr = jQuery.noConflict(); jqr("#menurowright"+id).remove(); } function addMore() { var jqr = jQuery.noConflict(); nextrow=parseInt(jqr('#lastrow').val())+1; var html="Delete"; jqr( "#addBeforeMe" ).before( html); jqr('#lastrow').val(nextrow); } var jqr = jQuery.noConflict(); document.addEventListener('click', function (event) { if (event.target.matches('.menu_right')) { jqr(".fadermenu").slideUp(); jqr("#fadermenu").slideToggle(); } else if (event.target.matches('.menu_left')) { jqr(".fadermenu").slideUp(); jqr("#fadermenuleft").slideToggle(); } else if (event.target.matches('.menubottom')) { jqr(".fadermenu").slideUp(); jqr("#fadermenubottom").slideToggle(); } else if (event.target.matches('.menumail')) { jqr(".fadermenu").slideUp(); jqr("#fadermenumail").slideToggle(); } else if (event.target.matches('.menuprofile')) { jqr(".fadermenu").slideUp(); jqr("#fadermenuprofile").slideToggle(); } else if (event.target.matches('.menuupgrade')) { jqr(".fadermenu").slideUp(); jqr("#fadermenuupgrade").slideToggle(); } else if (event.target.matches('.menueditprofile')) { jqr(".fadermenu").slideUp(); jqr("#fadermenueditprofile").slideToggle(); } else if (event.target.matches('.browse_menu')) { jqr(".fadermenu").slideUp(); jqr("#fadermenubrowse").slideToggle(); } else { jqr(".fadermenu").slideUp(); return; } // Don't follow the link event.preventDefault(); }, false); function closePrefPopup() { jqr("#fadermenubrowse").slideUp(); } function open_menu(id) { if(jqr('#'+id).css('display') == 'none'){ yesdisplay=1; jqr('#'+id+'_fa').addClass('fa-minus-circle'); jqr('#'+id+'_fa').removeClass('fa-plus-circle'); } else { yesdisplay=0; jqr('#'+id+'_fa').addClass('fa-plus-circle'); jqr('#'+id+'_fa').removeClass('fa-minus-circle'); } jqr(".dv_adm_menu").slideUp(); if(yesdisplay==1) { jqr('#'+id).slideDown(); } else{ jqr('#'+id).slideUp(); } } function submitPagination(page,size){ jqr('#page').val(page); jqr('#shownum').val(size); showMoreResult(); //jqr('#search_pager_myForm').submit(); } function submitPaginationForm() { jqr("#shownum").val(jqr("#lstShownum").val()); jqr('#search_pager_myForm').submit(); } function addMoreRight() { var jqr = jQuery.noConflict(); nextrow=parseInt(jqr('#lastrowRight').val())+1; var html="Delete"; jqr( "#addBeforeMeRight" ).before( html); jqr('#lastrowRight').val(nextrow); } function closeCommentBox(box) { jqr('#' + box).css({'display': 'none'}); } function openGiftBox() { jqr('#QuickBoxGifts').css({'display': 'block'}); } function selectGift(img,thisobj) { jqr('.dv_gft').children('div').removeClass('selectme'); jqr(thisobj).children('div').addClass('selectme'); jqr('#giftId').val(img); } function sendGift() { url = jqr("#site_url").val(); var loadUrl = url + "/action.php?type=gift&action=send" ; if(jqr('#giftId').val()){ jqr("#loading_img").css('display', 'block'); jqr.ajax({ url: loadUrl, method: 'POST', data: {"gift": jqr('#giftId').val(),"toUserId":jqr('#toUserId').val()}, success: function (data) { jqr("#loading_img").css('display', 'none'); alert("Gift sent successfully"); jqr('#QuickBoxGifts').css({'display': 'none'}); }, error: function (data) { alert("Please try again."); jqr("#loading_img").css('display', 'none'); } }); } else { alert('Please select a gift first.'); } } function delGift(id,page) { url = jqr("#site_url").val(); var loadUrl = url + "/action.php?type=delGift" ; //alert(loadUrl+'&id='+id); if(confirm('Are you sure to delete?')) { jqr("#loadingIcon").css('display', 'block'); jqr.ajax({ url: loadUrl, method: 'POST', data: {"id": id }, success: function (data) { jqr("#loadingIcon").css('display', 'none'); if(page=='home') { openHomePage('gifts',this); } else{ window.location.reload(); } }, error: function (data) { alert("Please try again."); jqr("#loadingIcon").css('display', 'none'); } }); } } function openRequest() { jqr('#reqFrm').submit(); } function displayNextPrf(cID,nID) { jqr("#prfProfile"+cID).remove(); jqr("#prfProfile"+nID).css('display', 'block'); } function saveInst(uid,cID,nID,interest) { url = jqr("#site_url").val(); var loadUrl = url + "/action.php?type=saveInterest"; jqr.ajax({ url: loadUrl, method: 'POST', data: {"id": uid ,"interest":interest}, success: function (data) { jqr("#prfProfile"+cID).remove(); jqr("#prfProfile"+nID).css('display', 'block'); }, error: function (data) { alert("Please try again."); jqr("#loadingIcon").css('display', 'none'); } }); } function changeSearchView(varclass,act) { jqr(".searchView").css('display', 'none'); jqr("."+varclass).css('display', 'block'); jqr(".schview").removeClass('activeview'); jqr('.'+act).addClass('activeview'); if(varclass=="listview") { jqr('#lstResultAs').val('list'); } else { jqr('#lstResultAs').val('gallery'); } } function processFunction(action,touser,touserId) { url=jqr("#site_url").val(); userId=jqr("#currentUserId").val(); if(action=="message") { window.location.href=url+'/send-mail/'+userId+'/'+touser; } else if(action=="addFriend"){ addFriend(url,touserId); refreshDD('select_search_res_div',touserId); } else if(action=="addToFavorite"){ window.open(url+'/hot-list/'+userId+'/'+touser, '', 'toolbar=no,menubar=no,height=150,width=200,left=' + (screen.width / 2 - 100) + ',top=' + (screen.height / 2 - 75) + ''); }else if(action=="sendFlirt"){ window.location.href=url+'/send-flirt/'+userId+'/'+touser; }else if(action=="sendGift"){ jqr('#toUserId').val(touserId); openGiftBox(); }else if(action=="report"){ }else if(action=="block"){ blockMe(touserId,'yes','no'); refreshDD('select_search_res_div',touserId); } else if(action=="removeFriend"){ removeFriend(url,touserId); refreshDD('select_search_res_div',touserId); } else if(action=="unblock"){ blockMe(touserId,'no','no'); refreshDD('select_search_res_div',touserId); } } function refreshDD(id,userid) { var loadUrl = url + "/action.php"; jqr.ajax({ url: loadUrl, method: 'POST', data: {"user_id": userid ,"type":"refreshDD"}, success: function (data) { jqr("#"+id+userid).html(data); }, error: function (data) { //alert("Please try again."); } }); } function addFriend(url,user_id) { var loadUrl = url + "/action.php"; jqr.ajax({ url: loadUrl, method: 'POST', data: {"user_id": user_id ,"type":"addFriend"}, success: function (data) { alert(data); }, error: function (data) { alert("Please try again."); } }); } function removeFriend(url,user_id) { var loadUrl = url + "/action.php"; jqr.ajax({ url: loadUrl, method: 'POST', data: {"user_id": user_id ,"type":"removeFriend"}, success: function (data) { alert(data); }, error: function (data) { alert("Please try again."); } }); } jqr(document).ready(function($) { jqr( ".search_result" ).mouseover(function() { meid=jqr(this).attr('id'); jqr("#more"+meid).css('display','block'); }); jqr( ".search_result" ).mouseout(function() { meid=jqr(this).attr('id'); jqr("#more"+meid).css('display','none'); }); }); function viewGiftBox(touserId) { jqr('#toUserId').val(touserId); openGiftBox(); } function checkAllOpt(cls) { jqr('.chk-'+cls).prop('checked',true); } function uncheckkAllOpt(cls) { jqr('.chk-'+cls).prop('checked',false); } function showMoreResult() { url=jqr("#site_url").val(); var loadUrl = url + "/prgsearchpagination.php"; jqr("#loading_simg").css('display', 'inline'); jqr.ajax({ url: loadUrl, method: 'POST', data: jq('#search_pager_myForm').serialize(), success: function (data) { jqr(".searchpagination").remove(); // alert(data); jqr(".searchresult").append(data); scroll= jqr("#scroll").val()+800; jqr("#scroll").val(scroll); jqr("#loading_simg").css('display', 'none'); jqr(".searchresult").scrollTop(scroll); }, error: function (data) { jqr("#loading_simg").css('display', 'none'); alert("Please try again."); } }); } function displayMembership(divid) { jqr(".dvupfull").css('display', 'none'); jqr(".dvuptoggleme").removeClass("dvuptogglactive"); jqr("#toggle"+divid).addClass("dvuptogglactive"); jqr("#div"+divid).css('display', 'block'); } function saveExpDate(uid){ url=jqr("#site_url").val(); var loadUrl = url + "/action.php"; var date=jqr("#dd_year"+uid).val()+'-'+jqr("#dd_month"+uid).val()+'-'+jqr("#dd_day"+uid).val(); jqr.ajax({ url: loadUrl, method: 'POST', data: {"user_id": uid ,"type":"updateExpDate","date":date}, success: function (data) { }, error: function (data) { } }); } function changePwd(uid){ jqr("#pwd"+uid).val(""); jqr("#pwd"+uid).prop('disabled', false); jqr("#change"+uid).css('display','none'); jqr("#savepwd"+uid).css('display','block'); } function updatePwd(uid) { url=jqr("#site_url").val(); var loadUrl = url + "/action.php"; var pwd=jqr("#pwd"+uid).val(); if(pwd!=""){ jqr.ajax({ url: loadUrl, method: 'POST', data: {"user_id": uid ,"type":"updatePwd","pwd":pwd}, success: function (data) { jqr("#pwd"+uid).val(data); jqr("#pwd"+uid).prop('disabled', true); jqr("#change"+uid).css('display','block'); jqr("#savepwd"+uid).css('display','none'); }, error: function (data) { } }); } } function markFeature(uid) { url=jqr("#site_url").val(); var loadUrl = url + "/action.php"; var pwd=jqr().val(); if (! jqr("#feature"+uid).is(':checked')) { var feature=0; } else { var feature=1; } jqr.ajax({ url: loadUrl, method: 'POST', data: {"user_id": uid ,"type":"markFeature","feature":feature}, success: function (data) { }, error: function (data) { } }); } function checkme() { if (! jqr('#checkAll').is(':checked')) { jqr('.chk_user_id').prop('checked',false); } else { jqr('.chk_user_id').prop('checked', true); } } function openFeature(){ var ele = jqr('#fa_featured'); if(ele.hasClass('fa-plus')){ ele.removeClass('fa-plus') .addClass('fa-minus') } else{ ele.addClass('fa-plus') .removeClass('fa-minus') } jqr("#dv_featured_inner").slideToggle(); } function validateForm(){ validation=true; /* for panel one*/ jqr(".rsrequired").each(function (item) { if(jqr(this).val()==""){ alert(jqr(this).attr('title')); openRegistrationPanel('rgspanel1','dvlftrgs1'); validation=false; jqr(this).focus(); return false; } }); if(!validation){ return false; } // check for dob if(jqr("#lstDay").val()=="" || jqr("#lstMonth").val()=="" || jqr("#txtYear").val()=="") { alert("Dob is mandatory!"); openRegistrationPanel('rgspanel1','dvlftrgs1'); validation=false; jqr("#lstDay").focus(); } if(!validation){ return false; } /* for panel two*/ jqr(".rsrequiredpanel2").each(function (item) { if(jqr(this).val()==""){ alert(jqr(this).attr('title')+' is mandatory!'); openRegistrationPanel('rgspanel2','dvlftrgs2'); validation=false; jqr(this).focus(); return false; } }); if(!validation){ return false; } /***************************/ /* for panel three*/ jqr(".rsrequiredpanel3").each(function (item) { if(jqr(this).val()==""){ alert(jqr(this).attr('title')+' is mandatory!'); openRegistrationPanel('rgspanel3','dvlftrgs3'); validation=false; jqr(this).focus(); return false; } }); /***************************/ if(jqr('.chkseeking:checkbox:checked').length == 0){ validation=false; alert("Please select seeking!"); jqr(".chkseeking").focus(); openRegistrationPanel('rgspanel2','dvlftrgs2'); return false; } if(jqr('.chkDisclaimer:checkbox:checked').length == 0){ validation=false; alert("Please check Disclaimer!!"); jqr(".chkDisclaimer").focus(); openRegistrationPanel('rgspanel1','dvlftrgs1'); return false; } /*********************/ var totalMultiChkCount =jqr("#totalMultiChkCount").val(); for( var chkct=1; chkct<= totalMultiChkCount ; chkct++){ if(jqr('.rsrequiredchkpanel'+chkct+':checkbox:checked').length == 0){ validation=false; alert("Please check "+jqr('.rsrequiredchkpanel'+chkct).attr('title')); jqr('.rsrequiredchkpanel'+chkct).focus(); return false; } } /******************/ if(jqr("#txtComment").val().length<20){ alert("Please enter 20 character in message field!"); validation=false; openRegistrationPanel('rgspanel2','dvlftrgs2'); return false; } /********************/ if(!validation){ return false; } else{ return true } } function readMore(id) { jq("#moreText" + id).slideToggle(100, "linear"); jq('#moreText' + id).css('display', 'contents'); jq('#readMore' + id).css('display', 'none'); jq('#readLess' + id).css('display', 'contents'); } function readLess(id) { jq("#moreText" + id).slideToggle(50, "linear"); jq('#readMore' + id).css('display', 'contents'); jq('#readLess' + id).css('display', 'none'); } function sendInstMessage(bmsg){ url = jqr("#site_url").val(); var loadUrl = url + "/action.php?type=sendInstantMsg" ; if(jqr(".inst_txt").val()!="") { jqr("#instmsgres").html(""); jqr.ajax({ url: loadUrl, method: 'POST', data: jqr('#frminstmsg').serialize(), success: function (data) { jqr("#loadingIcon").css('display', 'none'); var json = jq.parseJSON(data); //now json variable contains data in json format //let's display a few items for (var i=0;i < json.length;++i) { var result=json[i].result; var message=json[i].msg; } if(result=="success") { jqr(".inst_txt").val(""); } jqr("#instmsgres").html(message); }, error: function (data) { jqr("#loadingIcon").css('display', 'none'); } }); } else{ jqr(".inst_txt").focus(); jqr("#instmsgres").html(bmsg); } }