var calForm = ""; var calSDay = ""; var calSMonth = "";  childwin = null; var cal_isNetscape = navigator.appName.indexOf("Netscape") != -1; var cal_today = new Date(); var cal_currentDate = cal_today.getDate(); var cal_currentMonth = cal_today.getMonth(); var cal_currentYear = cal_today.getYear(); if (cal_isNetscape) cal_currentYear += 1900; function openCalendar(tform, sday, smonth, e) { self.calForm = tform; self.calSDay = sday; self.calSMonth = smonth; w = screen.width-330; h = screen.height-170; x = e.screenX; y = e.screenY; if(x > w){ x = x-330; } if(y > h){ y = y-170; } var calendarUrl = "calendar.php"; var monthSel = eval("document." + calForm + "." + calSMonth); if (monthSel != null) { var selectedMonthIndex = monthSel.selectedIndex; var month = selectedMonthIndex + 1; var year = cal_currentYear; if (month < cal_currentMonth ) { year = year + 1;} calendarUrl = calendarUrl + "?year=" + year + "&month=" + month;} childwin=window.open(calendarUrl,'Calendar','width=340,height=190,top='+y+',left='+x);} function setDate(day, month, year) { var daySel = eval("document." + calForm + "." + calSDay); daySel.options[day - 1].selected = true; var monthSel = eval("document." + calForm + "." + calSMonth); monthSel.options[month].selected = true; }
function closeMe(){ if (childwin != null){ childwin.close(); childwin = null }} 
function toggleForm(id){ var layer = document.getElementById('form' + id); var form = document.getElementById('tog' + id); var tab = document.getElementById('tab' + id); if (layer.style.display != 'block'){ layer.style.display = 'block';} else { layer.style.display = 'none';}}
function checkEnter(e){ if(e && e.which){ e = e; characterCode = e.which; } else { characterCode = e.keyCode; }
if(characterCode == 13){ document.login_form.pass.value=(hexMD5(document.login_form.pass.value)); document.login_form.submit(); return false; } else { return true; }}
function check_email(email){ var email = email.replace(' ',''); var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(email)){ return true; } else { alert('Please Enter a Valid Email Address'); return false; }}
function just_check_email(email){ var email = email.replace(' ',''); var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(email)){ return true; } else { return false; }}
function echeck(email){ if (document.layers||document.getElementById||document.all) { return check_email(email); } else { return true; }}
function noop(info){ return alert(info) }
allowed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 
function isValid(string,allowed){ for(var i=0; i< string.length; i++){ if(allowed.indexOf(string.charAt(i)) == -1) return false; } return true;}
function check_contents(b){sc=document.f_search.q.value; var yn; var go; if(sc.length == 0){ go=0; yn=0; } else { yn=1; sc = sc.replace('.',''); if(isValid(sc,allowed)) go=1; } if(go == 1 && yn == 1){ document.f_search.submit(); } else if(yn == 0){ noop('There is nothing in the search field'); } else if(go == 0){ noop('Invalid Search'); }}
function showLayer(id){ var lyr = getElemRefs(id); if(lyr && lyr.css) lyr.css.visibility = "visible";}
function hideLayer(id){ var lyr = getElemRefs(id); if(lyr && lyr.css) lyr.css.visibility = "hidden";}
function displayNone(id){ var lyr = getElemRefs(id); if(lyr && lyr.css) lyr.css.display = "none";}
function displayBlock(id){ var lyr = getElemRefs(id); if(lyr && lyr.css) lyr.css.display = "block";}
function getElemRefs(id){ var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null; if (el) el.css = (el.style)? el.style: el; return el;}
function addEngine(name,ext,cat){ if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")){ window.sidebar.addSearchEngine("http://www.iconograms.org/"+name+".src","http://www.iconograms.org/"+name+"."+ext,name,cat);}}
function addBookmark(title, url){ if(typeof window.sidebar == "object" && (typeof window.sidebar.addPanel == "function")){ window.sidebar.addPanel(title, url,""); } else if(document.all){ window.external.Addfavorite(url,title); } else if(window.opera && window.print){ return true; }}
