function showCell(cell, visible){ var item = document.getElementById(cell); if(item!=null){ item.style.display = (visible?"":"none"); } else { alert(cell + " not found"); }}function setCellHtml(cell, html){ if(html==""){ document.getElementById(cell).style.display = "none"; } else { document.getElementById(cell).style.display = ""; document.getElementById(cell).innerHTML = html; }}function isCellActive(cell){ var cellObject = document.getElementById(cell); return cellObject==null || cellObject.style.display == "";}function makeRequest(url){ var req=false; var returnValue = ""; if(window.XMLHttpRequest) { try { req = new XMLHttpRequest(); } catch(e) { req = false; } } else if(window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; }} } if(req){ req.open("GET", url, false); req.send(""); if (req.readyState==4) { returnValue = req.responseText; } } return returnValue;} function formatNumber(number, pattern, decSep){ var returnValue = ""; if(decSep==null) decSep = "."; var numberSplit = (number+"").split(decSep); var patternSplit = pattern.split(decSep); var integer = formatInteger(numberSplit[0], patternSplit[0]); var fraction = ""; if(patternSplit.length>1){ if(numberSplit.length>1){ fraction = formatFraction(numberSplit[1], patternSplit[1]); } else { fraction = formatFraction(0, patternSplit[1]); } } if(patternSplit.length==1){ returnValue = integer; } else { returnValue = integer + decSep + fraction; } return returnValue;}function formatInteger( integer, pattern ){ var result = ''; integerIndex = integer.length - 1; patternIndex = pattern.length - 1; while ( (integerIndex >= 0) && (patternIndex >= 0) ){ var digit = integer.charAt( integerIndex ); integerIndex--; if ( (digit < '0') || (digit > '9') ) continue; while ( patternIndex >= 0 ){ var patternChar = pattern.charAt( patternIndex ); patternIndex--; if ( patternChar == '#' || patternChar == '0' ){ result = digit + result; break; }else{ result = patternChar + result; } } } if(pattern.indexOf('0')>-1 && patternIndex>pattern.indexOf('0')){ while ( patternIndex >= pattern.indexOf('0')){ var patternChar = pattern.charAt( patternIndex ); patternIndex--; if ( patternChar == '#'){ result = "0" + result }else{ result = patternChar + result; } } } return result;}function formatFraction( fraction, pattern ){ var result = ''; fraction = (("0." + fraction)-0).toFixed(pattern.lastIndexOf('0')>=0?Math.max(pattern.lastIndexOf('0')+1,fraction.length) :fraction.length)-0+""; fractionIndex = Math.min(fraction.length-1, 2); patternIndex = 0; while ( (fractionIndex < fraction.length) && (patternIndex < pattern.length) ){ var digit = fraction.charAt( fractionIndex ); fractionIndex++; if ( (digit < '0') || (digit > '9') ) continue; while ( patternIndex < pattern.length ){ var patternChar = pattern.charAt( patternIndex ); patternIndex++; if ( patternChar == '#' || patternChar == '0' ){ result = result + digit; break; }else{ result = result + patternChar; } } } if(patternIndex<=pattern.lastIndexOf('0')){ while ( patternIndex <= pattern.lastIndexOf('0')){ var patternChar = pattern.charAt( patternIndex ); patternIndex++; if ( patternChar == '#' || patternChar == '0'){ result = result + "0"; }else{ result = result + patternChar; } } } return result;}function imageError(image){ if(image.title==''){ image.title='No image found'; image.src='/Stein/images/stein_site_graphics/no_image.gif'; image.width='0'; }}function resize(image, maxWidth, maxHeight){var widthDif = image.width - maxWidth;var heightDif = image.height - maxHeight;if(widthDif>0 && widthDif>heightDif){image.width = maxWidth;} else if(heightDif>0 && heightDif>widthDif){image.height = maxHeight;}}function resizeByHalf(image, maxWidth, maxHeight){var widthDif = image.width - maxWidth;var heightDif = image.height - maxHeight;if(widthDif>0 || heightDif>0){image.width = image.width / 2;resizeByHalf(image, maxWidth, maxHeight);}}