var process = true;
var NS4 = document.layers ? 1:0
var IE4 = document.all ? 1:0
var IE5 = document.getElementById&&document.all ? 1:0
var NS6 = document.getElementById&&!document.all ? 1:0

apply1 = new Image();
apply1.src = "/images/canadian_mortgage_application-1.gif";
apply0 = new Image();
apply0.src = "/images/canadian_mortgage_application-0.gif";
hi1 = new Image();
hi1.src = "/images/s1.gif";
hi0 = new Image();
hi0.src = "/images/s0.gif";


function imgOn(img)
{
    img1 = eval(img + "1.src");
    document [img].src = img1;
}

function imgOff(img) 
{
    img0 = eval(img + "0.src");
    document [img].src = img0;
}

function AddFavorites() {

	if (IE4) {
		bookmarkSource = location.href;
		bookmarkTitle = document.title;

		document.writeln("<A HREF='javascript:window.external.AddFavorite(\"" + bookmarkSource + '\",\"' + bookmarkTitle + "\");'>" + 
			"<IMG SRC='/images/add_to_favorites.gif' BORDER=0 VSPACE=0 HSPACE=0 HEIGHT=20 WIDTH=75 ALIGN=right ALT='Add to Favorites'></A>"); 
	}
	else if (NS4) {
		document.writeln("<IMG SRC='/images/add_bookmark.gif' BORDER=0 VSPACE=0 HSPACE=0 HEIGHT=20 WIDTH=100 ALIGN=right ALT='Right mouse click to add to Bookmarks'>");
	}
	else if (NS6)  {
		document.writeln("<IMG SRC='/images/bookmark_page.gif' BORDER=0 VSPACE=0 HSPACE=0 HEIGHT=20 WIDTH=100 ALIGN=right ALT='Right mouse click to add to Bookmarks'>");
	}
}

function Rcertify() 
{
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=103032018465222051', 'Participant','location=yes,scrollbars=yes,width=450,height=300'); 
window.name = 'opener';
} 

function OpenWindow(URL,HEIGHT,WIDTH)
{
	popUpWindow = window.open(URL,"InfoWindow",'height=' + HEIGHT + 'px,width=' + WIDTH + 'px,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,center=yes,resizable=yes,left=10,top=170 ');
    popUpWindow.focus();
}



(function(){

	if (typeof window.DONE_OFFSITE_ANALYTICS != "undefined")
		return; // Skip. Only do this once per page loaded.
		
	window.DONE_OFFSITE_ANALYTICS = 1;

	var xhttp;
	if (typeof XMLHttpRequest == "undefined") {
		xhttp = function () {
			try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
			catch (e1) {}
			try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
			catch (e2) {}
			try { return new ActiveXObject("Msxml2.XMLHTTP"); }
			catch (e3) {}
		};
	} else {
		xhttp = XMLHttpRequest;
	}

	if (typeof xhttp != "undefined") {
		var url = '/inc/ceg-inc/offsite_analytics.php?f=' + escape(window.location) + '&r=' + escape(document.referrer);
		var rq = new xhttp();
		rq.onreadystatechange = function() { /* DO NOTHING */ };
		rq.open("GET", url, true);
		rq.send(null);
	}
	
})();