var blurbArray = [
	["We're a Top Global Design Firm","As a leading design and consulting services firm across North America and beyond, we are recognized as a top 50 global design firm. We share a vision to become a top 10 global design firm, and we are well on our way. This means that our people have the opportunity to work on some of the best projects for some of the best clients in the marketplace."],
	["We Help You Grow","Stantec strives to attract leaders for today and tomorrow. We offer numerous opportunities for advancement and professional growth, including professional development programs, continuing education programs, balanced work week initiatives, an employee referral program, professional association memberships, and the list goes on."],
	["We Offer Multidisciplinary Opportunities","Stantec's comprehensive services support clients at every stage, from initial concept and financial feasibility to project completion and beyond. This opens the door to a wide range of multidisciplinary and professional practices for our people to explore. With so many areas of specialization within a multitude of market sectors, you'll have the flexibility to realize your career goals as you learn and grow."],
	["We Believe That People Make a Difference","The key to our success is our people. People, passion, and progress have made our Company what it is today, and create the foundation for what it will be tomorrow. Teamwork is one of our core values, and when we say &quot;teamwork is fundamental to our culture and determines our reputation and vitality,&quot; we mean it. We respect and value employee contribution and input, and provide an environment that encourages self-improvement, innovation, creativity, and entrepreneurialism."],
	["We Provide Competitive Compensation and Benefits","Our compensation plans are designed to reward top performance and reflect current market conditions. We strive to maintain this through annual compensation reviews and market surveys to qualify our compensation decisions. Further, we provide comprehensive benefit packages for employees, with plans designed to assist employees and their families with medical and dental coverage, income replacement, and retirement savings."],
	["We Care About the Communities in Which We Live, Work, and Play","This is evident in how we conduct ourselves and our business. We may be a professional services firm, but we haven't forgotten to have a bit of fun along the way. From inter-office charity fundraisers for a little competitive fun during the Stanley Cup hockey playoffs, donating time and supplies to Habitat for Humanity, participating in local Corporate Challenge events, shaving heads to raise money for cancer research, or raising money in the American Heart Association's Heart Walk, Stantec staff take an active role in their communities and make memories along the way."]
]


function NextRandomNumber()  {
	var hi   = this.seed / this.Q;
	var lo   = this.seed % this.Q;
	var test = this.A * lo - this.R * hi;
	if (test > 0) 
		this.seed = test;
	else 
		this.seed = test + this.M;
	return (this.seed * this.oneOverM);
}

function RandomNumberGenerator() {
	var d = new Date();
	this.seed = 2345678901 + (d.getSeconds() * 0xFFFFFF) + (d.getMinutes() * 0xFFFF);
	this.A = 48271;
	this.M = 2147483647;
	this.Q = this.M / this.A;
	this.R = this.M % this.A;
	this.oneOverM = 1.0 / this.M;
	this.next = NextRandomNumber;
	return this;
}

function random(lrn, urn) {
	return Math.floor((urn - lrn + 1) * rand.next() + lrn);
}

function getRotation() {
	var percentile =  random(uslrn, usurn)
	var pointerTitle
	var pointerText
	var display
	
		pointerTitle = blurbArray[percentile-1][0]
		pointerText = blurbArray[percentile-1][1]
	display = "<h2>"+pointerTitle+"</h2><p>"+pointerText+"</p>"
	
	writeDisplay(display)
}

function writeDisplay(txtDisplay) {
	if (document.layers){
		document.layers.rotation.document.write(txtDisplay)
		document.layers.rotation.document.close()
	}
	else if (document.all)
		rotation.innerHTML=txtDisplay
	else if (document.getElementById)
		document.getElementById("rotation").innerHTML=txtDisplay

}


var rand = new RandomNumberGenerator();
var uslrn = 1;    // Stores Lower Range Number.
var usurn = 6;    // Stores Upper Range Number.


function GoOrClose(newurl) {
	var isParent = (!window.opener || window.opener.closed) ? true: false

	if (!isParent) {
		if(newurl == "http:/"+"/www.stantec.com") {
			window.close()
		} else {
			location.href = newurl
		}
	} else {
		location.href = newurl
	}
}