// JavaScript Document
var menuArray = new Array('Home','Services','Radnor','About','Contact');
var linkArray = new Array('index','services','radnor','about','contact');
var homeAddress = "http://www.radnorfinancial.com/";
//var homeAddress = "http://www.pointlisse.com/RFAI/";
//var homeAddress = "http://mistress:8500/RFAI/";

function createMenu(homepage, menuID){ // boolean for location (index), item to be highlighted
	// handle homepage/regularpage location
	if(homepage)
		var pathText = "";
	else
		var pathText = "../";
		
	document.write('<table border="0" cellpadding="0" cellspacing="0"><tr>');
	// left cap
	document.write('<td><img src="'+pathText+'art/menuCapLeft.gif" border="0"></td>');
	
	
		
	// output each menu; handle home separately
	if((homepage) && (menuID == 0))
		document.write('<td><a href="'+homeAddress+'index.cfm"><img src="'+pathText+'art/menuHomeOn.gif" border="0" id="menu0" /></a></td>');
	if((homepage == 0) && (menuID))
		document.write('<td><a href="'+homeAddress+'index.cfm" onMouseOver="swapMenu(0,1,1)" onMouseOut="swapMenu(0,0,1)"><img src="'+pathText+'art/menuHomeOff.gif" border="0" id="menu0" /></a></td>');
	
	document.write('<td><img src="'+pathText+'art/menuBack.gif" border="0" height="26" width="50" /></td>');
	
	var loopct = menuArray.length;
	for(m=1; m<loopct; m++){
		if(m == menuID)
			document.write('<td><a href="'+pathText+'html/'+menuArray[m]+'.html"><img src="'+pathText+'art/menu'+menuArray[m]+'On.gif" border="0" id="menu'+m+'" /></a></td>');
		else
			document.write('<td><a href="'+pathText+'html/'+menuArray[m]+'.html" onMouseOver="swapMenu('+m+',1,0)" onMouseOut="swapMenu('+m+',0,0)"><img src="'+pathText+'art/menu'+menuArray[m]+'Off.gif" border="0" id="menu'+m+'" /></a></td>');
		
		// add spacer where appropriate
		if(m < loopct-1)
			document.write('<td><img src="'+pathText+'art/menuBack.gif" border="0" height="26" width="50" /></td>');
		}
	
	//right cap
	document.write('<td><img src="'+pathText+'art/menuCapRight.gif" border="0"></td>');
	document.write('</tr></table>');
	}
	
// mouseOver/Out functionality
function swapMenu(menuID, state, homepage){	
	var theMenu = document.getElementById("menu"+menuID);
	// swapOver
	if(state){
		theMenu.src = homeAddress+"art/menu"+menuArray[menuID]+"Over.gif";
		}
	else{
		theMenu.src = homeAddress+"art/menu"+menuArray[menuID]+"Off.gif";
		}
	}
	
function showFooter(){
	var rYear = new Date();
	document.write('<div style="width:690px;" class="subText" align="left"><br />Copyright &copy; '+rYear.getFullYear()+' Radnor Financial Advisors, Inc. All rights reserved.<br><br></div>');
	}
	
function showHeader(incLogo){
	if(incLogo)
		var topPad = 5;
	else
		var topPad = -9;
		
	document.write('<div style="width:inherit; padding-right:43px; margin-top:'+topPad+'px;" align="right" class="subText"><a href="javascript:rfaiPop(\'disclosure\')">Important Disclosure Information</a> &bull; <a href="javascript:rfaiPop(\'privacy\')">Privacy Statement</a> &bull; <a href="javascript:rfaiPop(\'help\')">Site Help</a>  &bull; <a href="javascript:rfaiPop(\'login\')">Client Login</a></div>');
	if(incLogo){ // include small logoType
		document.write('<div style="width:inherit; padding-left:43px; padding-bottom:8px;" align="left"><a href="'+homeAddress+'"><img src="../art/rfaiLogoSmall.gif" width="332" height="64" border="0" alt="Radnor Financial Advisors, Inc. - Personal Wealth Management Services"></a></div>');
		}
	}
	
function rfaiPop(theWin, pdfName, resize){
	// only allow resizing of window if argument is provided.
	if(!resize)
		resize = 0;
		
	if(theWin == 'map'){
		var thePage = "http://maps.yahoo.com/py/maps.py?Pyt=Tmap&addr=485+Devon+Park+Drive,+Suite+119&csz=Wayne%2C+PA+19087&Get%A0Map=Get+Map";
		var theH = 800;
		var theW = 950;
		var winName = "mapWin";
		}
	else if(theWin == 'login'){
		//window.document.location.href=homeAddress+"html/clientLogin.html";
		window.document.location.href="https://secure.radnorfinancial.com";
		return false;
		}
	else if(theWin == 'pdfview'){
		var thePage = homeAddress+"html/"+pdfName;
		var theH = 500;
		var theW = 700;
		var winName = "pdfWin";
		}
	else{
		var thePage = homeAddress+"html/"+theWin+".html";
		var theH = 320;
		var theW = 500;
		var winName = "helpWin";
		}
	var popWin = window.open(thePage,winName,'menubar=0,location=0, directories=0, height='+theH+', width='+theW+', left=0, status=0, toolbar=0,top=0,scrollbars=1,resizable='+resize);
	}
	
	
// create menus

var rMenuServices = new Array('Personal Wealth Management','Executive Financial Planning','Tax Preparation and Accounting');
var rMenuAbout = new Array('Who We Are','Our Philosophy','About Our Logo');
var rMenuArray = new Array(rMenuServices,rMenuAbout);

function createSubMenu(menu,current){ // which menu, which item selected
	// output menu
	var menuLen = rMenuArray[menu].length;
	document.write('<div id="subMenu">');
	for(s=0; s<menuLen; s++){
		document.write('<img src="../art/linkBullet.gif" width="9" height="9" align="middle">');
		if(s == current)
			document.write('<span class="subSelected">'+rMenuArray[menu][s]+'</span>');
		else 
			document.write('<a href="'+rMenuArray[menu][s].replace(/ /g,"")+'.html">'+rMenuArray[menu][s]+'</a>');
		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
		//if(s < menuLen-1)
			//document.write(' | ');
		}
	document.write('</div><br>');
	}
	
function viewArticle(theArticle){
	 if (document.images)
            location.replace('html/Radnor.html#'+theArticle);
        else
            location.href = 'html/Radnor.html#'+theArticle;
	//document.location.href = 'html/Radnor.html#journal';
	rfaiPop('pdfview',theArticle,1);
	
	}