/*	

	Dusted Design Partners Limited

*/

printLink = function() {
	if (document.getElementById("print-but")) {
		var printBut = document.getElementById("print-but");
		printBut.onclick=function() {
			if (window.print) {
				window.print();
			} else {
				alert("Unfortunately your browser doesn't support printing via Javascript.\nTo print this page please select \"File > Print...\" in your browser's menu.");
			}
			return false;
		}
	}
}
addBookmark = function() {
	if (document.getElementById("bookmark-but")) {
		var bookBut = document.getElementById("bookmark-but");
		bookBut.onclick=function() {
			if (document.all) {
				bookmarkurl=document.location;
				bookmarktitle="Terra Firma - Private Equity";
				window.external.AddFavorite(bookmarkurl,bookmarktitle);
			} else {
				alert("Unfortunately your browser doesn't support adding bookmarks via this link.\n\nTo bookmark this page please use your browser's menu.");
			}
			return false;
		}
	}
}

ieHover = function() {
	if (document.getElementById("hovers")) {
		var ieRows = document.getElementById("hovers").getElementsByTagName("tr");
		for (var i=0; i<ieRows.length; i++) {
			ieRows[i].onmouseover=function() {
				this.className+=" iehover";
			}
			ieRows[i].onmouseout=function() {
				this.className="";
			}
		}
	}
}
preHover = function() {
	if (document.getElementById("popups")) {
		var preLinks = document.getElementById("popups").getElementsByTagName("a");
		for (var i=0; i<preLinks.length; i++) {
			preLinks[i].onmouseover=function() {
				whatPopup = this.getAttribute("rel");
				document.getElementById(whatPopup).className="prehover";
			}
			preLinks[i].onmouseout=function() {
				whatPopup = this.getAttribute("rel");
				document.getElementById(whatPopup).className="preview";
			}
		}
	}
}
frameJump = function() {
        if (!document.getElementsByTagName) return;
        var anchors = document.getElementsByTagName("a");
        for (var i=0; i<anchors.length; i++) {
                var anchor = anchors[i];
                anchor.tabindex = i;
                if (anchor.getAttribute("href") && 
	                anchor.getAttribute("rel") == "external")
	                anchor.target = "_parent";
        }
}


window.onload = function() {
	printLink();addBookmark();ieHover();preHover();frameJump();
}
