var pathNameArray=window.location.pathname.split("/");var rootPath=window.location.protocol+"//"+window.location.host;if(pathNameArray[1]=="stackmeup"){rootPath+="/"+pathNameArray[1]+"/"}else{rootPath+="/"}var realEstateAjaxPath=rootPath+"ajax_queries/real-estate/";var yourBodyAjaxPath=rootPath+"ajax_queries/your-body/";var incomeAjaxPath=rootPath+"ajax_queries/income/";var ajaxPath=rootPath+"ajax_queries/";function getCheckedValue(b){if(!b){return""}var c=b.length;if(c==undefined){if(b.checked){return b.value}else{return""}}for(var a=0;a<c;a++){if(b[a].checked){return b[a].value}}return""}function extractNumber(j,i,k){var m=j.value;var b="[0-9]*";if(i>0){b+="\\.?[0-9]{0,"+i+"}"}else{if(i<0){b+="\\.?[0-9]*"}}b=k?"^-?"+b:"^"+b;b=b+"$";var f=new RegExp(b);if(f.test(m)){return true}var l="[^0-9"+(i!=0?".":"")+(k?"-":"")+"]";var e=new RegExp(l,"g");m=m.replace(e,"");if(k){var h=m.length>0&&m.charAt(0)=="-";var d=/-/g;m=m.replace(d,"");if(h){m="-"+m}}if(i!=0){var c=/\./g;var a=c.exec(m);if(a!=null){var g=m.substring(a.index+a[0].length);g=g.replace(c,"");g=i>0?g.substring(0,i):g;m=m.substring(0,a.index)+"."+g}}j.value=m}function blockNonNumbers(c,g,j,f){var k;var h=false;var d;var a;if(window.event){k=g.keyCode;h=window.event.ctrlKey}else{if(g.which){k=g.which;h=g.ctrlKey}}if(isNaN(k)){return true}d=String.fromCharCode(k);if(k==8||h){return true}a=/\d/;var b=f?d=="-"&&c.value.indexOf("-")==-1:false;var i=j?d=="."&&c.value.indexOf(".")==-1:false;return b||i||a.test(d)}function acceptCommablockNonNumbers(c,g,j,f){var k;var h=false;var d;var a;if(window.event){k=g.keyCode;h=window.event.ctrlKey}else{if(g.which){k=g.which;h=g.ctrlKey}}d=String.fromCharCode(k);if(d==","){return true}else{if(isNaN(k)){return true}if(k==8||h){return true}a=/\d/;var b=f?d=="-"&&c.value.indexOf("-")==-1:false;var i=j?d=="."&&c.value.indexOf(".")==-1:false;return b||i||a.test(d)}}function cleanupSentence(b){var a=b;if(a!=""){a=a.replace(new RegExp(/^\s+/),"");a=a.replace(new RegExp(/\s+$/),"");a=escape(a);return a}}function getKey(a){if(window.event){return window.event.keyCode}else{if(a){return a.which}else{return null}}}function restrictChars(d,c){if(c=="0-9"){c="0123456789 "}else{if(c=="A-Z"){c="ABCDEFGHIJKLMNOPQRSTUVWXYZ "}else{if(c=="0-9A-Z"){c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ "}}}var a,b;a=getKey(d);if(a==null){return true}b=String.fromCharCode(a).toLowerCase();if(c.toLowerCase().indexOf(b)!=-1){return true}if(a==0||a==8||a==9||a==13||a==27){return true}return false}function stackmeupDiv(){scroll(0,0);if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){StackResult=eval(xmlHttp.responseText);var IncomeError=StackResult[0].IncomeError;var AlertMessage=StackResult[0].AlertMessage;if(AlertMessage!=""&&AlertMessage){alert(AlertMessage);return false}else{if(IncomeError==1){alert("Please enter an amount greater than 0");document.frm_IncomeNationally.income.value="";document.frm_IncomeNationally.income.focus();return false}else{if(IncomeError==2){alert("Please enter an amount greater than 0");document.frm_IncomeState.income.value="";document.frm_IncomeState.income.focus();return false}else{if(IncomeError==3){alert("Please enter an amount greater than 0");document.frm_IncomeCounty.income.value="";document.frm_IncomeCounty.income.focus();return false}else{if(IncomeError==4){alert("Please enter an amount greater than 0");document.frm_IncomeCity.income.value="";document.frm_IncomeCity.income.focus();return false}else{var divStatus=sanitizeString(StackResult[0].DivStatus);$("rsltDivStatus").value=divStatus;if(divStatus!=3){var result=sanitizeString(StackResult[0].ResultMessage)}else{var result=StackResult[0].ResultMessage}if(result!=""){$("Question_div").className="hidediv";if(divStatus==1){$("Result_NoratingImage_div").className="hidediv";$("Result_Listing_div").className="hidediv";$("Result_div").className="result_div";var PercentageResult=StackResult[0].PercentageResult;$("RankingID1").innerHTML=PercentageResult;$("ratingTextarea1").className="";$("ResultMessage1").innerHTML=result;$("joinCommunityDiv").className="HideJoinCommunityDiv";$("topStackPlaceHolder").className="ShowtopstackDiv";var topStackHtml=sanitizeString(StackResult[0].TopStacker);$("topStackPlaceHolder").innerHTML=topStackHtml;if(topStackHtml==""){$("topStackPlaceHolder").innerHTML=topStackHtml}else{$("topStackPlaceHolder").innerHTML=topStackHtml}var AnimationHTML=sanitizeString(StackResult[0].Animation);$("AnimationPlaceHolder1").innerHTML=AnimationHTML;var UpdateButton=StackResult[0].DisplayUpdate;$("updateBtnPlaceHolder1").innerHTML=UpdateButton}else{if(divStatus==2){$("Result_Listing_div").className="hidediv";$("Result_div").className="hidediv";$("Result_NoratingImage_div").className="result_div";var PercentageResult=StackResult[0].PercentageResult;$("RankingID2").innerHTML=PercentageResult;$("ResultMessage2").innerHTML=result;$("joinCommunityDiv").className="HideJoinCommunityDiv";$("topStackPlaceHolder").className="ShowtopstackDiv";var topStackHtml=sanitizeString(StackResult[0].TopStacker);$("topStackPlaceHolder").innerHTML=topStackHtml;if(topStackHtml==""){$("topStackPlaceHolder").innerHTML=topStackHtml}else{$("topStackPlaceHolder").innerHTML=topStackHtml}var AnimationHTML=sanitizeString(StackResult[0].Animation);$("AnimationPlaceHolder2").innerHTML=AnimationHTML;var UpdateButton=StackResult[0].DisplayUpdate;$("updateBtnPlaceHolder2").innerHTML=UpdateButton}else{if(divStatus==3){$("Result_div").className="hidediv";$("Result_NoratingImage_div").className="hidediv";$("Result_Listing_div").className="result_div";$("ResultMessage3").innerHTML=result;$("joinCommunityDiv").className="HideJoinCommunityDiv";$("topStackPlaceHolder").className="ShowtopstackDiv";var topStackHtml=sanitizeString(StackResult[0].TopStacker);if(topStackHtml==""){$("topStackPlaceHolder").innerHTML=topStackHtml}else{$("topStackPlaceHolder").innerHTML=topStackHtml}var AnimationHTML=sanitizeString(StackResult[0].Animation);$("AnimationPlaceHolder3").innerHTML=AnimationHTML;var UpdateButton=StackResult[0].DisplayUpdate;$("updateBtnPlaceHolder3").innerHTML=UpdateButton}}}$("StatMsg").innerHTML=StackResult[0].ResStatMsg;if(divStatus==1||divStatus==2){var OverallPerformance=StackResult[0].Overall;var resultGraphAreaName;switch(OverallPerformance){case"1":setTimeout("PlayFlashMovie();",500);if(divStatus==1){$("ratingTextarea1").className="poorTextarea";resultGraphAreaName="resultGraphArea1"}else{if(divStatus==2){resultGraphAreaName="resultGraphArea2"}}$(resultGraphAreaName).innerHTML="<!--[if gte IE 6]><script type='text/javascript'>startIeFix();<\/script><![endif]--><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='18' height='265'><param name='movie' value='"+rootPath+"images/animations/barAnimation1.swf'><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><param name='wmode' value='transparent'><embed src='"+rootPath+"images/animations/barAnimation1.swf' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='18' height='265'></object><!--[if gte IE 6]></noscript><script type='text/javascript'>endIeFix();<\/script><![endif]-->";break;case"2":setTimeout("PlayFlashMovie();",1000);if(divStatus==1){$("ratingTextarea1").className="fairTextarea";resultGraphAreaName="resultGraphArea1"}else{if(divStatus==2){resultGraphAreaName="resultGraphArea2"}}$(resultGraphAreaName).innerHTML="<!--[if gte IE 6]><script type='text/javascript'>startIeFix();<\/script><![endif]--><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='18' height='265'><param name='movie' value='"+rootPath+"images/animations/barAnimation2.swf'><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><param name='wmode' value='transparent'><embed src='"+rootPath+"images/animations/barAnimation2.swf' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='18' height='265'></object><!--[if gte IE 6]></noscript><script type='text/javascript'>endIeFix();<\/script><![endif]-->";break;case"3":setTimeout("PlayFlashMovie();",1500);if(divStatus==1){$("ratingTextarea1").className="averageTextarea";resultGraphAreaName="resultGraphArea1"}else{if(divStatus==2){resultGraphAreaName="resultGraphArea2"}}$(resultGraphAreaName).innerHTML="<!--[if gte IE 6]><script type='text/javascript'>startIeFix();<\/script><![endif]--><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='18' height='265'><param name='movie' value='"+rootPath+"images/animations/barAnimation3.swf'><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><param name='wmode' value='transparent'><embed src='"+rootPath+"images/animations/barAnimation3.swf' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='18' height='265'></object><!--[if gte IE 6]></noscript><script type='text/javascript'>endIeFix();<\/script><![endif]-->";break;case"4":setTimeout("PlayFlashMovie();",2000);if(divStatus==1){$("ratingTextarea1").className="goodTextarea";resultGraphAreaName="resultGraphArea1"}else{if(divStatus==2){resultGraphAreaName="resultGraphArea2"}}$(resultGraphAreaName).innerHTML="<!--[if gte IE 6]><script type='text/javascript'>startIeFix();<\/script><![endif]--><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='18' height='265'><param name='movie' value='"+rootPath+"images/animations/barAnimation4.swf'><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><param name='wmode' value='transparent'><embed src='"+rootPath+"images/animations/barAnimation4.swf' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='18' height='265'></object><!--[if gte IE 6]></noscript><script type='text/javascript'>endIeFix();<\/script><![endif]-->";break;case"5":setTimeout("PlayFlashMovie();",2500);if(divStatus==1){$("ratingTextarea1").className="excellentTextarea";resultGraphAreaName="resultGraphArea1"}else{if(divStatus==2){resultGraphAreaName="resultGraphArea2"}}$(resultGraphAreaName).innerHTML="<!--[if gte IE 6]><script type='text/javascript'>startIeFix();<\/script><![endif]--><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='18' height='265'><param name='movie' value='"+rootPath+"images/animations/barAnimation5.swf'><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><param name='wmode' value='transparent'><embed src='"+rootPath+"images/animations/barAnimation5.swf' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='18' height='265'></object><!--[if gte IE 6]></noscript><script type='text/javascript'>endIeFix();<\/script><![endif]-->";break;default:if(divStatus==1){$("ratingTextarea1").className="";resultGraphAreaName="resultGraphArea1"}else{if(divStatus==2){resultGraphAreaName="resultGraphArea2"}}$(resultGraphAreaName).innerHTML="";break}var PercentageValue=StackResult[0].PercentageValue;if(PercentageValue==1||PercentageValue==2||PercentageValue==3){if(divStatus==1){$("Result_F_T1").style.display="none";$("ResultTopStacker_F_T1").style.display="inline"}else{if(divStatus==2){$("Result_F_T2").style.display="none";$("ResultTopStacker_F_T2").style.display="inline"}}}else{if(divStatus==1){$("ResultTopStacker_F_T1").style.display="none";$("Result_F_T1").style.display="inline"}else{if(divStatus==2){$("ResultTopStacker_F_T2").style.display="none";$("Result_F_T2").style.display="inline"}}}if(divStatus!=3){var timeDelay;if($("ratingTextarea1").className=="averageTextarea"){timeDelay=4560}else{if($("ratingTextarea1").className=="fairTextarea"){timeDelay=3900}else{if($("ratingTextarea1").className=="goodTextarea"){timeDelay=4260}else{timeDelay=3600}}}if(PercentageValue==3){setTimeout("showStaticPopup('divTopStackerNonMember2','','50')",timeDelay)}else{if(PercentageValue==1){setTimeout("showStaticPopup('divTopStackerNonMember3','','50')",timeDelay)}else{if(PercentageValue==2){setTimeout("showStaticPopup('divTopStackerNonMember','','50')",timeDelay)}}}}}var DivGoTo=StackResult[0].DivGoTo;if(DivGoTo!=""&&DivGoTo){window.location.href="#"+DivGoTo;scroll(0,0)}}}}}}}}}function getFlashMovieObject(a){if(window.document[a]){return window.document[a]}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a]){return document.embeds[a]}}else{return document.getElementById(a)}}function PlayFlashMovie(){var a=getFlashMovieObject("animationMan");a.Play()}function replaceAll(a){var c=a;var b=c.indexOf(",");while(b!=-1){c=c.replace(",","");b=c.indexOf(",")}return c}function alltrim(a){return a.replace(/^\s+|\s+$/g,"")}function validateprice(a){a=alltrim(a);return/^\$?[1-9][0-9]{0,2}(,[0-9]{3})*(\.[0-9]{2})?$/.test(a)}function hideCommonDivs(){document.getElementById("StatMsg").innerHTML="";document.getElementById("Result_div").className="hidediv";document.getElementById("Result_NoratingImage_div").className="hidediv";document.getElementById("Result_Listing_div").className="hidediv";document.getElementById("Question_div").className="question_div";document.getElementById("AnimationPlaceHolder1").innerHTML="";document.getElementById("AnimationPlaceHolder2").innerHTML="";document.getElementById("AnimationPlaceHolder3").innerHTML="";return true}function myXMLHttpObject(c){var b=null;try{b=new XMLHttpRequest()}catch(d){try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){b=null}}}if(b==null){alert("Error initializing XMLHttpRequest!")}else{if(c!=null){b.onreadystatechange=c}return b}}function isNumberKey(b){var a=(b.which)?b.which:event.keyCode;if(a>31&&(a<48||a>57)){return false}return true}function isDecimalKey(b){var a=(b.which)?b.which:event.keyCode;if(a>31&&(a<46||a>57||a==47)){return false}return true}function LTrim(e){var b=new String(" \t\n\r");var d=new String(e);if(b.indexOf(d.charAt(0))!=-1){var a=0,c=d.length;while(a<c&&b.indexOf(d.charAt(a))!=-1){a++}d=d.substring(a,c)}return d}function RTrim(d){var a=new String(" \t\n\r");var c=new String(d);if(a.indexOf(c.charAt(c.length-1))!=-1){var b=c.length-1;while(b>=0&&a.indexOf(c.charAt(b))!=-1){b--}c=c.substring(0,b+1)}return c}function trim(a){return RTrim(LTrim(a))}function showMoreAnswers(a){if(document.getElementById("span"+a).innerHTML=="See more responses"){document.getElementById("span"+a).innerHTML="Hide more responses";document.getElementById("div"+a).style.display="inline"}else{document.getElementById("span"+a).innerHTML="See more responses";document.getElementById("div"+a).style.display="none"}}var bo_ns_id=0;function startIeFix(){if(isIE()){document.write('<noscript id="bo_ns_id_'+bo_ns_id+'">')}}function endIeFix(){if(isIE()){var a=document.getElementById("bo_ns_id_"+bo_ns_id++);var b=a.innerHTML;document.write(b)}}function isIE(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("msie")>-1&&a.indexOf("mac")<0){return true}else{return false}}var rand_no=Math.random();var loginEvent;function LoginValidation(a){loginEvent=a;var c=trim($F("txtAlias"));var b=trim($F("txtPassword"));var d=trim($F("returnURL"));if(c==""){alert("Enter Username");$("txtAlias").focus();return false}else{if(b==""){alert("Enter Password");$("txtPassword").focus();return false}else{parameters="password="+base64_encode(b)+"&alias="+c+"&retunURL="+d;parameters+="&sNo="+rand_no;var e=ajaxPath+"signin_chk.php";makeRequest(e,parameters,signInCheck,"POST",false);return false}}}function LoginPopupValidation(a){loginEvent=a;var c=trim($F("txtPopupAlias"));var b=trim($F("txtPopupPassword"));var d=trim($F("returnURL"));if(c==""){alert("Enter Username");$("txtPopupAlias").focus();return false}else{if(b==""){alert("Enter Password");$("txtPopupPassword").focus();return false}else{parameters="password="+base64_encode(b)+"&alias="+c+"&retunURL="+d;parameters+="&sNo="+rand_no;var e=ajaxPath+"signin_chk.php";makeRequest(e,parameters,signInCheck,"POST",false);return false}}}function signInCheck(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){LoginResult=eval(xmlHttp.responseText);var StatusMessage=sanitizeString(LoginResult[0].StatusMessage);var ReturnURL=sanitizeString(LoginResult[0].ReturnURL);if(StatusMessage=="Success"){if($("windowOpener").value=="FB_T_TOPSTACKER"){window.close();window.opener.location.href=ReturnURL}else{window.location.href=ReturnURL}return false}else{if(StatusMessage=="InvalidPassword"){if($("divLoginBox")){$("divLoginBox").className="hidediv"}$("div_forgetPassword").className="hidediv";showStaticPopup("divInvalidPassword",loginEvent,300);return false}else{if(StatusMessage=="InvalidAlias"){if($("divLoginBox")){$("divLoginBox").className="hidediv"}$("div_forgetAlias").className="hidediv";showStaticPopup("divInvalidAlias",loginEvent,300);return false}}}}}function openRegistrationPage(a){window.close();window.opener.location.href=a}function showForgetPassword(){$("div_forgetPassword").className="showdiv";$("div_forgetPasswordError").innerHTML="";$("forgetPasswordEmail").value="";$("forgetPasswordEmail").focus()}function forgetPassword(){var b="";var a=$F("forgetPasswordEmail");var c=validateEmail(a);if(c!=true){$("div_forgetPasswordError").className="showdiv";$("div_forgetPasswordError").innerHTML=c}else{parameters="email="+a;parameters+="&alias="+b;parameters+="&sNo="+rand_no;var d=ajaxPath+"community/SendPassword.php";makeRequest(d,parameters,sendPasswordResult,"POST",false);return false}}function sendPasswordResult(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){passwordResult=eval(xmlHttp.responseText);var StatusMessage=sanitizeString(passwordResult[0].StatusMessage);if(StatusMessage=="Send"){$("div_forgetPasswordError").className="showdiv";$("div_forgetPasswordError").innerHTML="Mail sent successfully. Please check your mail for new password"}else{$("div_forgetPasswordError").className="showdiv";$("div_forgetPasswordError").innerHTML=StatusMessage}}}function showForgetAlias(){$("div_forgetAlias").className="showdiv";$("div_forgetAliasError").innerHTML="";$("forgetAliasEmail").value="";$("forgetAliasEmail").focus()}function forgetAlias(){var a=$F("forgetAliasEmail");var b=validateEmail(a);if(b!=true){$("div_forgetAliasError").className="showdiv";$("div_forgetAliasError").innerHTML=b}else{parameters="email="+a;parameters+="&sNo="+rand_no;var c=ajaxPath+"community/SendAlias.php";makeRequest(c,parameters,sendAliasResult,"POST",false);return false}}function sendAliasResult(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){aliasResult=eval(xmlHttp.responseText);var StatusMessage=sanitizeString(aliasResult[0].StatusMessage);if(StatusMessage=="Send"){$("div_forgetAliasError").className="showdiv";$("div_forgetAliasError").innerHTML="Mail sent successfully. Please check your mail for Username."}else{$("div_forgetAliasError").className="showdiv";$("div_forgetAliasError").innerHTML=StatusMessage}}}function showLoginPopup(b,c,a,d){if(d&&d!=""){var e=d;$("returnURL").value=d}else{var e=trim($F("returnURL"))}$(b).className="showdiv";showStaticPopup(b,c,a)}function base64_encode(h){var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var c,b,a,m,l,k,j,n,g=ac=0,f="",e=[];h=utf8_encode(h);do{c=h.charCodeAt(g++);b=h.charCodeAt(g++);a=h.charCodeAt(g++);n=c<<16|b<<8|a;m=n>>18&63;l=n>>12&63;k=n>>6&63;j=n&63;e[ac++]=d.charAt(m)+d.charAt(l)+d.charAt(k)+d.charAt(j)}while(g<h.length);f=e.join("");switch(h.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"=";break}return f}function utf8_encode(d){d=(d+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var b="";var h,a;var f=0;h=a=0;f=d.length;for(var g=0;g<f;g++){var e=d.charCodeAt(g);var c=null;if(e<128){a++}else{if((e>127)&&(e<2048)){c=String.fromCharCode((e>>6)|192)+String.fromCharCode((e&63)|128)}else{c=String.fromCharCode((e>>12)|224)+String.fromCharCode(((e>>6)&63)|128)+String.fromCharCode((e&63)|128)}}if(c!=null){if(a>h){b+=d.substring(h,a)}b+=c;h=a=g+1}}if(a>h){b+=d.substring(h,d.length)}return b}function showTopstackerFrmPopup(b,a){if(a==1){window.location.href=b}else{showLoginPopup("divLoginBox",loginEvent,300,b)}}function RegisterValidation(){var c=true;password=trim($F("txtOptInPassword"));confpassword=trim($F("txtOptInConfirmPassword"));if(trim($F("txtOptInEmail"))==""){alert("Please enter Email Address");$("txtOptInEmail").value="";$("txtOptInEmail").focus();c=false;return false}else{var j=validateEmail($F("txtOptInEmail"));if(j!=true){alert(j);$("txtOptInEmail").focus();c=false;return false}var f=trim($F("txtOptInConfirmEmail"));if(f==""||f!=$F("txtOptInEmail")){alert("Please confirm your email address");$("txtOptInConfirmEmail").focus();c=false;return false}}if(password==""){alert("Please enter Password");$("txtOptInPassword").value="";$("txtOptInPassword").focus();c=false;return false}if(confpassword!=$F("txtOptInPassword")){alert("Check the password typed.");$("txtOptInPassword").focus();c=false;return false}if(trim($F("txtOptInFname"))==""){alert("Please enter First name");$("txtOptInFname").value="";$("txtOptInFname").focus();c=false;return false}if(trim($F("txtOptInLname"))==""){alert("Please enter Last name");$("txtOptInLname").value="";$("txtOptInLname").focus();c=false;return false}var g=trim($F("txtOptInZipCode"));if(g==""){alert("Please enter Zip Code");$("txtOptInZipCode").value="";$("txtOptInZipCode").focus();c=false;return false}else{if(isNaN(g)){alert("Please enter correct Zip Code");$("txtOptInZipCode").focus();c=false;return false}}var a=true;if(trim($F("txtOptInDOBMonth"))==0){alert("Please select Month of Birth");$("txtOptInDOBMonth").value="";$("txtOptInDOBMonth").focus();c=false;a=false;return false}if(trim($F("txtOptInDOBDay"))==0){alert("Please select Day of Birth");$("txtOptInDOBDay").value="";$("txtOptInDOBDay").focus();c=false;a=false;return false}if(trim($F("txtOptInDOBYear"))==0){alert("Please select Year of Birth");$("txtOptInDOBYear").value="";$("txtOptInDOBYear").focus();c=false;a=false;return false}if(a==true){var l=$F("txtOptInDOBMonth")+"/"+$F("txtOptInDOBDay")+"/"+$F("txtOptInDOBYear");var k=isValidDate(l);if(k!=true){alert(k);$("txtOptInDOBMonth").focus();c=false;return false}else{$("txtOptInDOB").value=l}}var b=document.frmOptIn.txtOptInGender.length;var h=0;for(var d=0;d<b;d++){if(document.frmOptIn.txtOptInGender[d].checked==true){h=document.frmOptIn.txtOptInGender[d].value}}if(h==0){alert("Select your gender");c=false;return false}var e=trim($F("txtOptInAlias"));if(e==""){alert("Please enter Username");$("txtOptInAlias").focus();return false}var m=document.frmOptIn.OptInagree.checked;if(m==false){alert("You must agree to our Privacy Policy and Terms of Use");c=false;return false}if(c==true){InsertOptInInfo(e,$F("txtOptInEmail"),password,trim($F("txtOptInFname")),trim($F("txtOptInLname")),document.getElementById("txtOptInCountry").value,$("txtOptInZipCode").value,l,h)}}function validateEmail(d){var b="";var a=/^[^@]+@[^@.]+\.[^@]*\w\w$/;var c=/[\(\)\<\>\,\;\:\\\"\[\]]/;if(d==""){b="Enter email address.\n"}else{if(!a.test(d)){b="Enter valid email address.\n"}else{if(d.match(c)){b="Enter valid email address.\n"}else{return true}}}return b}function isValidDate(b){var f=new Date();var d=f.getFullYear();var a=d-16;var h=/^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;var g=b.match(h);var c="";if(g==null){c="Date is not in a valid format.";return c}else{month=g[1];day=g[3];year=g[4];if(month<1||month>12){c="Month must be between 1 and 12.";return c}else{if(day<1||day>31){c="Day must be between 1 and 31.";return c}else{if((month==4||month==6||month==9||month==11)&&day==31){c="Month "+month+" doesn't have 31 days!";return c}else{if(year>a){c="You must be 16 years old or more";return c}else{if(month==2){var e=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!e)){c="February "+year+" doesn't have "+day+" days!";return c}else{return true}}else{return true}}}}}}}function InsertOptInInfo(b,c,e,i,f,k,g,d,h){var a=ajaxPath+"community/InsertLoginInfo.php";var j="&Alias="+b+"&Email="+c+"&Password="+e+"&FirstName="+i+"&LastName="+f+"&CountryCode="+k+"&ZipCode="+g+"&DOB="+d+"&Gender="+h;makeRequest(a,j,InsertOptInInfoStatus,"POST",false)}function InsertOptInInfoStatus(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){if(trim(xmlHttp.responseText)=="Username already exist. Please try some other."){alert(trim(xmlHttp.responseText));document.getElementById("txtAliasEdit").value="";document.getElementById("txtAliasEdit").focus()}else{if(trim(xmlHttp.responseText)!=""){alert("Your Opt-In details inserted successfully.");window.location=xmlHttp.responseText}else{alert("Your log-info updated successfully.")}}}}function $(a){return document.getElementById(a)}function $F(a){return document.getElementById(a).value}function GetXmlHttpObject(c){var a=null;if(navigator.userAgent.indexOf("Opera")>=0){try{a=new XMLHttpRequest();a.onload=c;a.onerror=c;return a}catch(d){alert("Error. Scripting for ActiveX might be disabled");return}}if(navigator.userAgent.indexOf("MSIE")>=0){var b="Msxml2.XMLHTTP";if(navigator.appVersion.indexOf("MSIE 5.5")>=0){b="Microsoft.XMLHTTP"}try{a=new ActiveXObject(b);a.onreadystatechange=c;return a}catch(d){alert("Error. Scripting for ActiveX might be disabled");return}}if(navigator.userAgent.indexOf("Mozilla")>=0){try{a=new XMLHttpRequest();a.onload=c;a.onerror=c;return a}catch(d){alert("Error. Scripting for ActiveX might be disabled");return}}}function makeRequest(a,d,e,b,c){if(b=="POST"){xmlHttp=GetXmlHttpObject(e);xmlHttp.open("POST",a,c);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");xmlHttp.send(d)}else{if(b=="GET"){a=a+"?"+d;xmlHttp=GetXmlHttpObject(e);xmlHttp.open("GET",a,c);xmlHttp.send(null)}}}function sanitizeString(b){var a=b.replace(/(\r\n|\r|\n)/g,"<br />");a=a.replace(/(<br>)/g,"");a=a.replace(/(&quot;)/g,'"');return a}var ns6=document.getElementById&&!document.all;var x=0,y=0;function showStaticPopup(i,g,h){document.getElementById("both-grid-overlay").style.display="block";var b=(document.height!==undefined)?document.height:document.body.offsetHeight;var a=(document.width!==undefined)?document.width:document.body.offsetWidth;document.getElementById("both-grid-overlay").style.width=a-20+"px";document.getElementById("both-grid-overlay").style.height=b+"px";getScrollXY();var f=0;var d=0;if(h!=1){scroll(0,50)}if(h==50){f=0;d=90;h=50;document.getElementById("both-grid-overlay").style.height=(b+700)+"px"}else{if(h==60){f=0;d=90;h=50}else{if(h==300){f=0}else{if(h==61){f=5}else{h=50}}}}if(ns6){document.getElementById(i).style.left=(a/4)-d+"px";document.getElementById(i).style.top=h+f+"px"}else{document.getElementById(i).style.pixelLeft=(a/4)-d;document.getElementById(i).style.pixelTop=h+f}document.getElementById(i).style.display="";document.getElementById(i).style.zIndex=200;try{document.getElementById("lblResult").innerHTML=""}catch(c){return false}return false}function fadeOpenerWindow(d,b,c,a){showLoginPopup(d,b,c,a)}function closeWindow(a){window.close();window.opener.location.href=a}function getScrollXY(){if(typeof(window.pageYOffset)=="number"){x=window.pageXOffset;y=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){x=document.body.scrollLeft;y=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop}}}}function hidePopup(a){document.body.style.overflow="auto";scroll(x,y);document.getElementById("both-grid-overlay").style.display="none";document.getElementById(a).style.display="none"}function hidePopupOpener(a){window.opener.document.body.style.overflow="auto";window.opener.scroll(x,y);window.opener.document.getElementById("both-grid-overlay").style.display="none";window.opener.document.getElementById(a).style.display="none";hidePopup(a)}function showEmail(g,c,f,d){document.getElementById("lblEmail").innerHTML=d.toUpperCase();document.getElementById("txtEmailBody").value="";document.getElementById("both-grid-overlay").style.display="block";var b=(document.height!==undefined)?document.height:document.body.offsetHeight;var a=(document.width!==undefined)?document.width:document.body.offsetWidth;document.getElementById("both-grid-overlay").style.width=a-20+"px";document.getElementById("both-grid-overlay").style.height=b+"px";getScrollXY();scroll(0,0);if(ns6){document.getElementById(g).style.left=a/4+"px";document.getElementById(g).style.top=f+"px"}else{document.getElementById(g).style.pixelLeft=a/4;document.getElementById(g).style.pixelTop=f}document.getElementById(g).style.display="";document.getElementById("divContactUS").style.display="none";document.getElementById("divAdvertiseUS").style.display="none";document.getElementById("divFAQ").style.display="none";document.getElementById("divPrivacyTerms").style.display="none";return false}function hidePopupEmail(b,a){document.getElementById(b).style.display="none";document.getElementById("both-grid-overlay").style.display="none"}function showMessage(h,d,l,j,k){document.getElementById("tdExpertise").innerHTML=document.getElementById("tdExpertise"+k).innerHTML;document.getElementById("hdPrivateRecordId").value=k;document.getElementById("hdBrainTrustId").value=k;document.getElementById("tdViewPMBody").disabled=true;document.getElementById("both-grid-overlay").style.display="block";var a=(document.height!==undefined)?document.height:document.body.offsetHeight;var f=(document.width!==undefined)?document.width:document.body.offsetWidth;document.getElementById("both-grid-overlay").style.width=f-20+"px";document.getElementById("both-grid-overlay").style.height=a+"px";getScrollXY();var i=0;scroll(0,0);if(l>30){document.body.style.overflow="hidden"}else{if(l=25){i=30}}if(ns6){document.getElementById(h).style.left=f/4+"px";document.getElementById(h).style.top=l+i+"px"}else{document.getElementById(h).style.pixelLeft=f/4;document.getElementById(h).style.pixelTop=l+i}document.getElementById(h).style.display="";if(document.getElementById("divInBox").style.display=="inline"){CommentId="hdComment"+j;document.getElementById("imgSendPrivateReply").style.display="none";document.getElementById("imgReplyPrivateMessage").style.display="inline";document.getElementById("imgBrainTrustPrivateMessage").style.display="inline";document.getElementById("imgSavePrivateMessage").style.display="inline";document.getElementById("imgBlockUserPrivate").style.display="inline";var g=document.getElementById("tdPMSubject"+j).innerHTML;var b=document.getElementById("tdMessageDate"+j).innerHTML;var c=document.getElementById("hdCount").value;if(c!="NO"){ReadMessage(j)}else{document.getElementById("hdCount").value="NO";document.getElementById("tdMessageCount").innerHTML="&nbsp;NO MESSAGES&nbsp;"}g=g.replace("<b>","");g=g.replace("</b>","");g=g.replace("<B>","");g=g.replace("</B>","");b=b.replace("<b>","");b=b.replace("</b>","");b=b.replace("<B>","");b=b.replace("</B>","");document.getElementById("tdPMSubject"+j).innerHTML=g;document.getElementById("tdMessageDate"+j).innerHTML=b;document.getElementById("tdViewPMSubject").innerHTML=g;document.getElementById("tdViewPMDate").innerHTML=b;document.getElementById("tdViewPMImageSRC").src=document.getElementById("tdSenderImage"+j).src;document.getElementById("tdViewPMBody").value=document.getElementById(CommentId).value;document.getElementById("tdViewSenderName").innerHTML=document.getElementById("tdSendername"+j).innerHTML;document.getElementById("tdMessageFrom1").innerHTML="MESSAGE FROM";document.getElementById("tdMessageFrom2").innerHTML="MESSAGE FROM";document.getElementById("hdMessageId").value=j;document.getElementById("tdBRViewFrom1").innerHTML="BRAIN REQUEST FROM";document.getElementById("tdBRViewFrom2").innerHTML="BRAIN REQUEST FROM";document.getElementById("imgAccept").style.display="inline";document.getElementById("imgDeny").style.display="inline";document.getElementById("tdViewBRName").innerHTML=document.getElementById("tdSendername"+j).innerHTML;document.getElementById("tdViewBRSubject").innerHTML=g;document.getElementById("tdViewBRDate").innerHTML=b;document.getElementById("tdViewBRImageSRC").src=document.getElementById("tdSenderImage"+j).src;document.getElementById("tdViewBRBody").value=document.getElementById(CommentId).value}else{CommentId="hdSentComment"+j;var g=document.getElementById("tdSentPMSubject"+j).innerHTML;var b=document.getElementById("tdSentMessageDate"+j).innerHTML;document.getElementById("imgSendPrivateReply").style.display="none";document.getElementById("imgReplyPrivateMessage").style.display="none";document.getElementById("imgBrainTrustPrivateMessage").style.display="none";document.getElementById("imgSavePrivateMessage").style.display="none";document.getElementById("imgBlockUserPrivate").style.display="none";document.getElementById("tdMessageFrom1").innerHTML="MESSAGE TO";document.getElementById("tdMessageFrom2").innerHTML="MESSAGE TO";document.getElementById("tdViewPMSubject").innerHTML=g;document.getElementById("tdViewPMDate").innerHTML=b;document.getElementById("tdViewPMImageSRC").src=document.getElementById("tdSentSenderImage"+j).src;document.getElementById("tdViewPMBody").value=document.getElementById(CommentId).value;document.getElementById("tdViewSenderName").innerHTML=document.getElementById("tdSentSendername"+j).innerHTML;document.getElementById("tdBRViewFrom1").innerHTML="BRAIN REQUEST TO";document.getElementById("tdBRViewFrom2").innerHTML="BRAIN REQUEST TO";document.getElementById("imgAccept").style.display="none";document.getElementById("imgDeny").style.display="none";document.getElementById("tdViewBRName").innerHTML=document.getElementById("tdSentSendername"+j).innerHTML;document.getElementById("tdViewBRSubject").innerHTML=g;document.getElementById("tdViewBRDate").innerHTML=b;document.getElementById("tdViewBRImageSRC").src=document.getElementById("tdSentSenderImage"+j).src;document.getElementById("tdViewBRBody").value=document.getElementById(CommentId).value}return false}function SendEmail(a){if(trim(document.getElementById("txtEmailBody").value)!=""){var c=ajaxPath+"community/SendEmail.php";var b="TO="+document.getElementById("lblEmail").innerHTML.toLowerCase()+"&Body="+document.getElementById("txtEmailBody").value+"&Subject="+a;makeRequest(c,b,SendEmailStatus,"POST",false)}else{document.getElementById("txtEmailBody").value="";document.getElementById("txtEmailBody").focus();alert("Message body cannot be blank.")}}function SendEmailStatus(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){hidePopup("divContactUSEmail");alert(xmlHttp.responseText)}}function ReadMessage(a){var c=ajaxPath+"community/ReadMessage.php";var b="ID="+a;makeRequest(c,b,ReadMessageStatus,"POST",false)}function ReadMessageStatus(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){GetMessageCount()}}function SaveAdvertiseDetails(){var b=ajaxPath+"community/AdvertiseDetails.php";var a="Fname="+document.getElementById("txtFname").value+"&Lname="+document.getElementById("txtLname").value+"&Company="+document.getElementById("txtCompany").value+"&WebSite="+document.getElementById("txtWebSite").value+"&Email="+document.getElementById("txtEmail").value+"&Phone="+document.getElementById("txtPhone").value+"&Country="+document.getElementById("ddlCountry").value+"&ZipCode="+document.getElementById("txtZipCode").value+"&Industry="+document.getElementById("txtIndustry").value+"&Budget="+document.getElementById("txtBudget").value+"&Section="+document.getElementById("txtSection").value+"&SubSection="+document.getElementById("txtSubSection").value+"&Market="+document.getElementById("txtAreaMarket").value+"&Agree"+document.getElementById("chkAgree").checked;makeRequest(b,a,SaveAdvertiseStatus,"POST",false)}function SaveAdvertiseStatus(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){hidePopup("divAdvertiseUS")}}function AdvertiseValidation(){var a=true;if(trim($F("txtFname"))==""){alert("Please enter First name");$("txtFname").value="";$("txtFname").focus();a=false;return false}if(trim($F("txtLname"))==""){alert("Please enter Last name");$("txtLname").value="";$("txtLname").focus();a=false;return false}if(trim($F("txtCompany"))==""){alert("Please enter Company name");$("txtCompany").value="";$("txtCompany").focus();a=false;return false}if(trim($F("txtWebSite"))==""){alert("Please enter Website Address");$("txtWebSite").value="";$("txtWebSite").focus();a=false;return false}else{var c=Validate();if(c!=true){alert("Please enter valid Website Address.Example: http://www.stackmeup.com/");$("txtWebSite").focus();a=false;return false}}if(trim($F("txtEmail"))==""){alert("Please enter Email Address");$("txtEmail").value="";$("txtEmail").focus();a=false;return false}else{var c=validateEmail($F("txtEmail"));if(c!=true){alert(c);$("txtEmail").focus();a=false;return false}}if(trim($F("txtPhone"))==""){alert("Please enter phone number");$("txtPhone").value="";$("txtPhone").focus();a=false;return false}else{var c=check_usphone($("txtPhone").value);if(c!=true){alert("Please enter valid phone number");$("txtPhone").focus();a=false;return false}}var b=trim($F("txtZipCode"));if(b==""){alert("Please enter Zip Code");$("txtZipCode").value="";$("txtZipCode").focus();a=false;return false}else{if(isNaN(b)){alert("Please enter correct Zip Code");$("txtZipCode").focus();a=false;return false}}if(trim($F("txtIndustry"))==""){alert("Please enter industry name");$("txtIndustry").value="";$("txtIndustry").focus();a=false;return false}if(trim($F("txtBudget"))==""){alert("Please enter your total budget.");$("txtBudget").value="";$("txtBudget").focus();a=false;return false}if(trim($F("txtSection"))==""){alert("Please enter section name.");$("txtSection").value="";$("txtSection").focus();a=false;return false}if(trim($F("txtSubSection"))==""){alert("Please enter section name.");$("txtSubSection").value="";$("txtSubSection").focus();a=false;return false}if(a==true){SaveAdvertiseDetails()}}function check_usphone(a){var b=/^(\()?(\d{3})([\)-\. ])?(\d{3})([-\. ])?(\d{4})$/;return b.test(a)}function Validate(){var a=new RegExp();a.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&?/.=]+$");return(a.test(document.getElementById("txtWebSite").value))}function validateEmail(d){var b="";var a=/^[^@]+@[^@.]+\.[^@]*\w\w$/;var c=/[\(\)\<\>\,\;\:\\\"\[\]]/;if(d==""){b="You didn't enter an email address.\n"}else{if(!a.test(d)){b="Please enter a valid email address.\n"}else{if(d.match(c)){b="The email address contains illegal characters.\n"}else{return true}}}return b}function showPublicComment(g,d,k,j){document.getElementById("imgReplyMessage").style.display="inline";document.getElementById("imgBrainTrustMessage").style.display="inline";document.getElementById("imgSaveMessage").style.display="inline";document.getElementById("imgBlockUser").style.display="inline";document.getElementById("tdViewPublicBody").disabled=true;document.getElementById("tdPublicMessageFrom2").innerHTML="MESSAGE FROM";document.getElementById("tdPublicMessageFrom1").innerHTML="MESSAGE FROM";document.getElementById("imgSendReply").style.display="none";document.getElementById("hdRecordId").value=j;document.getElementById("both-grid-overlay").style.display="block";var a=(document.height!==undefined)?document.height:document.body.offsetHeight;var f=(document.width!==undefined)?document.width:document.body.offsetWidth;document.getElementById("both-grid-overlay").style.width=f-20+"px";document.getElementById("both-grid-overlay").style.height=a+"px";getScrollXY();var i=0;scroll(0,0);if(k>30){document.body.style.overflow="hidden"}else{if(k=25){i=30}}if(ns6){document.getElementById(g).style.left=f/4+"px";document.getElementById(g).style.top=k+i+"px"}else{document.getElementById(g).style.pixelLeft=f/4;document.getElementById(g).style.pixelTop=k+i}document.getElementById(g).style.display="";CommentId="hdPComment"+j;var h=document.getElementById("tdPSubject"+j).innerHTML;var b=document.getElementById("tdPCommentDate"+j).innerHTML;var c=document.getElementById("hdCommentCount").value;if(c!="NO"){ReadComment(j);if(document.getElementById("tdPSubject"+j).innerHTML.indexOf("<b>")!=-1||document.getElementById("tdPSubject"+j).innerHTML.indexOf("<B>")!=-1){c=c-1;if(c<10&&c>0){c="0"+c}else{if(c==0){c="NO"}}}document.getElementById("hdCommentCount").value=c;document.getElementById("tdCommentCount").innerHTML="&nbsp;"+c+" NEW MESSAGES&nbsp;"}else{document.getElementById("hdCommentCount").value="NO";document.getElementById("tdCommentCount").innerHTML="&nbsp;NO MESSAGES&nbsp;"}h=h.replace("<b>","");h=h.replace("</b>","");h=h.replace("<B>","");h=h.replace("</B>","");b=b.replace("<b>","");b=b.replace("</b>","");b=b.replace("<B>","");b=b.replace("</B>","");document.getElementById("tdPSubject"+j).innerHTML=h;document.getElementById("tdPCommentDate"+j).innerHTML=b;document.getElementById("tdViewPublicSubject").innerHTML=h;document.getElementById("tdViewPublicDate").innerHTML=b;document.getElementById("tdViewPublicImageSRC").src=document.getElementById("tdPSenderImage"+j).src;document.getElementById("tdViewPublicBody").value=document.getElementById(CommentId).value;document.getElementById("tdViewPublicSenderName").innerHTML=document.getElementById("tdPSendername"+j).innerHTML;return false}function ReadComment(a){var c=ajaxPath+"community/ReadComment.php";var b="ID="+a;makeRequest(c,b,ReadCommentStatus,"POST",false)}function ReadCommentStatus(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){GetCommentCount()}}function showContactEmail(g,c,f,d){document.getElementById("lblEmail").innerHTML=d.toUpperCase();document.getElementById("both-grid-overlay").style.display="block";var b=(document.height!==undefined)?document.height:document.body.offsetHeight;var a=(document.width!==undefined)?document.width:document.body.offsetWidth;document.getElementById("both-grid-overlay").style.width=a-20+"px";document.getElementById("both-grid-overlay").style.height=b+"px";alert(b);getScrollXY();alert(y);scroll(x,y);if(ns6){document.getElementById(g).style.left=(a/4)+50+"px";if(b>1000){document.getElementById(g).style.top=630+"px"}else{document.getElementById(g).style.top=350+"px"}}else{document.getElementById(g).style.pixelLeft=(a/4)+50;if(b>1000){document.getElementById(g).style.pixelTop=630}else{document.getElementById(g).style.pixelTop=350}}document.getElementById(g).style.display="";return false}function SearchWithoutLogin(a){document.getElementById("returnURL").value=window.document.location.toString();showLoginPopup("divLoginBox",a,300)}function VisibleOptInDiv(a){if(document.getElementById(a).style.display=="none"){document.getElementById(a).style.display="block"}else{document.getElementById(a).style.display="none"}};