	//newsstart
var texts = new Array(
"<p><font color='{COLOR}'><b>June 28, 2007</b>Check back soon for more up to date news.<br></font></p>");


var evttexts = new Array(
"<p><font color='{COLOR}'><b>April 26, 2005</b><br>Vancouver Real Estate Forum<br>Wednesday, April 26th, Hyatt Regency, 7 am<br><br>The Vancouver Real Estate Forum is western Canada's largest annual conference on Real Estate investment and management issues.  It offers high-quality speakers at relatively low registration fees.  Call 1.877.739.2112 ext. 228 to register.<br><br></font></p>",
"<p><font color='{COLOR}'><b>Jan 23-25, 2005</b><br>ICSC 2005 Whistler Conference<br>ICSC 2005 Whistler Conference at The Fairmont Chateau Whistler, BC Janurary 23-25, 2005 will provide an insight on how to develop or re-develop properties in non traditional ways, and how it means finding ways to create hew exciting projects, woven together by leading edge design evolutions.\">more info</a></font></p>",
"<p><font color='{COLOR}'><b>May 4, 2005</b><br>Edmonton Real Estate Forum<br>Wednesday May 4, 2005 The Westin Hotel downtown Edmonton<br>The fourth annual Edmonton Real Estate Forum will provide valuable insights into one of the leading ICI markets in Western Canada.  It will focus on the challenges facing asset managers, brokers, corporate real estate executives active in the ownership, management and financing of commmercial, industrial, investment, and residential real estate.<br><br><a href=\"http://www.mediaedgewest.com/realestateforumswest/edmonton/\">more info</a></font></p>");
//newsend
	
	var mousePos = "";
	var bgcolor = "#264059";
	var fcolor = "#FFCC00";
	var evtbgcolor = "#112A43";
	var evtfcolor = "#FF9933";
	var steps = 25;
	var show = 5500;
	var sleep = 30;
	var evtsleep = 30;
	var loop = true;
	var colors = new Array(steps);
	getFadeColors(bgcolor,fcolor,colors);
	var evtcolors = new Array(steps);
	getFadeColors(evtbgcolor,evtfcolor,evtcolors);
	var color = 0;
	var evtcolor = 0;
	var text = 0;
	var evttext = 0;
	var step = 1;
	var evtstep = 1;
	var navdir = 1;
	var evtnavdir = 1;
	var startfade = 1;
	var evtfade = 1;
	var maxBkgs = 6;
	
	
	function fade() {
		
		//if (document.all) testvars.innerHTML = "Text: " + text;
		//if (document.layers) { document.testvars.document.write("Text: " + text); document.fader.document.close(); }
		
			var text_out = texts[text].replace("{COLOR}", colors[color]);
			if (document.all) fader.innerHTML = text_out;
			if (document.layers) { document.fader.document.write(text_out); document.fader.document.close(); }
			color += step;
			if (color >= colors.length-1) {
				step = -1;
				if (!loop && text >= texts.length-1) return;
			}
			if (color == 0) {
				step = 1;
				text += navdir;
				if (text < 0){
					text = texts.length - 1;
				}else if (text >= texts.length) {
					text = 0
				}
			}
			
			if (color < 24 || startfade == 1){
				startfade = 0;
				setTimeout("fade()", (color == colors.length-2 && step == -1) ? show : ((color == 1 && step == 1) ? sleep : 50));
			}
	}
	
function fadeevt() {
				
			var evt_text_out = evttexts[evttext].replace("{COLOR}", evtcolors[evtcolor]);
			if (document.all) evt.innerHTML = evt_text_out;
			if (document.layers) { document.evt.document.write(evt_text_out); document.fader.document.close(); }
			evtcolor += evtstep;
			
			if (evtcolor >= evtcolors.length-1) {
				evtstep = -1;
				if (!loop && evttext >= evttexts.length-1) return;
			}
			if (evtcolor == 0) {
				evtstep = 1;
				evttext += evtnavdir;
				if (evttext < 0){
					evttext = evttexts.length - 1;
				}else if (evttext >= evttexts.length) {
					evttext = 0
				}
			}
			if (evtcolor < 24 || evtfade == 1){
				evtfade = 0;
				setTimeout("fadeevt()", (evtcolor == evtcolors.length-2 && evtstep == -1) ? show : ((evtcolor == 1 && evtstep == 1) ? evtsleep : 50));
			}
	}
	
	function startfades() {
	
		rndPic();
		fade();
		fadeevt();
	
	}
	
	function newsstart(){
	
		var text_out = "";
		for (x=0;x<texts.length;x++){
			text_out += texts[x].replace("<font color='{COLOR}'>", "").replace("</font>", "") + "\n"
		}
		
		if (document.all) newsText.innerHTML = text_out;
		if (document.layers) { document.newsText.document.write(text_out); document.newsText.document.close(); }
	
		rndPic();
		fade();
		fadeevt();
	
	}
	
	function eventstart(){
	
		var text_out = "";
		for (x=0;x<evttexts.length;x++){
			text_out += evttexts[x].replace("<font color='{COLOR}'>", "").replace("</font>", "") + "\n"
		}
		
		if (document.all) eventText.innerHTML = text_out;
		if (document.layers) { document.eventText.document.write(text_out); document.eventText.document.close(); }
	
		rndPic();
		fade();
		fadeevt();
		
	}
	function rndPic(){
		cBkg=Math.floor((Math.random()*maxBkgs))+1;
		document.getElementById("bkgIMG").src = "img/splsh-0"+cBkg+".jpg";
	}
	function nextevt(){
		evtfade = 1;
		evtcolor = 23;
		evtnavdir = 1;
		fadeevt();
	}
	function prevevt(){
		evtfade = 1;
		evtcolor = 23;
		evtnavdir = -1;
		fadeevt();
	}
	
	function nextnews(){
		startfade = 1;
		color = 23;
		navdir = 1;
		fade();
	}
	function prevnews(){
		startfade = 1;
		color = 23;
		navdir = -1;
		fade();
	}
	
	function getFadeColors(ColorA, ColorB, Colors) {
		len = Colors.length; 
		if (ColorA.charAt(0)=='#') ColorA = ColorA.substring(1);
		if (ColorB.charAt(0)=='#') ColorB = ColorB.substring(1);
		var r = HexToInt(ColorA.substring(0,2));
		var g = HexToInt(ColorA.substring(2,4));
		var b = HexToInt(ColorA.substring(4,6));
		var r2 = HexToInt(ColorB.substring(0,2));
		var g2 = HexToInt(ColorB.substring(2,4));
		var b2 = HexToInt(ColorB.substring(4,6));
		var rStep = Math.round((r2 - r) / len);
		var gStep = Math.round((g2 - g) / len);
		var bStep = Math.round((b2 - b) / len);
		for (i = 0; i < len-1; i++) {
			Colors[i] = "#" + IntToHex(r) + IntToHex(g) + IntToHex(b);
			r += rStep;
			g += gStep;
			b += bStep;
		}
		Colors[len-1] = ColorB;
	}
	function IntToHex(n) {
		var result = n.toString(16);
		if (result.length==1) result = "0"+result;
		return result;
	}
	function HexToInt(hex) {
		return parseInt(hex, 16);
	}
	function stopFade(){
		var text_out = texts[text].replace("{COLOR}", fcolor);
		if (document.all) fader.innerHTML = text_out;
		if (document.layers) { document.fader.document.write(text_out); document.fader.document.close(); }
		mousePos = "in";
	}
	function startFade(){
		if (mousePos == "in"){
			mousePos = "";
		}
	}




























































































































