// Revision #1
// Date: 07/07/2006
// Revision: November/2008: Login Popup


var bcURL = "";
var bcStoreURL = "";
var bcSecureStoreURL = "";
var bcShopCatalog = "";
var sOutcome = ""; 
var searchBoxDisplay = "";
var topRightPanel = "";
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) {
	// The block below is for local development only. -JY
	
	case "localhost":
	//For Current Dev Status only
		bcURL = 'http://localhost';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	break;
	
	case "estwr-12-4":		
		bcURL = 'http://estwr-12-4';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	break;

	case "estwr-12-62":		
		bcURL = 'http://estwr-12-62';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;

	case "estwr-12-63":		
		bcURL = 'http://estwr-12-63';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;

	case "estwr-12-64":		
		bcURL = 'http://estwr-12-64';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;

	case "estwr-12-65":		
		bcURL = 'http://estwr-12-65';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;

	case "estwr-12-77":		
		bcURL = 'http://estwr-12-77';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;
	  
	case "dev.shop.barbiecollector.com":
		bcURL = 'http://dev.barbiecollector.com';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
	break;	

	case "dev.barbiecollector.com":		
		bcURL = 'http://dev.barbiecollector.com';
		bcStoreURL = hostProtocol+'dev.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dev.shop.barbiecollector.com';
		bcShopContactUs = "http://dev.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;

	case "dtcstage.barbiecollector.com":
	case "dtc.stage.shop.barbiecollector.com":
		bcURL = 'http://dtcstage.barbiecollector.com';
		bcStoreURL = hostProtocol+'dtc.stage.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://dtc.stage.shop.barbiecollector.com';
		bcShopContactUs = "http://dtc.stage.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		break;
		
	case "testbarbiecollector.mattel.net":
		bcURL = 'http://testbarbiecollector.mattel.net';
		bcStoreURL = hostProtocol+'stage.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://stage.shop.barbiecollector.com';
		bcShopContactUs = "http://stage.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
		break;

	case "stage.barbiecollector.com":
	case "stage.shop.barbiecollector.com":
		bcURL = 'http://stage.barbiecollector.com';
		bcStoreURL = hostProtocol+'stage.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://stage.shop.barbiecollector.com';
		bcShopContactUs = "http://stage.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
		break;
		
	case "www.barbiecollector.com":
	case "shop.barbiecollector.com":
		bcURL = 'http://www.barbiecollector.com';
		bcStoreURL = hostProtocol+'shop.barbiecollector.com';
		bcSecureStoreURL = 'https://shop.barbiecollector.com';
		bcShopContactUs = "http://shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;	  

	case "test.barbiecollector.com":
		bcURL = 'http://test.barbiecollector.com';
		bcStoreURL = hostProtocol+'stage.shop.barbiecollector.com';
		bcSecureStoreURL = 'https://stage.shop.barbiecollector.com';
		bcShopContactUs = "http://stage.shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;	  
	
	case "bulletinboard.barbiecollector.com":
		bcHostName = 'http://www.barbiecollector.com';
		bcURL = 'http://www.barbiecollector.com';
		bcStoreURL = hostProtocol+'shop.barbiecollector.com';
		bcSecureStoreURL = 'https://shop.barbiecollector.com';
		bcShopContactUs = "http://shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;
	 
	default:
		bcURL = 'http://www.barbiecollector.com';
		bcStoreURL = hostProtocol+'shop.barbiecollector.com';
		bcSecureStoreURL = 'https://shop.barbiecollector.com';
		bcShopContactUs = "http://shop.barbiecollector.com/html/contactus.html";
		searchBoxDisplay = "block";
		topRightPanel = "block";
	  break;
}
	bcShopCatalog = bcSecureStoreURL + "/pls/bc/catreq_main?plsql=/pls/bc";

// Override the searchBoxDisplay if set
if (searchBoxDisplayOverride != "") {
	searchBoxDisplay = searchBoxDisplayOverride;
}

if (topRightPanelOverride != "") {
	topRightPanel = topRightPanelOverride;
}


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 EnterKeySubmit(e) {
	
	if (e.which || e.keyCode) {
        if ((e.which == 13) || (e.keyCode == 13)) {
            document.getElementById('regLogin').click();
            
            return false;
        }
     } else {
        return true
     };
     
   /*  if (event.which || event.keyCode) {
        if ((event.which == 13) || (event.keyCode == 13)) {
            document.getElementById('regLogin').click();
            return false;
        }
     } else {
        return true
     };
*/
}

function Write_BC_Top_Nav() {
	var sOutcome = '';
	
	// ^top setting by pixel	
	
//Begin pagetop layout.
 sOutcome +='<div id="header" style="background-color:#fff;text-align:left;font-size:10px;height:71px;width:766px;">';
 // LRG IMG sOutcome +='<div id="header" style="background-color:#fff;text-align:left;font-size:10px;height:85px;width:766px;">';
 
	// ^top setting by pixel
	
//BC Logo	
	sOutcome +='<div id="headerimg" style="float:left;top:0;text-align:left;padding:8px 0 0 10px;">';
	// LRG IMG sOutcome +='<div id="headerimg" style="float:left;top:0;text-align:left;padding:11px 0 0 11px;">';
	
	sOutcome +='<a href="'+bcURL+'/"><img src="'+bcURL+'/images/topnav2009/bc_2009logo_sml.gif" height="55" width="99" alt="Barbie Collector logo" title="Barbie Collector logo" border="0" /></a>';
	// LRG IMG sOutcome +='<a href="'+bcURL+'/"><img src="'+bcURL+'/images/topnav2009/bc_2009logo.jpg" height="64" width="115" alt="Barbie Collector logo" title="Barbie Collector logo" border="0" /></a>';
	
	 // Countdown Clock entry
		sOutcome +='<span id="countdownBanner" style="padding:0 0 0 97px;"></span>';
		// /Countdown Clock entry
	
	sOutcome +='</div>';
 
	
sOutcome +='<div id="topRightPanel" style="display:'+topRightPanel+'">';

if ( GetCookieCollection("obcc,cun") == null ) {
var sPopupForm = '';

//Begin Dropdown Form
//onkeydown="if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)){document.getElementById(\'regLogin\').click();return false;}} else {return true};"
sPopupForm +='<form method=post name=bclogin id=bclogin action='+bcURL+'/UMS/Login.aspx onkeydown=EnterKeySubmit(event)>';
sPopupForm +='<input type=hidden name=returnURL value=>';
sPopupForm +='<table cellspacing=10 cellpadding=0 border=0>';
sPopupForm +='<tr valign=middle>';
sPopupForm +='<td style=padding:0;><span class=formlabel>Username:</span></td>';
sPopupForm +='<td style=padding:0;><input class=formfield type=text id=txtUsername name=txtUsername size=32 style=width:190;></td>';
sPopupForm +='</tr>';
sPopupForm +='<tr valign=middle>';
sPopupForm +='<td style=padding:0;><span class=formlabel>Password:</span></td>';
sPopupForm +='<td style=padding:0;><input class=formfield type=password id=txtPassword name=txtPassword size=32 style=width:190;></td>';
sPopupForm +='</tr>';
sPopupForm +='<tr valign=middle>';
sPopupForm +='<td colspan=2 align=right style=padding:0;>';
//sPopupForm +='<input type=image name=regLogin id=regLogin src=http://www.barbiecollector.com/images/buttons/login2.jpg alt=login title=login height=20 width=82><br />';
//sPopupForm +='<input type=image name=regLogin id=regLogin src=http://www.barbiecollector.com/images/shared/spacer.jpg alt=login title=login height=1 width=1><br />';
sPopupForm +='<input type=button onclick=javascript:document.bclogin.submit(); name=regLogin id=regLogin alt=login title=login height=20 width=82 value=LOGIN style=color:#fff;background-color:#f685a3;font-family:verdana;font-size:11px;font-weight:bold;width:82px;height:20px; border:1px solid #000; ><br />';
sPopupForm +='</td>';
sPopupForm +='</tr>';
sPopupForm +='<tr valign=middle>';
sPopupForm +='<td colspan=2 align=right style=padding:0;>';
sPopupForm +='<a style=font-size:11px; href='+bcURL+'/UMS/PasswordAssist1.aspx>Forgot your password?</a>';
sPopupForm +='</td>';
sPopupForm +='</tr>';
sPopupForm +='</table>';
sPopupForm +='</form>';
//End of Dropdown Form



	// ^top setting by pixel
 sOutcome +='<div id="divNotLoggedIn" style="position:absolute;right:54px;top:20px;font-weight:bold;color:#757575;">';
 // LRG IMG sOutcome +='<div id="divNotLoggedIn" style="position:absolute;right:54px;top:34px;font-weight:bold;color:#757575;">';
	
 sOutcome +='<p class="logintext">';
 sOutcome +='Welcome!<br />';
 sOutcome +='<a class="logintext" href="javascript:void(0);" onmousedown="return overlib_login(\'' + sPopupForm + '\',CAPTION,\'<div style=padding:3px;>Login in Here!</div>\', CAPTIONSIZE, \'13px\',OFFSETX,-148,OFFSETY,5, STICKY,CLOSECLICK, CLOSESIZE, \'13px\');" onmouseup="return nd();">Log In</a> | <a class="logintext" href="'+bcURL+'/UMS/Registration.aspx">Register</a><br />';
 
 //LEFTOVERS: Original Color - #f6869b
			
} 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" height="52" width="52" style="border-width:3px; border-color:pink" align="left" />';
} else {
	_avatar = '<a class="logintext" href='+bcURL+'/UMS/MyAccount.aspx><img src="'+bcURL+'/images/club/avatars/2006/' + _avatar + '" id="DocumentTop_imgAvatar" style="border-width:3px; border-color:pink" align="left" height="52" width="52" /></a>';
}
	
	
	// ^top setting by pixel
	// AVATARimage
	sOutcome +='<div id="DocumentTop_divLoggedin" style="position:absolute;left:510px;top:11px;width:174px;">';
	// LRG IMG sOutcome +='<div id="DocumentTop_divLoggedin" style="position:absolute;left:510px;top:25px;width:174px;">';
 sOutcome += _avatar;
 sOutcome +='</div>';
	// /AVATARimage


	// ^top setting by pixel
	sOutcome +='<div id="cart" style="position:absolute;right:54px;top:21px;font-weight:bold;color:#757575;">';
	// LRG IMG sOutcome +='<div id="cart" style="position:absolute;right:54px;top:35px;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 />';
	}//End of Else Statement

	sOutcome += show_bag_items() + ' Items in <a href="'+bcShopCart+'">Shopping Bag</a><br />';
 sOutcome +='</p>';
	sOutcome +='</div>'; //End of cart


	// ^top setting by pixel
	// // // Shopping bag image
	sOutcome +='<div id="cartimg" style="float:right;padding:19px 0 0 0;font-weight:bold;color:#757575;">';
	//sOutcome +='<div id="cartimg" style="float:right;padding:23px 0 0 0;font-weight:bold;color:#757575;">';
	sOutcome +='<a href="'+bcShopCart+'"><img src="'+bcURL+'/images/topnav/bcshoppingbag2.gif" alt=""></a>';
	sOutcome +='</div>'; //End of Shopping bag image

	sOutcome +='</div>';
 sOutcome +='</div>'; //End of topRightPanel
 
	
 sOutcome +='<div id="menu">';
	
 //First row of links.
 //Divs can be used here instead of many &nbsp tags.
 sOutcome +='<div id="buttons">';
 sOutcome +='<a href="'+bcURL+'/"><img src="'+bcURL+'/images/topnav2009/topnav2009_home.gif" height="24" width="97" border="0" /></a>';
 sOutcome +='<a href="'+bcURL+'/news/"><img src="'+bcURL+'/images/topnav2009/topnav2009_news.gif" height="24" width="80" border="0" /></a>';
 sOutcome +='<a href="'+bcURL+'/shop/"><img src="'+bcURL+'/images/topnav2009/topnav2009_shop.gif" height="24" width="80" border="0" /></a>';
 sOutcome +='<a href="'+bcURL+'/showcase/"><img src="'+bcURL+'/images/topnav2009/topnav2009_showcase.gif" height="24" width="118" border="0" /></a>';
 sOutcome +='<a href="'+bcURL+'/collecting/"><img src="'+bcURL+'/images/topnav2009/topnav2009_collecting.gif" height="24" width="126" border="0" /></a>';
 sOutcome +='</div>';
 
 // Due to the global menu update, this section ends 02-February-2009
 //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>';

 //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 += '<a onmouseover="return barbielib(\'<div id=hometips class=hometips><nobr>Search BarbieCollector.com</nobr></div>\', LEFT, BELOW, FGCOLOR,\'#ffffff\', BGCOLOR,\'#f6869b\', OFFSETY,17, OFFSETX,57);" onmouseout="return nd();" >';
 sOutcome +='<input name="search" type="image" src="'+bcURL+'/images/buttons/searchfordolls.gif" style="margin:3px 0 0 0;">';
 sOutcome += '</a>';
 sOutcome +='</form>';
 sOutcome +='</div>';
				
 sOutcome +='</div>'; //end id menu


//Second row of links.
 sOutcome +='<div id="menu2">';
 sOutcome +='<a href="'+bcURL+'/BarbieFanClub/"><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;"><a href="/collecting/"><img src="'+bcURL+'/images/landingbars/collecting_header.gif" width="766" height="23" alt="" border="0"></a></div>';    
	if (pairs[1] == 'club') sOutcome +='<div id="section_head" style="margin:1px 0 0 0;"></div>';    


document.write(sOutcome);
	//Outcome.innerHtml = sOutcome; //For future XHTML usage
}

function Write_BCS_Bottom_Nav() {

 var sOutcome = '';
 
 if (pairs[1] == 'BarbieFanClub') {
	if (GetCookieCollection("obcc,logged") > 0) {
	
		sOutcome += '<div style="width:766px;margin:0px 0 0 0;padding:3px 0 6px 0;background:#f1b7bd;text-align:center;">';
		sOutcome += '  <a class=bfc href="/UMS/myaccount.aspx">My Account</a>';
		sOutcome += '  <a class=bfc href="/BarbieFanClub/Legal/Faq.aspx" style="padding:0 27px;">FAQ</a>';
		sOutcome += '  <a class=bfc href="/BarbieFanClub/Legal/BFC_Membership_Agreement.aspx">Membership Agreement</a>';
		sOutcome += ' </div>';
	}
}

 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>';
 }

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 += '<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 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=150160&view=all">Barbie&trade; Dream Sale</a></p>';
	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">Barbie&reg; Fashion Model Collection</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=150162">So In Style&trade;</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">Apparel</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150150">Beauty &';
		sOutcome += '<div style="margin-top:0px;margin-left:24px;padding:0px">Accessories</div>';
		sOutcome += '</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150151">Home & Gifts</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150161">Barbie&trade; Rocks</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/shelf.aspx?deptid=1&shelfid=150163">Jonathan Adler</a></span></li>';
		sOutcome += '<li><span><a href="'+bcURL+'/shop/dept.aspx?deptid=1&shelfid=01&view=all">View All Accents</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/giftcard.aspx">Gift Cards</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 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();
	}