<!--
/*
			Date: 03/28/2001
Programmer: Cory Schaubs
	Comments: Made the page dynamically adjust to it's environment.
						This will eliminate the need for multiple files.
*/

// These variables must be set for correct linking between the 3 separate server environments that comprise NAPAonline.com -- Other than the two exceptions noted below, changing this file will automatically update all the links for a. The Store Locator section located at Vicinity and b. The FAQ, Returns, and Email section that the Silknet company implemented. (Final resting place should be the server, "support.napaonline.com")

// ** PLEASE NOTE ** An ASP database variable in the Silknet IIS server must be changed whenever the NAPAonline main server variable is changed (They should be the exact same variable). Please contact the appropriate Silknet representative to handle this update.

// ** ALSO PLEASE NOTE ** If you are changing any of these variables, you must also update the "globals.inc" file in order to update all the Net.Commerce Macros' server name links.

// The basic NAPAonline server variable

/****************************************************************************
 due to the way includes are randomly done in the files these functions are
 copied over from browser_detect.js to ease maintainence. Original functions
 getCookieValue(js_name) and readCookie(js_name)
 
 browser_detect.js and server_name_variables.js may not be orderly included
 in all files. Also not all files include browser_detect.js which is the file
 that contains the readCookie function defined.
 ****************************************************************************/
 
 
 function getPCookieValue(js_name)
{
  var js_firstChar, js_lastChar;
  var js_theBigCookie = document.cookie;
  js_firstChar = js_theBigCookie.indexOf(js_name);
  if (js_firstChar != -1) {
    js_firstChar += js_name.length + 1;
    js_lastChar = js_theBigCookie.indexOf(';', js_firstChar);
    if (js_lastChar == -1) js_lastChar = js_theBigCookie.length;
    return js_theBigCookie.substring(js_firstChar, js_lastChar);
  } 
  else {
    return false;
  }
}

function readPCookie(js_name) {
  if (document.cookie == '')
    return false;
  else
    return unescape(getPCookieValue(js_name));
}

//Global Variables
var vicinity_server_name = "";
var silknet_server_name = "";
var server_name = location.hostname;//need to initialize server_name to location.hostname
//in order for the redirection page (index.html) to work correctly if the user types in
//only napa2, pizzazz, etc... instead of napa2.napaonline.com, pizzazz.naponline.com etc...

// We used to set vicinity_server_name in these sections
// The Store Locator section server variable

// We used to set vicinity_server_name here (now done in globals.inc)
if (readPCookie("PARTNERSHIP_ID") == "1") 
{
	//Original - Vicinity
	if (location.hostname == "pizzazz.napaonline.com" || location.hostname == "napa2.napaonline.com" || location.hostname == "hqskanadev1.napaonline.com" || location.hostname == "napasrv7.napaonline.com" || location.hostname == "pizzazz2.napaonline.com")
	{
	}
	else
	{
	}	
}
else 
{
	//Original - Vicinity
if (location.hostname == "pizzazz.napaonline.com" || location.hostname == "napa2.napaonline.com" || location.hostname == "hqskanadev1.napaonline.com" || location.hostname == "napasrv7.napaonline.com" || location.hostname == "pizzazz2.napaonline.com")
	{
	}
	else
	{
	}
}


//Silknet server  and Regular server variables

//QA Test 
if (location.hostname == "hqskanadev1.napaonline.com" || location.hostname == "pizzazz.napaonline.com" )
{
	silknet_server_name = "hqskanadev1.napaonline.com/nolpublic/napa";
	server_name = "pizzazz.napaonline.com";
}

//Staging
if (location.hostname =="www.nolprolink.com")
{
        silknet_server_name=  "hqskanadev1.napaonline.com/nolpublic/napa";
        server_name="www.nolprolink.com";
}

//development
if (location.hostname == "pizzazz2.napaonline.com")
{
	silknet_server_name = "hqskanadev1.napaonline.com/nolpublic/napa";
	server_name = "pizzazz2.napaonline.com";
}


//Production 
if (location.hostname == "b2cws03.napaonline.com" || location.hostname == "www.napaonline.com")
{
	silknet_server_name = "b2cws03.napaonline.com/nolpublic/napa";
	server_name = "www.napaonline.com";
}






