  // Browser Detect  v2.1.6
  // documentation: http://www.dithered.com/javascript/browser_detect/index.html
  // license: http://creativecommons.org/licenses/by/1.0/
  // code by Chris Nott (chris[at]dithered[dot]com)
  var ua = navigator.userAgent.toLowerCase();


  // browser engine name
  this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
  this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

  // browser name
  this.isKonqueror   = (ua.indexOf('konqueror') != -1);
  this.isSafari      = (ua.indexOf('safari') != - 1);
  this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
  this.isOpera       = (ua.indexOf('opera') != -1);
  this.isIcab        = (ua.indexOf('icab') != -1);
  this.isAol         = (ua.indexOf('aol') != -1);
  this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) );
  this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
  this.isFirebird    = (ua.indexOf('firebird/') != -1);
  this.isFirefox     = (ua.indexOf('firefox/') != -1); // scotts
  this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );

  // spoofing and compatible browsers
  this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
  this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);

  // rendering engine versions
  this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
  this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
  this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );

  // browser version
  this.versionMinor = parseFloat(navigator.appVersion);

  // correct version number
  if (this.isGecko && !this.isMozilla) {
    this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
  } else if (this.isMozilla) {
    this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
  } else if (this.isIE && this.versionMinor >= 4) {
    this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
  } else if (this.isKonqueror) {
    this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
  } else if (this.isSafari) {
    this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
  } else if (this.isOmniweb) {
    this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
  } else if (this.isOpera) {
    this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
  } else if (this.isIcab) {
    this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
  }

  this.versionMajor = parseInt(this.versionMinor);
  // dom support
  this.isDOM1 = (document.getElementById);
  this.isDOM2Event = (document.addEventListener && document.removeEventListener);

  // css compatibility mode
  this.mode = document.compatMode ? document.compatMode : 'BackCompat';

  // platform
  this.isWin    = (ua.indexOf('win') != -1);
  this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
  this.isMac    = (ua.indexOf('mac') != -1);
  this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
  this.isLinux  = (ua.indexOf('linux') != -1);

  // specific browser shortcuts
  this.isNS4x = (this.isNS && this.versionMajor == 4);
  this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
  this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
  this.isNS4up = (this.isNS && this.versionMinor >= 4);
  this.isNS6x = (this.isNS && this.versionMajor == 6);
  this.isNS6up = (this.isNS && this.versionMajor >= 6);
  this.isNS7x = (this.isNS && this.versionMajor == 7);
  this.isNS7up = (this.isNS && this.versionMajor >= 7);

  this.isIE4x = (this.isIE && this.versionMajor == 4);
  this.isIE4up = (this.isIE && this.versionMajor >= 4);
  this.isIE5x = (this.isIE && this.versionMajor == 5);
  this.isIE55 = (this.isIE && this.versionMinor == 5.5);
  this.isIE5up = (this.isIE && this.versionMajor >= 5);
  this.isIE6x = (this.isIE && this.versionMajor == 6);
  this.isIE6up = (this.isIE && this.versionMajor >= 6);
  this.isIE4xMac = (this.isIE4x && this.isMac);
//------------------------------------------------------------//

//--- BOOKMARKING --------------------------------//
//------------------------------------------------------------//

function NoBookmarking (){
	alert("Sorry, your browser doesn't support this feature." + 
		"\nPlease use the bookmark feature of your browser to save the location of this page.");
}


function CreateBookmarkLink(thisUrl,thisTitle) {
	if (window.sidebar) {
		if (this.isNS) {
			alert("Netscape users: This link will open in your Sidebar rather than the main page!\n\nTo prevent this, please use the bookmark feature of your browser (Ctrl+D) to save the location of this page.\n\nSorry about this, but it is currently unavoidable with Netscape.");
		} else {
			alert("Firefox users: This link will open in your Sidebar rather than the main page!\n\nTo prevent this, once you have saved this link, from your Bookmarks Manager please right click the link and choose 'Properties' and then uncheck the box marked:\n'Load This Bookmark in the Sidebar'\n\nSorry about this, but it is currently unavoidable with Firefox.");
		}
		window.sidebar.addPanel(thisTitle, thisUrl, "");
	} else if ( window.opera && window.print ) {
		alert("Opera users: By Default this link will open in your Sidebar rather than the main page!\nTo prevent this please uncheck the box marked\n'Show in Panel' that appears on the Add Bookmark window\n\nSorry about this, but it is currently unavoidable with Opera.");
		var mbm = document.createElement('a');
		mbm.setAttribute('rel','sidebar');
		mbm.setAttribute('href',thisUrl);
		mbm.setAttribute('title',thisTitle);
		mbm.click();
	} else if( document.all ) {
		if (!this.isMac) {
			window.external.AddFavorite(thisUrl, thisTitle);
		} else {
			NoBookmarking ();
		}
	}
 }

function HideDiv(divID) { 
	var elem = document.getElementById(divID);
	var editMode = document.getElementById("MSOLayout_InDesignMode");

	if (editMode == null || editMode.value != "1") {
		if (elem != null) {
			elem.style.display = "none";
			elem.style.visibility = "hidden"; 
		}
	}
}

//------------------------------------------------------------//


var newPrint = null;
function popPrinterFriendly(link) {
	newPrint = window.open(link,'newwindow','menubar=1,location=0,resizable=1,scrollbars=1,width=760,height=500');
	newPrint.focus();
	return;
}

var newQuiz = null;
function popQuiz(link) {
	newQuiz = window.open(link,'newwindow','menubar=1,location=0,resizable=1,scrollbars=1,width=540,height=500');
	newQuiz.focus();
	return;
}
var newEmail = null;
function popEmailThisPage(link) {
	link = "/EmailThisPage/Default.aspx?S=" + link;
	newEmail = window.open(link,'newwindow','menubar=0,location=0,resizable=1,scrollbars=1,width=500,height=560');
	newEmail.focus();
	return;
}
//Account Statement popup
function popExWindow(mypage, myname, scroll) {
	var top_position = screen.height / 8;
	var left_position = screen.width / 8;
	windowProperties = 'height='+(screen.height/2)+',width='+(screen.width*3/4)+',top='+top_position+',left='+left_position+',scrollbars='+scroll+',resizable,menubar=yes,toolbar=yes,status=yes,location=yes'
	win = window.open(mypage, myname, windowProperties)
}
//apply class to glossary links
var activateGlossaryLinks = true;//used to disabled gloss links in print preview
function glossaryTag() {
	if (activateGlossaryLinks) {
		var getLinks = document.getElementsByTagName("a");
		//alert(getLinks.length);
		for (var i=0; i < getLinks.length; i++) {
			var getId = getLinks[i].id;
			//alert(getId);
			if (getId.indexOf("IEFGlossary_") != -1) {
				//alert('yes!');
				getLinks[i].className = "glossary";
			}
		}
	}
}
//hide admin login for public site and also perform OneStat collection
//var publicSite = "http://www.investored.ca";//"http://www.investored.ca";
var IefUrls = new Array('http://admin.investored.ca','http://stgapp01.iefprod.com','http://209.167.63.170','http://cx-sywt3v8df0su');
//var IefUrls = new Array('http://admin.investored.ca','http://209.167.63.170','http://cx-sywt3v8df0su');


function showLogin() {
	var siteUrl=document.URL.toString().toLowerCase();
	var checkedUrls = 0;
	for (var i=0; i<IefUrls.length; i++) {
		var matchThis = siteUrl.substring(0,IefUrls[i].length);

		if (matchThis == IefUrls[i]) {
			return;
		} else {
			checkedUrls++;
		}
	}
	if (checkedUrls == IefUrls.length) {
		//Removed as we are doing server side code to hide the bar
		//document.getElementById("sharepointLoginBar").style.display = "none";
		OneStat_Pageview();
		return;
	}
}
//populate search prefix
function populateSearchPrefix(pfx){
	var e=document.getElementsByTagName("input");
	for(var i=0;i<e.length;i++){
		if (e[i].title.indexOf("Search Prefix Source") != -1) {
			if (e[i].value!=null && e[i].value=='')
				e[i].value=pfx;
		}
	}
}
//check if printer friendly, set style sheets
function isPrint() {
	var siteUrl=document.location.toString();
	var ChapPrintId=siteUrl.indexOf("?pvw");
	var printId=siteUrl.indexOf("?print");
	if (printId != -1 || ChapPrintId != -1) {
		activateGlossaryLinks = false;//disable gloss links for print preview
		document.write('<link rel="stylesheet" type="text/css" media="all" href="/Style%20Library/en-us/Core%20Styles/print.css" />');
		//document.write('<div id="Printer"><a href="javascript:window.print();"><span>Print This Page</span></a></div><div id="PrintHeader"><h3><span>Investor Education Fund</span></h3></div><div class="clearboth"></div>');
	} else {
		document.write('<link rel="alternate stylesheet" href="/Style%20Library/en-us/Core%20Styles/IefFontDefault.css" media="screen,print" title="Default Text" type="text/css">');
		document.write('<link rel="alternate stylesheet" href="/Style%20Library/en-us/Core%20Styles/IefFontSmall.css" media="screen,print" title="Small Text" type="text/css">');
		document.write('<link rel="alternate stylesheet" href="/Style%20Library/en-us/Core%20Styles/IefFontLarge.css" media="screen,print" title="Large Text" type="text/css">');
	}
}
isPrint();

//left nav highlighting for pages using generic templates
var LnLinkArray = new Array();//("url","left nav link id")

LnLinkArray[0] = new Array("/personal-finance/Pages/default.aspx","FinancialPlanning");
LnLinkArray[1] = new Array("/personal-finance/investing-basics/","InvestingBasics");
LnLinkArray[2] = new Array("/personal-finance/saving-money-and-managing-debt/","SavingAndManagingDebt");
LnLinkArray[3] = new Array("/personal-finance/saving-money-and-managing-debt/","SavingForRetirement");
LnLinkArray[4] = new Array("/personal-finance/retirement/","SavingForRetirement");
LnLinkArray[5] = new Array("/personal-finance/saving-for-education-resp/","SavingForEducation");
LnLinkArray[6] = new Array("/personal-finance/buying-a-home/","BuyingAHome");
LnLinkArray[7] = new Array("/personal-finance/financial-advice/","GettingFinancialAdvice");
LnLinkArray[8] = new Array("/investments/Pages/default.aspx","KindsOfInvestments");
LnLinkArray[9] = new Array("/investments/gic-and-savings-bonds/","GICsSavingsBonds");
LnLinkArray[10] = new Array("/investments/registered-retirement-savings-plans-rrsp/","RRSPs");
LnLinkArray[11] = new Array("/investments/mutual-funds-and-exchange-traded-funds/","MutualFunds");
LnLinkArray[12] = new Array("/investments/stocks/","Stocks");
LnLinkArray[13] = new Array("/investments/bonds/","Bonds");
LnLinkArray[14] = new Array("/investments/registered-education-savings-plans-resp/","EducationRESPs");
LnLinkArray[15] = new Array("/investments/real-estate/","HomeRealEstate");

LnLinkArray[16] = new Array("/most-popular/","PopularQuestions");
LnLinkArray[17] = new Array("/teachers-corner/Pages/default.aspx","TeachersCorner");
LnLinkArray[18] = new Array("/teachers-corner/curriculum-correlations/","TeachersCorner");
LnLinkArray[19] = new Array("/teachers-corner/guides-and-activities/Pages/resources-order-form.aspx","GuidesandActivities");
LnLinkArray[20] = new Array("/teachers-corner/about/Pages/faqs.aspx","FAQ");
LnLinkArray[21] = new Array("/teachers-corner/about/","AboutTheProgram");
LnLinkArray[22] = new Array("/teachers-corner/about/Pages/e-newsletter/aspx","TeachersCorner");
LnLinkArray[23] = new Array("/teachers-corner/about/Pages/contact-us.aspx","TeachersCorner");
LnLinkArray[24] = new Array("/help/terms-of-use/","TermsOfUse");
LnLinkArray[25] = new Array("/about/contact-us/","ContactUs");
LnLinkArray[26] = new Array("/personal-finance/wills-and-estate-planning/","WillsEstatePlanning");
LnLinkArray[27] = new Array("/about/funding-financial-literacy/","SponsorshipProgram");
LnLinkArray[28] = new Array("/about/funding-financial-literacy/Pages/how-to-apply-for-funding.aspx","HowToSubmitAProposal");
LnLinkArray[29] = new Array("/about/funding-financial-literacy/Pages/sample-of-funded-projects.aspx","ProjectsWeSponsor");
LnLinkArray[30] = new Array("/teachers-corner/guides-and-activities/Pages/fair-play-resources-order-form.aspx","GuidesandActivities");
LnLinkArray[31] = new Array("/teachers-corner/professional-development/Pages/professional-development-interview.aspx","TeachersCorner");
LnLinkArray[32] = new Array("/teachers-corner/about/Pages/testimonials.aspx","TeachersCorner");
LnLinkArray[33] = new Array("/brochures/Pages/ocasi.aspx","SponsorshipProgram");
LnLinkArray[34] = new Array("/investment-news/","News");
LnLinkArray[35] = new Array("/teachers-corner/guides-and-activities/","GuidesandActivities");
LnLinkArray[36] = new Array("/teachers-corner/multimedia-resources/","MultimediaResources");
LnLinkArray[37] = new Array("/teachers-corner/competitions-and-presentations/","CompetitionsandPresentations");
LnLinkArray[38] = new Array("/teachers-corner/professional-development/","ProfessionalDevelopment");
LnLinkArray[39] = new Array("/teachers-corner/recognition-and-awards/Pages/teacher-recognition-criteria.aspx","TeacherRecognition");
LnLinkArray[40] = new Array("/teachers-corner/recognition-and-awards/Pages/student-recognition-award-winners.aspx","StudentAwards");
LnLinkArray[41] = new Array("/teachers-corner/student-resources/","StudentResources");
LnLinkArray[42] = new Array("/teachers-corner/globe-and-mail-classroom/","GlobeandMail");
LnLinkArray[43] = new Array("/teachers-corner/recognition-and-awards/Pages/teacher-recognition-award-winners.aspx","TeacherRecognition");
LnLinkArray[44] = new Array("/featured-topics/","FeaturedTopics");

LnLinkArray[45] = new Array("/personal-finance/wills-and-estate-planning/","WillsEstatePlanning");
LnLinkArray[46] = new Array("/case-studies/","CaseStudies");
LnLinkArray[47] = new Array("/investments/bank-accounts/","BankAccounts");
LnLinkArray[48] = new Array("/investments/pensions/","Pensions");
LnLinkArray[49] = new Array("/investments/registered-retirement-income-funds-rrif-annuities/","RRIF");
LnLinkArray[50] = new Array("/investments/insurance/","Insurance");
LnLinkArray[51] = new Array("/investments/advanced-investments/","AdvancedInvestments");
LnLinkArray[52] = new Array("/investments/tax-free-savings-accounts/","TFSA");
LnLinkArray[53] = new Array("/research-centre/","researchCentre");

LnLinkArray[54] = new Array("/videos/","Videos");

		
function hiliteLgNav() {
	var pageUrl=document.URL.toString();
//	alert ("PageUrl:" + pageUrl);
	//alert(pageUrl);
	for (var i=0; i<LnLinkArray.length;i++) {
		var hiliteThis = pageUrl.indexOf(""+ LnLinkArray[i][0] +"");
		//alert(hiliteThis);
//		alert (i);
		if ( hiliteThis != -1) {
			document.write('<style type="text/css">');
			/*
			if (LnLinkArray[i][1] == "PopularQuestions" || LnLinkArray[i][1] == "ViewAllQuestions") {
				document.write('ul#PopularQuestions_SubNavList  { display:block; }');
			}
			*/
			if (LnLinkArray[i][1] == "TeachersCorner" || LnLinkArray[i][1] == "GuidesandActivities" || LnLinkArray[i][1] == "MultimediaResources" || LnLinkArray[i][1] == "CompetitionsandPresentations" || LnLinkArray[i][1] == "ProfessionalDevelopment" || LnLinkArray[i][1] == "TeacherRecognition" || LnLinkArray[i][1] == "StudentAwards" || LnLinkArray[i][1] == "StudentResources" || LnLinkArray[i][1] == "GlobeandMail") {
				document.write('ul#TeachersCorner_SubNavList { display:block; }');
				document.write('ul#FinancialPlanning_SubNavList, ul#KindsOfInvestments_SubNavList { display:none; }');
			}
			if (LnLinkArray[i][1] == "SponsorshipProgram" || LnLinkArray[i][1] == "HowToSubmitAProposal" || LnLinkArray[i][1] == "ProjectsWeSponsor" || LnLinkArray[i][1] == "HowWeDecide") {
				document.write('ul#SponsorshipProgram_SubNavList { display:block; }');
				document.write('ul#FinancialPlanning_SubNavList, ul#KindsOfInvestments_SubNavList { display:none; }');
			}
			document.write('a#'+LnLinkArray[i][1]+' { color:#A2B904; font-weight:bold; text-decoration:none; }');
			document.write('</style>');
			return;
		}
	}
}
hiliteLgNav();
// start - Rate This Page scripts
var Ratings = new Array("Choose a Rating", "Didn\'t Like It", "Wasn\'t Bad", "Liked It", "Really Liked It", "Loved It!");
//function setRating(rating) {
//	var setRating = document.getElementById("RatingsPanel");
//	var pos = (document.getElementById('rtp_rating').value * 19);
//	setRating.style.backgroundPosition = '0 -'+ pos +'px';
//}
function setCookie(name, value, expires, path, domain, secure) {
	document.cookie= name + "=" + escape(value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}

function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}
function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}
var rateCookie = getCookie("rtpRating");
var RatingPos = (rateCookie * 19);
var RatingStar = " <div id=\"RatingsPanel\" style=\"background-position:0 -"+ RatingPos +"px;\"></div>";
var RatingText = "<span class=\"Rating\">" + Ratings[rateCookie] +"</span>";

function showRating(rating) {
	var setRating = document.getElementById("RatingsPanel");
	var setText = document.getElementById("RatingsText");
	for (var i=1; i < Ratings.length; i++) {
		var pos = 19;
		if (i <= rating) {
			//document.getElementById("RatingStar"+ i +"").style.backgroundImage = 'url(/images/icons/StarOn.png)';
			pos = (pos * i);
			setRating.style.backgroundPosition = '0 -'+ pos +'px';
		}
	}
	setText.innerHTML = ""+ Ratings[rating] +"";
	setText.style.color = "#1F6C8F";
	setText.style.fontWeight = "bold";
}
function resetRating() {
	var setRating = document.getElementById("RatingsPanel");
	var setText = document.getElementById("RatingsText");
	//for (var i=1; i < Ratings.length; i++) {
		//document.getElementById("RatingStar"+ i +"").style.backgroundImage = 'none';
	//}
	rate = document.getElementById('rtp_rating').value;
	if (rate != null && rate > 0) {
		var pos = (rate * 19);
		setRating.style.backgroundPosition = '0 -'+ pos +'px';
		setText.innerHTML = ""+ Ratings[rate] +"";
		setText.style.color = "#1F6C8F";
		setText.style.fontWeight = "bold";
	} else {
		setRating.style.backgroundPosition = '0 0';
		setText.innerHTML = ""+ Ratings[0] +"";
		setText.style.color = "black";
		setText.style.fontWeight = "normal";
	}
}
function sendComments() {
	document.getElementById("RatingsComments").style.display="inline";
	document.getElementById("SendComments").style.display="none";
}
// end - Rate This Page scripts
// searc results paging
function searchPaging() {
	var e = document.getElementsByTagName("a");
	for (var i=0; i<e.length; i++) {
		var url = e[i].href;
		if (url.indexOf("start1=") != -1) {
			var idx = url.indexOf("start1=") + 7;
			var pageIdx = url.substring(idx);
			pageIdx = pageIdx.substring(0,pageIdx.length - 3);
			if (pageIdx > 40) {
				e[i].style.display = 'none';
			}
		}
	}
}

//check regions on homepage for content
function toggleDiv(thisDiv, state) {
	if (state) {
		document.getElementById(thisDiv).style.display = "block";
	} else {
		document.getElementById(thisDiv).style.display = "none";
	}
}

function checkRegions() {
	var teaser = document.getElementById("TeaserBox").getElementsByTagName("h3")[0];
	var spotlight = document.getElementById("Spotlight").getElementsByTagName("h3")[0];
	var str = "<span>&nbsp;</span>";
	var str2 = "<span>        &nbsp;</span>";//for firefox
	var browse1 =  document.getElementById("browse1").getElementsByTagName("h3")[0].innerHTML;
	var browse2 =  document.getElementById("browse2").getElementsByTagName("h3")[0].innerHTML;
	var browse3 =  document.getElementById("browse3").getElementsByTagName("h3")[0].innerHTML;
	var Poll1 =  document.getElementById("Poll1").getElementsByTagName("table")[0];
	var Poll2 =  document.getElementById("Poll2").getElementsByTagName("table")[0];
	var Poll3 =  document.getElementById("Poll3").getElementsByTagName("table")[0];
	
	if (!teaser && !document.getElementById("ctl00_PlaceHolderMain_ctl00_ctl00_ctl00____AddSummaryLink_SortLinks_LINK")) {
		toggleDiv("TeaserBox", false);
	}
	if (!spotlight && !document.getElementById("ctl00_PlaceHolderMain_ctl07_ctl00_ctl00____AddSummaryLink_SortLinks_LINK")) {
		toggleDiv("Spotlight", false);
	}
	
	if (browse1.length == str.length || browse1.length == str2.length) {
		toggleDiv("browse1", false);
	}
	if (browse2.length == str.length || browse2.length == str2.length) {
		toggleDiv("browse2", false);
	}
	if (browse3.length == str.length || browse3.length == str2.length) {
		toggleDiv("browse3", false);
	}
	if (!Poll1) {
		toggleDiv("Poll1", false);
	}
	if (!Poll2) {
		toggleDiv("Poll2", false);
	}
	if (!Poll3) {
		toggleDiv("Poll3", false);
	}
}
//search button
/*function CatchKeyPressEventIE(event,id) {
	if (event && event.which == 13) {
		//alert("got it netscape");
		document.getElementById(id).click();
		return false;
	}
    else
        return true;
}

function CatchKeyPressEvent(event, id) {
	if(navigator.appName == "Netscape")
		return  CatchKeyPressEventIE(event, id);    
 
	if (window.event && window.event.keyCode == 13) {
		//alert("got it ie");
		document.getElementById(id).click();
        return false;
    }
  else
    return true;
}
*/
// set width of upsell, downsell, those who read columns
function setColWidth() {
	var downCol = document.getElementById("lgDownSell");
	var upCol = document.getElementById("lgUpSell");
	var peopleCol = document.getElementById("lgPeopleWhoRead");	
	if (downCol != null && upCol != null && peopleCol != null) {
		document.getElementById("lgDownSell").style.width = "30%";
		document.getElementById("lgUpSell").style.width = "30%";
		document.getElementById("lgPeopleWhoRead").style.width = "30%";
	}
	if (downCol != null && upCol != null && peopleCol == null) {
		document.getElementById("lgDownSell").style.width = "47%";
		document.getElementById("lgUpSell").style.width = "47%";
	}
	if (downCol != null && upCol == null && peopleCol != null) {
		document.getElementById("lgDownSell").style.width = "47%";
		document.getElementById("lgPeopleWhoRead").style.width = "47%";
	}
	if (downCol == null && upCol != null && peopleCol != null) {
		document.getElementById("lgUpSell").style.width = "47%";
		document.getElementById("lgPeopleWhoRead").style.width = "47%";
	}
	if (downCol != null && upCol == null && peopleCol == null) {
		document.getElementById("lgDownSell").style.width = "100%";
	}
	if (downCol == null && upCol != null && peopleCol == null) {
		document.getElementById("lgUpSell").style.width = "100%";
	}
	if (downCol == null && upCol == null && peopleCol != null) {
		document.getElementById("lgPeopleWhoRead").style.width = "100%";
	}
}

// Account ID : 358464
// Website URL: http://www.investored.ca
// Copyright (C) 2002-2007 OneStat.com All Rights Reserved
function OneStat_Pageview()
{
    var d=document;
    var sid="358464";
    var CONTENTSECTION="";
    var osp_ACTION="";
    var osp_TRANSACTION="";
    var osp_AMOUNT="";
    var osp_PRODUCTCODE="";
    var osp_PRODUCTGROUP="";
    var osp_ADCAMPAIGN="";
    var osp_CUSTOMER="";
    var osp_CUST0 = "";
    var osp_CUST1 = "";
    var osp_CUST2 = "";
    var osp_CUST3 = "";
    var osp_CUST10 = "";
    var osp_CUST11 = "";
    var osp_URL=d.URL;
    var osp_Title=d.title;
    var t=new Date();
    var p="http"+(d.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&sid="+sid;
    p+="&url="+escape(osp_URL);
    p+="&ti="+escape(osp_Title);
    p+="&section="+escape(CONTENTSECTION);
    p+="&cma="+escape(osp_ACTION);
    p+="&cmt="+escape(osp_TRANSACTION);
    p+="&cmm="+escape(osp_AMOUNT);
    p+="&cmp="+escape(osp_PRODUCTCODE);
    p+="&cmg="+escape(osp_PRODUCTGROUP);
    p+="&cmad="+escape(osp_ADCAMPAIGN);
    p+="&cmc="+escape(osp_CUSTOMER);
    p+="&cu0="+escape(osp_CUST0);
    p+="&cu1="+escape(osp_CUST1);
    p+="&cu2="+escape(osp_CUST2);
    p+="&cu3="+escape(osp_CUST3);
    p+="&cu10="+escape(osp_CUST10);
    p+="&cu11="+escape(osp_CUST11);
    p+="&rf="+escape(parent==self?document.referrer:top.document.referrer);
    p+="&tz="+escape(t.getTimezoneOffset());
    p+="&ch="+escape(t.getHours());
    p+="&js=1";
    p+="&ul="+escape(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage);
    if(osp_URL!=d.URL) p+="&ol="+escape(d.URL);
    if(typeof(screen)=="object"){
       p+="&sr="+screen.width+"x"+screen.height;p+="&cd="+screen.colorDepth;
       p+="&jo="+(navigator.javaEnabled()?"Yes":"No");
    }
    d.write('<img id="ONESTAT_TAG" border="0" width="1" height="1" src="'+p+'" >');
}



