function tmt_confirm(msg){document.MM_returnValue=(confirm(unescape(msg)))}function toggle(targetId){if(document.getElementById){target=document.getElementById(targetId);if(target.style.display=="none"){target.style.display=""}else{target.style.display="none"}}}function replace(string,text,by){var strLength=string.length,txtLength=text.length; if((strLength==0)||(txtLength==0))return string; var i=string.indexOf(text);if((!i)&&(text!=string.substring(0,txtLength)))return string;if(i==-1)return string;var newstr=string.substring(0,i)+by;if(i+txtLength<strLength)newstr+=replace(string.substring(i+txtLength,strLength),text,by);newstr=newstr.replace(/[^-a-zA-Z0-9]/g,'');newstr=newstr.toLowerCase(newstr);newstr=newstr.replace('--','-');return newstr}function agreesubmit(el){checkobj=el;if(document.all||document.getElementById){for(i=0;i<checkobj.form.length;i++){var tempobj=checkobj.form.elements[i];if(tempobj.type.toLowerCase()=="submit")tempobj.disabled=!checkobj.checked}}}function defaultagree(el){if(!document.all&&!document.getElementById){if(window.checkobj&&checkobj.checked)return true; else{alert("You must agree to the Site Policies in order to use our website!");return false}}}function NewWindow(mypage,myname,w,h,scroll,pos){if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100}if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100}else if((pos!="center"&&pos!="random")||pos==null){LeftPosition=0;TopPosition=20}settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';win=window.open(mypage,myname,settings)}function messageCounter(){var messagecontent=document.form.Message.value;messagecontent=messagecontent.replace(/\s+/g,' ');messagecontent=messagecontent.split(" ");document.form.wordcounttotal.value=messagecontent.length}function changeTxt(elem){if(elem&&elem.value=="What's on your mind?")elem.value="";return}function clearSearch(elem){if(elem&&elem.value=="search christianblog.com")elem.value="";return}var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i; function checkmail(e){var returnval=emailfilter.test(e.value);if (returnval==false){alert("Please enter a valid email address.");e.select()}return returnval}