
function updateFramesAll(thisNum,thisAd) {
	parent.tab.location="tab.exclude.html";
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesSp1(thisNum) {
	parent.tab.location="tab.exclude.html";
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
}
function updateFramesNoNav(thisNum,thisAd) {
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesNoNavsp(thisNum,thisAd) {
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
	parent.sponsor.location="sponsor.exclude.html";	
}
function updateFramesBPR(thisNum,thisAd) {
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
	parent.tab.location="tab.exclude.html";	
}
function updateFramesNoNavF500(thisNum,thisAd) {
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.right.location="right.nav.exclude.html?thisNum=" + thisNum;
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesNoNavPhoto(thisNum,thisAd) {
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesTabNav(thisTab,thisNum,thisAd) {
	parent.photo.location="picture." + thisTab + "." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisTab + "." + thisNum + ".exclude.html";
	parent.content.location="content." + thisTab + "." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesTabNavNew(thisTab,thisNum,thisAd) {
	parent.content.location="content." + thisTab + "." + thisNum + ".html";
	parent.photo.location="picture." + thisTab + "." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisTab + "." + thisNum + ".exclude.html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
	parent.tab.location="tab." + thisTab + ".exclude.html";
}
function updateFramesRE(thisHome,thisImg,thisAd) {
	parent.photo.location="picture." + thisHome + "." + thisImg + ".exclude.html";
	parent.nav.location="nav." + thisHome + "." + thisImg + ".exclude.html";
	parent.content.location="content." + thisHome + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesREsp(thisHome,thisImg,thisAd) {
	parent.content.location="content." + thisHome + ".html";
	parent.photo.location="picture." + thisHome + "." + thisImg + ".exclude.html";
	parent.nav.location="nav." + thisHome + "." + thisImg + ".exclude.html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
	parent.sponsor.location="sponsor.exclude.html";
}
function updateFramesREimg(thisHome,thisImg,thisAd) {
	parent.photo.location="picture." + thisHome + "." + thisImg + ".exclude.html";
	parent.nav.location="nav." + thisHome + "." + thisImg + ".exclude.html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
}
function updateFramesAllX2(thisNum,thisTab,thisAd) {
	parent.tab.location="tab." + thisTab + ".exclude.html";
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.content.location="content." + thisNum + ".html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
	updateFramesX2(thisTab);
	updateFramesX2(thisTab);
}
function updateFramesTabRoll(thisNum,thisNav,thisAd) {
	parent.content.location="content." + thisNum + ".html";
	parent.photo.location="picture." + thisNum + ".exclude.html";
	parent.nav.location="nav." + thisNum + ".exclude.html";
	parent.ad.location="/popups/ads/bottom." + thisAd + ".exclude.html";
	parent.tab.location="tab.exclude.html" + "#tab" + thisNav;
	}
function updateFramesX(navUrl) {
	parent.tab.location=navUrl;
	}
function updateFramesX2(thisTab) {
	parent.tab.location="tab." + thisTab + ".exclude.html";
}
function writeMagLogo(pathName) {
	var myPath = pathName;
	if (myPath.match("biz2")) {
		document.write('<map name="logomap"><area alt="BUSINESS 2.0" coords="0,2,131,29" href="/magazines/business2" target="opener"><area alt="CNNMoney.com" coords="132,3,220,32" href="http://money.cnn.com" target="opener"></map><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/b2_on_cnnmoney.gif" alt="Business 2.0 on CNNMoney.com" width="222" height="29" border="0" usemap="#logomap">');
	} else if (myPath.match("fortune")) {
		document.write('<map name="logomap"><area alt="FORTUNE" coords="1,1,123,25" href="/magazines/fortune/" target="opener"><area alt="CNNMoney.com" coords="132,0,224,26" href="http://money.cnn.com/" target="opener"></map><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/fortune_logo.gif" alt="CNNMoney.com" width="224" height="26" border="0" usemap="#logomap">');
	} else if (myPath.match("fsb")) {
		document.write('<map name="logomap"><area alt="FORTUNE Small Business" coords="-9,-1,88,27" href="/magazines/fsb/" target="opener"><area alt="CNNMoney.com" coords="102,0,197,26" href="/" target="opener"></map><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/fsb_on_cnnmoney.gif" alt="CNNMoney.com" width="222" height="29" border="0" usemap="#logomap">');
	} else if (myPath.match("moneymag")) {
		document.write('<map name="logomap"><area alt="MONEY" coords="2,2,78,25" href="/magazines/moneymag/" target="opener"><area alt="CNNMoney.com" coords="85,0,181,25" href="http://money.cnn.com/" target="opener"></map><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/money_on_cnnmoney.gif" alt="CNNMoney.com" width="179" height="26" border="0" usemap="#logomap">');
	} else {
		document.write('<a href="http://money.cnn.com/" target="opener"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/cnn_money_popuplogo.gif" alt="CNNMoney.com" width="123" height="21" border="0"></a>');
	}
}
function writeMoreMenu(pathName) {
	var moreMenu = "none";
	if (pathName.match("biz2")) {
		moreMenu = "biz2";
	} else if (pathName.match("fortune")) {
		moreMenu = "fortune";
	} else if (pathName.match("fortune/quizzes")) {
		moreMenu = "quizzes";
	} else if (pathName.match("fsb")) {
		moreMenu = "fsb";
	} else if (pathName.match("moneymag")) {
		moreMenu = "moneymag";
	} else if (pathName.match("autos")) {
		moreMenu = "autos";
	} else if (pathName.match("consumer")) {
		moreMenu = "consumer";
	} else if (pathName.match("real_estate")) {
		moreMenu = "real_estate";
	} else {
		moreMenu = "none";
	}
	document.write('<iframe src="/popups/more.' + moreMenu + '.exclude.html" width="140" height="28" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" align="right"></iframe>');
}

function writeNextButtons(numSlides,dirPath) {
var string = document.location.pathname;
var num1 = string.lastIndexOf('/') + 1;
var num2 = string.lastIndexOf('.');
var thisPage = string.substring(num1, num2);
if ( (thisPage=='index') || (string==dirPath) ) {
	var prevPage = 'jump';
	var nextPage = '2';
	var seqNum = '1';
} else if (thisPage==numSlides) {
	var pageNum = thisPage * 1;
	var prevPage = pageNum - 1;
	var nextPage = 'jump';
	var seqNum = pageNum;
} else if (thisPage=='2') {
	var pageNum = thisPage * 1;
	var prevPage = 'index';
	var nextPage = pageNum + 1;
	var seqNum = pageNum;
} else {
	var pageNum = thisPage * 1;
	var prevPage = pageNum - 1;
	var nextPage = pageNum + 1;
	var seqNum = pageNum;
}
document.write('<table cellspacing="0" cellpadding="0" border="0" class="navrow"><tr><td>');
document.write('<a href=\"' + prevPage + '.html">');
document.write('<img src="http://i.cnn.net/money/.element/img/1.0/popup_common/button_back_sm.gif" width="60" height="24" border="0" alt="BACK"></a></td><td>');
document.write('<a href=\"' + nextPage + '.html">');
document.write('<img src="http://i.cnn.net/money/.element/img/1.0/popup_common/button_next_sm.gif" width="60" height="24" border="0" alt="NEXT"></a></td><td class="photorder">');
document.write( seqNum + '&nbsp;of&nbsp;' + numSlides );
document.write('</td></tr></table>');
}

function writeMagLogo2() {
	var myPath = top.location.pathname;
	if (myPath.match("biz2")) {
		document.write('<a href="/magazines/business2/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_b2_fullpage.gif" width="160" height="45" border="0" alt="Business 2.0" align="absmiddle"></a>');
	} else if (myPath.match("fortune")) {
		document.write('<a href="/magazines/fortune/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_fortune_fullpage.gif" width="160" height="45" border="0" alt="Fortune Magazine" align="absmiddle"></a>');
	} else if (myPath.match("fsb")) {
		document.write('<a href="/magazines/fsb/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_fsb_fullpage.gif" width="160" height="45" border="0" alt="Fortune Small Business" align="absmiddle"></a>');
	} else if (myPath.match("moneymag")) {
		document.write('<a href="/magazines/moneymag/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_money_fullpage.gif" width="160" height="45" border="0" alt="Money Magazine" align="absmiddle"></a>');
	} else { }
}

function writeMagLogo3() {
	var myPath = top.location.pathname;
	if (myPath.match("biz2")) {
		document.write('<td class="logo" width="160"><a href="/magazines/business2/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_b2_fullpage.gif" width="160" height="45" border="0" alt="Business 2.0" align="absmiddle"></a></td><td class="logo">');
	} else if (myPath.match("fortune")) {
		document.write('<td class="logo" width="160"><a href="/magazines/fortune/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_fortune_fullpage.gif" width="160" height="45" border="0" alt="Fortune Magazine" align="absmiddle"></a></td><td class="logo">');
	} else if (myPath.match("fsb")) {
		document.write('<td class="logo" width="160"><a href="/magazines/fsb/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_fsb_fullpage.gif" width="160" height="45" border="0" alt="Fortune Small Business" align="absmiddle"></a></td><td class="logo">');
	} else if (myPath.match("moneymag")) {
		document.write('<td class="logo" width="160"><a href="/magazines/moneymag/index.html"><img src="http://i.cnn.net/money/.element/img/1.0/popup_common/logo_money_fullpage.gif" width="160" height="45" border="0" alt="Money Magazine" align="absmiddle"></a></td><td class="logo">');
	} else { document.write('<td class="nomaglogo">');}
}

function writeSource() {
	var mySource = "CNN";
	if (location.pathname.match("biz2")) {
		var mySource = "BIZ2";
	} else if (location.pathname.match("fortune")) {
		var mySource = "FORT";
	} else if (location.pathname.match("fsb")) {
		var mySource = "FSB";
	} else if (location.pathname.match("moneymag")) {
		var mySource = "MONEY";
	}
	return mySource;
}

function writeTitleTag(thisTitle,dirPath) {
	var myTitle = thisTitle;
	var myPath = dirPath;
	
	var string = document.location.pathname;
	var num1 = string.lastIndexOf('/') + 1;
	var num2 = string.lastIndexOf('.');
	var thisPage = string.substring(num1, num2);
	var titleLoc;
	if ( (thisPage=='index') || (string==myPath) ) {
		var titleLoc = '1';
	} else if (thisPage=='jump') {
		var titleLoc = 'More';
	} else {
		var titleLoc = thisPage;
	}
	
	var magSource = "CNNMoney";
	if (location.pathname.match("biz2")) {
		var magSource = "Business 2.0";
	} else if (location.pathname.match("fortune")) {
		var magSource = "FORTUNE";
	} else if (location.pathname.match("fsb")) {
		var magSource = "Fortune Small Business";
	} else if (location.pathname.match("moneymag")) {
		var magSource = "Money Magazine";
	}
	
	var titleTag = '<title>' + myTitle + ' | '  + titleLoc + ' | ' + magSource + '</title>';
	document.write(titleTag);
}