
function getElement(elementId)
{if(elementId!="")
{return document.getElementById(elementId);}}
var glassElement=getElement("glassPane");var shadedElement=getElement("shadedPane");var IE=document.all?true:false;var shaderEnabled=false;var windowWidth="";var windowHeight="";var windowTop="";var windowLeft="";addLoadEvent(init);addResizeEvent(setOldPhotoPositions);addScrollEvent(updateShadedPopupPosition);function init()
{setOldPhotoPositions();}
function setOldPhotoPositions()
{var oldPhoto1=getElement("oldPhoto1");var oldPhoto2=getElement("oldPhoto2");var oldPhoto3=getElement("oldPhoto3");var windowWidth=getWindowWidth();var minX=972;var oldPhoto1X=windowWidth-getWidth(oldPhoto1);var oldPhoto2X=windowWidth-getWidth(oldPhoto2);var oldPhoto3X=windowWidth-getWidth(oldPhoto3);if(oldPhoto1X<minX){oldPhoto1X=minX;}
if(oldPhoto2X<minX){oldPhoto2X=minX;}
if(oldPhoto3X<minX){oldPhoto3X=minX;}
setElementX(oldPhoto1,oldPhoto1X-20);setElementY(oldPhoto1,30);setElementX(oldPhoto2,oldPhoto2X-20);setElementY(oldPhoto2,240);setElementX(oldPhoto3,oldPhoto3X-10);setElementY(oldPhoto3,445);}
function addLoadEvent(func)
{var oldonload=window.onload;if(typeof window.onload!='function')
{window.onload=func;}
else
{window.onload=function()
{if(oldonload)
{oldonload();}
func();}}}
function addResizeEvent(func)
{var oldEvent=window.onresize;if(typeof window.onresize!='function')
{window.onresize=func;}
else
{window.onresize=function()
{if(oldEvent)
{oldEvent();}
func();}}}
function addScrollEvent(func)
{var oldEvent=window.onscroll;if(typeof window.onscroll!='function')
{window.onscroll=func;}
else
{window.onscroll=function()
{if(oldEvent)
{oldEvent();}
func();}}}
function getTagGroup(elementTag,regExp)
{var tagArray=document.getElementsByTagName(elementTag);var elementArray=new Array();for(ctr=0;ctr<tagArray.length;ctr++)
{if((tagArray[ctr].id).search(regExp)!=-1)
{if(elementArray.length>0)
{elementArray=elementArray.concat(new Array(tagArray[ctr]));}
else
{elementArray=new Array(tagArray[ctr]);}}}
return elementArray;}
function imageViewPopup(imageUrl)
{shadePageBackground("#000000",55);glassElement=getElement("glassPane");glassElement.style.display="none";var content;content="<table cellpadding=\"0\" cellspacing=\"0\">";content=content+"<tr><td ></td><td>";content=content+" <div style=\"background-color: #D0C3AA; padding: 5px\">";content=content+"  <div stlye=\"padding: 3px 15px 3px 15px; \" align=\"right\">";content=content+"   <input type=\"button\" value=\"Close\" onclick=\"restorePageBackground();\">";content=content+"  </div>";content=content+"  <div style=\"margin: 10px; padding: 15px; border: solid; border-width: 1px; border-color: #AAAAAA; background-color: #FFFFFF;\" align=\"center\">";content=content+"   <img src=\""+imageUrl+"\">";content=content+"  </div>";content=content+" </div>";content=content+"</td><td ></td></tr>";content=content+"</table>";glassElement.innerHTML=content;glassElement.style.display="block";updateShadedPopupPosition();setTimeout("updateShadedPopupPosition()",1000);}
function shadePageBackground(shadeColor,shadeOpacity)
{shadedElement=getElement("shadedPane");if(shadedElement)
{shaderEnabled=true;if(parseInt(navigator.appVersion)>3)
{if(!IE)
{windowWidth=window.innerWidth+20+"px";windowHeight=window.innerHeight+300+"px";}
else
{windowWidth=document.body.offsetWidth+20;windowHeight=document.body.offsetHeight+300;}
windowTop=document.body.scrollTop;windowLeft=document.body.scrollLeft;}
shadedElement.style.top=windowTop;shadedElement.style.left=0;shadedElement.style.width=windowWidth;shadedElement.style.height=windowHeight;shadedElement.style.backgroundColor="#000000";shadedElement.style.filter="alpha(opacity="+shadeOpacity+");";shadedElement.style.MozOpacity=shadeOpacity/100;shadedElement.style.display="block";}
else
{alert("ERROR brdApiPopup >> shadePageBackground(shadedElement, shadeColor, shadeOpacity):\n- shadedElement is undefined.");}}
function restorePageBackground()
{shadedElement.style.display="none";glassElement.style.display="none";shaderEnabled=false;}
function updateShadedPopupPosition()
{var glassElement=getElement("glassPane");if(glassElement)
{glassElement.style.left=(getWindowWidth()/2)-(getWidth(glassElement)/2)+"px";glassElement.style.top=(getWindowHeight()/2)-(getHeight(glassElement)/2)+getPageYOffset()+"px";}
else
{alert("ERROR brdApiPopup >> updateShadedPopupPosition():\n- glassElement is undefined.");}}
function getWidth(element)
{return element.clientWidth;}
function getHeight(element)
{return element.clientHeight;}
function getElementX(contentElement)
{var iReturnValue=0;while(contentElement!=null)
{iReturnValue+=contentElement.offsetLeft;contentElement=contentElement.offsetParent;}
return iReturnValue;}
function getElementY(contentElement)
{var iReturnValue=0;while(contentElement!=null)
{iReturnValue+=contentElement.offsetTop;contentElement=contentElement.offsetParent;}
return iReturnValue;}
function setElementX(element,posXValue)
{element.style.left=posXValue+"px";}
function setElementY(element,posYValue)
{element.style.top=posYValue+"px";}
function getWindowWidth()
{var myWidth=0;if(typeof(window.innerWidth)=="number")
{myWidth=window.innerWidth;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{myWidth=document.documentElement.clientWidth;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{myWidth=document.body.clientWidth;}
return myWidth;}
function getWindowHeight()
{var myHeight=0;if(typeof(window.innerWidth)=="number")
{myHeight=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{myHeight=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{myHeight=document.body.clientHeight;}
return myHeight;}
function getPageYOffset()
{var ScrollTop=document.body.scrollTop;if(ScrollTop==0)
{if(window.pageYOffset)
ScrollTop=window.pageYOffset;else
ScrollTop=(document.body.parentElement)?document.body.parentElement.scrollTop:0;}
return ScrollTop;}
function getPageXOffset()
{var ScrollTop=document.body.scrollLeft;if(ScrollTop==0)
{if(window.pageXOffset)
ScrollTop=window.pageXOffset;else
ScrollTop=(document.body.parentElement)?document.body.parentElement.scrollLeft:0;}
return ScrollTop;}
function setNavigationBtnActions()
{var navLinks=getTagGroup("div","navLink");var navLinkElement="";if(navLinks.length>0)
{for(ctr=0;ctr<navLinks.length;ctr++)
{navLinkElement=navLinks[ctr];navLinkElement.onmouseover=function()
{this.style.cursor="pointer";this.className="navigationBtnHover";}
navLinkElement.onmouseout=function()
{this.style.cursor="";this.className="navigationBtn";}
navLinkElement.onclick=function()
{document.location.href=getElement(this.id+"Url").value;}}}}
function clearTextarea(element,defaultText)
{if(element.value==defaultText)
{element.value="";}}
function enlargeImage(imageElement)
{if(imageElement)
{var imageUrl=imageElement.src;imageViewPopup(imageUrl)}}