var debug = false;
var bNewWindow = false;
var wtl_loc = document.URL.indexOf('https:')==0?'https://a248.e.akamai.net/v/248/2120/1d/download.akamai.com/crs/lgsitewise.js':'http://crs.akamai.com/crs/lgsitewise.js';
var wtl_TagVer = 6;
var wtl_FWD = 0;
//var wtl_url = document.URL;
var wtl_url = "http://www.coca-cola.com/";
var wtl_title = document.title;
var wtl_TagID = 104655;
var wtl_SID = "005-01-9-20-233860-104655";
var wtl_Offset = "-500";
WTL_TAG = new Image;
WTL_TAG.ID = "WTL_TAG";
var ORDER= "";
var SERVER= "";
var INVOICE= "";
var CARTVIEW= "";
var CARTADD= "";
var CARTREMOVE= "";
var CHECKOUT= "";
var CARTBUY= "";
var ADCAMPAIGN= "";
// These variables can be set by calling modules to override the popup window properties.
var newWindowProps = "";
var newWindowName = "";
var sContentGroup = "Corporate";
function navigate (sUrl, bNewWindow, sSubContentGruop, targetWin) {
if (debug == true) alert( "Navigate : '" + sUrl + "'," + bNewWindow + ",");
if ( targetWin == null ) targetWin = top;
// First do the navigation
if (sUrl.length > 0) {
if (bNewWindow == true || bNewWindow == "true") {
window.open(sUrl, "popup", "width=740,height=520,status=yes,toolbar=yes,menub ar=yes,scrollbars=yes,directories=yes,location=yes ,resizable=yes");
} else {
targetWin.location = sUrl;
}
}
doTracking (sSubContentGruop, targetWin);
}
function doTracking (sSubContentGruop) {
if (debug == true) alert( "Tracking : " + sContentGroup + "," + sSubContentGruop );
// then call the wtl_Tag6
wtl_Tag6(wtl_TagID, wtl_SID, wtl_url, wtl_title, sContentGroup + "," + sSubContentGruop);
//wtl_Tag6(wtl_TagID,wtl_SID,wtl_url,wtl_title);
}
function popupSiteMap() {
var newWindowProps1 = "width=784,height=479,status=no,toolbar=no,menubar =no,scrollbars=1,resizable=no";
var newWindowName1 = "SiteMap";
var sUrl = "/sitemap/index.html";
parent.open (sUrl, newWindowName1, newWindowProps1);
doTracking ("Site Map");
}
function store() {
var newWindowProps1 = "width=780,height=480,status=yes,menubar=yes,toolb ar=yes,resizable=yes,scrollbars=yes,location=yes";
var newWindowName1 = "store";
var sUrl = "http://www.coca-colastore.com";
parent.open (sUrl, newWindowName1, newWindowProps1);
doTracking ("Store");
}
function navigateBack() {
history.back();
doTracking ("Corporate", "Back");
}
var pageRollOvers = [];
var rollOverCounter = 0;
/**
* Called by document.onLoad to create the rollover objects
* Createing a rollover object cause it's on image to be
* preloaded
*
* @param rollOverArray - an array of rollovers records in the form:
* [0] = the name/id of the image object as is in the img tag
* [1] = the off rollover image href
* [2] = the on rollover image href
*/
function createRollOvers(rollOverArray)
{
for (var i=0; i<rollOverArray.length; i++)
addRollOver(new RollOver(rollOverArray[i][0], rollOverArray[i][1], rollOverArray[i][2]));
}
/**
* helper for createRollOvers
*/
function addRollOver(rollOver){ pageRollOvers[rollOverCounter++] = rollOver;}
/**
* used by the anchor tags onMouseOver and onMouseOut calls
* to retrieve the RollOver object that you can call rollOn()
* or rollOff on
*
* @param rolloverName - the name/id of the img href associate
* with a rollover
*
* @return a RollOver object
*/
function getRollOver(rollOverName)
{
for (var i=0; i<rollOverCounter; i++)
{
if (pageRollOvers[i].imageObject == rollOverName)
return pageRollOvers[i];
}
return null;
}
/**
* RollOver object, a simple object that can toggle
* the src of an ImageObject
*
* @param imgObject - the name/id of the image as it
* appears in the img tag
* @param offImageSrc - the href of the off state image
* @param onImageSrc - the href of the on state image
*/
function RollOver(imgObject, offImageSrc, onImageSrc)
{
//preload rollover images
this.preLoadOnImg = new Image();
this.preLoadOnImg.src = onImageSrc;
//object properties
this.imageObject = imgObject;
this.offImageSrc = offImageSrc;
this.onImageSrc = onImageSrc;
//object methods
this.rollOn = RollOver_rollOn;
this.rollOff = RollOver_rollOff;
}
function RollOver_rollOn(){ var img = DOMGetElement(this.imageObject); if (img)img.src=this.onImageSrc;}
function RollOver_rollOff(){ var img = DOMGetElement(this.imageObject); if (img)img.src=this.offImageSrc;}
/**
* Menu Data Structures
*
* Menu Record
* [0] = arbitrary, unique, identifier of the menu state. This
* determines which menu element is "active" and which sub
* menus are displayed
* [1] = OPTIONAL(if this is a text menu): Image name and id as
* designated in the img tag
* [2] = OPTIONAL(if this is a text menu): image width
* [3] = OPTIONAL(if this is a text menu): image height
* [4] = OPTIONAL(if this is a text menu): href to the image
* minus the naming convention extensions such as '_dn'
* and the file type. The default menu printing functions
* will create RollOver obejcts according to the '_dn' & '_ro'
* naming convention. All menu graphics are assumed to be gifs.
* [5] = The 'alt' value of an img tag if this is a graphic menu or the
* menu text if this is a text menu
* [6] = The link for this menu option to link to
* [7] = OPTIONAL: An array of nested menu elements. This is used to create
* a single level of nesting on the left nav but it could
* be used to create create tree menus of arbitrary depth
*/
/**
* Menu Object, prints out a menu based on the above menu data structure.
* The menus were done in an object oriented way to maximize flexibility
* and reusability of functions. LeftNavMenu modifies the behavior
* of Menu by using a different printMenuOption method
*
* @param inMenuOptions = an array of menu options. Eacy array
* element is a 7 element list as outlined above
* @param choice = an indicator of the current page. The
* choice will be compared against the first element
* of each menu option record.
* @returns an initialized menu object that can print a menu
*/
function Menu(inMenuOptions, choice)
{
//Object Properties
this.menuOptions = inMenuOptions
this.choice = choice;
//Object Functions
this.print = Menu_Print;
this.printMenuOption = Menu_PrintMenuOption;
this.optionSelected = Menu_optionSelected;
}
/**
* Used by menu objects to loop over an array of menu
* option arrays...to loop over each menu choice and
* have a replaceable helper function print out the
* menu line item. A helper function does the printing
* so that the object can switch out the function to
* print differet types of menus
*/
function Menu_Print()
{
for (var i=0; i<this.menuOptions.length; i++)
this.printMenuOption(this.menuOptions[i], this.choice1);
}
/**
* Seaches a menuOption and it's sub menus (contained in an
* array in item [7], for a menu option that has matches
* this objects currently selected option. The function
* is recursive and work for an menu structure of
* arbitrary depth.
*
* @param the record to search fro this.choice
*/
function Menu_optionSelected(menuOption)
{
if (menuOption[0] == this.choice)
return true;
else if (menuOption[7]!=null)
for (var i=0; i<menuOption[7].length; i++)
if (this.optionSelected(menuOption[7][i]))
return true;
return false;
}
/**
* This method is designed to print out each
* option in a graphical horizontal menu
*/
function Menu_PrintMenuOption(menuOption)
{
if (this.optionSelected(menuOption))
{
if (NS4)
{
document.write('<td><a href="'+menuOption[6]+'">');
document.write('[img]'+menuOption[4]+'_dn.gif[/img]</a></td>');
}
else
{
document.write('<td><a href="javascript:navigate(\'' + menuOption[6] + '\', false, \'' + menuOption[1] + '\', top)" onMouseOver="'+menuOption[1]+'_am.hideSubMenu(); '+menuOption[1]+'_am.show(); '+menuOption[1]+'_am.activeColor();" onMouseOut="'+menuOption[1]+'_am.menubar.startTimer(); '+menuOption[1]+'_am.normalColor();">');
document.write('[img]'+menuOption[4]+'_dn.gif[/img]</a></td>');
}
}
else
{
if (NS4)
{
addRollOver(new RollOver(menuOption[1], menuOption[4]+'.gif', menuOption[4]+'_ro.gif'));
document.write('<td><a href="'+menuOption[6]+'" onMouseOut="getRollOver(\'' + menuOption[1] + '\').rollOff();" onMouseOver="getRollOver(\'' + menuOption[1] + '\').rollOn();">');
document.write('[img]'+menuOption[4]+'.gif[/img]</a></td>');
}
else
{
addRollOver(new RollOver(menuOption[1], menuOption[4]+'.gif', menuOption[4]+'_ro.gif'));
document.write('<td><a href="javascript:navigate(\'' + menuOption[6] + '\', false, \'' + menuOption[1] + '\', top)" onMouseOut="getRollOver(\'' + menuOption[1] + '\').rollOff(); '+menuOption[1]+'_am.menubar.startTimer(); '+menuOption[1]+'_am.normalColor();" onMouseOver="getRollOver(\'' + menuOption[1] + '\').rollOn(); '+menuOption[1]+'_am.hideSubMenu(); '+menuOption[1]+'_am.show(); '+menuOption[1]+'_am.activeColor();">');
document.write('[img]'+menuOption[4]+'.gif[/img]</a></td>');
}
}
}
/**
* A specialization of the Menu object that replaces
* the printmenuOptions method with one that is
* designed to print out a vertical text based menu
*
* @param inMenuOptions = an array of menu options. Eacy array
* element is a 7 element list as outlined above
* @param choice = an indicator of the current page. The
* choice will be compared against the first element
* of each menu option record.
* @returns an initialized menu object that can print a menu
*/
function LeftNavMenu(inMenuOptions, choice)
{
//data
this.menuOptions = inMenuOptions
this.choice = choice;
//functions
this.print = Menu_Print;
this.optionSelected = Menu_optionSelected;
this.printMenuOption = LeftNavMenu_printMenuOption;
this.printSubOptions = LeftNavMenu_printSubOptions;
}
/**
* Prints a vertical text tree menu.
*
* TODO-make the output routine and table structure
* support arbitrary nesting depths
*/
function LeftNavMenu_printMenuOption(menuOption)
{
if (this.optionSelected(menuOption))
{
if ( menuOption[ 7])
{
document.write('<tr><td valign="top" width="8%">[img]/images/navtree_arrow_dn.gif[/img]</td><td class="copy-navtree" width="92%">'+menuOption[5]+'</td></tr>');
document.write('<tr><td></td><td><table border=0 cellspacing=0 cellpadding=0>');
this.printSubOptions(menuOption);
document.write('</table></td></tr>');
}
else
document.write('<tr><td valign="top" width="8%">[img]/images/navtree_arrow_active.gif[/img]</td><td class="copy-navtree" width="92%">'+menuOption[5]+'</td></tr>');
}
else
{
document.write('<tr><td valign="top" width="8%">[img]/images/navtree_arrow.gif[/img]</td>');
document.write('<td class="copy-navtree" width="92%">'+menuOption[5]+'</td></tr>');
}
}
function LeftNavMenu_printSubOptions(menuOption)
{
for (var i=0; i<menuOption[7].length; i++)
{
//debug(menuOption[7][i]);
if (this.optionSelected(menuOption[7][i]))
{
document.write('<tr><td class="copy-navtree-on" valign="top" width="10%"> </td>');
document.write('<td class="copy-navtree-on" valign="middle" width="90%"> '+menuOption[7][i][5]+'</td></tr>');
}
else
{
document.write('<tr><td class="copy-navtree" width="10%" valign="top">· </td>');
document.write('<td class="copy-navtree" width="90%">'+menuOption[7][i][5]+'</td></tr>');
}
}
}

Rispondi quotando