// ---------------------------------------------------------------------------------------
// browser sniffer, defines variables for the rest of the functions below to use.

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
sNS6 = (!document.all && document.getElementById) ? true : false;

// ---------------------------------------------------------------------------------------
// Date function

function todaydate(){
var d=new Date()
var monthname=new Array("January","Febuary","March","April","May","June","July","August","September","October","November","December")
var dayname=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
document.write(dayname[d.getDay()] + " ")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getDate() +", ")
document.write(d.getFullYear())
}

// ---------------------------------------------------------------------------------------
// Rollovers for Homepage

function homeswapimg(name, state){
if (state == "on") document.images[name].src="Rollovers/Utility/"+name+"_on.gif";
else if (state == "off")  document.images[name].src="Rollovers/Utility/"+name+"_off.gif";
}

// ---------------------------------------------------------------------------------------
// Rollovers for Otherpages

function swapimg(name, state){
if (state == "on") document.images[name].src="../Rollovers/Utility/"+name+"_on.gif";
else if (state == "off")  document.images[name].src="../Rollovers/Utility/"+name+"_off.gif";
}

// ---------------------------------------------------------------------------------------
// Rollovers for Otherpages Subpages

function swapimgsub(name, state){
if (state == "on") document.images[name].src="../../Rollovers/Utility/"+name+"_on.gif";
else if (state == "off")  document.images[name].src="../../Rollovers/Utility/"+name+"_off.gif";
}

// ---------------------------------------------------------------------------------------
// resizes page to its proper dimension

function resizeFix() {
	if(widthCheck != window.innerWidth || heightCheck != window.innerHeight) {
		window.location.reload();
   }
}


// ---------------------------------------------------------------------------------------
// handles netscape resizing problem by forcing to reload when window is resized

if(ns4) {
	widthCheck = window.innerWidth;
    	heightCheck = window.innerHeight;
    	window.onresize = resizeFix();
}


// ---------------------------------------------------------------------------------------
//To be used for popup windows with all atributes passed to function 

function popup_all(topic,namer,tool,loc,dir,stat,menu,scroll,resize,x,y) {
eval('window.open(topic, namer, "history=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+ ',scrollbars='+scroll+',resizable='+resize+',width=' +  y  + ',height=' +  x + '");');

}


// ---------------------------------------------------------------------------------------
//To be used for popup windows all parameters passed and if user is leaving site presented with a dialog box

function popup_leaving(topic,namer,tool,loc,dir,stat,menu,scroll,resize,x,y) {

input_box=confirm("Leaving ");
	if (input_box==true)    { 
		// Output when OK is clicked
        eval('window.open(topic, namer, "history=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+ ',scrollbars='+scroll+',resizable='+resize+',width=' +  y  + ',height=' +  x + '");');
	} else {
        // Output when Cancel is clicked
	}
}

 //-----------------------------------------------------------
   
  
   //This is Drop Menu Swap Code for Homepage
   
   function swapDD(lyrnm, name, state){
	isNS6 = (!document.all && document.getElementById) ? true : false;
      if ((navigator.appName=="Netscape" && !isNS6)){
   	if (state == "on") { 
   		document[lyrnm].document.images[name].src = "Rollovers/LeftNav/"+name+"_on.gif";
         } else if (state == "off") { 
   		document[lyrnm].document.images[name].src = "Rollovers/LeftNav/"+name+"_off.gif"; 
   	}
      } else {
         if (state == "on") document.images[name].src="Rollovers/LeftNav/"+name+"_on.gif";
   	else if (state == "off") document.images[name].src="Rollovers/LeftNav/"+name+"_off.gif";
      }
   }
   
//-----------------------------------------------------------
  
   //This is Drop Menu Swap Code for Secondary Pages
   
   function swapDDother(lyrnm, name, state){
	isNS6 = (!document.all && document.getElementById) ? true : false;
      if ((navigator.appName=="Netscape" && !isNS6)){
   	if (state == "on") { 
   		document[lyrnm].document.images[name].src = "../Rollovers/LeftNav/"+name+"_on.gif";
         } else if (state == "off") { 
   		document[lyrnm].document.images[name].src = "../Rollovers/LeftNav/"+name+"_off.gif"; 
   	}
      } else {
         if (state == "on") document.images[name].src="../Rollovers/LeftNav/"+name+"_on.gif";
   	else if (state == "off") document.images[name].src="../Rollovers/LeftNav/"+name+"_off.gif";
      }
   }
   
//-----------------------------------------------------------
  
   //This is Drop Menu Swap Code for Secondary Sub Pages
   
   function swapDDSub(lyrnm, name, state){
	isNS6 = (!document.all && document.getElementById) ? true : false;
      if ((navigator.appName=="Netscape" && !isNS6)){
   	if (state == "on") { 
   		document[lyrnm].document.images[name].src = "../../Rollovers/LeftNav/"+name+"_on.gif";
         } else if (state == "off") { 
   		document[lyrnm].document.images[name].src = "../../Rollovers/LeftNav/"+name+"_off.gif"; 
   	}
      } else {
         if (state == "on") document.images[name].src="../../Rollovers/LeftNav/"+name+"_on.gif";
   	else if (state == "off") document.images[name].src="../../Rollovers/LeftNav/"+name+"_off.gif";
      }
   }   
//-----------------------------------------------------------

function MM_reloadPage(init) {  //Updated by PVII. Reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7_autoLayers() { //v1.2 by PVII
 var g,b,k,f,args=P7_autoLayers.arguments;
 var a = parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc) {p7c=new Array();document.p7setc=true;
  for (var u=0;u<10;u++) {p7c[u] = new Array();}}
 for(k=0; k<p7c[a].length; k++) {
  if((g=MM_findObj(p7c[a][k]))!=null) {
   b=(document.layers)?g:g.style;b.visibility="hidden";}}
 for(k=1; k<args.length; k++) {
  if((g=MM_findObj(args[k])) != null) {
   b=(document.layers)?g:g.style;b.visibility="visible";f=false;
   for(j=0;j<p7c[a].length;j++) {
    if(args[k]==p7c[a][j]) {f=true;}}
  if(!f) {p7c[a][p7c[a].length++]=args[k];}}}
}

function P7_ReDoIt() { //v1.2 by PVII
 if(document.layers) {MM_reloadPage(false);}
}

function P7_Snap() { //v2.63 by PVII
  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
  for (k=0; k<(args.length-3); k+=4)
   if ((g=MM_findObj(args[k]))!=null) {
    el=eval(MM_findObj(args[k+1]));
    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
    if(document.getElementById) {
     d="document.getElementsByName('"+args[k]+"')[0]";
     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
    }else if(document.all) {d=da;} 
    if (document.all || document.getElementById) {
     while (tx==1) {p+=".offsetParent";
      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
      }else{tx=0;}}
     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
      x=document.body.scrollLeft + event.clientX + bx;
      y=document.body.scrollTop + event.clientY;}}
   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
   if(el) {e=(document.layers)?el:el.style;
   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
}

//---------------------------------------------------------------------------------------------------------
//Factoid Generator



function get_factoid()
{
    var ranNum= Math.round(Math.random()*26); //change the mulitplier number to how ever many factoids you have minus 1 
                                             //Therefore if you have 7 factoids make the multipler number 6.  

var factoid = new Array ();
    
factoid[0]="Brascan’s common share price has increased over 30% since last year’s AGM";
factoid[1]="90% of Brascan’s assets are invested in our real estate, financial and power generation businesses";
factoid[2]="The New York Redevelopment Committee, charged with rebuilding the World Trade Center site, is located in Brascan’s One Liberty Plaza";
factoid[3]="Brascan recently launched the $400 million Tricap Restructuring Fund – the first of its kind in Canada";
factoid[4]="Brascan has been in the power generation business for over 100 years";
factoid[5]="Brascan is expanding its asset management business, which currently has $3 billion of assets under management";
factoid[6]="Brascan returned its New York office tenants to their premises in record time following September 11th, some within five weeks";
factoid[7]="Through current acquisitions and new projects, Brascan is increasing its power generating capacity to almost 1,700 megawatts";
factoid[8]="Brascan ranks among the top-ten developers of master planned communities in North America";
factoid[9]="80% of our commercial property income comes from our office properties in supply-constrained markets such as New York City, Boston and Toronto";
factoid[10]="Brascan has recently acquired the 126 megawatt Great Northern Energy hydroelectric power generating system in northern Maine";
factoid[11]="Brascan owns 41% of Nexfor which is the second largest producer of OSB building materials in North America";
factoid[12]="Brascan provides a wide range of business services, largely focused on the execution and administration of residential and commercial real estate transactions";
factoid[13]="Brascan currently has three hydroelectric power plants under construction to serve the growing Brazilian energy market";
factoid[14]="Brascan’s residential operations achieved a record 70% of projected sales for the year by the end of the first quarter";
factoid[15]="Brascan is one of the lowest cost producers of power in North America";
factoid[16]="Brascan owns 40% of Noranda, which recently completed the Antamina zinc-copper mine in Peru, ahead of schedule and below budget with increased reserves";
factoid[17]="Brascan is building a power interconnection between Ontario and Michigan to expand our distribution into that market";
factoid[18]="Commercial real estate represents Brascan’s largest investment, primarily premier office properties across North America";
factoid[19]="Brascan has secured an agreement to acquire  four power generating plants from Ontario Power  Generation";
factoid[20]="Noranda recently launched the Noranda Income Fund, with an initial public offering of $250 million in trut units";
factoid[21]="Brascan has expanded its power operations over the last year to 32 stations, located in B.C., Ontario, Quebec, Maine and Louisiana";
factoid[22]="Brascan teams up with leading financial institutions to lend, invest in and advise companies which are restructuring or rebuilding their operations";
factoid[23]="Brascan has received “Ecologo” certification from Environment Canada as a producer of low impact renewable energy";
factoid[24]="BCE Place is regarded by its peers and tenants as one of the premier office complexes in Canada";
factoid[25]="Almost four million square feet of office space was re-leased during 2001 at increased rates";
factoid[26]="Nexfor recently acquired three OSB mills from International Paper for US$250 million";

document.write(factoid[ranNum]);

}


function newWin(url) {
remote = window.open(url,"NBHwin","width=630,height=450,resizable=1,toolbar=1,menubar=1,directories=0,status=0,scrollbars=1");
remote.opener.name = "opener";
}
