
﻿ var Project=Class.create();Project.prototype={initialize:function(data1,data2,data3,data4,data5,data6,data7,data8,oSummary,oImageType,oLeed,oArchitectCredit,image1Path,image2Path,image3Path,image4Path,image5Path){this.id=data1.strip();this.practiceAreaId=data2.strip();this.areaId=data3.strip();this.subAreaId=data4.strip();this.itemId=data5.strip();this.name=data6.strip();this.location=data7.strip();this.description=data8;this.summary=oSummary;this.leed=oLeed;this.architectCredit=oArchitectCredit;this.path=image1Path;this.images=[];var i=0;if(image1Path!=null){this.images[i]=image1Path;i++;}
if(image2Path!=null){this.images[i]=image2Path;i++;}
if(image3Path!=null){this.images[i]=image3Path;i++;}
if(image4Path!=null){this.images[i]=image4Path;i++;}
if(image5Path!=null){this.images[i]=image5Path;i++;}
this.imageType=oImageType;},mainPageThumbnail:function(){var mpt=(this.path!=null)?this.path.gsub('.jpg','____.jpg'):'';return mpt;},mainPageDetailImage:function(){var mpt=(this.path!=null)?this.path.gsub('.jpg','___.jpg'):'';return mpt;},projectPageThumbnail:function(imageNumber){var mpt=(this.images[imageNumber]!=null)?this.images[imageNumber].gsub('.jpg','__.jpg'):'';return mpt;},projectPageDetailImage:function(imageNumber){var mpt=(this.images[imageNumber]!=null)?this.images[imageNumber].gsub('.jpg','_.jpg'):'';return mpt;}}
var LocationItem=Class.create();LocationItem.prototype={initialize:function(data1,data2,data3,data4,data5,oAddress,oPhoneNumbers,oImagePath,oLeftPosition,oTopPosition,lng,lat,cName,cTitle,cEmail,cImage,oTitle,oAirport){this.name=data1;this.type=data2;this.id=data3;this.country=data4;this.province=data5;this.address=oAddress;this.phoneNumbers=oPhoneNumbers;this.officeImage=oImagePath;this.officeLeft=oLeftPosition;this.officeTop=oTopPosition;this.latitude=parseFloat(lat);this.longitude=parseFloat(lng);this.contactName=cName;this.contactTitle=cTitle;this.contactEmail=cEmail;this.officeTitle=oTitle;this.contactImage=cImage;this.airport=oAirport;}}
var NewsReleaseItem=Class.create();NewsReleaseItem.prototype={initialize:function(oId,oTitle,oDate,oDescription,oArchived,oImagePath,oLeftValue,oItemNumber){this.id=oId;this.title=oTitle;this.description=oDescription;this.date=oDate;this.archived=oArchived;this.imagePath=oImagePath;this.leftValue=oLeftValue;this.itemNumber=oItemNumber;}}
var AnnouncementItem=Class.create();AnnouncementItem.prototype={initialize:function(oId,oTitle,oDate,oDescription,oArchived,oImagePath){this.id=oId;this.title=oTitle;this.description=oDescription;this.date=oDate;this.archived=oArchived;this.imagePath=oImagePath;}}
var ContentItem=Class.create();ContentItem.prototype={initialize:function(oId,oTitle,oSubTitle,oText1){this.id=oId;this.title=oTitle;this.description=oText1;this.subtitle=oSubTitle;}}
var IRContentItem=Class.create();IRContentItem.prototype={initialize:function(oId,oTitle,oText1,oText2,oText3,oIsHTML){this.id=oId;this.title=oTitle;this.text1=oText1;this.text2=oText2;this.text3=oText3;this.isHTML=oIsHTML;}}
var IRLocationItem=Class.create();IRLocationItem.prototype={initialize:function(oId,oLeftPosition){this.id=oId;this.leftPosition=oLeftPosition;}}
var ContentLinkItem=Class.create();ContentLinkItem.prototype={initialize:function(oId,oLeftPosition){this.id=oId;this.leftPosition=oLeftPosition;}}
var TestimonialItem=Class.create();TestimonialItem.prototype={initialize:function(oId,oName,oTitle,oAnswer1,oAnswer2,oAnswer3,oAnswer4,oAnswer5,oAnswer6,oAnswer7,oAnswer8,oAnswer9,oLargeImage,thumbnailImage){this.id=oId;this.name=oName;this.title=oTitle;this.answer1=oAnswer1;this.answer2=oAnswer2;this.answer3=oAnswer3;this.answer4=oAnswer4;this.answer5=oAnswer5;this.answer6=oAnswer6;this.answer7=oAnswer7;this.answer8=oAnswer8;this.answer9=oAnswer9;this.thumbnail=thumbnailImage;this.largeImage=oLargeImage;}}
var SectorItem=Class.create();SectorItem.prototype={initialize:function(oId,oName){this.id=oId;this.name=oName;}}
var ServiceItem=Class.create();ServiceItem.prototype={initialize:function(oId,oName){this.id=oId;this.name=oName;}}
var PageContent=Class.create();PageContent.prototype={initialize:function(data1,data2,data3,data4,data5,data6,data7){this.id=data1.strip();this.practiceAreaId=data2.strip();this.areaId=data3.strip();this.subAreaId=data4.strip();this.itemId=data5.strip();this.title=data6.strip();this.description=data7.strip();}}
var AboutContent=Class.create();AboutContent.prototype={initialize:function(oId,oTitle,oDescription,ofilePath,ofilePath2,ofilePath3){this.id=oId;this.title=oTitle;this.description=oDescription;this.imagePath=ofilePath;this.imagePath2=ofilePath2;this.imagePath3=ofilePath3;}}
var AwardLinkItem=Class.create();AwardLinkItem.prototype={initialize:function(oYear,oLeft){this.left=oLeft;this.year=oYear;}}
var AwardContentItem=Class.create();AwardContentItem.prototype={initialize:function(oId,oProjectName,oYear,oPlace,oAwardSubmission,oAwardName,oSponsoringOrg,oAssociateArchitect){this.id=oId;this.projectname=oProjectName;this.year=oYear;this.place=oPlace;this.awardsubmission=oAwardSubmission;this.awardname=oAwardName;this.sponsoringorg=oSponsoringOrg;this.associatearchitect=oAssociateArchitect;}}
var ECContentItem=Class.create();ECContentItem.prototype={initialize:function(oName,oDate,oType,oList){this.name=oName;this.date=oDate;this.type=oType;this.list=oList;}}
var FRDocumentItem=Class.create();FRDocumentItem.prototype={initialize:function(oTitle,oFile,oYear,oIndent){this.title=oTitle;this.filepath=oFile;this.year=oYear;this.indent=oIndent;}}
var FAQItem=Class.create();FAQItem.prototype={initialize:function(oQuestion,oAnswer){this.question=oQuestion;this.answer=oAnswer;}}
var DocumentItem=Class.create();DocumentItem.prototype={initialize:function(oTitle,oFile){this.title=oTitle;this.filepath=oFile;}}
var YearItem=Class.create();YearItem.prototype={initialize:function(oId,oName){this.id=oId;this.name=oName;}}
var ImageItem=Class.create();ImageItem.prototype={initialize:function(oId,oTitle,oThumbnail,oLargeImage){this.id=oId;this.title=oTitle;this.thumbnail=oThumbnail;this.largeImage=oLargeImage;}}
var AcquisitionItem=Class.create();AcquisitionItem.prototype={initialize:function(oName,oLocation,oDate,oSegments){this.name=oName;this.location=oLocation;this.date=oDate;this.segments=oSegments;}}
var ApplicationTipItem=Class.create();ApplicationTipItem.prototype={initialize:function(oNumber,oQuestion,oAnswer){this.number=oNumber;this.question=oQuestion;this.answer=oAnswer;}}
var SystemContentItem=Class.create();SystemContentItem.prototype={initialize:function(oTitle,oContent){this.title=oTitle;this.content=oContent;}}
function getFullDateString(date){var dateArray=date.split("/");var year=dateArray[2].substring(0,4);var date=dateArray[1];var month=parseInt(dateArray[0]);var monthName=(month==1)?'January':(month==2)?'February':(month==3)?'March':(month==4)?'April':(month==5)?'May':(month==6)?'June':(month==7)?'July':(month==8)?'August':(month==9)?'September':(month==10)?'October':(month==11)?'November':'December';return monthName+' '+date+', '+year;}
var DirectorItem=Class.create();DirectorItem.prototype={id:null,name:null,position:null,title:null,location:null,description:null,smallImage:null,largeImage:null,initialize:function(id,name,title,position,location,description,smallImage,largeImage){this.id=id;this.name=name;this.title=title;this.position=position;this.location=location;this.description=description;this.smallImage=smallImage;this.largeImage=largeImage;}}
var GovernanceItem=Class.create();GovernanceItem.prototype={text:null,description:null,initialize:function(text,description){this.text=text;this.description=description;}}
function getFirstChildNodeValue(listItem,id){var nv=listItem.getElementsByTagName(id)[0];if(nv==null){return"";}
else{var curValue='';if(nv.firstChild!=null)
{var i=0;while(i<nv.childNodes.length)
{curValue+=nv.childNodes[i].nodeValue;i++;}}
return curValue;}}
﻿Event.observe(window,'load',function(){var hnp=$('headerNavPanel');Event.observe(hnp,'mouseover',moNav,false);Event.observe(hnp,'mouseout',moNav,false);Event.observe(hnp,'click',clickNav,false);var searchButton=$('searchButton');if(searchButton){Event.observe(searchButton,'mouseover',moButton,false);Event.observe(searchButton,'mouseout',moButton,false);}
var searchButton=$('homeButton');if(searchButton){Event.observe(searchButton,'mouseover',moButton,false);Event.observe(searchButton,'mouseout',moButton,false);}
var hl=$('headerLogo');if(hl!=null)
Event.observe(hl,'click',goHome,false);});function goHome(e){document.location.href='default.htm';}
var scrolling=false;function moButton(e){var item=(e.fromElement!=null)?e.fromElement:e.target;if(item.id=='')
item=(e.toElement!=null)?e.toElement:e.rangeParent;if(item.id=='searchButton'){item.src=(e.type=='mouseover')?'../images/button_find_hover.gif':'../images/button_find.gif';}
else if(item.id=='homeButton'){item.src=(e.type=='mouseover')?'../images/homebuttonhover.gif':'../images/homebutton.gif';}}
function moNavPanel(e){var item=(e.fromElement!=null)?e.fromElement:e.target;var toElement=(e.toElement!=null)?e.toElement:e.rangeParent;if((toElement!=null)&&(toElement.id!=null)&&(toElement.id.indexOf('headerNavPanel')>-1)){return;}
if((item.id=='headerNavPanel')&&(toElement.id.indexOf('hnp')==-1)){if(!scrolling){scrolling=true;var navPanel=$('headerNavPanel');if(navPanel.style.left!='-680px'){navPanel.morph({left:'-680px'},{duration:1.2,queue:{scope:'hnScope',position:'with-last'}});$('hnpControl').src='../images/buttons/npcLeft.png';}
scrolling=false;}}}
function moNav(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if((item.id=='headerNavPanel')||(item.id=='hnpControl'))return;var itemId=parseInt(item.id.gsub('hnpItemLabel',''));var itemSet=(itemId<=5)?'ms':(itemId<=8)?'cin':'la';var hnpItem=$('hnpItem'+itemId);var replaceImg,origImg;if(itemSet=='ms'){replaceImg=(item.className=='activeNavLabel')?'../images/buttons/navBoxBlue.gif':'../images/buttons/navBoxBlueHover.gif';origImg=(item.className=='activeNavLabel')?'../images/buttons/navBoxBlueHover.gif':'../images/buttons/navBoxBlue.gif';}
else if(itemSet=='cin'){replaceImg=(item.className=='activeNavLabel')?'../images/buttons/navBoxRed.gif':'../images/buttons/navBoxRedHover.gif';origImg=(item.className=='activeNavLabel')?'../images/buttons/navBoxRedHover.gif':'../images/buttons/navBoxRed.gif';}
else if(itemSet=='la'){replaceImg=(item.className=='activeNavLabel')?'../images/buttons/navBoxOrange.gif':'../images/buttons/navBoxOrangeHover.gif';origImg=(item.className=='activeNavLabel')?'../images/buttons/navBoxOrangeHover.gif':'../images/buttons/navBoxOrange.gif';}
if(item.id.indexOf('hnpItemLabel')>-1){if(!item.id.gsub)
return;var id=item.id.gsub('hnpItemLabel','');if(itemSet=='ms'){hnpItem.src=(e.type=='mouseover')?replaceImg:origImg;item.style.color=(e.type=='mouseover')?'#6699cc':'#00457C';}
else if(itemSet=='cin'){hnpItem.src=(e.type=='mouseover')?replaceImg:origImg;item.style.color=(e.type=='mouseover')?'#ff0033':'#840c2c';}
else if(itemSet=='la'){hnpItem.src=(e.type=='mouseover')?replaceImg:origImg;item.style.color=(e.type=='mouseover')?'#ff6600':'#EAA758';}}}
function clickNav(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if((item.id=='hnpControl')||(item.id=='headerNavPanel'))return;var curId=(item.id!=null)?item.id.substring(item.id.length-1,item.id.length):0;switch(curId){case'6':document.location.href='careers.html';break;case'7':document.location.href='investorrelations.html';break;case'8':document.location.href='news.html';break;case'9':document.location.href='locationmap.html';break;case'0':document.location.href='aboutus.html';break;default:document.location.href='marketsector.html?paid='+curId;break;}}
var cScroller,pScroller;function showContactPanel(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if((item.id=='footerLinks')||(item.id=='portalsLink'))return;var dhp=$('detailHoverPanel');if((item.id=='privacyLink')||(item.id=='copyrightLink')){if(sysItems.length==0){getPrivacyPolicy();}}
if(item.id=='homeLink'){document.location.href='default.htm';return;}
else if((item.id=='privacyLink')||(item.id=='privacyPolicyLink')){if(dhp.style.top=='26px')
$('dhpTextPanelWrapper').morph({top:'-430px'},{duration:0.8,queue:{scope:'showScope',position:'end'}});else
$('dhpTextPanelWrapper').style.top='-430px';if(pScroller==null)
pScroller=new Control.Scroller($('privacyContent'),$('pccHandle'),$('pccTrack'),{visibleHeight:335,delta:5});pScroller.slider.setValue(0,0);}
else if((item.id=='contactUsPanelLink')||(item.id=='contactUsLink')){if(dhp.style.top=='26px')
$('dhpTextPanelWrapper').morph({top:'-860px'},{duration:0.8,queue:{scope:'showScope',position:'end'}});else
$('dhpTextPanelWrapper').style.top='-860px';}
else if(item.id=='copyrightLink'){if(dhp.style.top=='26px')
$('dhpTextPanelWrapper').morph({top:'0px'},{duration:0.8,queue:{scope:'showScope',position:'end'}});else
$('dhpTextPanelWrapper').style.top='0px';if(cScroller==null)
cScroller=new Control.Scroller($('copyrightContent'),$('cccHandle'),$('cccTrack'),{visibleHeight:335,delta:5});cScroller.slider.setValue(0,0);}
if(dhp.style.top!='26px'){dhp.morph({top:'26px'},{duration:0.8,queue:{scope:'showScope',position:'end'}});$('dhpCover').style.left='0px';}}
function moFooterLinks(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if(item.id=='')return;if(item.id=='footerLinks')return;item.style.color=(e.type=='mouseover')?'#EAA758':(item.id=='privacyPolicyLink')?'blue':'#AFAFAF';}
function closeContactWindow(){var dhp=$('detailHoverPanel');if(dhp.style.top=='26px'){dhp.morph({top:'1030px'},{duration:0.7,queue:{scope:'showScope',position:'end'}});$('dhpCover').style.left='1030px';}}
Event.observe('searchButton','click',searchSubmit,false);Event.observe('homeButton','click',homeSubmit,false);function searchSubmit(){var searchText=document.getElementById('searchInput').value;if(searchText!='')
{document.location.href="sitesearch.html?s="+searchText;}
return false;}
function homeSubmit(){document.location.href="/default.htm";}
function mo_ContactClose(e){var item=(e.srcElement!=null)?e.srcElement:e.target;item.style.color=(e.type=='mouseover')?'#00457C':'#fff';}
function mo_ContactSubmit(e){var item=(e.srcElement!=null)?e.srcElement:e.target;item.style.color=(e.type=='mouseover')?'#00457c':'#fff';}
function submitContactForm(e){var item=(e.srcElement!=null)?e.srcElement:e.target;var subject=$('cfSubject');var firstName=$('cfFirstName');var lastName=$('cfLastName');var email=$('cfEmail');var city=$('cfCity');var province=$('cfProvince');var ms=$('cfMarketSector');var marketsectorValue=(ms!=null)?ms.value:'';var gs=$('cfSubject');var generalSubjectValue=(gs!=null)?gs.value:'';var feedback=$('cfFeedback');if((subject.value!='')&&(firstName.value!='')&&(lastName.value!='')&&(email.value!='')&&(city.value!='')&&(province.value!='')&&((marketsectorValue!='')||(generalSubjectValue!=''))&&(feedback.value!='')){var itemId=item.id;var toField='';var subjectValue=subject.value.stripScripts().stripTags();var firstNameValue=firstName.value.stripScripts().stripTags();var lastNameValue=lastName.value.stripScripts().stripTags();var emailValue=email.value.stripScripts().stripTags();var cityValue=city.value.stripScripts().stripTags();var provinceValue=province.value.stripScripts().stripTags();var feedbackValue=feedback.value.stripScripts().stripTags();if(!validEmail(emailValue)){alert('Invalid Email address. Please enter a valid email address.');return;}
var qs='';if((ms==null)||((subject.style.left=='148px')&&(generalSubjectValue!=''))){toField='info@stantec.com';qs='subject='+generalSubjectValue+'&firstName='+firstNameValue+'&lastName='+lastNameValue+'&from='+emailValue+'&city='+cityValue+'&province='+provinceValue+'&marketsector='+generalSubjectValue+'&feedback='+feedbackValue+'&to='+toField;}
else if((ms!=null)&&(ms.style.left=='148px')&&(marketsectorValue!='')){toField='askstantec@stantec.com';qs='subject='+marketsectorValue+'&firstName='+firstNameValue+'&lastName='+lastNameValue+'&from='+emailValue+'&city='+cityValue+'&province='+provinceValue+'&marketsector='+marketsectorValue+'&feedback='+feedbackValue+'&to='+toField;}
if(qs==''){alert('Please complete all fields in this form.');return;}
var opt={method:'post',onSuccess:handleSubmitContactForm,on404:handleError,onFailure:handleError};new Ajax.Request('xmlQuery/contact/contactus.aspx?'+qs,opt);}
else{alert('Please complete all fields in this form.');}}
function validEmail(email){var atSign=email.indexOf("@")
var period=email.lastIndexOf(".")
var result=false;if((email=="")||(atSign==-1)||(period==-1)||(atSign==0))
return false;if((atSign>period)||(period-atSign==1)||(period==(email.length-1))){return false;}
if((email.indexOf("#")>-1)||(email.indexOf("!")>-1)||(email.indexOf("$")>-1)||(email.indexOf("%")>-1)||(email.indexOf("^")>-1)||(email.indexOf("&")>-1)||(email.indexOf("*")>-1)||(email.indexOf("?")>-1)||(email.indexOf(" ")>-1)||(email.indexOf("+")>-1)||(email.indexOf(";")>-1))
return false;return true;}
var handleSubmitContactForm=function(req){var data=(req.responseText.indexOf('Success')>-1);finishSubmitEmail(data,req.responseText);}
function finishSubmitEmail(result,errorMsg){if(result){alert('Thank you for your message.');new Effect.Event({queue:{position:'end',scope:'showScope'},beforeUpdate:function(){$('cfFirstName').value='';$('cfLastName').value='';$('cfEmail').value='';$('cfCity').value='';$('cfProvince').value='';if($('cfMarketSector')!=null)
$('cfMarketSector').selectedIndex=0;$('cfSubject').selectedIndex=0;$('cfFeedback').value='';}});closeContactWindow();}
else{alert('Please verify your email address. ');}}
var sysItems=[];var sysLink='';function getSystemContent(dest){var opt={method:'post',onSuccess:handleGetSystemContent,on404:handleError,onFailure:handleError};sysLink=dest;new Ajax.Request('xmlQuery/systemContent.aspx',opt);}
var handleGetSystemContent=function(req)
{var contentData=req.responseXML.getElementsByTagName('SystemContent');var item=null;var systemItems;var title,content;if(contentData.length>0){for(var i=0;i<contentData.length;i++)
{title=getFirstChildNodeValue(contentData[i],'Title');content=getFirstChildNodeValue(contentData[i],'Content');item=new SystemContentItem(title,content);sysItems.push(item);}}
loadSystemContent();}
function loadSystemContent(){for(var i=0;i<sysItems.length;i++){if(sysItems[i].title=='privacy')
$('privacyContent').innerHTML=sysItems[i].content;else if(sysItems[i].title=='copyright')
$('copyrightContent').innerHTML=sysItems[i].content;}
if(sysLink=='portal')
openPortal();}
function openPortal()
{if(sysItems.length==0)
getSystemContent('portal');else{var portalItem=sysItems.find(function(n){return n.title=='portal'});var link=portalItem.content.gsub('<div>','').gsub('</div>','');window.open(link);}}
function getPrivacyPolicy(){if(sysItems.length==0)
getSystemContent();else
loadSystemContent();}
function getNewsAndAnnouncements(){var opt={method:'post',onSuccess:handleGetNewsAndAnnouncements,on404:handleError,onFailure:handleError};new Ajax.Request('xmlQuery/news/newsAndAnnouncements.aspx',opt);}
var handleGetNewsAndAnnouncements=function(req){var contentData=req.responseXML.getElementsByTagName('NewsContents');var newsItem=null;var id,title,description,imagePath,date,archived;var dateString;var count=0;for(var i=0;i<contentData.length;i++)
{id=getFirstChildNodeValue(contentData[i],'ID');title=getFirstChildNodeValue(contentData[i],'NewsTitle');description=getFirstChildNodeValue(contentData[i],'FullDescription');date=getFirstChildNodeValue(contentData[i],'Date');imagePath=getFirstChildNodeValue(contentData[i],'NewsImage');archived=getFirstChildNodeValue(contentData[i],'Archive');newsItem=new NewsReleaseItem(id,title,date,description,archived,imagePath);dateString=date.split('/');dateString=dateString[2].split(' ');if(dateString[0]!=currentYear){allNewsArchivesItems.push(newsItem);}
if(count<4){newsItems.push(newsItem);count++;}}
var announcementsFromXML=req.responseXML.getElementsByTagName('AnnouncementsContents');var announcement;var month;if(announcementsFromXML.length>0){for(var i=0;i<announcementsFromXML.length;i++)
{id=getFirstChildNodeValue(announcementsFromXML[i],'ID');title=getFirstChildNodeValue(announcementsFromXML[i],'AnnouncementsTitle');description=getFirstChildNodeValue(announcementsFromXML[i],'FullDescription');date=getFirstChildNodeValue(announcementsFromXML[i],'Date');imagePath=getFirstChildNodeValue(announcementsFromXML[i],'AnnouncementsImage');archived=getFirstChildNodeValue(announcementsFromXML[i],'Archive');announcement=new AnnouncementItem(id,title,date,description,archived,imagePath);dateString=date.split('/');month=parseInt(dateString[1]);dateString=dateString[2].split(' ');announcementItems.push(announcement);}}
var nkfFromXML=req.responseXML.getElementsByTagName('NewsKeyFacts');var employees,offices,annualReport,factSheet;if(nkfFromXML.length>0){title=getFirstChildNodeValue(nkfFromXML[0],'Title');employees=getFirstChildNodeValue(nkfFromXML[0],'Employees');offices=getFirstChildNodeValue(nkfFromXML[0],'Offices');annualReport=getFirstChildNodeValue(nkfFromXML[0],'AnnualReport');annualReport="STN_2008_Financial_Review.pdf"
factSheet="Q2 09 Fact Sheet.pdf";loadNewsKeyFacts(employees,offices,annualReport,factSheet);}
loadNewsItems();}
function getNews(){var opt={method:'post',onSuccess:handleGetNews,on404:handleError,onFailure:handleError};new Ajax.Request('xmlQuery/newsById.aspx?nid='+currentState.newsId,opt);}
var handleGetNews=function(req)
{var contentData=req.responseXML.getElementsByTagName('NewsContents');var newsItem=null;var id,title,description,imagePath,date,archived;var dateString;if(contentData[0])
{id=getFirstChildNodeValue(contentData[0],'ID');title=getFirstChildNodeValue(contentData[0],'NewsTitle');description=getFirstChildNodeValue(contentData[0],'FullDescription');date=getFirstChildNodeValue(contentData[0],'Date');imagePath=getFirstChildNodeValue(contentData[0],'NewsImage');archived=getFirstChildNodeValue(contentData[0],'Archive');newsItem=new NewsReleaseItem(id,title,date,description,archived,imagePath);currentState.newsItem=newsItem;showFullNewsRelease(null);}}
function getAnnouncement(){var opt={method:'post',onSuccess:handleGetAnnouncement,on404:handleError,onFailure:handleError};new Ajax.Request('xmlQuery/announcmentById.aspx?anid='+currentState.announcementId,opt);}
var handleGetAnnouncement=function(req)
{var announcementsFromXML=req.responseXML.getElementsByTagName('AnnouncementsContents');var id,title,description,imagePath,date,archived;var dateString;if(announcementsFromXML[0])
{id=getFirstChildNodeValue(announcementsFromXML[0],'ID');title=getFirstChildNodeValue(announcementsFromXML[0],'AnnouncementsTitle');description=getFirstChildNodeValue(announcementsFromXML[0],'FullDescription');date=getFirstChildNodeValue(announcementsFromXML[0],'Date');imagePath=getFirstChildNodeValue(announcementsFromXML[0],'AnnouncementsImage');archived=getFirstChildNodeValue(announcementsFromXML[0],'Archive');announcement=new AnnouncementItem(id,title,date,description,archived,imagePath);currentState.announcementItem=announcement;showFullAnnouncementItem(null);}}
function handleError(){}
function getNewsArchivesByYear(year){var opt={method:'post',onSuccess:handleGetNewsArchivesByYear,on404:handleError,onFailure:handleError};var startDate=year+'-1-1';var endDate=year+'-12-31';new Ajax.Request('xmlQuery/news/newsArchivesByYear.aspx?start='+startDate+'&end='+endDate,opt);}
var handleGetNewsArchivesByYear=function(req){archivesItems.clear();var id,title,description,imagePath,date,archived;var contentData=req.responseXML.getElementsByTagName('NewsContents');var archivesItem=null;archivesItems.clear();for(var i=0;i<contentData.length;i++)
{id=getFirstChildNodeValue(contentData[i],'ID');title=getFirstChildNodeValue(contentData[i],'NewsTitle');description=getFirstChildNodeValue(contentData[i],'FullDescription');date=getFirstChildNodeValue(contentData[i],'Date');imagePath=getFirstChildNodeValue(contentData[i],'NewsImage');archived=getFirstChildNodeValue(contentData[i],'Archive');newsItem=new NewsReleaseItem(id,title,date,description,archived,imagePath);archivesItems.push(newsItem);allNewsArchivesItems.push(newsItem);}
loadArchiveData();}
function getAnnouncementsArchives(){var opt={method:'post',onSuccess:handleGetAnnouncementsArchives,on404:handleError,onFailure:handleError};new Ajax.Request('xmlQuery/news/announcementArchives.aspx',opt);}
var handleGetAnnouncementsArchives=function(req){var id,title,description,imagePath,date,archived;var announcementsFromXML=req.responseXML.getElementsByTagName('AnnouncementsContents');var announcement;var aItem;archiveAnnouncementsItems.clear();if(announcementsFromXML.length>0){for(var i=0;i<announcementsFromXML.length;i++)
{id=getFirstChildNodeValue(announcementsFromXML[i],'ID');title=getFirstChildNodeValue(announcementsFromXML[i],'AnnouncementsTitle');description=getFirstChildNodeValue(announcementsFromXML[i],'FullDescription');date=getFirstChildNodeValue(announcementsFromXML[i],'Date');imagePath=getFirstChildNodeValue(announcementsFromXML[i],'AnnouncementsImage');archived=getFirstChildNodeValue(announcementsFromXML[i],'Archive');announcement=new AnnouncementItem(id,title,date,description,archived,imagePath);aItem=announcementItems.find(function(n){return n.id==id});if(aItem==null){archiveAnnouncementsItems.push(announcement);allArchiveAnnouncementsItems.push(announcement);}}
loadAnnouncementsData();}}
var newsReleaseItemStyle='position:relative;left:0px;top:0px;width:506px;cursor:pointer;';var newsReleaseAlternatingItemStyle='position:relative;left:0px;top:0px;width:506px;background-color:#E2E5EC;cursor:pointer;';var nrHeaderStyle='position:absolute;left:5px;top:5px;width:490px;background-color:transparent;overflow:hidden;';var nrHeaderTextStyle='font-family: Arial, Helvetica, sans-serif;line-height:12px;font-size: 9pt;font-weight: bolder;color:#5883AD;margin:0px;';var nrSubTitleStyle='position:relative;left:5px;width:490px;height:15px;overflow:hidden;';var nrSubTitleTextStyle='font-family: Arial, Helvetica, sans-serif;font-size: 9pt;font-weight:550;color:#333333;';var nrDescriptionStyle='position:absolute;left:60px;top:36px;width:613px;height:45px;overflow:hidden;';var nrDescriptionTextStyle='font-family:Arial, Helvetica, sans-serif;line-height: 13px;font-size: 8pt;color:#989898;';var nrMoreInformationStyle='position:absolute;left:580px;top:68px;width:100px;height:15px;';var nrMoreInformationLinkStyle='font-family:Arial, Helvetica, sans-serif;line-height: 13px;font-size: 7pt;cursor:pointer;color:#5883AD;';var anItemStyle='position:relative;left:0px;top:0px;width:506px;overflow:hidden;cursor:pointer;';var anItemAlternatingStyle='position:relative;left:0px;top:0px;width:506px;background-color:#E2E5EC;overflow:hidden;cursor:pointer;';var dateTitleStyle='position:relative;left:5px;top:2px;width:490px;height:16px;overflow:hidden;';var dateTitleTextStyle='font-family: Arial, Helvetica, sans-serif;line-heigth:14px;margin:0px;font-size: 8pt;font-weight:550;color:#333333;';var anTitleStyle='position:relative;left:5px;top:2px;width:490px;overflow:hidden;line-height:14px;margin:0px;font-family: Arial, Helvetica, sans-serif;font-size: 9pt;font-weight:bold;color:#5883AD;';var archiveHeadingStyle='position:relative;overflow:hidden;left:0px;top:0px;width:208px;height:15px;font-family: Arial, Helvetica, sans-serif;font-size: 9pt;font-weight:bold;color:#5883AD;overflow:hidden;cursor:pointer;';var archiveCurrentLinkStyle='position:absolute;overflow:hidden;width:210px;height:15px;font-family: Arial, Helvetica, sans-serif;font-size: 9pt;font-weight:bold;color:#5883AD;overflow:hidden;cursor:pointer;';var newsItems=[];var announcementItems=[];var allArchiveAnnouncementsItems=[];var archiveAnnouncementsItems=[];var archivesItems=[];var allNewsArchivesItems=[];var currentYear=2008;var nrScroller,anScroller,dhpScroller;Event.observe(window,'load',function(){var today=new Date();var thisYear=today.getFullYear();currentYear=thisYear;getNewsAndAnnouncements();addArchivesPanel();enableMediaKitLinks();$('announcementsContentTextArea').style.left='-510px';nrScroller=new Control.Scroller('newsContentTextArea','nccHandle','nccTrack',{visibleHeight:202,delta:5});anScroller=new Control.Scroller('announcementsContentTextArea','accHandle','accTrack',{visibleHeight:202,delta:5});dhpScroller=new Control.Scroller('newsDescriptionPanel','dhpHandle','dhpTrack',{visibleHeight:322,delta:5});var dhpNewsCloseButton=$('newsdhpCloseButton');Event.observe(dhpNewsCloseButton,'click',closeNewsItemPanel,false);Event.observe(dhpNewsCloseButton,'mouseover',moElement,false);Event.observe(dhpNewsCloseButton,'mouseout',moElement,false);var cul=$('footerLinks');Event.observe(cul,'click',showContactPanel,false);Event.observe(cul,'mouseover',moFooterLinks,false);Event.observe(cul,'mouseout',moFooterLinks,false);var dhpclose=$('dhpCloseButton');Event.observe(dhpclose,'click',closeContactWindow,false);Event.observe(dhpclose,'mouseover',mo_ContactClose,false);Event.observe(dhpclose,'mouseout',mo_ContactClose,false);var cfsubmit=$('newsCFSubmitButton');Event.observe(cfsubmit,'click',submitContactForm,false);Event.observe(cfsubmit,'mouseover',mo_ContactSubmit,false);Event.observe(cfsubmit,'mouseout',mo_ContactSubmit,false);var ppLink=$('privacyPolicyLink');Event.observe(ppLink,'click',showContactPanel,false);Event.observe(ppLink,'mouseover',moFooterLinks,false);Event.observe(ppLink,'mouseout',moFooterLinks,false);Event.observe($('newsPrintImage'),'click',printItem,false);});function printItem(){var title=$('newsdhpHeaderText').innerHTML;var subTitle=$('newsdhpSubTitleText').innerHTML;var description=$('newsdhpDescriptionText').innerHTML;var output="<html>\n"+"<head>\n"+"<title>Stantec - News Releases & Announcements</title>\n"+"<script>\n"+"function step1() {\n"+"  setTimeout('step2()', 10);\n"+"}\n"+"function step2() {\n"+"  window.print();\n"+"}\n"+"</scr"+"ipt>\n"+"</head>\n"+"<body onLoad='step1()'>\n"+"<img src=\"../images/logo_small.gif\" /><h2 style=\"font-family:Arial;font-weight:bold;font-size:12pt;color:#00457C\">"+title+"</h2>\n"+"<h2 style=\"font-family:Arial;font-size:9pt;color:#333\">"+subTitle+"</h2>\n"+"<span style=\"font-family:Arial;font-size:9pt;\">"+description+"</span>\n"+"</body>\n"+"</html>\n";var iLeft=(window.screen.availWidth-820)*0.5;var iTop=(window.screen.availHeight-653)*0.5;var iHeight=(window.screen.availHeight-653)*0.5;var options="directories=no,toolbar=no,location=no,status=no,resizable=yes,menubar=no,scrollbars=yes,width=820,height=653,top="+iHeight+",left="+iLeft;var tempWindow=window.open("Stantec","new",options);tempWindow.document.open();tempWindow.document.write(output);tempWindow.document.close();}
function loadNewsKeyFacts(employees,offices,annualReport,factSheet){$('numEmployees').innerHTML=employees;$('numOffices').innerHTML=offices;var ar=annualReport;if(ar)
$('annualReport').title='../InvestorsDocuments/'+ar;var fs=factSheet;if(fs)
$('factSheet').title='../InvestorsDocuments/'+fs;}
function loadNewsItems(){var cnr=$('currentNewsReleases');var ca=$('currentAnnouncementsArea');cnr.style.left='3060px';ca.style.left='510px';addNewsReleaseItems(cnr,newsItems,'nr',false);addAnnouncementItems(ca,announcementItems,'an',false);}
function closeNewsItemPanel(e){var dhp=$('newsDetailHoverPanel');if(dhp.style.left=='138px'){dhp.morph({left:'1030px'},{duration:0.7,queue:{scope:'showScope',position:'end'}});$('dhpCover').style.left='1030px';}}
function enableMediaKitLinks(){var mkLinks=$$('span.mkLink');for(var i=0;i<mkLinks.length;i++){Event.observe(mkLinks[i],'click',onMediaKitLinkClick,false);Event.observe(mkLinks[i],'mouseover',moElement,false)
Event.observe(mkLinks[i],'mouseout',moElement,false);}}
function onMediaKitLinkClick(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if(item.id=='factSheet'){window.open($('factSheet').title);}
else if(item.id=='investorRelations'){document.location.href='investorRelations.html';}
else if(item.id=='communityInvestment'){document.location.href='aboutUs.html#about_cioverview';}
else if(item.id=='acquisitionUpdate'){document.location.href='aboutUs.html#about_acquisitionupdate';}
else if(item.id=='annualReport'){window.open($('annualReport').title);}}
function onArchivePanelClick(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if(item.id=='lblLinks')return;if(item.id=='newsreleases'){$('newsReleaseHeaderText').innerHTML='News Releases';$('newsContentTextArea').morph({left:'-3056px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});$('newsContentControlWrapper').morph({left:'530px'},{duration:0.5,queue:{scope:'regionScope',position:'with-last'}});nrScroller.slider.setValue(0,0);}
else if(item.id=='moreannouncements'){$('announcementsHeaderText').innerHTML='Archived Announcements';$('moreannouncements').morph({left:'250px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});$('currentannouncements').morph({left:'-4px'},{duration:0.5,queue:{scope:'regionScope',position:'with-last'}});if($('moreAnnouncementsArea').innerHTML=='')
getAnnouncementsArchives();else{$('announcementsContentTextArea').morph({left:'0px'},{duration:0.5,queue:{scope:'regionScope',position:'with-last'}});$('announcementsContentControlWrapper').morph({left:'514px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});anScroller.slider.setValue(0,0);}}
else if(item.id=='currentannouncements'){$('announcementsHeaderText').innerHTML='Announcements';$('moreannouncements').morph({left:'0px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});$('currentannouncements').morph({left:'-250px'},{duration:0.5,queue:{scope:'regionScope',position:'with-last'}});$('announcementsContentTextArea').morph({left:'-510px'},{duration:0.5,queue:{scope:'regionScope',position:'with-last'}});$('announcementsContentControlWrapper').morph({left:'530px'},{duration:0.5,queue:{scope:'regionScope',position:'with-last'}});anScroller.slider.setValue(0,0);}
else{var itemId=(item.id!='')?parseInt(item.id.gsub('nr','')):0;currentYear=itemId;var curDiv=$('nrContent'+itemId);$('newsReleaseHeaderText').innerHTML='News Releases ('+currentYear+')';if(curDiv.innerHTML==''){getNewsArchivesByYear(itemId);}
else{moveNewsArea();}}}
function addEvents(){var lbl=$('lbLinks');Event.observe(lbl,'click',onArchivePanelClick,false);Event.observe(lbl,'mouseover',moElement,false);Event.observe(lbl,'mouseout',moElement,false);}
function addArchivesPanel(){var lbLinks=$('lbLinks');var today=new Date();var thisYear=today.getFullYear();var nrItem=Builder.node('div',{style:archiveHeadingStyle},'Current News Releases');var newsAreaStyle='position: absolute;top: 10px;width: 506px;height: 1052px;';var left=3060;var nrContent=$('newsContentTextArea');lbLinks.appendChild(nrItem);nrItem.id='newsreleases';addEvents();var year=thisYear;var nrItem,nrDiv;for(var i=1;i<6;i++){nrItem=Builder.node('div',{style:archiveHeadingStyle},year);nrItem.id='nr'+year;lbLinks.appendChild(nrItem);left=left-510;nrDiv=Builder.node('div',{style:newsAreaStyle+';left:'+left+'px'},'');nrDiv.id='nrContent'+year;nrContent.appendChild(nrDiv);year=thisYear-i;}
var nrItem=Builder.node('div',{style:archiveHeadingStyle+';top:4px'},'More Announcements');nrItem.id='moreannouncements';lbLinks.appendChild(nrItem);var nrItem=Builder.node('div',{style:archiveCurrentLinkStyle+';top:95px;left:-250px;'},' Current Announcements');nrItem.id='currentannouncements';lbLinks.appendChild(nrItem);}
function moElement(e){var item=(e.srcElement!=null)?e.srcElement:e.target;if(item.id=='lblLinks')return;item.style.color=(e.type=='mouseover')?'#EAA758':(item.id=='contactUsLink')?'#BFBFBF':'#5883AD';}
function clearListItemBackground(list){for(var i=0;i<list.length;i++){var curItem=$(list[i].id+'dt');if(curItem!=null)
curItem.style.backgroundColor='#FFF';}}
function loadArchiveData(){var curDiv=$('nrContent'+currentYear);addNewsReleaseItems(curDiv,archivesItems,'ar',true);moveNewsArea();}
function loadAnnouncementsData(){addAnnouncementItems($('moreAnnouncementsArea'),archiveAnnouncementsItems,'aa',true);$('announcementsContentTextArea').morph({left:'0px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});}
function moveNewsArea(){var today=new Date();var thisYear=today.getFullYear();var leftValue=-3056;var year=thisYear;for(var i=1;i<7;i++){leftValue=leftValue+510;if(currentYear==year){break;}
year=thisYear-i;}
$('newsContentTextArea').morph({left:leftValue+'px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});$('newsContentControlWrapper').morph({left:'514px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});nrScroller.slider.setValue(0,0);}
function addNewsReleaseItems(nrContentArea,newsItems,tag,showScroller){var itemStyle=0;var curItem;var height=0;var curDate;var title,tHeight,nHeight,nrItem,nrHeader,nrHeaderText,stHeight,nrDateTitle,nrDateText;for(var i=0;i<newsItems.length;i++){curItem=newsItems[i];itemStyle=(i%2==0)?newsReleaseItemStyle:newsReleaseAlternatingItemStyle;title=curItem.title;tHeight=(title.length>81)?(title.length>153)?56:32:18;nHeight=(tHeight==56)?'75px':(tHeight==32)?'48px':'36px';nrItem=Builder.node('div',{style:itemStyle+';height:'+nHeight},'');nrHeader=Builder.node('div',{style:nrHeaderStyle+';height:'+tHeight+'px;'},'');nrHeaderText=Builder.node('p',{style:nrHeaderTextStyle},title);stHeight=(tHeight==56)?'55px':(tHeight==32)?'32px':'19px';nrDateTitle=Builder.node('div',{style:dateTitleStyle+';top:'+stHeight},'');nrDateTitleText=Builder.node('p',{style:dateTitleTextStyle},getFullDateString(curItem.date));nrHeaderText.id=tag+newsItems[i].id;nrItem.id=curItem.id+'xsc';nrHeader.appendChild(nrHeaderText);nrDateTitle.appendChild(nrDateTitleText);nrItem.appendChild(nrHeader);nrItem.appendChild(nrDateTitle);nrContentArea.appendChild(nrItem);height=height+tHeight;var nrht=$(nrHeaderText.id);Event.observe(nrht,'click',showFullNewsRelease,false);Event.observe(nrht,'mouseover',moNewsReleaseItem,false);Event.observe(nrht,'mouseout',moNewsReleaseItem,false);}
height=(height<210)?250:(height+40);$('newsContentTextArea').style.height=height+'px';if(showScroller)
$('newsContentControlWrapper').morph({left:'514px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});}
function moNewsReleaseItem(e){var item=(e.srcElement!=null)?e.srcElement:e.target;item.style.color=(e.type=='mouseover')?'#EAA758':'#5883AD';}
function moCloseElement(e){var item=(e.srcElement!=null)?e.srcElement:e.target;item.style.color=(e.type=='mouseover')?'#EAA758':'white';}
function showFullNewsRelease(e){var cur=null;if(!isRefreshingFromHistory)
{var item=(e.srcElement!=null)?e.srcElement:e.target;var itemArray=(item.id.indexOf('nr')>-1)?newsItems:allNewsArchivesItems;var cItemId=item.id.substring(2);var curItem=itemArray.findAll(function(n){return n.id==cItemId});cur=curItem[0];}
else
{cur=currentState.newsItem;isRefreshingFromHistory=false;}
$('newsdhpHeaderText').innerHTML=cur.title;$('newsdhpSubTitleText').innerHTML=getFullDateString(cur.date);$('newsdhpDescriptionText').innerHTML=cur.description;var dhpNI=$('dhpNewsImage');dhpNI.src=(cur.imagePath=='')?'../images/sed.jpg':cur.imagePath;dhpNI.onload=function addMargins(){var iHeight=parseInt(dhpNI.getHeight());var iWidth=parseInt(dhpNI.getWidth());var oimd=$('dhpNewsImageWrapper');var yMargin=0;var xMargin=Math.round((oimd.offsetWidth-iWidth)/2)-5;oimd.style.margin=yMargin+'px '+xMargin+'px '+yMargin+'px '+xMargin+'px;';}
$('newsDetailHoverPanel').morph({left:'138px'},{duration:0.8,queue:{scope:'showScope',position:'end'}});$('dhpCover').style.left='0px';dhpScroller.slider.setValue(0,0);}
function addAnnouncementItems(aContentArea,aItems,tag,showScroller){var itemStyle;var curItem;var height=0;for(var i=0;i<aItems.length;i++){curItem=aItems[i];itemStyle=(i%2==0)?anItemStyle:anItemAlternatingStyle;var aTitle=curItem.title;var tHeight=(aTitle.length>82)?(aTitle.length>153)?60:46:32;height=height+tHeight;var anItem=Builder.node('div',{style:itemStyle+';height:'+tHeight+'px'},'');var anHeaderText=Builder.node('p',{style:anTitleStyle},curItem.title);var nrDateTitle=Builder.node('div',{style:dateTitleStyle},'');var nrDateTitleText=Builder.node('p',{style:dateTitleTextStyle},getFullDateString(curItem.date));anHeaderText.id=tag+curItem.id;anItem.id=curItem.id+'xsc';anItem.appendChild(anHeaderText);nrDateTitle.appendChild(nrDateTitleText);anItem.appendChild(nrDateTitle);aContentArea.appendChild(anItem);var curAnnItem=$(anHeaderText.id);Event.observe(curAnnItem,'click',showFullAnnouncementItem,false);Event.observe(curAnnItem,'mouseover',moNewsReleaseItem,false);Event.observe(curAnnItem,'mouseout',moNewsReleaseItem,false);}
height=(height<210)?250:(height+40);$('announcementsContentTextArea').style.height=height+'px';if(showScroller){$('announcementsContentControlWrapper').morph({left:'514px'},{duration:0.5,queue:{scope:'regionScope',position:'end'}});anScroller.slider.setValue(0,0);}}
function showFullAnnouncementItem(e){var cur=null;if(!isRefreshingFromHistory)
{var item=(e.srcElement!=null)?e.srcElement:e.target;itemArray=(item.id.indexOf('an')>-1)?announcementItems:allArchiveAnnouncementsItems;var cItemId=item.id.substring(2);var curItem=itemArray.findAll(function(n){return n.id==cItemId});cur=curItem[0];}
else
{cur=currentState.announcementItem;isRefreshingFromHistory=false;}
$('newsdhpHeaderText').innerHTML=cur.title;$('newsdhpSubTitleText').innerHTML=getFullDateString(cur.date);$('newsdhpDescriptionText').innerHTML=cur.description;$('newsDetailHoverPanel').morph({left:'138px'},{duration:0.8,queue:{scope:'showScope',position:'end'}});$('dhpNewsImage').src=(cur.imagePath=='')?'../images/sed.jpg':cur.imagePath;$('dhpCover').style.left='0px';dhpScroller.slider.setValue(0,0);}﻿var titlePrefix="Stantec";var State=Class.create();State.prototype={newsId:null,announcementId:null,archiveId:null,newsItem:null,announcementItem:null,initialize:function(newsId,newsItem,announcementId,announcementItem,archiveId){this.newsId=newsId;this.newsItem=newsItem;this.announcementId=announcementId;this.announcementItem=announcementItem;this.archiveId=archiveId;},copy:function(other){this.newsId=other.newsId;this.newsItem=other.newsItem;this.announcementId=other.announcementId;this.announcementItem=other.announcementItem;this.archiveId=other.archiveId;},getName:function(){return null;}}
var currentState=null;var isRefreshingFromHistory=false;Event.observe(window,'load',function(){});function initialize()
{dhtmlHistory.addListener(handleHistoryChange);if(dhtmlHistory.isFirstLoad())
{firstLoad=true;}
if(dhtmlHistory.getCurrentLocation())
{currentState=getStateFromLocation(dhtmlHistory.getCurrentLocation());setTitle();dhtmlHistory.addListener(handleHistoryChange);}
if(currentState==null)
{currentState=new State();}
else
{handleHistoryChange(dhtmlHistory.getCurrentLocation(),currentState);}}
function getStateFromLocation(location)
{if(location)
{if(location.indexOf('news')>-1)
{var str=location.replace('news','');var state=new State();state.newsId=str;return state;}
else if(location.indexOf('announcement')>-1)
{var str=location.replace('announcement','');var state=new State();state.announcementId=str;return state;}
else if(location.indexOf('archive')>-1)
{var str=location.replace('archive','');var state=new State();state.archiveId=str;return state;}
return null;}
return null;}
function handleHistoryChange(newLocation,historyData){if(historyData)
{if(currentState==null)
currentState=new State();currentState.copy(historyData);setTitle();isRefreshingFromHistory=true;isRefreshingFromHistory=true;if(currentState.newsId)
{getNews();}
else if(currentState.announcementId)
{getAnnouncement();}
setTitle();}}
function stripTitle(title){if(title){var sTitle=title.replace('<br>',' ');sTitle=sTitle.replace('<BR>',' ');sTitle=sTitle.replace('&amp;','&');return sTitle;}
return titlePrefix;}
function setTitle(){var titleObj=null;if(window.parent)
{titleObj=window.parent.document;}
else
{titleObj=window.document;}
if((currentState==null)||(currentState.getName()==null))
{titleObj.title=titlePrefix;}
else
{titleObj.title=titlePrefix+' - '+stripTitle(currentState.getName());}}