function clear_textarea(B){var C=B.personalisedmessage.value;var A=C.search("Type your message here. For example,");if(A>=0){B.personalisedmessage.value=""}}function clear_textarea1(B){var C=B.personalisedmessage1.value;var A=C.search("Type your message here. For example,");if(A>=0){B.personalisedmessage1.value=""}}function calcCharLen1(B,G,A,F){var E=B;var D=E.elements[G];var C=(!F)?100:F;var H=D.value.length;E.elements[A].value=H;if(H>C){D.value=D.value.substring(0,C);E.elements[A].value=C;alert("You can enter only "+C+" characters.")}}function disable_field_onload(B,A){var C=document.forms[B];C.elements[A].disabled=true}function disable_field(C,A,B){var D=document.forms[C];if(B=="mobile"){if(D.elements.country_code.value=="+1|USA"||D.elements.country_code.value=="+1|Canada"){D.elements[A].disabled=false}else{D.elements[A].value="";D.elements[A].disabled=true}}else{if(B=="telephone"){D.elements[A].disabled=false}}}function changecountrycode(B,A){myString=new String(B);splitString=myString.split("|");A.value=splitString[0]}function combo_option(E,F){var D=0;var C=new Array();var A=0;for(var B=0;B<document.frm_main.elements[E.name].length;B++){if(document.frm_main.elements[E.name].options[B].selected){if(document.frm_main.elements[E.name].options[B].text!=""){C.push(B);D++}if(D>3){document.frm_main.elements[E.name].options[B].selected=false;D++;A=1}}}if(A==1){alert("You can choose only three "+F)}A=0}function show_hide_options(A,B,E){var D=document.getElementById(A);if(E=="selected"||D.style.display=="none"){for(var C=1;C<=A.substr(1);C++){tmp_id=A.substr(0,1)+C;if(tmp_id!="R1"){document.getElementById(tmp_id).style.display=""}}if(B){B.innerHTML=B.innerHTML.replace("More","Fewer");B.innerHTML=B.innerHTML.replace("plus","minus");B.style.background="#FFFFFF";B.innerHTML=B.innerHTML.replace("span",'span style="display: none;"');B.innerHTML=B.innerHTML.replace("SPAN",'SPAN style="display: none;"')}}else{for(var C=1;C<=A.substr(1);C++){tmp_id=A.substr(0,1)+C;if(tmp_id!="R1"){document.getElementById(tmp_id).style.display="none"}}if(B){B.innerHTML=B.innerHTML.replace("Fewer","More");B.innerHTML=B.innerHTML.replace("minus","plus");B.style.background="#F3F3F3";B.innerHTML=B.innerHTML.replace("span",'span style="display: ;"');B.innerHTML=B.innerHTML.replace("SPAN",'SPAN style="display: ;"')}}}function check_option_dosent_matter(C){var A=0;var B=0;for(B=0;B<document.frm_main.elements[C.name].length;B++){if(A==1){document.frm_main.elements[C.name][B].checked=false}if(document.frm_main.elements[C.name][B].value=="null"||document.frm_main.elements[C.name][B].value==""){if(document.frm_main.elements[C.name][B].checked==true){A=1}}}}function check_option(A){for(i=0;i<document.frm_main.elements[A.name].length;i++){if(document.frm_main.elements[A.name][i].value=="null"||document.frm_main.elements[A.name][i].value==""){if(document.frm_main.elements[A.name][i].checked==true){document.frm_main.elements[A.name][i].checked=false}}}}var abc=true;function calcCharLen(B,G,A,F){var E=document.forms[B];var D=E.elements[G];var C=(!F)?100:F;var H=D.value.length;E.elements[A].value=H;if(B=="profile"&&G=="aboutyourself"&&H>100){abc=false;toggleHint("hide","aboutyourself")}else{abc=true;toggleHint("show","aboutyourself")}if(H>C){D.value=D.value.substring(0,C);E.elements[A].value=C;alert("You can enter only "+C+" characters.")}}function cls(A){A.value="";return}var opened=false;var win;function openWin(D,B,C,A){if(opened==false){win=open(D,B,"status=0,scrollbars=1,menubar=0,toolbar=0,location=0,resizeable=0,width="+C+",height="+A)}else{if(opened==true){if(win.closed==false){win.close()}win=window.open(D,B,"status=0,scrollbars=1,menubar=0,toolbar=0,location=0,resizeable=0,width="+C+",height="+A)}}opened=true}function setStat(A){window.status=A;window.defaultStatus=""}function veriPopUp(A){sealWin=window.open(A,"win","toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=720,height=450");self.name="mainWin"}function age_diff_max(){var A=parseInt(document.quicksearch.ageto.options[document.quicksearch.ageto.selectedIndex].text)-parseInt(document.quicksearch.agefrom.options[document.quicksearch.agefrom.selectedIndex].text);if(A>10){alert("Age range exceeds 10 years.\nChange age range or use Smart Search");return false}else{if(parseInt(document.quicksearch.ageto.options[document.quicksearch.ageto.selectedIndex].text)<parseInt(document.quicksearch.agefrom.options[document.quicksearch.agefrom.selectedIndex].text)){alert("Invalid From & To Age");return false}else{return true}}}function chk_community(C){var B=document.quicksearch.community;var A="Community";if(B.options[B.selectedIndex].value==""){if(C=="religion"){A="Religion"}alert("Please select "+A);B.focus();return false}else{return true}}function chk_religion(){if(document.quicksearch.religion.options[document.quicksearch.religion.selectedIndex].value==""){alert("Please select Religion");return false}else{return true}}function chk_quicksearch_religion(){if(age_diff_max()==true){if(document.quicksearch.community.options[document.quicksearch.community.selectedIndex].value==""){alert("Please select Religion");document.quicksearch.community.focus();return false}}else{return false}}function chk_quicksearch(A){if(age_diff_max()==true){return chk_community(A)}else{return false}}function go(){href=document.explore.destination.value;if(href){window.open(href)}}function quick_link_submit_page(){url=top_banner_form.url.options[top_banner_form.url.selectedIndex].value;if(url=="/shaadi-rewards/index.php"||url=="/introduction/how-to-use.php"||url=="http://www.shaadipoint.com/"||url=="http://www.shaaditimes.com/"||url=="http://www.shaaditimes.com/shaadi-shop.php"||url=="/wedding/directory/index.php"){window.open(url)}else{window.open(url,"_self")}}function combo_max_option(B,F,G){var E=0;var D=new Array();var A=0;if(F.options[0].text!="Doesn't Matter"){E=F.options.length}for(var C=0;C<document.frm_main.elements[B.name].length;C++){if(document.frm_main.elements[B.name].options[C].selected){if(document.frm_main.elements[B.name].options[C].text!=""){D.push(C);E++}if(E>3){document.frm_main.elements[B.name].options[C].selected=false;E++;A=1}}}if(A==1){alert("You can add only three "+G);return false}return true}function fill_mothertongue_from(F,M,Q){var L=new Array();if(M=="smart_search"){var H=document.frm_main;var P=H.elements["communityarray[]"]}else{var H=document.quicksearch;var P=H.community}var I=H.elements["castearray[]"];if(M=="smart_search"){for(var U=0;U<P.options.length;U++){L[U]=P.options[U].value}var T=H.elements["mothertongue_fromarray[]"];var S=H.elements["mothertonguearray[]"];var O=new Array();for(var U=0;U<S.options.length;U++){O[U]=S.options[U].value}S.options.length=0;S[0]=new Option("Doesn't Matter"," ")}else{if(P.options[P.selectedIndex].value){L[0]=P.options[P.selectedIndex].value}var T=H.elements["mothertonguearray[]"]}T.options.length=0;document.getElementById("show_hide_caste").style.display="none";if(L.length>0){document.getElementById("show_hide_mothertongue").style.display="";T.size=5;T[0]=new Option("----Select Mother Tongue----","");var V=1;var R=0;var N=0;var G=new Array();var E=new Array();var J=new Array();var D=new Array();var X=new String(F).split("|");G=Q.split("|");if(Q=="null"){G=X}for(var W=0;W<L.length;W++){var A=L[W];if(A=="Hindu"||A=="Muslim"||A=="Other"||A=="Jain"||A=="Buddhist"||A=="Parsi"||A=="Sikh"||A=="Jewish"||A=="Spiritual - not religious"||A=="No Religion"||A=="Christian"||A=="Muslim:Sunni"||A=="Muslim:Shia"||A=="Muslim:Dawoodi Bohra"||A=="Christian:Protestant"||A=="Christian:Born Again"||A=="Christian:Roman Catholic"||A=="Sikh:Jat"||A=="Sikh:Ramgharia"||A=="Sikh:Khatri"||A=="Sikh:Gursikh"||A=="Jain:Shwetamber"||A=="Jain:Digambar"||A=="Jain:Vania"||A==" "){if(A==" "){I.options.length=0}for(var U=0;U<X.length;U++){var K=X[U].trim();if(InArray(G,K)>=0){if(M=="smart_search"){D[R]=K;R++}else{J[N]=K;N++;E[V]=K;V++}}else{if(M=="smart_search"&&InArray(O,K)>=0&&A!=" "){D[R]=K;R++}else{E[V]=K;V++}}}}else{splitString=new String(A).split("|");for(var U=1;U<splitString.length;U++){var K=splitString[U].trim();if(InArray(G,K)>=0){if(M=="smart_search"){D[R]=K;R++}else{J[N]=K;N++;E[V]=K;V++}}else{if(M=="smart_search"&&InArray(O,K)>=0){D[R]=K;R++}else{E[V]=K;V++}}}}}if(E.length>0){E=unique_array(E);for(var W=1;W<E.length;W++){var C=E[W];if(InArray(J,C)>=0){T[W]=new Option(C,C,false,true);T[W].selected=true}else{T[W]=new Option(C,C)}}}if(M=="smart_search"){if(D.length>0){D=unique_array(D);for(var W=0;W<D.length;W++){var B=D[W];S[W]=new Option(B,B)}}}}else{document.getElementById("show_hide_mothertongue").style.display="none"}}function copytolist(H,A){var B=false;var D=false;for(i=0;i<H.options.length;i++){var C=H.options[i];if(C.selected){if(H==document.frm_main.elements["communityarray[]"]||H==document.frm_main.elements["mothertonguearray[]"]||H==document.frm_main.elements["castearray[]"]||H==document.frm_main.elements["occupationarray[]"]||H==document.frm_main.elements["residencystatusarray[]"]||H==document.frm_main.elements["education_level_array[]"]||H==document.frm_main.elements["education_area_array[]"]||H==document.frm_main.elements["countryofresidencearray[]"]||H==document.frm_main.elements["stateofresidencearray[]"]){D=true}B=true;var G=C.text;var F=C.value;if(D==false){to_array=new Array();for(j=0;j<A.options.length;j++){if((C.text)==(A.options[j].text)){to_array[j]=C.text}}}if(G!=""&&G!="----Select Mother Tongue----"&&G!="---------Select Caste---------"&&F!=""){if(A.options[0]&&(A.options[0].text=="Doesn't Matter"||A.options[0].text=="")&&H!=document.frm_main.elements["countryofresidencearray[]"]){A.options.length=0;if(A==document.frm_main.elements["communityarray[]"]){document.frm_main.elements["mothertonguearray[]"].length=0}}if(G!="Doesn't Matter"){if(D==false){if((G&&InArray(to_array,G)==-1)){A.options[A.length]=new Option(G,F)}}}if(D){H.options[i]=null;i--}}}}if(H.options.length==0&&D){if(H==document.frm_main.elements["communityarray[]"]||H==document.frm_main.elements["mothertonguearray[]"]||H==document.frm_main.elements["castearray[]"]){var E=" "}else{var E=""}H.options[0]=new Option("Doesn't Matter",E)}if(H.options.length>0&&H.options.length<=2){if(H.options[0].text=="---------Select Caste---------"&&H.options.length==2){if(H.options[1].text==""){H.options[1]=null}}else{if(H.options.length==1&&H.options[0].text==""){H.options[0]=null}}}if(!B){alert("Please select the Options");return false}return true}function select_values(){var E=new Array("communityarray[]","mothertonguearray[]","castearray[]","countryofresidencearray[]","occupationarray[]","residencystatusarray[]","education_level_array[]","education_area_array[]","stateofresidencearray[]","nearestcityarray[]");var D=new Array();for(var A=0;A<document.frm_main.elements.length;A++){var C=document.frm_main.elements[A];if(InArray(E,C.name)>=0){for(var B=0;B<C.options.length;B++){C.options[B].selected=true}}}return true}function get_selected_countries(B,D,E){var C="";for(var A=0;A<document.frm_main.elements["countryofresidencearray[]"].length;A++){if((document.frm_main.elements["countryofresidencearray[]"].options[A].text=="India"||document.frm_main.elements["countryofresidencearray[]"].options[A].text=="USA")){C+="'"+document.frm_main.elements["countryofresidencearray[]"].options[A].text+"',"}else{if(document.frm_main.elements["countryofresidencearray[]"].options[A].text=="Doesn't Matter"){C="'India','USA'";break}}}if(!E){if(C||B){display_state_dropdown(C,B,"",document.frm_main.elements["stateofresidence_fromarray[]"],D,"smart_search","")}else{document.frm_main.elements["stateofresidencearray[]"].options.length=0;if(document.getElementById("show_hide_state")){document.getElementById("show_hide_state").style.display="none"}}}}function unique_array(D){var C=new Array();var A=0;for(var B=0;B<D.length;B++){var E=D[B];if(InArray(C,E)<0){C[A]=E;A++}}return C}String.prototype.trim=function(){var A=this;A=A.replace(/^\s*(.*)/,"$1");A=A.replace(/(.*?)\s*$/,"$1");return A};function InArray(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return -1}function set_community_value(A){if((A==0)||(A==1)){document.getElementById("loadCommunity").innerHTML='<select name="community" style="width:142px" onchange="set_comm_val(this.value)" class="formselect"  id="community" disabled><option value=" ">Doesn\'t Matter</option></select>';document.getElementById("hiddenCommunity").value=""}else{if(A==2){document.getElementById("loadCommunity").innerHTML='<select name="community" onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community"><option value="Hindu">All</option><option value="Hindu|Assamese|Arunachali|Manipuri">Assamese</option><option value="Hindu|Bengali">Bengali</option><option value="Hindu|Gujarati|Kutchi">Gujarati</option><option value="Hindu|Hindi|Awadhi|Bhojpuri|Brij|Chattisgarhi|Garhwali|Haryanavi|Himachali/Pahari|Kumaoni|Magahi|Maithili|Rajasthani|Sanskrit|Urdu">Hindi</option><option value="Hindu|Kannada|Coorgi|Tulu">Kannada</option><option value="Hindu|Konkani">Konkani</option><option value="Hindu|Malayalam">Malayalam</option><option value="Hindu|Marathi">Marathi</option><option value="Hindu|Marwari|Rajasthani">Marwari</option><option value="Hindu|Oriya">Oriya</option><option value="Hindu|Punjabi|Dogri">Punjabi</option><option value="Hindu|Sindhi">Sindhi</option><option value="Hindu|Tamil">Tamil</option><option value="Hindu|Telugu">Telugu</option><option value="Hindu|Other|Aka|Arabic|Arunachali|Awadhi|Bhojpuri|Bhutia|Burmese|Chattisgarhi|Chinese|English|French|Garhwali|Garo|German|Haryanavi|Himachali/Pahari|Hindko|Kakbarak|Kanauji|Kashmiri|Khandesi|Khasi|Koshali|Kumaoni|Ladakhi|Lepcha|Magahi|Maithili|Malay|Manipuri|Miji|Mizo|Monpa|Nepali|Pashto|Persian|Russian|Sanskrit|Santhali|Sinhala|Spanish|Swedish|Tagalog|Urdu">Other</option></select>';document.getElementById("hiddenCommunity").value="Hindu"}else{if(A==3){document.getElementById("loadCommunity").innerHTML='<select name="community" onchange="set_comm_val(this.value)" class="formselect"   style="width:142px" id="community"><option value="Muslim">All</option><option value="Muslim:Sunni">Sunni</option><option value="Muslim:Shia">Shia</option><option value="Muslim:Rajput">Rajput</option><option value="Muslim:Dawoodi Bohra">Dawoodi Bohra</option><optgroup label="-----------------------"></optgroup><option value="Muslim|Urdu">Urdu</option><option value="Muslim|Punjabi">Punjabi</option><option value="Muslim|Bengali">Bengali</option><option value="Muslim|Hindi">Hindi</option><option value="Muslim|English">English</option></select>';document.getElementById("hiddenCommunity").value="Muslim"}else{if(A==4){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community"><option value="Christian">All</option><option value="Christian:Roman Catholic">Roman Catholic</option><option value="Christian:Protestant">Protestant</option><option value="Christian:Born Again">Born Again</option><option value="Christian:Marthoma">Marthoma</option><optgroup label="-----------------------"></optgroup><option value="Christian|Malayalam">Malayalam</option><option value="Christian|English">English</option><option value="Christian|Tamil">Tamil</option><option value="Christian|Konkani">Konkani</option></select>';document.getElementById("hiddenCommunity").value="Christian"}else{if(A==5){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community"><option value="Sikh">All</option><option value="Sikh:Jat">Jat</option><option value="Sikh:Ramgharia">Ramgharia</option><option value="Sikh:Khatri">Khatri</option><option value="Sikh:Gursikh">Gursikh</option><option value="Sikh:Clean Shaven">Clean Shaven</option><optgroup label="-----------------------"></optgroup><option value="Sikh|Punjabi">Punjabi</option><option value="Sikh|English">English</option></select>';document.getElementById("hiddenCommunity").value="Sikh"}else{if(A==6){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community"><option value="Jain">All</option><option value="Jain:Shwetamber">Shwetamber</option><option value="Jain:Digambar">Digambar</option><option value="Jain:Vania">Vania</option></select>';document.getElementById("hiddenCommunity").value="Jain"}else{if(A==7){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community" disabled><option value="Parsi">All</option></select>';document.getElementById("hiddenCommunity").value="Parsi"}else{if(A==8){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community" disabled><option value="Buddhist">All</option></select>';document.getElementById("hiddenCommunity").value="Buddhist"}else{if(A==9){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community" disabled><option value="Jewish">All</option></select>';document.getElementById("hiddenCommunity").value="Jewish"}else{if(A==10){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community" disabled><option value="No Religion">All</option></select>';document.getElementById("hiddenCommunity").value="No Religion"}else{if(A==11){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community" disabled><option value="Spiritual - not religious">All</option></select>';document.getElementById("hiddenCommunity").value="Spiritual - not religious"}else{if(A==12){document.getElementById("loadCommunity").innerHTML='<select name="community"  onchange="set_comm_val(this.value)" class="formselect"  style="width:142px" id="community" disabled><option value="Other">All</option></select>';document.getElementById("hiddenCommunity").value="Other"}}}}}}}}}}}}}function set_comm_val(A){document.getElementById("hiddenCommunity").value=A};
