// Revision #1
// Date: 07/07/2006
// Purpose: 


var bcURL = "";
var bcStoreURL = "";
var bcSecureStoreURL = "";
var bcShopCatalog = "";
var sOutcome = ""; 
var searchBoxDisplay = "";
var bcShopContactUs = "";

var hostProtocol = "http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://";

var bcHostName = hostProtocol+location.hostname;
var bcShopMyAcct = "/account/account.php";
var myPath = location.pathname + window.location.search.substring(window.location.search.indexOf("?"));
var query = location.pathname;
var pairs = query.split("/");

switch (location.hostname) {
	// DEV
	case "jpbarbiecollector.29a.mattel.net":
		bcURL = 'http://jpbarbiecollector.29a.mattel.net';
		bcStoreURL = hostProtocol+'shop.jpbarbiecollector.29a.mattel.net';
		bcSecureStoreURL = 'http://shop.jpbarbiecollector.29a.mattel.net';
		bcShopContactUs = "http://shop.jpbarbiecollector.29a.mattel.net/html/contactus.html";
		searchBoxDisplay = "block";
	  break;	  
	// QA
	case "dev.jpbarbiecollector.net":
		bcURL = 'http://dev.jpbarbiecollector.net';
		bcStoreURL = 'http://shop.dev.jpbarbiecollector.net';
		bcSecureStoreURL = 'https://shop.dev.jpbarbiecollector.net';
		bcShopContactUs = "http://shop.dev.jpbarbiecollector.net/html/contactus.html";
		searchBoxDisplay = "block";
	  break;	  
	// STAGING
	case "stagejpbarbiecollector.mattel.net":
		bcHostName = 'http://stagejpbarbiecollector.mattel.net';
		bcURL = 'http://stagejpbarbiecollector.mattel.net';
		bcStoreURL = 'http://shop.stagejpbarbiecollector.mattel.netm';
		bcSecureStoreURL = 'https://shop.stagejpbarbiecollector.mattel.net';
		bcShopContactUs = "http://shop.stagejpbarbiecollector.mattel.net/html/contactus.html";
		searchBoxDisplay = "block";
	  break;
	// PRODUCTION / DEFAULT
	case "www.jpbarbiecollector.com":
	case "shop.jpbarbiecollector.com":   
	default:
		bcURL = 'http://jp.barbiecollector.com';
		bcStoreURL = 'http://shop.jp.barbiecollector.com';
		bcSecureStoreURL = 'https://shop.jp.barbiecollector.com';
		bcShopContactUs = "http://shop.jp.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
	  break;
}
	bcShopCatalog = bcSecureStoreURL + "/pls/bc/catreq_main?plsql=/pls/bc";

// Override the searchBoxDisplay if set
if (searchBoxDisplayOverride != "") {
	searchBoxDisplay = searchBoxDisplayOverride;
}

var bcShopCart = bcStoreURL + '/pls/bc/shopping_bag.main?p_action=viewcart&p_sc_type=S';

// Global Settings
if ( GetCookieCollection("obcc,logged") > 0 ) {
	if ( pairs[2] == "bfc" ) {
		var navfolder = "/images/globalnav/topnav/pink/";
		var isLoggedInLogo = "/barbiecollector/images/bcheader.jpg";
		var isLoggedOut = "<a href='"+bcURL+"/club/logout.aspx?log=out'>Log out</a>";
	} else {
		var navfolder = "/images/globalnav/topnav/white/";
		var isLoggedInLogo = "/barbiecollector/images/bcheader.jpg";
		var isLoggedOut = "<a href='"+bcURL+"/club/logout.aspx?log=out'>Log out</a>";
	}
} else if ( GetCookieCollection("obcc,logged") == -1 ) {
		var navfolder = "/images/globalnav/topnav/white/";
		var isLoggedInLogo = "/barbiecollector/images/bcheader.jpg";
		var isLoggedOut = "<a href='"+bcURL+"/club/logout.aspx?log=out'>Log out</a>";
} else {
		var navfolder = "/images/globalnav/topnav/white/";
		var isLoggedInLogo = "/barbiecollector/images/bcheader.jpg";
		var isLoggedOut = "<a href='"+bcURL+"/club/logout.aspx?log=out'>Log out</a>";
}


function Write_BC_Top_Nav() {
	var sOutcome = '';
	
//	sOutcome +='<!-- This is to center the layout. -->';
 sOutcome +='<div id="header">';
	
	//sOutcome +='<!-- BC Logo -->';				
	sOutcome +='<div id="headerimg" style="position:absolute;left:0;top:0;">';
	sOutcome +='<a href="'+bcURL+'/"><img src="'+bcURL+'/images/topnav/logo.gif" alt="" border="0"></a>';
	sOutcome +='</div>';
 
	//sOutcome +='<!-- Login form -->';	
	
if ( GetCookieCollection("obcc,cun") == null ) {
	sOutcome +='<div id="divNotLoggedIn" style="position:absolute;right:54px;top:10px;font-weight:bold;color:#757575;">';				
	
	// SAVEtoNOV06
	//	sOutcome +='<div id="divNotLoggedIn" style="position:absolute;right:54px;top:10px;font-weight:bold;color:#757575;">';
	//	sOutcome +='<label id="Documenttop1_lblLine1" style="position:absolute;left:0px;top:10px;"><span>Welcome!</span></label>';
//	sOutcome +='<label id="Documenttop1_lblLine2" style="position:absolute;left:0px;top:25px;"><a href=/UMS/Registration.aspx>Log In</a> | <a href=/UMS/Registration.aspx>Register</a></label><br>';
	// /SAVEtoNOV06

 sOutcome +='<p class="logintext">';
 sOutcome +='Welcome!<br />';
	sOutcome +='<a class="logintext" href="' + bcURL + '/UMS/Registration.aspx">Log In</a> | <a class="logintext" href="' + bcURL + '/UMS/Registration.aspx">Register</a><br />';
			
} else { // User is logged in...
		
var _avatar = GetCookieCollection("obcc,cavfilename");
var _displayname = GetCookieCollection("obcc,cdn");

if (_avatar == null || _avatar == '') {
	_avatar ='<img src="'+bcURL+'/images/shared/spacer.gif" id="DocumentTop_imgAvatar" style="border-width:3px; border-color:pink" align="left" height="52" width="52" />';
} else {
	_avatar = '<img src="'+bcURL+'/images/club/avatars/2006/' + _avatar + '" id="DocumentTop_imgAvatar" style="border-width:3px; border-color:pink" align="left" height="52" width="52" />';
}
	
	// AVATARimage
	sOutcome +='<div id="DocumentTop_divLoggedin" style="position:absolute;left:510px;top:5px;width:174px;">';
 sOutcome += _avatar;
 sOutcome +='</div>';
	// /AVATARimage
				
	sOutcome +='<div id="cart" style="position:absolute;right:54px;top:10px;font-weight:bold;color:#757575;">';
 sOutcome +='<p class="logintext">';
	sOutcome +='<a class="logintext" href='+bcURL+'/UMS/MyAccount.aspx>Hi, ' + _displayname + '!</a><br />';
	sOutcome +='<a class="logintext" href='+bcURL+'/UMS/Logout.aspx>Log Out</a> | <a href='+bcURL+'/UMS/MyAccount.aspx>My Account</a><br />';
		
	// SAVEtoNOV06
	// sOutcome +='<span id="DocumentTop_lblLine1" style="position:absolute;left:0px;top:5px;"><a href=/UMS/MyAccount.aspx>Hi, ' + _displayname + '!</a></span>';
	// sOutcome +='<span id="DocumentTop_lblLine2" style="position:absolute;left:0px;top:20px;"><a href=/UMS/Logout.aspx>Log Out</a> | <a href=/UMS/MyAccount.aspx>My Account</a></span><br>';
	// /SAVEtoNOV06
	}
		
	//sOutcome +='<!-- Shopping cart -->';	
 //sOutcome +='<br><br>';
				
	sOutcome += show_bag_items() + ' Items in <a href="'+bcShopCart+'">Shopping Bag</a><br />';
	sOutcome +='</p>';
	sOutcome +='</div>'; // /cart

	sOutcome +='<!-- Shopping bag image -->';
	sOutcome +='<div id="cartimg" style="position:absolute;right:5;top:0px;font-weight:bold;color:#757575;">';
	sOutcome +='<a href="'+bcShopCart+'"><img src="'+bcURL+'/images/topnav/bcshoppingbag.jpg" alt=""></a>';
	sOutcome +='</div>'; // /cartimg
	sOutcome +='</div>';
		
	sOutcome +='<div id="menu">';
	sOutcome +='<!-- First row of links. -->';
	sOutcome +='<!-- Divs can be used here instead of many &nbsp tags. -->';
	sOutcome +='<div id="buttons">';
	sOutcome +='<a href="'+bcURL+'/news/"><img src="'+bcURL+'/images/topnav/topnav_news.gif" border=0 /></a>';
	sOutcome +='<a href="'+bcURL+'/shop/"><img src="'+bcURL+'/images/topnav/topnav_shop.gif" border=0 /></a>';
	sOutcome +='<a href="'+bcURL+'/showcase/"><img src="'+bcURL+'/images/topnav/topnav_showcase.gif" border=0 /></a>';
	sOutcome +='<a href="'+bcURL+'/collecting/"><img src="'+bcURL+'/images/topnav/topnav_collecting.gif" border=0 /></a>';
	sOutcome +='</div>';

	sOutcome +='<!-- Search box -->';
	sOutcome +='<div id="search" style="display:'+searchBoxDisplay+'">';
	sOutcome +='<form action="'+bcURL+'/shop/search.aspx" method="post">';
		
	sOutcome +='<input class="searchtext" name="searchtext" type="text" value="" size="25" maxlength="50" style="height:16px;width:137px;margin:0 0 4px 0;border:none;">&nbsp;';
	sOutcome +='<input name="search" type="image" src="'+bcURL+'/images/buttons/searchfordolls.gif" style="margin:3px 0 0 0;">';
	sOutcome +='</form>';
	sOutcome +='</div>';
					
	sOutcome +='</div>'; //end id menu

	sOutcome +='<!-- Second row of links. -->';
	sOutcome +='<!-- Divs can be used here instead of many &nbsp tags. -->';
	sOutcome +='<div id="menu2">';
	sOutcome +='<a href="'+bcURL+'/club/bfc/"><img src="'+bcURL+'/images/topnav/bfc.gif" border=0 /></a>';
	sOutcome +='<a href="http://bulletinboard.barbiecollector.com/eve/ubb.x"><img src="'+bcURL+'/images/topnav/bb.gif" border=0 /></a>';
	//sOutcome +='<a href="'+bcURL+'/BulletinBoard/"><img src="'+bcURL+'/images/topnav/bb.gif" border=0 /></a>'; 
	sOutcome +='<a href="'+bcURL+'/mycollection/"><img src="'+bcURL+'/images/topnav/mc.gif" border=0 /></a>';
	sOutcome +='<a href="'+bcURL+'/contact/newsletter.aspx"><img src="'+bcURL+'/images/topnav/newsletter.gif" border=0 /></a>';
	sOutcome +='<a href="'+bcShopCatalog+'"><img src="'+bcURL+'/images/topnav/freecatalog.gif" border=0 /></a>';
	sOutcome +='</div>';
	
	if ((pairs[1] == 'shop' && pairs[2] != 'search.aspx') || location.hostname == 'dev.shop.barbiecollector.com' || location.hostname == 'stage.shop.barbiecollector.com' || location.hostname == 'shop.barbiecollector.com') sOutcome +='<div id="section_head" style="margin:1px 0 0 0;"><img src="'+bcURL+'/images/landingbars/shop_header.gif" width="766" height="23" alt="" border="0"></div><div id="section_head" style="margin:1px 0 0 0;"></div>';
	if (pairs[1] == 'showcase') sOutcome +='<div id="section_head" style="margin:1px 0 0 0;"><img src="'+bcURL+'/images/landingbars/showcase_header.gif" width="766" height="23" alt="" border="0"></div>';
	if (pairs[1] == 'news') sOutcome +='<div id="section_head" style="margin:1px 0 0 0;"><img src="'+bcURL+'/images/landingbars/news_header.gif" width="766" height="23" alt="" border="0"></div>';
	if (pairs[1] == 'collecting') sOutcome +='<div id="section_head" style="margin:1px 0 0 0;"><img src="'+bcURL+'/images/landingbars/collecting_header.gif" width="766" height="23" alt="" border="0"></div>';    
	if (pairs[1] == 'club') sOutcome +='<div id="section_head" style="margin:1px 0 0 0;"></div>';    


document.write(sOutcome);
}

function Write_Contact_LeftNav() {
    var sOutcome = '';
    sOutcome += '<div id="leftnav">	';
    sOutcome += '<p><a href="' + bcURL + '/Contact/newsletter.aspx">Newsletter</a></p>';
    sOutcome += '<p><a href="http://shop.barbiecollector.com/html/contactus.html">Contact Us</a></p>';
	sOutcome += '<p><a href="https://shop.barbiecollector.com/pls/bc/catreq_main?plsql=/pls/bc">Catalog</a></p>';
	sOutcome += '<p><a href="' + bcURL + '/Contact/storelocator.aspx">Store Locator</a></p>';
	sOutcome += '<p><a href="' + bcURL + '/Contact/unregister.asp">Unsubscribe</a></p>';
	sOutcome += '</div>';
	document.write (sOutcome);
}

function Write_BCS_Left_Nav() {
    var sOutcome = '';
    sOutcome += '<div id="shopItems1">';
    sOutcome += '<img src="'+bcURL+'/images/shop/sidenav/prod_header1.gif" border=0>';
    sOutcome += '<div class="shopsidenav">';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow3.gif" border=0><a class=shopsidenav href="'+bcURL+'/shop/shelf.aspx?shelfid=0&view=all">What\'s New</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow3.gif" border=0><a class=shopsidenav href="'+bcURL+'/shop/shelf.aspx?deptid=7&shelfid=150157">Special Offers</a></p>';
	
	sOutcome += '<ul id="tmenu0" style="margin: 6px 0 0 2px; display:none;">';
	sOutcome += '<li><span>Exclusives</span></a>';
	sOutcome += '<ul>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150155">Direct Exclusives</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=4&shelfid=150153">Online Exclusives</a></span></li>';
	sOutcome += '</ul>';
	sOutcome += '</li>';
	sOutcome += '</ul>';
	sOutcome += '<ul id="tmenu0" style="margin: 6px 0 0 2px; display:none;">';
	sOutcome += '<li><span>Dolls, Dolls, Dolls</span></a>';	
		sOutcome += '<ul>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150001">Children\'s</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150002">Designers</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150003">Fantasy</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150004">Fashion</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150005">Hollywood</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150156">Playline</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150007">Pop Culture</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150152">Special Occasion</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150010">Vintage Repros</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=2&shelfid=150011">World Culture</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/dept.aspx?deptid=2&shelfid=02&view=all">View All Dolls</a></span></li>';
		sOutcome += '</ul>';
	sOutcome += '</li>';
	sOutcome += '</ul>';
	sOutcome += '<ul id="tmenu0" style="margin: 6px 0 0 2px; display:none;">';
	sOutcome += '<li><span>Fashion & Fun for You</span></a>';
		sOutcome += '<ul>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150149">Home D&#233;cor</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150150">Gifts & Stationery</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150151">Collectibles</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/dept.aspx?deptid=1&shelfid=01&view=all">View All</a></span></li>';
		sOutcome += '</ul>';
	sOutcome += '</li>';
	sOutcome += '</ul>';
	sOutcome += '<div>&nbsp;</div>';	
	sOutcome += '</div>';
	sOutcome += '</div>';
    sOutcome += '<div id="shopItems2">';
	sOutcome += '<img src="'+bcURL+'/images/shop/sidenav/prod_header2.gif" border=0>';
	sOutcome += '<div class="shopsidenav">';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow2.gif" border=0><a class=shopsidenav href="'+bcURL+'/shop/catalog.aspx">Online Catalog</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow2.gif" border=0><a class=shopsidenav href="'+bcStoreURL+'/pls/bc/shopping_bag.main?p_action=quickcart&p_sc_type=Q">Catalog Quick Shop</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow2.gif" border=0><a class=shopsidenav href="'+bcURL+'/shop/promo/">Special Promotions</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow2.gif" border=0><a class=shopsidenav href="'+bcURL+'/shop/giftcerts.aspx">Gift Certificates</a></p>';
	sOutcome += '<div>&nbsp;</div>';
	sOutcome += '</div>';
	sOutcome += '</div>';
    sOutcome += '<div id="shopItems3">';
	sOutcome += '<img src="'+bcURL+'/images/shop/sidenav/prod_header3.gif" border=0>';
	sOutcome += '<div class="shopsidenav">';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow3.gif" border=0><a class=shopsidenav href="'+bcSecureStoreURL+'/account/account.php">My Account</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow3.gif" border=0><a class=shopsidenav href="'+bcSecureStoreURL+'/order_status/order_status.php">Order Status</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow3.gif" border=0><a class=shopsidenav href="'+bcStoreURL+'/shipping_info.html">Shipping Info</a></p>';
	sOutcome += '<p class=shopsidenav><img src="'+bcURL+'/images/shop/sidenav/arrow3.gif" border=0><a class=shopsidenav href="'+bcStoreURL+'/html/faq.html">Help/FAQ</a></p>';
	sOutcome += '<div>&nbsp;</div>';
	sOutcome += '</div>';
	sOutcome += '</div>';
    
    document.write (sOutcome);
    
}


function Write_BCS_Bottom_Nav() {
 var sOutcome = '';
 if (pairs[1] == 'club' || pairs[1] == 'bfc' ) {
	if (GetCookieCollection("obcc,logged") > 0) {
		sOutcome += '<table width="766" cellspacing="0" cellpadding="0" border="0">';
			sOutcome += '<tr>';
				sOutcome += '<td colspan=4 bgcolor="#F1B7BD" align=center>';
					sOutcome += '<table><tr>';
				sOutcome += '<td><a class=bfc href=\"/club/myaccount.aspx\">My Account</a></td>';
				sOutcome += '<td><img src="/images/shared/spacer.gif" width=40 height=12></td>';
				sOutcome += '<td><a class=bfc href="/club/help/faq.aspx">FAQ</a></td>';
				sOutcome += '<td><img src="/images/shared/spacer.gif" width=40 height=12></td>';
				sOutcome += '<td><a class=bfc href="/bfc/BFC_Membership_Agreement.aspx">Membership Agreement</a></td>';
				sOutcome += '<td><img src="/images/shared/spacer.gif" width=40 height=12></td>';
			sOutcome += '</tr></table></td></tr>';
		sOutcome += '</table>';
	}
}
 sOutcome += '<a href="'+bcURL+'/contact/storelocator.aspx"><img src="'+bcURL+'/images/bottomnav/nav1.gif" height="22" width="192" alt="Store Locator" title="Store Locator" border="0"></a>';
 sOutcome += '<a href="http://barbie.everythinggirl.com/"><img src="'+bcURL+'/images/bottomnav/nav2.gif" height="22" width="187" alt="Barbie.com" title="Barbie.com" border="0"></a>';
 sOutcome += '<a href="http://www.everythinggirl.com/" target="_blank"><img src="'+bcURL+'/images/bottomnav/nav3.gif" height="22" width="205" alt="More Fun Sites" title="More Fun Sites" border="0"></a>';
 sOutcome += '<a href="' + bcShopContactUs + '"><img src="'+bcURL+'/images/bottomnav/nav4.gif" height="22" width="182" alt="Contact Us" title="Contact Us" border="0"></a><br />';

	
	if (pairs[1] == 'shop' || location.hostname == 'dev.shop.barbiecollector.com' || location.hostname == 'stage.shop.barbiecollector.com' || location.hostname == 'shop.barbiecollector.com') {
	sOutcome += '<div id="shopDisclaimer" style="padding:12px 0;">';
	sOutcome += '<p class="footer"><span style="font-size:11px;font-weight:bold;color:#ca3366;">Our online shop is for purchases by credit card or gift certificate. You must be 18 or older to order.</span><br />';
	sOutcome += 'Please note that not all Barbie<sup>&#174;</sup> Collector products are available for purchase through our online store.<br>';
	sOutcome += 'For details on individual doll availability, please visit <a href="'+bcURL+'/showcase/" target="_top">'+bcURL+'/showcase</a>';
	sOutcome += '</p>';	
 sOutcome += '</div>';
 }

    //if (location.hostname == 'dev.shop.barbiecollector.com' || location.hostname == 'stage.shop.barbiecollector.com' || location.hostname == 'shop.barbiecollector.com') {	
        // add the footer more consistently with the /UserControl/footer.aspx call


// add the UK Barbie Collector footer link: Mm 19-Oct-2006
sOutcome += '<div id="footer">';
sOutcome += ' <p class="footer">';
sOutcome += '<div class="footer" style="margin:9px 0 0 0;">';
sOutcome += '  <a class="footer" href="'+bcURL+'/Legal/policy.aspx">ONLINE PRIVACY POLICY</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a class="footer" href="'+bcURL+'/Legal/agreement_terms_menu.aspx">Agreements &amp; Terms</a><br /></div>';
sOutcome += '<div class="footer" style="margin:3px 0 9px 0;"><a class="footer" href="javascript:UKPopup(\''+bcURL+'/UKBarbieCollector/UKBarbieCollectorPopup.aspx\',593,387,0,0)">UK Barbie Collector</a></div>';
sOutcome += ' </p>';

/*
        sOutcome += '<div id="footer">';
    	    sOutcome += '<p class="footer">';
	    	    sOutcome += '<a class="footer" href="'+bcURL+'/Contact/policy.aspx">ONLINE PRIVACY POLICY</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a class="footer" href="'+bcURL+'/Contact/agreement_terms_menu.aspx">Agreements &amp; Terms</a>';
	        sOutcome += '</p>';
*/
        	
	        sOutcome += '<p class="footer">';
		        sOutcome += 'ADVERTISEMENT. This website is dedicated to the promotion and sale of collectible Barbie&reg; dolls.';
	        sOutcome += '</p>';
	        sOutcome += '<p class="footer">';
		        sOutcome += 'Use of this site signifies your acceptance of the terms and conditions.<br>';
		        var myDate = new Date();	
		        sOutcome += '&copy; ' + myDate.getFullYear() + ' Mattel, Inc. All Rights Reserved.';
	        sOutcome += '</p>';
        sOutcome += '</div>';
        sOutcome += '<noscript>';
	        sOutcome += '<img border="0" name="DCSIMG" width="1" height="1" src="http://dcs.mattel.com/DCSFzf6f2B4S3eDMs3lPV83F5_6E4O/njs.gif?dcsuri=/nojavascript">';	        
        sOutcome += '</noscript>';
        //WebTrends 8.0
        sOutcome += '<noscript><img id="dcsimg_v8" width="1" height="1" src="http://statse.webtrendslive.com/dcsk315wd00000s9urat1hui4_3e3y/njs.gif?dcsuri=<%=Request.RawUrl%>&amp;WT.js=No&amp;WT.tv=8.0.0&amp;brand=barbiecollector" alt="" border="0" /></noscript>';
    

document.write (sOutcome);
}



////////////////////////////////////////////////////////////////////////////////////
//Function to activate images.
function imgOn(imgName) {
	if (document.images) {
		if(imgName == 'topnav7') {
	   	document["topnav6"].src = eval(imgName + "on.src");
		} else{
			document[imgName].src = eval(imgName + "on.src");
		}
	}
}
//Function to deactivate images.
function imgOff(imgName) {
	if (document.images) {
		if(imgName == 'topnav7') {
			document["topnav6"].src = eval(imgName + "off.src");
		} else{
			document[imgName].src = eval(imgName + "off.src");
		}
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////// Cookie sharing
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function GetCookieCollection(name) {
//Author: Nathan Vo
//Date: 12/16/2003
//Mattel, Inc.
//This function is to check cookie collections

	var myCookieCollection = name.split(",");
	
	if (myCookieCollection.length == 2 ) {	
		var myCookie = GetCookie(myCookieCollection[0]);
		var arg = myCookieCollection[1] + "=";	
		var alen = arg.length;
		var clen = myCookie.length;
		var i = 0;
		while (i < clen) {
			var j = i + alen; 
			if (myCookie.substring(i, j) == arg) {
				var endstr = myCookie.indexOf ("&", j);
				if (endstr == -1) endstr = myCookie.length;
				return unescape(myCookie.substring(j, endstr));					
				
			}				
			i++;
			if (i == 0) break;
		}
	} else {
		return GetCookie(name);
	}
}


	function getCookieVal (offset) {
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1) 
			endstr = document.cookie.length;
			return unescape(document.cookie.substring(offset, endstr));
		}

	function GetCookie (name) {
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;

		while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
				return getCookieVal (j);
				i = document.cookie.indexOf(" ", i) + 1;
				if (i == 0) break;
		}
		return""; //or return null
	}  
	
	function SetCookie (name, value) {
		var argv = SetCookie.arguments;
		var argc = SetCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
	}

	function add_to_cart() {
		var expdate = new Date ();
		expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
		
		var count = GetCookie("BAG_COUNT");
		
		if(count == null) SetCookie("BAG_COUNT", "0");
		else {
			var newcount = parseInt(count) + 1;
			DeleteCookie("BAG_COUNT");
			SetCookie("BAG_COUNT", newcount, expdate);
		}
	}

	function remove_from_cart() {
		var expdate = new Date ();
		expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
		
		var count = GetCookie("BAG_COUNT");
		
		if(count == null || count == 0) SetCookie("BAG_COUNT", "0");
		else {
			var newcount = parseInt(count) - 1;
			DeleteCookie("BAG_COUNT");
			SetCookie("BAG_COUNT", newcount, expdate);
		}
	}
	
	function DeleteCookie (name) {  
		var exp = new Date();  
		exp.setTime (exp.getTime() - 1);   
		var cval = GetCookie (name);  
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
	}
	
	function show_bag_items() {
		if(GetCookie("BAG_COUNT") == null || GetCookie("BAG_COUNT") == 0) return 0;
		else return GetCookie("BAG_COUNT");
	}

	// UK-BC popup.
	function UKPopup(URL, w, h, scrollYN, resizeYN){
	popupWindow=window.open(URL, 'ukpop','toolbar=no,scrollbars=' + scrollYN + ',location=no,statusbar=no,menubar=no,resizable=' +  resizeYN + ',width=' + w + ',height=' + h + ',left=75,top=75');
	popupWindow.focus();
	}
