/**
 * Common client-side functions
 * @ctype file
 * @id /diy_main/common_lib.js
 * @name common_lib.js
 * @author
 * @version $Revision:   4.13  $
 * @file $RCSfile$
 * @revdate $Date:   Apr 14 2004 16:36:20  $
 */

function getClientSideArgsForExternalSites(serverSideArgs){
		if (serverSideArgs){
			
			if(top && top.Session_userLoggedIn){ 
				 serverSideArgs += "&userLoggedIn="+ top.Session_userLoggedIn;
			}	
			if(getCookie("userName") != null){
				 serverSideArgs += "&userName=" + getCookie("userName");
			}
			if(getCookie("hdStore") != null && getCookie("targetedBizID") != null){
				var targetStoreId = getCookie("targetedBizID");
				serverSideArgs += "&targetedBizID="+targetStoreId;
				var storeInfo = getCookie("hdStore");
				var storeInfoArray = storeInfo.split("|");
				serverSideArgs += "&hdStoreName=" + escape(storeInfoArray[0]);
				serverSideArgs += "&hdStoreNumber=" + escape(storeInfoArray[3]);
			}	
			return serverSideArgs;
		}
	else {
		return null;
	}	
}

function openEmailFeature(URL,title,winWidth,winHeight){

    var winY,winX = 0;
        if (screen.width>winWidth && screen.height>winHeight){
            winX=(screen.width-winWidth)/2;
            winY=(screen.height-winHeight)/2;
        }
        var winOptions  = 'resizable=yes,scrollbars=yes,location=no,toolbar=yes,status=yes,top='+winY+',left='+winX;
        winOptions += ',screenX=10,screenY=10,width='+winWidth+',height='+winHeight;
        var popupWin2 = window.open(URL, title, winOptions);
        window.top.name='opener';
        if (popupWin2) {
            popupWin2.focus();
        }
    document.promoForm.enterPromoEmail.value = "";
}	
function getCSAnchorString(cntType, cntKey, destPath, destProto, args, anchor){ 
	var retStr = "" ;
	if (destProto == null)destProto = "http" ;
	var newLink = getCSLinkObject(cntType, cntKey, destPath, destProto) ;
	if (newLink != null)
	{
		if (newLink.href != null && newLink.href != "")
		{	if (args != null && args!= "")
				newLink.href += "&"+args;
			if (anchor != null && anchor != "")
				newLink.href += "#" + anchor;			
		}
		else
		{	newLink.href = "#";
			newLink.target = "_self";
		}
		retStr = "<a class=Jlink href=\"" + newLink.href + "\" target=\"" + newLink.target + "\">" ;
	}
	return retStr ;
}	
function getCSCorporateAnchorString(destPath, args, anchor){ 
	var retStr = "" ;
	var destProto = "http" ;
	var newLink = getCSCorporateLinkObject(destPath, args, anchor) ;
	if (newLink != null)
	{
		if (newLink.href != null && newLink.href != "")
		{	if (args != null && args!= "")
				newLink.href += "&"+args;
			if (anchor != null && anchor != "")
				newLink.href += "#" + anchor;			
		}
		else
		{	newLink.href = "#";
			newLink.target = "_self";
		}
		retStr = "<a class=Jlink href=\"" + newLink.href + "\" target=\"" + newLink.target + "\">" ;
	}
	return retStr ;
}
function getCSCorporateLinkObject(destPath, args, anchor){
	var omitSiteName = true;
	var newLink = {href: "", target: "corporate"};
	newLink.href = getHostString("http",omitSiteName) ;
	newLink.href += "/" + gv_siteContext + "/" + gv_langCode + destPath;
	if (args != null && args != "")	newLink.href += "&"+args;	
	if (anchor != null && anchor != "")	newLink.href += "#" + anchor;	
	return newLink ;
}	
function getCSLinkObject(cntType, cntKey, destPath, destProto, args, anchor){
	var newLink = {href: "", target: "_self"};
	if (destProto == null)destProto = "http" ;
	if (top.location.protocol != destProto+":")	{
		destPath = "/diy_main/pg_diy.jsp";
		newLink.target = "_top";
	}
	if (newLink.target=="_self" && top.location.href != parent.location.href)	newLink.target = "_parent";
	newLink.href = getHostString(destProto) ;
	newLink.href += "/" + gv_siteContext + "/" + gv_langCode + destPath;
	newLink.href += "?"+Session.Location.linkString();
	newLink.href += "&CNTTYPE=" + escape(cntType) + "&CNTKEY="  + escape(cntKey) ;
	if (args != null && args != "")	newLink.href += "&"+args;	
	if (MID != null && MID != "") newLink.href += "&MID="+MID;
	if (anchor != null && anchor != "")	newLink.href += "#" + anchor;
	return newLink ;
}	

function getHostString(destProto, omitSiteName){
	var port=0;
	var portStr="";
	if (destProto != "https"){
		port = getHTTPPort();
		if (port == 80) port = 0;
	}
	else {
		port = getHTTPSPort();
		if (port ==443) port = 0;
	}	
	if (port != null && port !=0) portStr = ":" + port;
	var host = getWebServerHost();
	var hostString = destProto + "://" + host + portStr;	
	if (omitSiteName){
		return hostString;
	}
	else{
  	return hostString + Request.SCRIPT_NAME;
	}
}
gc_ContextAttributeYes = "yes";
function LO_ObjectConstructor( obj, pgObj, relativeSourcePath )	{
	obj.NOCACHE_OUTPUT_FLG = false;
	obj.mv_pg = pgObj;
	obj.mv_relativeSourcePath = relativeSourcePath;
}
var gc_HOST_TYPE_SERVER = 1;
var gc_HOST_TYPE_CLIENT = 2;
function LO_PageConstructor( siteContext, hostType, thisPageRelativePath, pgObj ) {
	pgObj.mv_siteContext = siteContext;	
	pgObj.mv_relativePagePath = thisPageRelativePath;
	pgObj.mv_hostType = hostType;
	pgObj.mv_className = "PleaseAssignClassName";	
	pgObj.mv_allowCSJS = true;
	pgObj.mv_langCode = gv_langCode;
  pgObj.mv_pageTitle = "";
	pgObj.write = LO_PageConstructor_Write;
	pgObj.AddPageSectionRenderer = LO_PageConstructor_AddPageSectionRenderer;
	pgObj.a = LO_PageConstructor_AddPageSectionRenderer;
	pgObj.RegisterJSObject = LO_PageConstructor_Null;
	pgObj.RegisterContentObject = LO_PageConstructor_Null;
	pgObj.SetNoCacheOutput = LO_PageConstructor_Null;
	pgObj.SetPageTitle = LO_PageConstructor_SetPageTitle;
	pgObj.Finish = LO_PageConstructor_Null;
	pgObj.SetSectionDirty = LO_PageConstructor_Null;
	pgObj.GetSectionDirty = LO_PageConstructor_Null;
	pgObj.ProcessSection = LO_PageConstructor_ProcessSection;
  pgObj.GetNavFormString = LO_PageConstructor_GetNavFormString;
	pgObj.RT_ContentURL = RT_ContentURL;
	pgObj.mv_sectionRendererLists = new Array();
	pgObj.mv_dirtySections = new Array();
	}
function LO_PageConstructor_SetPageTitle(t)    {  this.mv_pageTitle = t;  }	
function LO_PageConstructor_Null()	{}
function LO_PageConstructor_Write(str)	{document.write(str)}

function LO_PageConstructor_AddPageSectionRenderer( sectionName, sectionRenderer ) 	{
	var sectionPool;
	var sectionList;
	sectionPool = this.mv_sectionRendererLists;
	sectionList = sectionPool[sectionName];
	if( !sectionList )
		{
		sectionList = new Array();
		sectionPool[sectionName] = sectionList;
		}
	sectionList[sectionList.length]= sectionRenderer ;
}
function LO_PageConstructor_ProcessSection(sectionName, markSectionDirty, reverseOrder) {
	var renderer;
	var rendererList;
	var rendererListIdx;
	var rendererListCount;
	var rendererListIncrement;
	if ( markSectionDirty )	this.mv_dirtySections[sectionName] = true;
	rendererList = this.mv_sectionRendererLists[sectionName];
	if ( rendererList ){
		rendererListCount = rendererList.length;
		if ( reverseOrder ){
			rendererListIncrement = -1;
			rendererListIdx = rendererListCount - 1;
			}
		else{
			rendererListIncrement = 1;
			rendererListIdx = 0;
			}
		while( rendererListCount-- > 0 )
			{
			renderer = rendererList[rendererListIdx];
			renderer.WriteSection(sectionName, this);
			rendererListIdx += rendererListIncrement;
			}			
		}
	}

 function  LO_PageConstructor_GetNavFormString(cntType, cntKey) {
   var s;
   if (!cntType) cntType = Request.value ("CNTTYPE");
   if (!cntKey) cntKey = Request.value ("CNTKEY");
   s =  "<input type=HIDDEN name=\"CNTTYPE\" value=\"" + cntType + "\">\n";
	 s += "<input type=HIDDEN name=\"CNTKEY\"  value=\"" + cntKey+ "\">\n";
   return s
  }		
	
var gc_SITE_CONTEXT_HDUS = "HDUS";
var gc_SITE_CONTEXT_DEFAULT = gc_SITE_CONTEXT_HDUS;
	
function RT_DRPATH(siteContext, langCode, drPath )	{
	return "/" + siteContext + "/" + langCode + drPath;
	}

function RT_SRPATH(siteContext, langCode, srPath ){
	if(srPath.indexOf("/cstudio/") == 0)	return srPath;
	return "/" + siteContext + "/" + langCode + srPath;
	}
function RT_UPLOADPATH(siteContext, langCode, uploadPath)
{	return "cmc_upload" + "/" + siteContext + "/" + langCode + uploadPath;	}
	
function RT_CATPATH(siteContext, langCode, catPath )
	{	return "/" + siteContext + "/" + langCode + catPath;	}

function RT_ImageURL(siteContext, langCode, relativePath, args, protocol, host, port)
	{	return RT_DocRoot(siteContext, langCode, relativePath, args, protocol, host, port);	}

function RT_NEW(siteContext, langCode, objName, arg1, arg2, arg3, arg4, arg5, arg6, arg7)	{
	var obj;
	var fullObjName = langCode + "_" + objName;
	eval("obj = new " + fullObjName + "(arg1, arg2, arg3, arg4, arg5, arg6, arg7);");
	obj.mv_className = fullObjName;
	obj.mv_nonTranslatedClassName = objName;
	return obj;
	}

function RT_BinaryURL(siteContext, langCode, relativePath, args, protocol, host, port)
	{	return RT_DocRoot(siteContext, langCode, relativePath, args, protocol, host, port);	}
 
function RT_DocRootURL(siteContext, langCode, relativePath, args, protocol, host, port)	{
	var url = "";
	if(host)	{
	  if (!protocol)protocol = "http" ;
	  url += protocol + "://" + host;  }
	if( port )url += ":" + port;
	url += relativePath;
	if ( !isEmptyString(args) )	url += "?" + args;
	return url;
	}


function RT_ContentURL(siteContext, langCode, cntType, cntKey, relativePath, args, protocol, host, port)	{
	var url = "";
	if(host){
		if (!protocol) protocol = "http" ;
		url += protocol + "://" + host;
	}
	if( port )	url += ":" + port;
	url += Request.SCRIPT_NAME + relativePath + "?" + "CNTTYPE=" + Request.url_encode(cntType) + "&" + "CNTKEY=" + Request.url_encode(cntKey) + "&";
	if ( !isEmptyString(args) )	url +=  args + "&" + Session.Location.linkString();
	else url += Session.Location.linkString();
	if (MID != null && MID != "") url += "&MID="+MID;
	return url;
	}
 
function RT_ScriptURL(siteContext, langCode, relativePath, args, protocol, host, port)	{
		var url = "";
		if(protocol)url += protocol + "://" + host;
		if( port )	url += ":" + port;
		url += Request.SCRIPT_NAME + relativePath + "?";
		if ( !isEmptyString(args) )	url += args + "&" + Session.Location.linkString();
		else	url += Session.Location.linkString();
		if (MID != null && MID != "") url += "&MID="+MID;
		return url;
	}

 function stopError()   {  return true;  } 
 window.onerror = stopError;

function  CSJS_DoRollover(pg){
  var llen = CSJS_DoRollover.arguments.length;
  if (document.images)   {
	for (var i = 1; i < llen ; i += 2)
	   { 
			 document[ CSJS_DoRollover.arguments[i + 1]].src = pg.mv_topNavImages[ CSJS_DoRollover.arguments[i]].src; 
	   } 
  } 
} 

var gc_ATTR_ID = "ATTR_ID";
var gc_ATTR_GROUP = "ATTR_GROUP";
var gc_ATTR_NAME = "ATTR_NAME";
var gc_ATTR_VALUE = "ATTR_VALUE";

function NAV_GetValue(nav, id, group, name){
var rowNo=-1;
var row;

if (nav)  {
	nav.cursor =0;
  if (id)	rowNo = nav.locate (gc_ATTR_ID, id)
  else if (group && name)	{
	 while ((rowNo = nav.locate (gc_ATTR_NAME, name)) != -1) {
	     row = nav.get (rowNo);
		   if (row.get(gc_ATTR_GROUP).stringValue == group) leave;
	     }
	  }
 }	
if (rowNo != -1) {
	 row = nav.get (rowNo);
	 myvalue = DB_GetValueByType(row.get (gc_ATTR_VALUE));
	 if (myvalue) myvalue = myvalue.toLowerCase() ;
	 return myvalue;
	 }
 return null;
}			

function NAV_LocateCSJSNavObjRow (attribName, attribValue){
   for (var isub = this.cursor; isub< this.row.length; isub++) {
		  if (eval("this.row[" + isub + "]." + attribName + " == '" + attribValue + "'")) return isub;
	    }
	 return -1;
}

function LO_CSJS_Environment(master) {
	this.mv_master = master;
	this.ApostropheFix= L0_CSJS_Environment_ApostropheFix;
  this.ClientIsSet= L0_CSJS_Environment_ClientIsSet;
	this.CheckIfAnyClientIsSet = L0_CSJS_Environment_CheckIfAnyClientIsSet;
	this.ClientRequestPersonal= L0_CSJS_Environment_ClientRequestPersonal;
	this.ClientLoadDummyValues = L0_CSJS_Environment_ClientLoadDummyValues;
	}
		
function L0_CSJS_Environment_ClientIsSet(code)  {
  var isSet = eval(this.mv_master + "personalData"+code+"Loaded");
  if ( (isSet == null) || !isSet)	 return false;
	else  return true;
   }

//returns true if either personalData1Loaded or personalData2Loaded is true.
function L0_CSJS_Environment_CheckIfAnyClientIsSet(){
	var isSet = eval(this.mv_master + "personalData2Loaded");
	if ( (isSet == null) || !isSet)	 {
		
		//Next attempt: eval "top.personalData1Loaded"
		isSet = eval(this.mv_master + "personalData1Loaded");
		if ( (isSet == null) || !isSet)	 {
			return false;
		}
		else{
			return true;
		}
		return false;
	}
	else  {
		return true;
	}
}
	
function L0_CSJS_Environment_ClientRequestPersonal(code)  {
		// Re-Request this page, but with DRC flag set to 'code'.
   var pos = location.href.indexOf("?");
   if (pos == -1)		location.href += "?DRC="+code;
   else location.href += "&DRC="+code;
  }
		
function L0_CSJS_Environment_ClientLoadDummyValues(type){
	var m = this.mv_master;
switch (type)
  {
	  case ("1"): // DIY data
	  eval (m + "Session_HD_myProjectsLink = '';");
	  eval (m + "Session_userLoggedIn = false;");
	  eval (m + "THDgetMyProjects = 'You can add How-To projects to your Personal Project File';");
	  eval (m + "isCsrUser = false;");
	  eval (m + "isCsrAdminUser = false;");
	  eval (m + "suggestedPicture_HEADER_IMAGE = '';");
	  eval (m + "firstMatch_SUMMARYTITLE = '';");
	  eval (m + "firstMatch_BASE_KEY = '';");
	  eval (m + "THDMP_SUGPROJ_NUM = 0;");
	  eval (m + "THDgetUsersEmail = '';");
	  eval (m + "THDMPgetMyProjListText = '';");
	  eval (m + "ACTUAL_SUGPROJ = 0;");
			eval (m + "personalData1Loaded = false;")
			break;
	  case ("2","3"): // CAT data
		  eval (m + "cart_GetCartItemCount = '0';");
		  eval (m + "cart_GetCartTotalQty = '0';");
	    eval (m + "cart_GetCartSubTotalFormatted = '$0.00';");
		  eval (m + "Session_HD_storeName = '';");
		  eval (m + "Session_HD_storePhoneFormatted = '';");
		  eval (m + "Session_HD_storeAddress1 = '';");
		  eval (m + "Session_HD_storeAddress2 = '';");
		  eval (m + "Session_HD_storeCity = '';");
			eval (m + "Session_HD_stateName = '';");
			eval (m + "Session_HD_shipToZip = '';");
			eval (m + "personalData2Loaded = false;")
			eval (m + "personalData3Loaded = false;")
			break;
		default:
			eval (m + "personalData" + type + "Loaded = false;")
		  break;
  }
	// generic descriptions
	  eval (m + "Request_SCRIPT_NAME = '';");
		eval (m + "getWebServerHost = '';");
		eval (m + "getHTTPPort = 80;");
		eval (m + "getHTTPSPort = 443;");
		eval (m + "getMIDValue = 0;");
	  eval (m + "Request_REMOTE_ADDR = '';");
	  eval (m + "Session_Location_linkString = '';");
	  eval (m + "Session_Location_formString= '';");
	  eval (m + "Session_HD_myHomeDepotLink = '';");
	  eval (m + "Session_HD_storeLocatorLink = '';");
	  eval (m + "currentVisitor_isRegistered = 0;");
	  eval (m + "currentVisitor_isActive = 0;");
	  eval (m + "currentVisitor_MAX_PERS_LEVEL = 0;");
	  eval (m + "currentVisitor_NUMBER_LOGIN = 0;");
	  eval (m + "currentVisitor_FIRSTNAME = '';");
	  eval (m + "THDcurrentVisitor_GetOnlineStoreLinkFrame = '';");
	eval (m + "THDcurrentVisitor_GetOnlineStoreLinkNoFrame = '';");
	  eval (m + "domain = 'homedepot.com';");
	  eval (m + "THDcurrentVisitor_IsPro = false;");
	  eval (m + "THDgetNearestRetailStore = '';");
	  eval (m + "THDcurrentVisitor_IsInStore = false;\n");
}
function L0_CSJS_Environment_ApostropheFix(s,addPlaceHolder) {
	if (s)  {
	  if (addPlaceHolder)  s = s.replace(/\x27/g, "ZZAPOSHOLDZZ");
		else   s = s.replace( /ZZAPOSHOLDZZ/g, "'");
		}
  return s;
   }
				 
function EncodeFix(val) {
		var s = "";
		if (val)
		{		
			s = new String(val);
			s = s.replace(/é/g, '%e9');
			//The Mac has funky encoding:
			s = s.replace(/%uFFE9/g, '%e9');
			s = s.replace(/%8E/g, '%e9');
			s = s.replace('+&+', '+%26+'); //this makes sure that only ampersands with spaces around them get encoded. 
		}
	  return s;
  }
	
// fgp01 - replace apostrophe placeholder with html quote (&#39;)
function convertPlaceHolderToHTML(val){
		var s =  "";
		if (val){
			s = new String(val);
		var ph = "ZZAPOSHOLDZZ";	
		while (s.indexOf(ph) != -1)
		{
	  	s = s.replace(ph, "&#39;");
   		}
		}
  return s;
}

function Certify(URL) {
  popupWin = window.open(URL, 'Participant', 'location,scrollbars,width=450,height=420')
  window.top.name = 'opener';
}

function openFeature2(URL,title,winWidth,winHeight){
	var winY,winX = 0;
	if (screen.width>winWidth && screen.height>winHeight)
	{
		winX=(screen.width-winWidth)/2;
		winY=(screen.height-winHeight)/2;
	}
	var winOptions  = 'resizable=yes,scrollbars=yes,location=no,toolbar=yes,status=yes,top='+winY+',left='+winX;
	winOptions += ',screenX=10,screenY=10,width='+winWidth+',height='+winHeight;
	var popupWin2 = window.open(URL, title, winOptions);
	window.top.name='opener';
	if (popupWin2) {
		popupWin2.focus();
	}
}
	
function openFeatureFlex(URL,title,winWidth,winHeight,resizable,scrollbars,location,toolbar,status,menubar){
	var winY,winX = 0;
	if (screen.width>winWidth && screen.height>winHeight)
	{
		winX=(screen.width-winWidth)/2;
		winY=(screen.height-winHeight)/2;
	}
	var winOptions = "";
	if (resizable){
		winOptions += ",resizable";
	}
	if (scrollbars){
		winOptions += ",scrollbars";
	}
	if (location){
		winOptions += ",location";
	}
	if (toolbar){
		winOptions += ",toolbar";
	}
	if (status){
		winOptions += ",status";
	}
	if (menubar){
		winOptions += ",menubar";
	}
	if (winOptions.charAt(0) == ","){
		winOptions = winOptions.substr(1);
	}
	
	winOptions  += ',top='+winY+',left='+winX + ',screenX=10,screenY=10,width='+winWidth+',height='+winHeight;
	var popupWin2 = window.open(URL, title, winOptions);
	window.top.name='opener';
	if (popupWin2) {
		popupWin2.focus();
	}
}

function addToWishList(oid, qtyField){
	var qty=qtyField.value;
	var hrefObj = getCSLinkObject("PROD_META", 'Your Account/Wish List','/wish_list/pg_index.jsp',null,'oid='+oid+"&qty="+qty);

	//Redirect to wish_list/pg_index.jsp
	if (hrefObj.target.indexOf ("self")!=0 ) 
	{ 
		window.location.href=hrefObj.href;
	}
	else 
	{
		top.location = hrefObj.href;
	}

}
function popChangeStoreWindow(filename){  
		var popupPage = RT_SRPATH(gv_siteContext, gv_langCode, filename);
		var url = RT_ScriptURL(gv_siteContext, gv_langCode, popupPage);
		var winArgs='width=350,height=350,scrollbars=No,resizable=No,screenX=40,screenY=50';
		var win = window.open(url, 'resultsPage', winArgs);
		win.focus();
  }
	
function displayContentPopup(contentType, contentKey, destPath, passArgs, winWidth, winHeight, features){
	if (winWidth == null)	winWidth = 600;
	if (winHeight == null)	winHeight = 400;
	var args = "";
	if (contentType != null)args += "&CNTTYPE="+escape(contentType);
	if (contentKey != null)	args += "&CNTKEY="+(contentKey);
	if (passArgs != null)	args += "&"+passArgs;
	var url = RT_ScriptURL(gv_siteContext, gv_langCode, RT_SRPATH(gv_siteContext, gv_langCode,  destPath))
	var winFeatures = 'width=' + winWidth + ',height=' + winHeight + ',scrollbars=yes,resizable=yes';
	if (features) winFeatures += ','+features;
	var cntWin = window.open(url + args,'ContentPopUp',winFeatures);
	cntWin.focus();
}

function getFullURL(context,lang,destProto,destPath){
  var linkObj = {href: "", target: "_self"};
	if (destProto == null)destProto = "http" ;
	if (top.location.protocol != destProto+":")
	{
		destPath = "/diy_main/pg_diy.jsp";
		linkObj.target = "_parent";
	}
	
  var hostString = getHostString(destProto);
	var relativePath = RT_SRPATH(context, lang, destPath);
	linkObj.href = hostString + relativePath;
  return linkObj;
}
function SystemOnResize(evnt){
}	
  function isEmptyString  (arg) {return !arg;}	
  function  DB_GetValueByType (arg) {return arg;}
  function  HTMLEncode (arg) {return arg;}
  function  THDcurrentVisitor() {return tempTHD_VisitorObj;}
	function  THDgetUsersEmail () { return eval (master + "THDgetUsersEmail");}
  function THDcurrentVisitor () { return tempTHD_VisitorObj;}
	function THDgetNearestRetailStore () { return clientEnv.ApostropheFix(eval ( master + "THDgetNearestRetailStore")) ;}
  function currentVisitor() { return tempVisitorObj;}
  function getRequest() {
	  return  { SCRIPT_NAME: eval (master + "Request_SCRIPT_NAME"),REMOTE_ADDR: eval (master + "Request_REMOTE_ADDR"),url_encode:	new Function("arg", "return escape(arg)"),value: 		new Function("arg", "return null") };
		}
	function getTempVisitor(){
	return {isRegistered: new Function("return eval (master+ 'currentVisitor_isRegistered')"),isActive: new Function (" return eval (master+ 'currentVisitor_isActive')"),MAX_PERS_LEVEL: top.currentVisitor_MAX_PERS_LEVEL,NUMBER_LOGIN: top.currentVisitor_NUMBER_LOGIN,FIRSTNAME: top.currentVisitor_FIRSTNAME };
		}
	function getTempTHD_VisitorObj_GetStoreLink()
	  {
		if (top.location.protocol == "http:") return  eval (master+ 'THDcurrentVisitor_GetOnlineStoreLinkNoFrame');
		else return  eval (master+ 'THDcurrentVisitor_GetOnlineStoreLinkFrame');
		}
	function getTempTHD_VisitorObj (){
	  return  {IsPro: new Function (" return eval (master+ 'THDcurrentVisitor_IsPro') "),IsInStore: new Function (" return eval (master+ 'THDcurrentVisitor_IsInStore') "),GetOnlineStoreLink: getTempTHD_VisitorObj_GetStoreLink, GetOnlineStoreLinkNoFrame: new Function ("return  eval (master+ 'THDcurrentVisitor_GetOnlineStoreLinkNoFrame')")};
		}
  function getSession (){
	  return { Location: { linkString: new Function("return eval (master+ 'Session_Location_linkString') ") ,   formString: new Function("return eval (master+ 'Session_Location_formString') ")}, HD: { myHomeDepotLink: clientEnv.ApostropheFix(eval (master+ "Session_HD_myHomeDepotLink")),storeName: clientEnv.ApostropheFix(eval (master+ "Session_HD_storeName")),storePhoneFormatted:eval (master+ "Session_HD_storePhoneFormatted"),storeAddress: clientEnv.ApostropheFix(eval (master+ "Session_HD_storeAddress")),storeLocatorLink:eval (master+ "Session_HD_storeLocatorLink") } };
  }
  function getWebServerHost() {return eval (master+ 'getWebServerHost'); }
	function getHTTPPort(){return eval (master+ 'getHTTPPort');}
	function getHTTPSPort() {return eval (master+ 'getHTTPSPort');}
	function getMID() {return eval (master + 'getMIDValue');}
	function THDcurrentMarket() {
	   return {IsUPSOnly: new Function ("return eval (master+ 'THDcurrentMarket_IsUPSOnly')")}
		 }
	
var commonLibLoaded = true;
	
	

