//------------------- OPEN NEW WINDOW -------------------// // generic window // function EZowin(url) { //1.0 window.open(url,'ezPopUp','width=400, height=325, resizable=0,scrollbars=yes,menubar=no,directories=0,status=0,copyhistory=0,minimise=no,maximise=no,left=0,top=0'); } // php window (bna & virtual tours) // function owin(url) { //iView v1.0 window.open(('../bna/bna.php?var=' + url),'UPpopup','width=520, height=390, resizable=0,scrollbars=0,menubar=no,directories=0,status=0,copyhistory=0,minimise=no,maximise=no,left=0,top=0'); } //------------------- for clearing and replacing text in form input fields and textareas -------------------// function clearText(thefield) { if (thefield.defaultValue==thefield.value) { thefield.value = "" } } function replaceText(thefield) { if (thefield.value=="") { thefield.value = thefield.defaultValue } } //------------------- Form Validation -------------------// function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0) if (t==1){ //fromto ma=a[i+1].split('_');if(isNaN(v)||v ma[1]/1){err=true} } else if (t==2){ rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true; } else if (t==3){ // date ma=a[i+1].split("#");at=v.match(ma[0]); if(at){ cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]]; dte=new Date(cy,cm,cd); if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true}; }else{err=true} } else if (t==4){ // time ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true} } else if (t==5){ // check this 2 if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")]; if(!o1.checked){err=true} } else if (t==6){ // the same if(v!=MM_findObj(a[i+1]).value){err=true} } } else if (!o.type&&o.length>0&&o[0].type=='radio'){ at = a[i].match(/(.*)\[(\d+)\].*/i); o2=(o.length>1)?o[at[2]]:o; if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true} if (t==2){ oo=false; for(j=0;j"+dayarray[day]+" "+montharray[month]+" "+daym+", "+year+"

") }