| Server IP : 199.79.62.161 / Your IP : 216.73.216.245 [ Web Server : Microsoft-IIS/10.0 System : Windows NT MDUS-PP-WB12 10.0 build 20348 (Windows Server 2022) AMD64 User : IWPD_5096(nirmaowd) ( 0) PHP Version : 8.3.30 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/INETPUB/VHOSTS/nirmalamatha.edu.in/ponnuguruvayurappan.org/Admin/js/ |
Upload File : |
var i=0;var select='';var GENDER;var cities='';
function clearDefault(el){if(el.defaultValue==el.value)el.value="";}
function cleargroups(){
document.getElementById("editdiv").style.display="none";
document.getElementById('showdiv').firstChild.style.display="block";
}
function clearedit(){
document.getElementById("editform").style.display="none";
document.getElementById("someid").style.display="block";
}
function clearadd(){
document.getElementById("addform").style.display="none";
if(i==0&&document.getElementById("showdiv").id!="label")
{
document.getElementById("showdiv").firstChild.style.display="block";
}
else
{
document.getElementById('someid').style.display="block";
}
document.getElementById('addname').value="";
document.getElementById('addmobile').value="";
document.getElementById("addmale").checked=false;
document.getElementById("addfemale").checked=false;
}
function cleardiv(){
document.getElementById("gnametr").style.display="none";
if(i==0&&document.getElementById("showdiv").id!="label")
{
document.getElementById("showdiv").firstChild.style.display="block";
}
else
{
document.getElementById('someid').style.display="block";
}
document.getElementById('gname').value='';
}
function checkall(){
var obj=document.getElementsByName('conchek');
if(i==obj.length)return;
if(document.getElementById('gnametr').style.display==""&&obj.length>10)
{
alert("Only 10 memebers in one group");
return;
};
for(var j=0;j<obj.length;j++){
if(obj[j].checked==false){
obj[j].checked=true;
change1(obj[j].id.substring(3));
};
};
document.getElementById('deletegroup').style.display="none";
document.getElementById('deletecontact').style.display="block";
}
function uncheckall(){
var obj=document.getElementsByName('conchek');
if(i==0)return;
for(var j=0;j<obj.length;j++)
{
if(obj[j].checked==true)
{
obj[j].checked=false;
change1(obj[j].id.substring(3));
};
};
if(document.getElementById('showdiv').firstChild.id=="label"){
document.getElementById('deletegroup').style.display="none";
}
else
{
document.getElementById('deletegroup').style.display="block";
}
document.getElementById('deletecontact').style.display="none";
document.getElementById('gnametr').style.display="none";
}
function change1(dat1){
var dat;
var temp=new Array();var single=new Array();var dat=document.getElementById('chk'+dat1);var trow=document.getElementById('tr'+dat1);var grouplabel=document.getElementById('showdiv').firstChild;temp=dat.value.split('|');grouplabel.style.display="none";if(dat.checked==true){if(document.getElementById('gnametr').style.display==''&&i>=11){dat.checked=false;alert("Group Doesnot Have morethan 10 members");return;}
trow.setAttribute("class","odd1");trow.setAttribute("className","odd1");select=select+":"+dat.value;i++;}else{trow.setAttribute("class","odd");trow.setAttribute("className","odd");select=select.replace(":"+dat.value,'');i--;}
if(i==0){document.getElementById('edit').style.display="block";document.getElementById('deletecontact').style.display="none";document.getElementById('deletegroup').style.display="block";document.getElementById('select1').style.display="none";grouplabel.style.display="block";document.getElementById('sendsms').style.display='none';if(grouplabel.id!="label")document.getElementById('composetab').style.display='';}else{document.getElementById('edit').style.display="block";document.getElementById('addform').style.display="none";document.getElementById('someid').style.display="block";document.getElementById('select1').style.display="block";document.getElementById('deletegroup').style.display="none";document.getElementById('deletecontact').style.display="block";document.getElementById('editdiv').style.display="none";document.getElementById('sendsms').style.display='';document.getElementById('composetab').style.display='none';}
if(i!=0&&grouplabel.id!="label"){document.getElementById('deletecontact').value='DeleteFromGroup';}
if(i==1&&document.getElementById(dat.id).checked==true){document.getElementById('someid').innerHTML=temp[0]+" ("+temp[1]+")";if(document.getElementById('gnametr').style.display!="")
edituser();
document.getElementById('edit').style.display='block';document.getElementById("deletecontact").style.display='block'}else if(i==1){single=select.substring(1).split('|');document.getElementById('someid').innerHTML=single[0]+" ("+single[1]+")";document.getElementById('edit').style.display="block";document.getElementById("addform").style.display='none';if(document.getElementById('gnametr').style.display!="")edituser();}else if(i==0){document.getElementById('someid').style.display="none";select='';document.getElementById("editform").style.display='none';document.getElementById("addform").style.display='none';document.getElementById('gnametr').style.display="none";}else{document.getElementById('someid').innerHTML=i+" contacts selected";document.getElementById('edit').style.display="none";document.getElementById("editform").style.display='none';document.getElementById("addform").style.display='none';document.getElementById("deletecontact").style.display='block'}
if(i==0&&grouplabel.id=="label"){document.getElementById('td1').style.display="none";document.getElementById('deletegroup').style.display="none";document.getElementById('edit').style.display="none";}else document.getElementById('td1').style.display="";}
function edituser(){
var grouplabel=document.getElementById('showdiv').firstChild;
document.getElementById('addform').style.display="none";
document.getElementById('gnametr').style.display="none";
if(grouplabel.id!="label"&&i==0){grouplabel.style.display="none";
document.getElementById('editdiv').style.display="block";
document.getElementById('editgroup').value=grouplabel.id.split(":")[0];
document.getElementById('editshort').value=grouplabel.id.split(":")[2];
return false;
}
if(select.length==0){
alert("Please select contacts");
return false;}
document.getElementById('someid').style.display="none";
var single2=new Array();
single2=select.substring(1).split('|');
document.getElementById("editform").style.display='block';
document.getElementById("addform").style.display='none';
document.getElementById("editname").value=single2[0];
if(single2[1].length==10&&(single2[1].indexOf('9')==0))
{
document.getElementById("editmobile").value=single2[1];
document.getElementById("editprefix").value='91';
}
else if(single2[1].length==12 && single2[1].indexOf('9715')==0)
{
document.getElementById("editmobile").value=single2[1].substring(3);
document.getElementById("editprefix").value='971';
}
else if(single2[1].length==12 && single2[1].indexOf('9665')==0)
{
document.getElementById("editmobile").value=single2[1].substring(3);
document.getElementById("editprefix").value='966';
}
else if(single2[1].length==12 && single2[1].indexOf('639')==0)
{
document.getElementById("editmobile").value=single2[1].substring(2);
document.getElementById("editprefix").value='63';
}
else if(single2[1].length==11&&(single2[1].indexOf('9659')==0||single2[1].indexOf('9656')==0||single2[1].indexOf('9655')==0))
{
document.getElementById("editmobile").value=single2[1].substring(3);
document.getElementById("editprefix").value='965';
}
else if(single2[1].length==11 && single2[1].indexOf('601')==0)
{
document.getElementById("editmobile").value=single2[1].substring(2);
document.getElementById("editprefix").value='60';
}
else if(single2[1].length==11 && single2[1].indexOf('639')==0)
{
document.getElementById("editmobile").value=single2[1].substring(2);
document.getElementById("editprefix").value='63';
}
else if(single2[1].length==10 && (single2[1].indexOf('658')==0 || single2[1].indexOf('659')==0))
{
document.getElementById("editmobile").value=single2[1].substring(2);
document.getElementById("editprefix").value='65';
}
document.getElementById("editid").value=single2[2];
document.getElementById("citylist").value=single2[4];
if(single2[3]=='fem'){document.getElementById("female").checked=true;
}
else if(single2[3]=='male')
{
document.getElementById("male").checked=true;}
else{document.getElementById("female").checked=false;
document.getElementById("male").checked=false;}
document.getElementById("editform").onclick=function onblur(event){javascript:changecityies("static");}
}
function addcon()
{
if(document.getElementById('showdiv').firstChild.id!="label")
{
if(document.getElementsByName('conchek').length>9)
{
alert("Group Does Not Contain More Than 10 Members");
return false;
}
else document.getElementById("addtitle").innerHTML="Adds Contact To Both AllContacts And Present Group";
}
document.getElementById('gnametr').style.display="none";
document.getElementById('editdiv').style.display='none';
document.getElementById('showdiv').firstChild.style.display="none";
document.getElementById('someid').innerHTML='';
if(i>1)
{
alert("Please uncheck the contacts");
return;
}
document.getElementById("addform").style.display='block';
document.getElementById("editform").style.display='none';
}
function addcontact(element)
{
element.disabled=true;
var oname,ono,oCPrefix,number;
var gender='';
oCPrefix=document.getElementById("addprefix");
oname=document.getElementById("addname");
ono=document.getElementById("addmobile");
number=ono.value;
if(oname.value.length==0)
{
alert("Please enter the Name !!");
element.disabled=false;
oname.focus();
return false;
};
if(oname.value.length>20)
{
alert("Name must be lessthan 20 characters");
oname.focus();
element.disabled=false;
return false;
};
if(oCPrefix.value!=91)number=oCPrefix.value+number;
if(!validatemobilenumber(number))
{ono.focus();
element.disabled=false;
return false;};
if(document.getElementById("addmale").checked==true)
gender=document.getElementById("addmale").value;
else if(document.getElementById("addfemale").checked==true)
gender=document.getElementById("addfemale").value;
else
{
alert("select the gender");element.disabled=false;
return false;
}
if(document.getElementById('showdiv').firstChild.id!="label")
{
addcontacttoboth(oname,ono,gender,oCPrefix.value,element);
}
else
{
var success=function(t)
{
if(t.responseText=='success')
{
alert(oname.value+' <'+ono.value+'>'+' added to your contacts successfully');
if(document.getElementById('showdiv').firstChild.id!="label")
{
document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+(Number(document.getElementById('count').innerHTML)+1);
document.getElementById("postback").submit();
}
else window.location.href="contacts.aspx";}
else
{alert(t.responseText);element.disabled=false;return false;
}
oname.value="";
ono.value="";
};
var failure=function(t)
{
alert('Unable to add. Please try later');element.disabled=false;
return false;
};
var url="ajaxaddcontact.aspx";
var pars="txtcontactname="+oname.value+"&mnoadd="+oCPrefix.value+ono.value+"&g="+gender+"&Prefix="+oCPrefix.value;
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});
return false;
}
}
function deletecon(){if(document.getElementById('showdiv').firstChild.id!="label"){deletefromgroup(document.getElementById('showdiv').firstChild.id.split(":")[1])}
else{if(select.length==0){alert("Please select contacts");return;}
var temp=new Array();temp=select.split(":");var con=new Array();for(j=1;j<=temp.length-1;j++){var show=temp[j].split("|");con[j-1]=show[2];}
deletecontactlatest(con);}}
function saveedit(element)
{
element.disabled=true;
var number,prefix;
prefix=document.getElementById("editprefix");
if(document.getElementById("editname").value=="")
{
alert("Enter Contact Name");
document.getElementById("editname").focus();
element.disabled=false;
return;
};
if(document.getElementById("editname").value.length>20)
{
alert("Name Must be less than 20 Characters");
document.getElementById("editname").focus();
element.disabled=false;
return;
};
number=document.getElementById("editmobile").value;
if(prefix.value!=91)number=prefix.value+number;
if(!validatemobilenumber(number))
{
document.getElementById("editmobile").focus();
element.disabled=false;
return false;
};
var editcont=new Array();
editcont[0]=document.getElementById("editname").value;
editcont[1]=prefix.value+document.getElementById("editmobile").value;
editcont[3]=Number(document.getElementById("editid").value);
if(document.getElementById("male").checked==true)
editcont[2]=document.getElementById("male").value;
else if(document.getElementById("female").checked==true)
editcont[2]=document.getElementById("female").value;
else
{
alert("Select the gender");element.disabled=false;
return false;
}
saveChanges1(editcont,element);
}
function deletecontactlatest(obj){var y=window.confirm("Do you want to delete contact ?");if(!y){return false;}
var url='DeleteContactlatest.aspx';var pars='id='+obj;var success=function(t){strs=t.responseText;var mes=new Array();var mes1=new Array();var mes2=new Array();var mes3=new Array();var mes4="";var count;var mes8='';mes=strs.split(":");if(mes.length==2){mes1=mes[1].split("|");if(mes1.length>1){mes2=mes1[1].split(",");for(count=0;count<mes2.length;count++){mes3=window.document.getElementById("chk"+mes2[count]).value.split("|");mes4=mes4+mes3[0];if(count<mes2.length-1){mes4=mes4+",";}}
alert(mes[0]+'\n'+mes1[0]+"\n"+mes4+mes1[2]);if(document.getElementById('showdiv').firstChild.id!="label"){document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+Number(document.getElementById('count').innerHTML);document.getElementById("postback").submit();}
else window.location.href="contacts.aspx";}
else{alert(mes[0]+'\n'+mes1[0])}}
else{mes5=mes[0].split("|")
if(mes5.length>1){mes6=mes5[1].split(",");for(count=0;count<mes6.length;count++){mes7=window.document.getElementById("chk"+mes6[count]).value.split("|");mes8=mes8+mes7[0]
if(count<mes6.length-1){mes8=mes8+","}}
alert(mes5[0]+'\n'+mes8+mes5[2]);if(document.getElementById('showdiv').firstChild.id!="label")
{document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+Number(document.getElementById('count').innerHTML);document.getElementById("postback").submit();}
else window.location.href="contacts.aspx";}else alert(mes[0]);}}
var failure=function(t){alert("Sorry, the update failed.");}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}
function funreload1(){window.location.reload(false);}
function saveChanges1(obj,element)
{
var strs=new String();
var url='SavechangesAjax.aspx';
var pars='content='+obj+'&location='+document.getElementById("citylist").value+'&Prefix='+document.getElementById("editprefix").value;
var success=function(t)
{
strs=t.responseText;
if(t.responseText.search("Done")==0)
{
alert(t.responseText.substring(4));
if(document.getElementById('showdiv').firstChild.id!="label")
{
document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+Number(document.getElementById('count').innerHTML);
document.getElementById("postback").submit();
}
else window.location.href="contacts.aspx";}
else
{
alert(t.responseText);element.disabled=false;
}
}
var failure=function(t){alert("Sorry, the update failed.");element.disabled=false;
}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}
function makegroup(){if(select.length==0){alert("Please select contacts");return;}
if(document.getElementById("select1").selectedIndex==2){opendiv();return;}
else if(document.getElementById('showdiv').firstChild.id=="label"){if(document.getElementById("select1").selectedIndex>2&&document.getElementById("select1").selectedIndex<document.getElementById("select1").length){appendtogroup(document.getElementById("select1").options[document.getElementById("select1").selectedIndex].value,document.getElementById("select1").options[document.getElementById("select1").selectedIndex].text);}}
else if(document.getElementById("select1").selectedIndex>2&&document.getElementById("select1").selectedIndex<document.getElementById("select1").length-2){appendtogroup(document.getElementById("select1").options[document.getElementById("select1").selectedIndex].value,document.getElementById("select1").options[document.getElementById("select1").selectedIndex].text);}
else if(document.getElementById("select1").selectedIndex==document.getElementById("select1").length-1)
deletefromgroup(document.getElementById("select1").options[document.getElementById("select1").selectedIndex].value);}
function makeDefault(){window.document.getElementById("select1").selectedIndex=0;}
function makehide(){window.document.getElementById("select1").options[0].style.display="none";var store=new String;var store=document.getElementById('groupnames').value;store=store.replace("|"+document.getElementById('showdiv').firstChild.id.split(":")[0]+":"+document.getElementById('showdiv').firstChild.id.split(":")[1],"");var groupseperate=store.split("|");for(a=1;a<groupseperate.length;a++){document.getElementById("select1").options[2+a]=new Option(' '+groupseperate[a].split(":")[0],groupseperate[a].split(":")[1]);}
if(document.getElementById('showdiv').firstChild.id!="label"){document.getElementById("select1").options[2+a]=new Option(" RemoveFrom...");document.getElementById("select1").options[2+a].style.fontWeight='bolder';document.getElementById("select1").options[3+a]=new Option(document.getElementById('showdiv').firstChild.id.split(":")[0],document.getElementById('showdiv').firstChild.id.split(":")[1]);}}
function editnamesave(){var newgroup=document.getElementById('editgroup').value;if(newgroup.length==0){alert("Group name must be enter");return;}
var append=document.getElementById('editshort').value;if(append.length==0){alert("Mobile Groupid must be eneter");return;}
var url='groupnamechange.aspx';var pars='newgroupname='+newgroup+'&gid='+document.getElementById('showdiv').firstChild.id.split(":")[1]+'&mgid='+append;var success=function(t){strs=t.responseText
if(t.responseText=="Group Name Changed Sucessfully"){alert(t.responseText);if(document.getElementById('showdiv').firstChild.id!="label"){document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+newgroup+","+Number(document.getElementById('count').innerHTML);document.getElementById("postback").submit();}
else window.location.href="contacts.aspx";}
else{alert(t.responseText);}}
var failure=function(t){alert("Sorry,the group rename failed");}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}
function appendtogroup(gid,gname){var CONseperate=select.split(":");var contactid='';for(a=1;a<CONseperate.length;a++){if(CONseperate[a].split("|")[2].length>0){contactid=contactid+CONseperate[a].split("|")[2];if(a<CONseperate.length-1)
contactid=contactid+',';}}
var url='appendtogroup.aspx';var pars="groupid="+gid+'&cid='+contactid+'&groupname='+gname;var success=function(t){strs=t.responseText
if(t.responseText.search(/Members added successfully to the group/)>-1){alert(t.responseText);if(document.getElementById('showdiv').firstChild.id!="label"){document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+Number(document.getElementById('count').innerHTML);document.getElementById("postback").submit();}
else window.location.href="contacts.aspx";}
else{alert(t.responseText);}}
var failure=function(t){alert("Sorry,members adding to group failed");}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}
function deletefromgroup(gid){var CONseperate=select.split(":");var contactid=new Array;var b;for(b=1;b<CONseperate.length;b++){contactid[b-1]=CONseperate[b].split("|")[2];}
var url='deletefromgroup.aspx';var pars="groupid="+gid+'&cid='+contactid;var success=function(t){strs=t.responseText;if(t.responseText=="Contact(s) successfully deleted from the group"){alert(t.responseText);if(document.getElementById('showdiv').firstChild.id!="label"){document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+Number(document.getElementById('count').innerHTML);document.getElementById("postback").submit();}
else window.location.href="contacts.aspx";}
else{alert(t.responseText);}}
var failure=function(t){alert('Sorry,contacts deleting from group failed');}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}
function opendiv(){document.getElementById("editform").style.display="none";document.getElementById("addform").style.display="none";document.getElementById("gnametr").style.display="";document.getElementById("showdiv").firstChild.style.display="none";}
function newgroup()
{
var name=new String();var temp=new Array();temp=select.split(":");if(i>=11){alert("Only 10 memebers in one group")
return;}if(document.getElementById("gname").value==""){alert("Please Enter GroupName");return;}
var con=new Array();
for(j=1;j<=temp.length-1;j++){
//con[j-1]="91"+temp[j].split("|")[1];
if (temp[j].split("|")[1].length == 10 && (temp[j].split("|")[1].indexOf("9")==0))
con[j-1]="91"+temp[j].split("|")[1];
else con[j-1]= temp[j].split("|")[1];
}
var url='makegroup.aspx';var pars="members="+con+"&groupname="+document.getElementById("gname").value;var success=function(t){strs=t.responseText
if(t.responseText.search("success")==0){alert(t.responseText.substring(7));if(document.getElementById('showdiv').firstChild.id!="label"){document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+Number(document.getElementById('count').innerHTML);document.getElementById("postback").submit();}
else window.location.href="contacts.aspx";}
else{alert(t.responseText);enablegroup(false);}}
var failure=function(t){alert("Creating group failed,Please Try Later");}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});enablegroup(true);}
function enablegroup(flag){document.getElementById("gname").disabled=flag;document.getElementById("groupsave").disabled=flag;document.getElementById("groupclear").disabled=flag;}
function DeleteGroup(){var append=document.getElementById('showdiv').firstChild.id.split(":");if(!confirm('Are you sure you want to delete the group '+'"'+append[0]+'"? This action cannot be undone'))return;else{var url='latestdeletegroup.aspx';var pars='gid='+append[1];var success=function(t){strs=t.responseText;if(t.responseText=="Group Deleted Successfully"){alert(t.responseText);window.location.href="contacts.aspx";}
else{alert(t.responseText);}}
var failure=function(t){alert("Deleting group fail");}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}}
function addcontacttoboth(oname,ono,gender,prefix,element)
{
var success=function(t)
{
if(t.responseText=='success')
{
alert(oname.value+' <'+ono.value+'>'+' added to your contacts And Group successfully');
if(document.getElementById('showdiv').firstChild.id!="label")
{
document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1]+","+document.getElementById('showdiv').firstChild.id.split(":")[0]+","+(Number(document.getElementById('count').innerHTML)+1);
document.getElementById("postback").submit();
}
else window.location.href="contacts.aspx";}
else
{
alert(t.responseText);element.disabled=false;
return false;
}
oname.value="";
ono.value="";
};
var gid=document.getElementById('showdiv').firstChild.id.split(":")[1];
var gname=document.getElementById('showdiv').firstChild.id.split(":")[0];
var failure=function(t)
{alert('Unable to add. Please try later');element.disabled=false;
return false;
};
var url="addcontacttoboth.aspx";
var pars="txtcontactname="+oname.value+"&mnoadd="+prefix+ono.value+"&g="+gender+"&groupid="+gid+'&groupname='+gname+'&Prefix='+prefix;
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});
return;
}
var inv=0;var mobnum='';function sendinvite(inobj){var mobobj=document.getElementById("txt_mobileno");if(inobj.checked==true){inv++;document.getElementById('tr'+inobj.id).setAttribute("class","odd1");document.getElementById('tr'+inobj.id).setAttribute("className","odd1");mobnum=mobnum+","+inobj.value;mobobj.value=mobnum.substring(1);}else{inv--;document.getElementById('tr'+inobj.id).setAttribute("class","odd");document.getElementById('tr'+inobj.id).setAttribute("className","odd");mobnum=mobnum.replace(","+inobj.value,'');mobobj.value=mobnum.substring(1);}}
function uncheckinvites(){if(inv==0)return;mobnum='';for(j=0;j<document.getElementsByName('invchk').length;j++){if(document.getElementsByName('invchk')[j].checked==true){inv--;document.getElementsByName('invchk')[j].checked=false;document.getElementById('tr'+document.getElementsByName('invchk')[j].id).setAttribute("class","odd");document.getElementById('tr'+document.getElementsByName('invchk')[j].id).setAttribute("className","odd");}}}
function checkmsgform(element){element.disabled=true;var mobilenumber=document.getElementById('txt_mobileno').value;var message=document.getElementById('txt_msg').value;if(mobilenumber==''){window.alert("Please enter the Mobile Number !!");document.getElementById('txt_mobileno').focus();element.disabled=false;return false;};if(mobilenumber.split(",").length>10){alert(" You cannot Invite morethan Ten members At a Time ");element.disabled=false;return;}
for(mcount=0;mcount<mobilenumber.split(",").length;mcount++){if(isNaN(mobilenumber.split(",")[mcount])){window.alert("Please enter a valid Mobile Number !!");document.getElementById('txt_mobileno').focus();element.disabled=false;return false;}
if(!validatemobilenumber(mobilenumber.split(",")[mcount])){document.getElementById('txt_mobileno').focus();element.disabled=false;return false;}}
if(message==''){window.alert("Please enter your SMS message !!");document.getElementById('txt_msg').focus();element.disabled=false;return false;}
strMsg=document.getElementById('txt_msg').value;strCount=50;var url='sendmobileinvite.aspx';var postdata="txt_MobileNo="+document.getElementById("txt_mobileno").value;postdata=postdata+"&txt_Msg="+document.getElementById("txt_msg").value;var success=function(t){if(t.responseText.search("done")==0){alert(t.responseText.substring(4));for(z=0;z<document.getElementsByName("invchk").length;z++){if(document.getElementsByName("invchk")[z].checked==true)
document.getElementById("tr"+document.getElementsByName("invchk")[z].id).style.display="none";}
document.getElementById("txt_mobileno").value='';mobnum='';document.getElementById("txt_msg").value='';}else alert(t.responseText);element.disabled=false;}
var failure=function(t){alert("Sorry, sending invitation failed.");element.disabled=false;}
var myAjax=new Ajax.Request(url,{method:'post',postBody:postdata,onSuccess:success,onFailure:failure});return false;}
function emailinvite(){var strtotNos,stremails;stremails=document.getElementById("txt_emails").value;strtotNos=stremails.split(",");var i;if(document.getElementById("txt_emails").value==''){window.alert('Please enter valid email-ids');document.getElementById("txt_emails").focus();return false;}
if(document.getElementById('emailbox').value==''){window.alert("Please enter your SMS message !!")
document.getElementById('emailbox').focus();return false;}
for(i=0;i<strtotNos.length;i++){if(echeck(trimAll(strtotNos[i]))==false){window.alert('Please enter valid emailid ');document.getElementById("txt_emails").focus();return false;}}
strMessage=document.getElementById('emailbox').value;strCount=80;var url="savesendinvitations.aspx";var postdata="txt_emails="+document.getElementById("txt_emails").value;postdata=postdata+"&txt_msg="+document.getElementById("emailbox").value+"&change=new";var success=function(t){if(t.responseText.search("Done")==0){retmes=t.responseText.split("|");if(retmes.length==2)
alert(retmes[0].substring(5)+"\n"+"\n"+retmes[1]);else alert(t.responseText.substring(5));document.getElementById("emailform").reset();}
else alert(t.responseText.substring(1));}
var failure=function(t){alert("Sorry, the update failed.");}
var myAjax=new Ajax.Request(url,{method:'post',postBody:postdata,onSuccess:success,onFailure:failure});return false;}
function groupsms(){if(document.getElementsByName('conchek').length==0){alert("Contacts not avaliable in this group");return;}
document.getElementById('post1').value=document.getElementById('showdiv').firstChild.id.split(":")[1];document.getElementById('postback').action="Compose_SMS.aspx";document.getElementById("post1").name="chk";document.getElementById('postback').submit();}
function smstocheck(){if(i>=11){alert("Please select less than 10");return;}
var numbers='',d,arraynum;arraynum=select.split(":");for(d=1;d<arraynum.length;d++){numbers=numbers+","+arraynum[d].split("|")[1];}
document.getElementById('post1').value=numbers.substring(1);document.getElementById('postback').action="Compose_SMS.aspx";document.getElementById("post1").name="numbers";document.getElementById('postback').submit();}
function changecityies(flag){if(flag=="static")document.getElementById("editform").onclick="return false";var mobobj=document.getElementById("editmobile");var prefix=document.getElementById("editprefix");var box=document.getElementById("citylist");var number=mobobj.value;if(prefix.value!=91)number=prefix.value+number;if(!validatemobilenumber(number)){return false;};if(flag!="static"){var mobinit=select.substring(1).split('|')[1];if(number.substring(1,5)==mobinit.substring(1,5))return false;}
if(document.getElementById("editprefix").value=='91'){var url='loadcities.aspx';var pars='number=91'+number;var success=function(t){cities=t.responseText;if(cities.length>1){var oTextbox=new AutoSuggestControl(box,new StateSuggestions(cities));document.getElementById("locat").style.display="";}}
var failure=function(t){};
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}else{box.onkeypress="return false;";box.onkeydown="return false;";box.onkeyup="return false;";box.onfocus="return false;";}}
function alertMsgLength(){var strLength;var strMsg;if(document.getElementById('txt_msg').value.length>50)
{strMsg=document.getElementById('txt_msg').value;document.getElementById('txt_msg').value=strMsg.substring(0,50);document.getElementById('txt_msg').focus();return false;}
strLength=document.getElementById('txt_msg').value.length;document.getElementById('char_count').value=50-strLength+' characters left ';}
var InviteFlag=true;function showinv(){if(InviteFlag){InviteFlag=false;var url='loadinvites.aspx';var pars='';var success=function(t){var concollection;concollection=t.responseXML.getElementsByTagName('INVITES');var Tabbody=document.getElementById("invitetable");if(concollection.length==0){var ObjTR=document.createElement("tr");ObjTR.setAttribute("class","odd");var ObjTD1=document.createElement("td");ObjTD1.setAttribute("class","servBodM");ObjTD1.style.cssText="width:65%;border-bottom:2px solid #ddd;padding-left:5px;color:Red;";ObjTD1.innerHTML="NO Contacts There";ObjTR.appendChild(ObjTD1);Tabbody.appendChild(ObjTR);Tabbody.deleteRow(0);}else{Tabbody.deleteRow(0);for(var i=0;i<concollection.length;i++){var ObjTR=document.createElement("tr");ObjTR.id="trinv"+concollection[i].getElementsByTagName('contact_id')[0].firstChild.nodeValue;var ObjTD1=document.createElement("td");var str="<input type='checkbox' name='invchk' id='inv"+concollection[i].getElementsByTagName('contact_id')[0].firstChild.nodeValue+"' value="+concollection[i].getElementsByTagName('Contact_Number')[0].firstChild.nodeValue+" onclick='sendinvite(this)'/>";str+=" <label for='inv"+concollection[i].getElementsByTagName('contact_id')[0].firstChild.nodeValue+"'><b>"+concollection[i].getElementsByTagName('Contact_Name')[0].firstChild.nodeValue+"</b></label> ("+concollection[i].getElementsByTagName('Contact_Number')[0].firstChild.nodeValue+") ";ObjTD1.innerHTML=str;ObjTD1.style.cssText="width:65%;border-bottom:2px solid #ddd;padding-left:5px;";ObjTD1.setAttribute("class","servBodM");ObjTD1.setAttribute("className","servBodM");ObjTR.appendChild(ObjTD1);ObjTR.setAttribute("class","odd");Tabbody.appendChild(ObjTR);}}}
var failure=function(t){alert(t.responseText);}
var myAjax=new Ajax.Request(url,{method:'post',postBody:pars,onSuccess:success,onFailure:failure});}
if(document.getElementById('window3')){document.getElementById('window3').style.display="block";initFloatingWindowWithTabs('window3',Array('SMS Invite','Email Invite'),300,600,250,150,true,false,false,false,true);}else document.getElementById('dhtmlgoodies_floating_window0').style.display="block";}
function makeload(){if(document.getElementById('label1'))document.getElementById('alltab').style.display="none";if(document.getElementById('showdiv').firstChild.id=="label"){document.getElementById('td1').style.display="none";document.getElementById('gtr').style.backgroundColor="#eee";}else{document.getElementById('td1').style.display="";document.getElementById('composetab').style.display="";document.getElementById('gtr'+document.getElementById('showdiv').firstChild.id.split(":")[1]).style.backgroundColor="#eee";}}