

/* --------------------------------------------------- */
/* POP-UP WINDOW */
/* --------------------------------------------------- */
function openwin(URL,theHeight,theWidth,addScroll) {
	var nXpos = (screen.availWidth - theWidth) / 2; 
	var nYpos = (screen.availHeight - theHeight) / 2; 
	var win = window.open(URL, 'popupWin', 'top=' + nYpos + ',left=' + nXpos + ',screenY=' + nYpos + ',screenX=' + nXpos + ',height=' + theHeight + ',width=' + theWidth + 'toolbar=0,scrollbars=' + addScroll + ',location=0,statusbar=0,menubar=0');
	win.focus();
}



/* --------------------------------------- */
/* OPEN EXTERNAL LINKS IN NEW WINDOW */
/* --------------------------------------- */
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;



/* --------------------------------------- */
/* SHOW LAYERS */
/* --------------------------------------- */
function showMenu(divId,linkId) {
	var subMenu = document.getElementById(divId);
	var linkActive = document.getElementById(linkId);
	
	subMenu.style.visibility = 'visible';
	linkActive.className = 'mainOn';
	
}

/* --------------------------------------- */
/* HIDE LAYERS */
/* --------------------------------------- */
function hideMenu(divId,linkId) {
	
	var subMenu = document.getElementById(divId);
	var linkActive = document.getElementById(linkId);
	var whatsOn = linkId + 'on';
	
	subMenu.style.visibility = 'hidden';
	
	if (linkActive.name !== whatsOn) {
		linkActive.className = 'main';
	}
}



function readIt() {
	ReadRSS('http://www.newageofinnovation.com/blog/movabletype/index.xml','rssBodyTemplate','rssTitleTemplate');
}