var imageArray = new Array(); var images = 'images/icon_gmail.png,images/icon_hotmail.png,images/icon_yahoo.png,images/icon_aol.png,images/icon_indiatimes.png,images/icon_linkedin.png,images/icon_orkut.png,images/icon_lycos.png,images/icon_rediff.png,images/icon_gmx.png,images/icon_webde.png,images/icon_youtube.png,images/icon_mail.png,images/icon_badoo.png,images/icon_bebo.png,images/icon_facebook.png,images/icon_flickr.png,images/icon_friendfeed.png,images/icon_friendster.png,images/icon_hi5.png,images/icon_lastfm.png,images/icon_ning.png,images/icon_plaxo.png,images/icon_twitter.png,images/icon_xing.png,images/icon_hotmail1.png'; images = images.split(','); for(i=0; i<=images.length-1; i++) { imageArray[i]= new Image(); imageArray[i].src= "http://www.gluedup.com/"+images[i]; } function ChgImg(val) { //alert(val); //alert(imageArray[val].src); document.getElementById("MyImgBox").setAttribute('src',imageArray[val].src); document.getElementById("MyImgBox").style.width="162px"; document.getElementById("MyImgBox").style.height="90px"; return true; } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&imaxL) objVal=objVal.substring(0,maxL); if (objCnt) { if(bName == "Netscape"){ objCnt.textContent=maxL-objVal.length;} else{objCnt.innerText=maxL-objVal.length;} } return true; } max=300; var bName = navigator.appName; function Limit(taObj) { if (taObj.value.length==max) return false; return true; } function Count(taObj,Cnt) { objCnt=createObject(Cnt); objVal=taObj.value; if (objVal.length>max) objVal=objVal.substring(0,max); if (objCnt) { if(bName == "Netscape"){ objCnt.textContent=max-objVal.length;} else{objCnt.innerText=max-objVal.length;} } return true; } function createObject(objId) { if (document.getElementById) return document.getElementById(objId); else if (document.layers) return eval("document." + objId); else if (document.all) return eval("document.all." + objId); else return eval("document." + objId); } /** * Character Counter for inputs and text areas using jquery */ $(document).ready(function(){ $('#interests').each(function(){ var length = $(this).val().length; // get current number of characters $(this).parent().find('.counter').html(300 - length + ' characters'); // update characters $(this).keyup(function(){ // bind on key up event var new_length = $(this).val().length; // get new length of characters $(this).parent().find('.counter').html( 300 - new_length + ' characters'); // update value to be displayed }); }); }); $(document).ready(function(){ $('#other').each(function(){ var length = $(this).val().length; // get current number of characters $(this).parent().find('.counter').html(500 - length + ' characters'); // update characters $(this).keyup(function(){ // bind on key up event var new_length = $(this).val().length; // get new length of characters $(this).parent().find('.counter').html( 500 - new_length + ' characters'); // update value to be displayed }); }); }); $(document).ready(function(){ $('#group').each(function(){ var length = $(this).val().length; // get current number of characters $(this).parent().find('.counter').html(150 - length + ' characters'); // update characters $(this).keyup(function(){ // bind on key up event var new_length = $(this).val().length; // get new length of characters $(this).parent().find('.counter').html( 150 - new_length + ' characters'); // update value to be displayed }); }); }); $(document).ready(function(){ $('#skills').each(function(){ var length = $(this).val().length; // get current number of characters $(this).parent().find('.counter').html(300 - length + ' characters'); // update characters $(this).keyup(function(){ // bind on key up event var new_length = $(this).val().length; // get new length of characters $(this).parent().find('.counter').html( 300 - new_length + ' characters'); // update value to be displayed }); }); }); /**** Text counter end *****/ /*** Add Row Dynamacally****/ function addFormField() { var numi = document.getElementById('idValue'); var id = (document.getElementById("idValue").value -1)+ 2; var els=document.forms["education"].elements["school[]"]; if(els!='undefined' && els!= undefined){ if((els.length) >= 2){ document.getElementById("addeducation").style.visibility = 'hidden'; } } $.ajax({ type: "POST", url: "index.php", cache: false, data: "action=getdetail&ajax=1&id=" + id, success: function(html){ $("#profile_info").append(html); } }); } function removeFormField(id) { var els=document.forms["education"].elements["school[]"]; if((els.length) != 2){ document.getElementById("addeducation").style.visibility = ''; } var agree = confirm("Are you sure you want to delete ?"); if(agree){ $.ajax({ type: "POST", url: "index.php", data: "action=deleteEducationdetail&ajax=1&id=" + id, success: function(msg){ //alert(msg); //alert( "Delete Data" ); } }); $("#"+id).remove(); }else{ return false; } } /*** Add Row Dynamacally****/ /*** Add Row Dynamacally for jobs****/ function addJobField() { var numi = document.getElementById('idValue'); var id = (document.getElementById("idValue").value -1)+ 2; var els=document.forms["jobs"].elements["position[]"]; numi.value = id; if(els!='undefined' && els!= undefined){ if((els.length) == 4){ document.getElementById("addjob").style.visibility = 'hidden'; } } $.ajax({ type: "POST", url: "index.php", cache: false, data: "action=getjobdetail&ajax=1&id=" + id, success: function(html){ $("#profile_jobinfo").append(html); } }); } function removeJobField(id) { var els=document.forms["jobs"].elements["position[]"]; if((els.length) != 4){ document.getElementById("addjob").style.visibility = ''; } var agree = confirm("Are you sure you want to delete ?"); if(agree){ $.ajax({ type: "POST", url: "index.php", data: "action=deleteJobdetail&ajax=1&id=" + id, success: function(msg){ //alert(msg); //alert( "Delete Data" ); } }); $("#"+id).remove(); }else{ return false; } } /*** Add Row Dynamacally for jobs****/ function clearTextField() { var userIdField = document.about.interests; if(userIdField.value == "Activities,books,movies etc.") { userIdField.value = ""; } } function fillTextField() { var userIdField = document.about.interests; if(userIdField.value == "") { userIdField.value = "Activities,books,movies etc."; } } function clearTextFieldOther() { var userIdField = document.about.group; if(userIdField.value == "Example:Lions club,Greenpiece etc.") { userIdField.value = ""; } } function fillTextFieldOther() { var userIdField = document.about.group; if(userIdField.value == "") { userIdField.value = "Example:Lions club,Greenpiece etc."; } } /** Get Country / isd code ****/ function GetISDcode(id) { var sId = document.getElementById('country'+id).value; $.ajax({ type: "POST", url: "index.php", cache: false, data: "action=getISDCode&ajax=1&id=" + sId, success: function(html){ if(html != ''){ document.getElementById("isd"+id).innerHTML = "+"+html; } } }); } /** END Country / isd code****/ /*********** Country/State/City**************/ function trim(s) { if(s != null) return s.replace(/^\s+/,'').replace(/\s+$/,'') ; } function GetState(val,cId,state) { if(!cId){ cId = document.getElementById(val+'_country').value; } if(val=='home'){ if(state){ stateurl = "action=getState&ajax=1&cid=" + cId+"&state="+state; }else{ stateurl = "action=getState&ajax=1&cid=" + cId ; } $.ajax({ type: "POST", url: "index.php", cache: false, data: stateurl, success: function(html){ document.getElementById(val+'statelist').innerHTML=html; } }); }else if(val=='work'){ if(state){ stateurl = "action=getworkState&ajax=1&cid=" + cId+"&state="+state; }else{ stateurl = "action=getworkState&ajax=1&cid=" + cId ; } $.ajax({ type: "POST", url: "index.php", cache: false, data: stateurl, success: function(html){ document.getElementById(val+'statelist').innerHTML=html; } }); } } function GetCity(val,sId,city) { if(!sId){ sId = document.getElementById(val+'_state').value; } if(val=='home'){ if(city){ cityurl = "action=getState&ajax=1&sid=" + sId+"&city="+city; }else{ cityurl = "action=getState&ajax=1&sid=" + sId ; } $.ajax({ type: "POST", url: "index.php", cache: false, data: cityurl, success: function(html){ if(trim(html)){ document.getElementById(val+'citylist').innerHTML=html; } } }); }else if(val=='work'){ if(city){ cityurl = "action=getworkState&ajax=1&sid=" + sId+"&city="+city; }else{ cityurl = "action=getworkState&ajax=1&sid=" + sId ; } $.ajax({ type: "POST", url: "index.php", cache: false, data: cityurl, success: function(html){ if(trim(html)){ document.getElementById(val+'citylist').innerHTML=html; } } }); } } function GetRegistrationState(cId,state) { if(!cId){ cId = document.getElementById('home_country').value; } if(state){ stateurl = "action=getRegistrationState&ajax=1&cid=" + cId+"&state="+state; }else{ stateurl = "action=getRegistrationState&ajax=1&cid=" + cId ; } $.ajax({ type: "POST", url: "index.php", cache: false, data: stateurl, success: function(html){ // alert(html); if(trim(html)){ document.getElementById('state_row').style.display = ""; document.getElementById('city_row').style.display = "none"; if(document.getElementById('home_city')!='null' && document.getElementById('home_city')!= null ){ document.getElementById('home_city').setAttribute("disabled", "true"); } document.getElementById('homestatelist').innerHTML=html; } } }); } function GetRegistrationCity(sId,city) { if(!sId){ sId = document.getElementById('home_state').value; } if(city){ cityurl = "action=getRegistrationState&ajax=1&sid=" + sId+"&city="+city; }else{ cityurl = "action=getRegistrationState&ajax=1&sid=" + sId ; } $.ajax({ type: "POST", url: "index.php", cache: false, data: cityurl, success: function(html){ if(trim(html)){ document.getElementById('city_row').style.display = ""; document.getElementById('homecitylist').innerHTML=html; }else{ document.getElementById('city_row').style.display = "none"; document.getElementById('home_city').setAttribute("disabled", "true"); } } }); } /********* End Country/State/City**************/ function fnLockNameScreen() { document.getElementById("name_box_bg").style.display='block'; document.getElementById("name_box_bg").style.visibility='visible'; document.getElementById("name_box_bg").style.height = document.getElementsByTagName('body')[0].scrollHeight + 20+"px"; document.getElementById("name_box_bg").style.width = document.getElementsByTagName('body')[0].scrollWidth+"px"; document.getElementById("name_box_bg").style.zIndex=1000; } function fnUnlockNameScreen() { document.getElementById("name_box_bg").style.display='none'; document.getElementById("name_box_bg").style.visibility='hidden'; } function fnUnlockName_Screen() { document.getElementById("name_box").style.display='none'; document.getElementById("name_box").style.visibility='hidden'; document.getElementById("name_box_bg").style.display='none'; document.getElementById("name_box_bg").style.visibility='hidden'; } function fnShowAddFirstNameBox(){ document.getElementById("name_box").style.display='block'; document.getElementById("name_box").style.visibility='visible'; document.getElementById("name_box").style.top = document.getElementsByTagName('body')[0].scrollHeight - 350+"px"; //document.getElementById("name_box").style.width = document.getElementsByTagName('body')[0].scrollWidth+"px"; document.getElementById("name_box").style.zIndex=1099; } function fnCheckFirstOrLastName(){ var firstname = document.createcontact.first_name.value; var lastname = document.createcontact.last_name.value; var email = document.createcontact.primary_email.value; if(firstname=='' || email==''){ fnLockNameScreen(); fnShowAddFirstNameBox(); return false; }else{ return true; } } function submitform() { var value_firstname = document.getElementById('firstname').value; var value_lastname = document.getElementById('lastname').value; var value_email = document.getElementById('create_email').value; //alert(value_firstname); if(value_firstname=='' || value_email==''){ alert("Please enter first name and email."); return false; }else{ document.getElementById('first_name').value = value_firstname; document.getElementById('last_name').value = value_lastname; document.getElementById('primary_email').value = value_email; document.createcontact.submit(); } } function fnshowDuplicateInfodiv(val){ if(val == 'manageduplicate' ){ document.getElementById('div_'+val).style.display=''; document.getElementById('div_duplicatelist').style.display='none'; }else if(val == 'duplicatelist'){ document.getElementById('div_'+val).style.display=''; document.getElementById('div_manageduplicate').style.display='none'; } } function fnGetDuplicateInfo(val,limit_val){ //alert(limit_val); $.ajax({ type: "POST", url: "index.php", cache: false, data: "action=getDuplicateInfoFromName&mod=duplicateInfo&ajax=1&contact_name=" + val +"&recordlimit="+ limit_val, success: function(html){ //alert(html); document.getElementById('duplicatelist').innerHTML=html; } }); } function fnGetAllDuplicateInfo(limit_val){ // for continue button $.ajax({ type: "POST", url: "index.php", cache: false, data: "action=getDuplicateInfoFromName&mod=duplicateInfo&ajax=1&recordlimit="+ limit_val, success: function(html){ //alert(html); document.getElementById('duplicatelist').innerHTML=html; } }); } function fnDeleteContactFromDuplicate(deleteid,limit_val){ $.ajax({ type: "POST", url: "index.php", cache: false, data: "action=getDuplicateInfoFromName&mod=delete&deleteid="+deleteid+"&ajax=1&recordlimit="+ limit_val, success: function(html){ //alert(html); document.getElementById('duplicatelist').innerHTML=html; } }); } function fnDeleteContactFromMerge(deleteid){ var contactids =""; var contactemails =""; var contactname=""; var totalFormElemets=document.contact_merge.elements.length; for(index=0; index= 2){ return true; }else{ return false; } } function toggle(val) { var oBox=document.getElementById(val).value; if(oBox!=''){ document.getElementById(val+'_1').disabled=''; }else{ document.getElementById(val+'_1').disabled='true'; } } function fnSelectAction(act,aid){ if(confirm("Are you sure you want to change access status?")){ var page_mod = document.getElementById('mode').value; var query = "ajax=1&mod="+ page_mod +"&formsubmit=1&user_id=" + aid + "&act="+ act; var actionUrl=document.getElementById('siteurl').value; var cnt_rc = document.getElementById('counter').value; actionUrl = actionUrl + "userprofile"; $.ajax({ type: "POST", url: actionUrl, data: query, cache: false, success: function(data){ if($("#success_msg")) $("#success_msg").show(); document.getElementById("success_msg").innerHTML = "Access Status successfully changed."; document.getElementById("user_"+aid).style.display= 'none'; document.getElementById('counter').value --; if(cnt_rc <= 1){ document.getElementById("lbl_yes").style.display= 'none'; document.getElementById("lbl_no").style.display= 'none'; } } }); } } function fnSelectAccessAction(act,aid,prf){ if(act==1){ query = "action=userprofile&mod=allowaccess&ajax=1&formsubmit=1&user=" + aid + "&act="+ act; }else if(act==2){ query = "action=userprofile&mod=removeaccess&ajax=1&formsubmit=1&user=" + aid + "&act="+ act; } if(confirm("Are you sure you want to change access status?")){ $.ajax({ type: "POST", url: "index.php", cache: false, data: query, success: function(data){ if($("#success_msg")) $("#success_msg").show(); document.getElementById("success_msg").innerHTML = "Access Info Status sucessfully changed."; } }); } } function fnSelectInviteAction(act,aid){ if(act==1){ query = "action=userprofile&mod=inviteaccept&accept=yes&ajax=1&formsubmit=1&user=" + aid + "&act="+ act; if(confirm("Are you sure you want to accept invitation?")){ $.ajax({ type: "POST", url: "index.php", cache: false, data: query, success: function(data){ window.location.href = "addcategory/invitation/accept/chkMails/"+aid; } }); } }else if(act==2){ query = "action=userprofile&mod=inviteaccept&accept=no&ajax=1&formsubmit=1&user=" + aid + "&act="+ act; if(confirm("Are you sure you want to reject invitation?")){ $.ajax({ type: "POST", url: "index.php", cache: false, data: query, success: function(data){ document.getElementById("user_"+aid).style.display= 'none'; document.getElementById('counter').value --; if(cnt_rc <= 1){ document.getElementById("lbl_yes").style.display= 'none'; document.getElementById("lbl_no").style.display= 'none'; } } }); } } } function textCounter(field, countfield, maxlimit) { /* * The input parameters are: the field name; * field that holds the number of characters remaining; * the max. numb. of characters. */ if (field.value.length > maxlimit) // if the current length is more than allowed field.value =field.value.substring(0, maxlimit); // don't allow further input else countfield.value = maxlimit - field.value.length; } // set the display field to remaining number function fnConfirmDeleteAccount(){ var agree = confirm("Are you sure you want to delete your account?"); if(agree){ return true; }else{ return false; } } function fnAddRemoveRelationship(contactid){ var usercategory =""; var totalFormElemets=document.mycontactinfo.elements.length; for(index=0; index