function PopCenter( w, h) { var x = (screen.width - w) / 2; var y = (screen.height - h) / 2; self.moveTo(x,y); self.resizeTo(w,h); return; } function PopUpWin( uri, name, args, wFocus ) { var k, v; var WinAttr = new Array(); WinAttr['toolbar'] = 'no'; WinAttr['location'] = 'no'; WinAttr['directories'] = 'no'; WinAttr['menubar'] = 'no'; WinAttr['scrollbars'] = 'no'; WinAttr['resizable'] = 'no'; WinAttr['copyhistory'] = 'no'; WinAttr['titlebar'] = 'no'; WinAttr['screenX'] = 1; WinAttr['screenY'] = 1; WinAttr['height'] = screen.height - 2; WinAttr['width'] = screen.width - 2; WinAttr['status'] = 'no'; WinAttr['center'] = 'no'; WinAttr['hcenter'] = 'no'; WinAttr['vcenter'] = 'no'; var argList = args.split(","); for (var i = 0; i < argList.length; i++ ) { k = argList[i].split("="); WinAttr[k[0]] = k[1]; } if (WinAttr['center'] == 'yes' || WinAttr['hcenter'] == 'yes') WinAttr['screenX'] = (screen.width - WinAttr['width']) / 2; if (WinAttr['center'] == 'yes' || WinAttr['vcenter'] == 'yes') WinAttr['screenY'] = (screen.height - WinAttr['height']) / 2; var arg = 'toolbar='+WinAttr['toolbar']+',location='+WinAttr['location']+',directories='+WinAttr['directories']+',menubar='+WinAttr['menubar']+',scrollbars='+WinAttr['scrollbars']+',resizable='+WinAttr['resizable']+',copyhistory='+WinAttr['copyhistory']+',titlebar='+WinAttr['titlebar']+',screenX='+WinAttr['screenX']+',screenY='+WinAttr['screenY']+',height='+WinAttr['height']+',width=' + WinAttr['width']+'status='+WinAttr['status']; var hWindow = window.open( uri, name, arg); if (wFocus) hWindow.focus(); return hWindow; } function fixStyles( container, default_value, style ) { container.style.color = 'black'; container.style.fontStyle = 'normal'; if (style) container.type = style; if (container.value == default_value) container.value = ''; container.select(); } function unfixStyles( container, default_value, style ) { if (container.value == '' || container.value == default_value) { container.style.color = 'grey'; container.style.fontStyle = 'italic'; if (style) container.type = style; container.value = default_value; } } function unfixFuzzyStyles( container, default_value, style ) { if (container.value == '' || container.value == default_value) { container.style.color = 'grey'; container.style.fontStyle = 'italic'; if (style) container.type = style; container.value = default_value; } //else if (container.id == 'lName' || container.id == 'fName') if ((typeof document.getElementById('cCode') == "undefined" || document.getElementById('cCode').value == '') && container.id == 'fName') { var uri = './fuzzy.php?f=' + document.getElementById('fName').value + '&l=' + document.getElementById('lName').value; PopUpWin( uri, 'fuzzy', 'height=10,width=400,center=yes,scrollbars=yes', true ); } } function lagLoad() { // stolen (and adapted) from http://www.digimantra.com/tutorials/sleep-or-wait-function-in-javascript/ var location = document.location.href; var dt = new Date(); dt.setTime(dt.getTime() + 250); while (new Date().getTime() < dt.getTime()); // end steal document.location.href = location; }