/* Updated 09 October 2007 */
/* 
======================================================================
EXTERNAL LINKS
======================================================================
Source: http://www.sitepoint.com/article/standards-compliant-world
Author: Kevin Yank
======================================================================
*/
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
		anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
	}
}
window.onload = externalLinks;

/* 
======================================================================
POPUP WINDOWS
======================================================================
Source: http://accessify.com/features/tutorials/the-perfect-popup/
Author: Ian Lloyd
======================================================================
*/
function popUp(strURL,strType,strHeight,strWidth) {
	var strOptions="";
	if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
	// Custom option for popup
	if (strType=="popWin") strOptions="scrollbars,top=30,height=380,width=530";
	// Open ze window (params are: url, windowname, display options)
	newWindow=window.open(strURL, 'newWin', strOptions);
	newWindow.focus();
}

/* TO USE THE EXTERNAL WINOW/POPUP FUNCTIONS
===========================================
Strict doctype:: 
<a href="my-pop-up-window.htm" onclick="popUp(this.href);return false;" rel="external">This is my link</a>
<a href="my-pop-up-window.htm" onclick="popUp(this.href,'console',400,200);return false;" rel="external">This is my link</a>
<a href="my-pop-up-window.htm" onclick="popUp(this.href,'popWin');return false;" rel="external">This is my link</a>
===========================================
*/