function HP_Onload() { window.open('http://www.israel21c.org/bin/en.jsp?enPage=FocusPage&enInfolet=referAfriend.jsp','referPopup','left=0,top=0,height=553,width=550'); self.focus(); } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function isEmail(str) { if (str.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true; else return false; } function validate() { if (isEmail(document.Register.Email.value) == false) {window.alert("Please enter a valid email address."); document.Register.Email.focus(); return false;} else { message="Thank you. " + document.Register.Email.value + " was successfully registered to ISRAEL21c."; window.alert(message); return true;} } function send_a_friend() { if (navigator.appName != "Microsoft Internet Explorer") composedURL = "http://www.israel21c.com/script/send_a_friend_net.asp?URL=" + document.URL + "&title=" + document.title; if (navigator.appName == "Microsoft Internet Explorer") composedURL = "http://www.israel21c.com/script/send_a_friend.asp?URL=" + document.URL + "&title=" + document.title; window.open(composedURL,"send_a_friend","height=580,width=520"); } function MM_findObj(n, d) { //v4.0 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 && iDay>0 && iDay<=iDaysInMonth){ if(bConvert){ return new Date(iYear,iMonth-1,iDay); }else return true; }else return false; } } //enUtils construstor function function enUtilsConstrustor() { //is parame set var isSet=function(prm){ var und; return(prm!=und && prm!=null); } this.isSet=isSet; //is parame empty var isEmpty=function(prm){ return(!isSet(prm) || prm==""); } this.isEmpty=isEmpty; //is numeric var isNum=function (v){ if(isEmpty(v))return false; return (v.toString() && !/\D/.test(v)); } this.isNum=isNum; //make sure param is not null or undefined var ntz=function(prm,def){ if(!isSet(def))def=""; return(isEmpty(prm)?def:prm); } this.ntz=ntz; //get object by id var objectOrGetId=function(oElement,type) { if(isEmpty(oElement))return null; type=ntz(type); if(typeof oElement!='object') { switch(type.toLowerCase()) { //when we use names case "img": oElement=document.images[oElement]; break; case "form": oElement=document.forms[oElement]; break; case "id": default: oElement=document.getElementById(oElement); break; } } return oElement; } this.objectOrGetId=objectOrGetId; /* toggle class name of an element params: elmnt - element refrence or id restore - resore orig class (def false) newClassName - class name to assign */ var elmntToggleClass=function (elmnt,restore,newClassName) { elmnt = objectOrGetId(elmnt); if(isEmpty(elmnt))return; if(!isSet(restore))restore=false; //switch (save last state first) var last=elmnt.enLastClassName; elmnt.enLastClassName=elmnt.className; if(restore) { elmnt.className=(isEmpty(last)?"":last); } else elmnt.className=newClassName; } //expose this.elmntToggleClass=elmntToggleClass; /* toggles element's display style - shows or hides the element params: elmnt - element refrence or id show - optional show or hide flag (true (def) / false) hiddenClassName - optional class name to hide element (def 'hiddenEl') */ var elmntShowHide=function (elmnt,show,hiddenClassName) { elmnt = objectOrGetId(elmnt); if(isEmpty(elmnt))return; if(!isSet(hiddenClassName))hiddenClassName="hiddenEl"; var currShown=(elmnt.className!=hiddenClassName); if(!isSet(show))show=(!currShown); if(show==currShown)return; elmntToggleClass(elmnt,show,hiddenClassName); } //expose this.elmntShowHide=elmntShowHide; /* get the nth position of an expression params: text - text to search expr - expression to find n - nth position returns - pos, or -1 if not found */ var getNthIndexOf=function(text,expr,n) { if(isEmpty(text)||isEmpty(expr)||!isNum(n))return -1; var pos=0; var len=expr.length; for(var i=1;i<=n;i++) { pos=text.indexOf(expr,pos+len); if(pos==-1)return -1; } return pos; } this.getNthIndexOf=getNthIndexOf; /* get base url for Calendar from window location for location of http://domain/site/file returns http://domain/site/ params: win - window to examine. optional. if ommited gets the current window */ var getBaseUrlForCalendar=function(win) { var url=isEmpty(win)?window.location.href:win.location.href; var pos=getNthIndexOf(url,"/",4); if(pos==-1)return ""; var newUrl = url.substring(0,pos+1); var index = url.indexOf("/bin/"); if (index != -1) newUrl = newUrl.substring(0,index+1); return newUrl; } this.getBaseUrlForCalendar=getBaseUrlForCalendar; //get selected value of radio buttons group var getRadioValue=function(r){ if(isEmpty(r))return null; r=objectOrGetId(r); //check if an array var len=r.length; if(len>0) { if(r[0].type!="radio")return null; //loop through multiple options for(var intLoop=0;intLoopdaysInMonth)selectedDay=daysInMonth; var k=1; for (var i = j; i-j < daysInMonth; i++){ theDay.options[i] = new Option(k,k); if(k==selectedDay){ theDay.options[i].selected=true; //theDay.options[i].defaultSelected=true; } k++; } }