function toggleDivs(containerDiv,toggleDiv) { if (containerDiv == "blog_components_top") { containerDiv = "blog_nav"; } containerDiv = "div."+containerDiv; $(containerDiv).each(function(index) { if ($(this).attr('id') != toggleDiv) $(this).hide(); }); toggleDiv = "div#"+toggleDiv; $(toggleDiv).toggle(); } // end function --------------------------------- function numbersonly(myfield, e, dec) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); // control keys if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) return true; // numbers else if ((("0123456789").indexOf(keychar) > -1)) return true; // decimal point jump else if (dec && (keychar == ".")) { myfield.form.elements[dec].focus(); return false; } else return false; } // end function --------------------------------- function addFavorite(){ browserName = navigator.appName; browserVer = parseInt(navigator.appVersion); if(browserName == "Microsoft Internet Explorer" && browserVer >= 4){ var curPage = 'http://www.compassemp.com'; window.external.AddFavorite(curPage, 'Compass EMP Funds - Brentwood, TN'); } else alert("[Sorry]\n\nThis does not work in your browser"); } function printPage(){ if (window.print) { window.print(); } else alert("[Sorry]\n\nThis does not work in your browser"); } function resizeImg(newWindow,img) { if (navigator.appName=='Netscape') {newWindow.window.resizeTo((img.width+20),(img.height+20)); } else newWindow.window.resizeTo((img.width+30),(img.height+55)); if (img.complete==true) { clearInterval(timeID); } } function expandInfo(whichElement){ document.getElementById(whichElement).style.display = (document.getElementById(whichElement).style.display == 'block' ) ? 'none' : 'block'; } function openWindow(page) { temp=new Image(); temp.src=page; newWindow = window.open(page,"title","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=100,left=50,marginwidth=0,topmargin=0,width=200,height=200"); timeID=setInterval("resizeImg(newWindow,temp)",150); newWindow.window.focus(); } function goURL(thisURL,thisWIDTH,thisHEIGHT) { APopupWindow = window.open(thisURL,"APopupWindow",'toolbar=no,width='+thisWIDTH+',height='+thisHEIGHT+',directories=0,status=0,resizable=1,menubar=0,scrollbars=1'); } // IE 6 hack to allow copy/paste DO NOT REMOVE! if (window.createPopup && document.compatMode && document.compatMode=="CSS1Compat") { document.onreadystatechange = onresize = function fixIE6AbsPos() { if (!document.body) return; if (document.body.style.margin != "0px") document.body.style.margin = 0; onresize = null; document.body.style.height = 0; setTimeout(function(){ document.body.style.height = document.documentElement.scrollHeight+'px'; }, 1); setTimeout(function(){ onresize = fixIE6AbsPos; }, 100); } }