|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/astrosfm/AAS_meetings/2008_winter/Galveston2008/Program_files/ |
Upload File : |
var windowsInternetExplorer = false;
var browserVersion = 0;
function detectBrowser()
{
windowsInternetExplorer = false;
var appVersion = navigator.appVersion;
if ((appVersion.indexOf("MSIE") != -1) &&
(appVersion.indexOf("Macintosh") == -1))
{
var temp = appVersion.split("MSIE");
browserVersion = parseFloat(temp[1]);
windowsInternetExplorer = true;
}
}
function onPageLoad()
{
detectBrowser();
adjustLineHeightIfTooBig("id1");
adjustFontSizeIfTooBig("id1");
adjustLineHeightIfTooBig("id3");
adjustFontSizeIfTooBig("id3");
adjustLineHeightIfTooBig("id4");
adjustFontSizeIfTooBig("id4");
adjustLineHeightIfTooBig("id6");
adjustFontSizeIfTooBig("id6");
adjustLineHeightIfTooBig("id8");
adjustFontSizeIfTooBig("id8");
adjustLineHeightIfTooBig("id9");
adjustFontSizeIfTooBig("id9");
adjustLineHeightIfTooBig("id10");
adjustFontSizeIfTooBig("id10");
adjustLineHeightIfTooBig("id11");
adjustFontSizeIfTooBig("id11");
adjustLineHeightIfTooBig("id12");
adjustFontSizeIfTooBig("id12");
adjustLineHeightIfTooBig("id13");
adjustFontSizeIfTooBig("id13");
adjustLineHeightIfTooBig("id14");
adjustFontSizeIfTooBig("id14");
adjustLineHeightIfTooBig("id15");
adjustFontSizeIfTooBig("id15");
adjustLineHeightIfTooBig("id16");
adjustFontSizeIfTooBig("id16");
adjustLineHeightIfTooBig("id17");
adjustFontSizeIfTooBig("id17");
adjustLineHeightIfTooBig("id18");
adjustFontSizeIfTooBig("id18");
adjustLineHeightIfTooBig("id19");
adjustFontSizeIfTooBig("id19");
adjustLineHeightIfTooBig("id20");
adjustFontSizeIfTooBig("id20");
adjustLineHeightIfTooBig("id21");
adjustFontSizeIfTooBig("id21");
adjustLineHeightIfTooBig("id22");
adjustFontSizeIfTooBig("id22");
adjustLineHeightIfTooBig("id24");
adjustFontSizeIfTooBig("id24");
adjustLineHeightIfTooBig("id28");
adjustFontSizeIfTooBig("id28");
fixupIEPNG("id2", "Program_files/transparent.gif");
fixupIEPNG("id5", "Program_files/transparent.gif");
fixupIEPNG("id7", "Program_files/transparent.gif");
fixupIEPNG("id23", "Program_files/transparent.gif");
fixupIEPNG("id25", "Program_files/transparent.gif");
fixupIEPNG("id26", "Program_files/transparent.gif");
fixupIEPNG("id27", "Program_files/transparent.gif");
return true;
}
var inImgPropertyChanged = false;
function imgPropertyChanged()
{
if ((window.event.propertyName == "src") && (! inImgPropertyChanged))
{
inImgPropertyChanged = true;
var el = window.event.srcElement;
if (el.src != smallTransparentGif)
{
el.filters.item(0).src = el.src;
el.src = smallTransparentGif;
}
inImgPropertyChanged = false;
}
}
function getParaDescendants(oAncestor)
{
var oParaDescendants = new Array();
var oPotentialParagraphs = oAncestor.getElementsByTagName('DIV');
for (var iIndex=0; iIndex<oPotentialParagraphs.length; iIndex++)
{
var oNode = oPotentialParagraphs.item(iIndex);
if (oNode.className.lastIndexOf('paragraph') != -1)
{
oParaDescendants.push(oNode);
}
}
return oParaDescendants;
}
var MINIMUM_FONT = "10";
var UNITS = "";
function elementFontSize(element)
{
var fontSize = MINIMUM_FONT;
if (document.defaultView)
{
var computedStyle = document.defaultView.getComputedStyle(element, null);
if (computedStyle)
{
fontSize = computedStyle.getPropertyValue("font-size");
}
}
else if (element.currentStyle)
{
fontSize = element.currentStyle.fontSize;
}
if ((UNITS.length == 0) && (fontSize != MINIMUM_FONT))
{
UNITS = fontSize.substring(fontSize.length - 2, fontSize.length)
}
return parseFloat(fontSize);
}
function adjustFontSizeIfTooBig(idOfElement)
{
var oTextBoxOuterDiv;
var oTextBoxMiddleDiv;
var oTextBoxInnerDiv;
var oTextBoxOuterDiv = document.getElementById(idOfElement);
if (oTextBoxOuterDiv)
{
oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
if (oTextBoxMiddleDiv)
{
oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
if (oTextBoxInnerDiv)
{
var offsetHeight = oTextBoxInnerDiv.offsetHeight;
var specifiedHeight = offsetHeight;
if (oTextBoxMiddleDiv.style.height != "")
{
specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
}
else if (oTextBoxOuterDiv.style.height != "")
{
specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
}
if (offsetHeight > specifiedHeight)
{
var smallestFontSize = 200;
var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
var oneLine = false;
for (i = 0; i < aParaChildren.length; i++)
{
var oParagraphDiv = aParaChildren[i];
var lineHeight = elementLineHeight(oParagraphDiv);
oneLine = oneLine || (lineHeight * 1.5 >= specifiedHeight);
if (oParagraphDiv.nodeName == "DIV")
{
var fontSize = elementFontSize(oParagraphDiv);
smallestFontSize = Math.min( smallestFontSize, fontSize );
for (j = 0; j < oParagraphDiv.childNodes.length; j++)
{
var oSpan = oParagraphDiv.childNodes[j];
if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
{
fontSize = elementFontSize(oSpan);
smallestFontSize = Math.min( smallestFontSize, fontSize );
}
}
}
}
var minimum = parseFloat(MINIMUM_FONT);
var count = 0
while ((smallestFontSize > minimum) && (offsetHeight > specifiedHeight) && (count < 10))
{
++ count;
if (oneLine)
{
var oldWidth = parseInt(oTextBoxOuterDiv.style.width);
oTextBoxInnerDiv.style.width =
"" + oldWidth * Math.pow(1.05, count) + "px";
}
else
{
var scale = Math.max(0.95, minimum / smallestFontSize);
for (i = 0; i < aParaChildren.length; i++)
{
var oParagraphDiv = aParaChildren[i];
if (oParagraphDiv.nodeName == "DIV")
{
var paraFontSize = elementFontSize(oParagraphDiv) * scale;
var paraLineHeight = elementLineHeight(oParagraphDiv) * scale;
for (j = 0; j < oParagraphDiv.childNodes.length; j++)
{
var oSpan = oParagraphDiv.childNodes[j];
if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
{
var spanFontSize = elementFontSize(oSpan) * scale;
var spanLineHeight = elementLineHeight(oSpan) * scale;
oSpan.style.fontSize = spanFontSize + UNITS;
oSpan.style.lineHeight = spanLineHeight + UNITS;
smallestFontSize = Math.min( smallestFontSize, spanFontSize );
}
}
oParagraphDiv.style.fontSize = paraFontSize + UNITS;
oParagraphDiv.style.lineHeight = paraLineHeight + UNITS;
smallestFontSize = Math.min( smallestFontSize, paraFontSize );
}
}
}
offsetHeight = oTextBoxInnerDiv.offsetHeight;
}
}
}
}
}
}
function elementLineHeight(element)
{
var lineHeight = MINIMUM_FONT;
if (document.defaultView)
{
var computedStyle = document.defaultView.getComputedStyle(element, null);
if (computedStyle)
{
lineHeight = computedStyle.getPropertyValue("line-height");
}
}
else if (element.currentStyle)
{
lineHeight = element.currentStyle.lineHeight;
}
if ((UNITS.length == 0) && (lineHeight != MINIMUM_FONT))
{
UNITS = lineHeight.substring(lineHeight.length - 2, lineHeight.length)
}
return parseFloat(lineHeight);
}
function adjustLineHeightIfTooBig(idOfElement)
{
var oTextBoxOuterDiv;
var oTextBoxMiddleDiv;
var oTextBoxInnerDiv;
var oTextBoxOuterDiv = document.getElementById(idOfElement);
if (oTextBoxOuterDiv)
{
oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
if (oTextBoxMiddleDiv)
{
oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
if (oTextBoxInnerDiv)
{
var offsetHeight = oTextBoxInnerDiv.offsetHeight;
var specifiedHeight = offsetHeight;
if (oTextBoxMiddleDiv.style.height != "")
{
specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
}
else if (oTextBoxOuterDiv.style.height != "")
{
specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
}
if (offsetHeight > specifiedHeight)
{
var adjusted = true;
var count = 0;
while ((adjusted) && (offsetHeight > specifiedHeight) && (count < 10))
{
adjusted = false;
++ count;
var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
for (i = 0; i < aParaChildren.length; i++)
{
var oParagraphDiv = aParaChildren[i];
if (oParagraphDiv.nodeName == "DIV")
{
var fontSize = elementFontSize(oParagraphDiv);
var lineHeight = elementLineHeight(oParagraphDiv) * 0.95;
if (lineHeight >= (fontSize * 1.1))
{
oParagraphDiv.style.lineHeight = lineHeight + UNITS;
adjusted = true;
}
for (j = 0; j < oParagraphDiv.childNodes.length; j++)
{
var oSpan = oParagraphDiv.childNodes[j];
if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
{
var fontSize = elementFontSize(oSpan);
var lineHeight = elementLineHeight(oSpan) * 0.95;
if (lineHeight >= (fontSize * 1.1))
{
oSpan.style.lineHeight = lineHeight + UNITS;
var adjusted = true;
}
}
}
}
}
offsetHeight = oTextBoxInnerDiv.offsetHeight;
}
}
}
}
}
}
function getChildOfType(oParent, sNodeName, requestedIndex)
{
var childrenOfType = oParent.getElementsByTagName(sNodeName);
return (requestedIndex < childrenOfType.length) ?
childrenOfType.item(requestedIndex) : null;
}
var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif)
{
smallTransparentGif = transparentGif;
if (windowsInternetExplorer && (browserVersion < 7))
{
var img = document.getElementById(strImageID);
if (img)
{
var src = img.src;
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
img.src = transparentGif;
img.attachEvent("onpropertychange", imgPropertyChanged);
}
}
}