/*
All program code originated by Magic Lamp Computing, LLC, including but not limited to html, xhtml,  javascript, php, 
and css contained herein is copyrighted by Magic Lamp Computing, LLC.
Any use of this code without express written approval of Magic Lamp Computing, LLC is prohibited.
*/
var addthis_config =
{
   // ... members go here
};

// Handle Flash FSCommand messages
// see end of CommonHTMLCode.html for additional code needed
//     to fix Microsoft proprietary method for binding events.
function SEOBookVideo_DoFSCommand(command, args) 
{
  DBZ.GetSEOBook();
}; 
function BannerVideo_DoFSCommand(command, args) 
{
  DBZ.DoBannerRequest();
}; 
// end of Handle Flash FSCommand messages

DBZ.Init = function (PageName)
{ 
  var ElementArr,InputID,InitVal,ClassList,TargetPos,TargetEnd,TargetVal,BreadCrumbs,CopyrightYrs;
  
  window.name = "DeepBuzz";
  DBZ.SiteID = "DBuzz";
  DBZ.PageName = PageName;
  DBZ.AdditionalInitFunction = false;  // this function is executed in DBZ.FinishInit
 
 /*  Ajax HTTP async request objects  */
  DBZ.VerifyROIdx = 0;
  DBZ.LoginROIdx = 1;
  DBZ.RegisterROIdx = 2;
  DBZ.SendPasswordROIdx = 3;
  DBZ.UpdateProfileROIdx = 4;
  DBZ.ShowProfileROIdx = 5;
  DBZ.SendMessageROIdx = 6;
  
  document.LoginForm.reset();
  document.RegisterForm.reset();
  document.ProfileForm.reset();
  DBZ.InitValArr = [];
  ElementArr = document.getElementsByTagName("*");
  for (i=0; i< ElementArr.length; i++)
  {
    ClassList = ElementArr[i].className;    
    if (ClassList.indexOf("NoShow") >= 0)
    {
      ElementArr[i].style.display = "none";
      ElementArr[i].style.visibility = "hidden";
    }
    if (ElementArr[i].tagName.toLowerCase() == "input")
    {
      InputID = ElementArr[i].id;
      InitVal = (ElementArr[i].value) ? ElementArr[i].value : "";
      DBZ.InitValArr[InputID] = InitVal;    
    }
    TargetPos = ClassList.indexOf("target_");
    if (TargetPos >= 0)
    {
      TargetPos = TargetPos + 6;
      TargetVal = ClassList.substring(TargetPos) + " ";
      TargetEnd = TargetVal.indexOf(" ");
      if (TargetEnd >= 0)
      {
        TargetVal = TargetVal.substring(0,TargetEnd);
      }
      ElementArr[i].target = TargetVal;
    }
  }
  DBZ.HideDropDowns();
  window.onresize = DBZ.RedrawWindow;
  
  CopyrightYrs = new Date();
  CopyrightYrs = CopyrightYrs.getFullYear() + "";
  if (CopyrightYrs > "2009")
  {
    CopyrightYrs = "2009-" + CopyrightYrs;
  }
  DBZ.$("CopyrightYrs").innerHTML = CopyrightYrs;
  
  // configuration data - replace this by retrieving from db table
  DBZ.SEO_eBookVersion = "01.00";
  DBZ.FreeAdviceTelephone = "+1 702-609-8753";
  DBZ.DeepBuzzEmailAddress = "info@DEEPBUZZ.com";
  //end of configuration data
  
  DBZ.$("eBookVersion").innerHTML = DBZ.SEO_eBookVersion;
  
  DBZ.LBContainerTop = 0;
  DBZ.LBContainerLeft = 0;
  DBZ.LBContainerHeight = 0;
  DBZ.LBContainerWidth = 0;
  DBZ.LBContainerBG = "";

  //  array of parameters for display of banners - parameters are [0] primary video or image, [1] background image, [2] onclick function executed in BannaerOnClick()
  DBZ.BannerVideoSWFArr = [  ["","",""],
                             ["flash/FlowerPower3.swf","images/BannerFlower1BGImg.jpg",DBZ.PlayHeaderBanner],
                             ["flash/frogwalk.swf","images/BannerFrog1BGImg.jpg",DBZ.PlayHeaderBanner],
                             ["flash/online-marketing-parrott.swf","",DBZ.PlayHeaderBanner],
                             ["flash/Index-largefont.swf","images/Indexheader.jpg",DBZ.PlayHeaderBanner],
                             ["","images/Affiliates.jpg",DBZ.BecomeAffiliate],
                             ["","images/IncreaseWebTraffic.jpg",DBZ.OpenMarketingPackages],
                             ["","images/ConvertLeads.jpg",DBZ.OpenMarketingPackages],
                             ["","images/ImproveROI.jpg",DBZ.OpenMarketingPackages],
                             ["flash/DeepBuzzContact.swf","images/DeepBuzzContact.jpg",DBZ.PlayHeaderBanner]
                          ];  
  DBZ.BannerVideoSWFIdx = 0;
  DBZ.BannerStaticImg = "";
  DBZ.AnimationSrc = "";
  DBZ.StaticSrc = "";
  DBZ.PlayImmediately = true;
  DBZ.PlayAfterDropDown = false;
  DBZ.RemoveAfterPlayTime = 0;
  
  DBZ.FootingHeight =  70;
  DBZ.BodyHeight = 1000;
  BreadCrumbs = "<span id='BreadCrumbsLbl'>You are here:&nbsp;&nbsp;</span>";
  switch (DBZ.PageName)
  {
    case "Home":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 1200;
      BreadCrumbs += "<span class='BreadCrumbHere'>Home</span>\n";
      DBZ.BannerVideoSWFIdx = 4;
      DBZ.PlayImmediately = false;
      DBZ.RemoveAfterPlayTime = 37000;
      break;
    case "Home-ImproveYourROI":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 985;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='index.shtml'>Home</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Improve Your ROI</span>\n";
      DBZ.BannerVideoSWFIdx = 8;
      break;
    case "Home-IncreaseWebTraffic":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 1040;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='index.shtml'>Home</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Increase Your Web Traffic</span>\n";
      DBZ.BannerVideoSWFIdx = 6;
      break;      
    case "Home-ConvertYourLeads":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 1025;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='index.shtml'>Home</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Convert Your Leads</span>\n";
      DBZ.BannerVideoSWFIdx = 7;
      break;      
    case "Services":
      BreadCrumbs += "<span class='BreadCrumbHere'>Services</span>\n";
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 2780;
      break;
    case "Services-WebDesign":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 2130;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Web Design</span>\n";
      DBZ.AdditionalInitFunction = DBZ.WebDesignInit;
      break; 
    case "Services-OnlineMedia":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 1450;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Online Media Strategies</span>\n";
      break;    
    case "Services-EmailCampaigns":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 2025;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Email Campaigns</span>\n";
      break;  
    case "Services-LinkBuilding":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 1700;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Link Building</span>\n";
      break;  
    case "Services-MobilePhoneMarketing":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 1950;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Mobile Phone Marketing</span>\n";
      break;
    case "Services-WebAnalytics":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 2300;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Web Analytics</span>\n";
      break;
    case "Services-SEO":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 1550;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" +
                    "<span class='BreadCrumbHere'>Search Engine Optimization</span>\n";
      break; 
    case "Services-SearchEngineMarketing":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 1675;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Search Engine Marketing</span>\n";
      break;
    case "Services-SMM":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 2075;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Social Media Marketing </span>\n";      
      break;       
    case "Services-ORM":
      DBZ.ActiveTab = "DBZTabs-Services";
      DBZ.BodyHeight = 1750;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Online Reputation Management</span>\n";      
      break;       
    case "Affiliates":
      DBZ.ActiveTab = "DBZTabs-Affiliates";
      DBZ.BodyHeight = 1100;
      BreadCrumbs += "<span class='BreadCrumbHere'>Affiliates</span>\n";
      DBZ.BannerVideoSWFIdx = 5;
      break;
    case "Resources":
      DBZ.ActiveTab = "DBZTabs-Resources";
      DBZ.BodyHeight = 1125;
      BreadCrumbs += "<span class='BreadCrumbHere'>Resources</span>\n";
      break;
    case "Resources-SEOTools":
      DBZ.ActiveTab = "DBZTabs-Resources";
      DBZ.BodyHeight = 1275;
      BreadCrumbs +=  "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='resources.shtml'>Resources</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>SEO Tools</span>\n";
      break;
    case "Contact":
      DBZ.ActiveTab = "DBZTabs-Contact";
      DBZ.BodyHeight = 1000;
      BreadCrumbs += "<span class='BreadCrumbHere'>Contact</span>\n";
      DBZ.BannerVideoSWFIdx = 9;
      DBZ.RemoveAfterPlayTime = 7000;
      DBZ.PlayImmediately = true;
      DBZ.PlayAfterDropDown = true;
      break;
    case "Home-UnderConstruction":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 1000;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='index.shtml'>Home</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Under Construction</span>\n";
      break;
    case "Service-UnderConstruction":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 1000;
      BreadCrumbs += "<a id='BreadCrumb1' class='BreadCrumbLink pagelink' href='services.shtml'>Services</a>&nbsp;&gt;&nbsp\n" + 
                    "<span class='BreadCrumbHere'>Under Construction</span>\n";
      break;
    case "UnderConstruction":
      DBZ.ActiveTab = "DBZTabs-Home";
      DBZ.BodyHeight = 1000;
      BreadCrumbs += "<span class='BreadCrumbHere'>Under Construction</span>\n";
      break;
    default:
      DBZ.ShowAlertBox("Page Name Error: " + DBZ.PageName);
      break;
  }
  if (DBZ.BannerVideoSWFIdx == 0 && DBZ.AnimationSrc == "" && DBZ.StaticSrc == "")
  {
    DBZ.BodyHeight = DBZ.BodyHeight - 180;
    DBZ.$s("BannerVideoContainer").display = "none";
    DBZ.$s("PageContent").top = "25px";    
  }
  DBZ.$s("ContentBody").height = DBZ.BodyHeight + "px";
  DBZ.$s("Content").height = (DBZ.BodyHeight - 140) + "px";
  DBZ.$s("PoliciesValidations").top = (DBZ.BodyHeight - 220) + "px";
  DBZ.$s("BadgesSealsBanner").top = (DBZ.BodyHeight - 270) + "px";
  DBZ.$s("Content-LL").top = (DBZ.BodyHeight - 149) + "px";
  DBZ.$s("Content-LR").top = (DBZ.BodyHeight - 149) + "px";
  DBZ.$("BreadCrumbs").innerHTML = BreadCrumbs;

  DBZ.$s("DropDown-Home-Container").height = "140px";
  DBZ.$s("DropDown-Services-Container").height = "450px";
  DBZ.$s("DropDown-Affiliates-Container").height = "0px";
  DBZ.$s("DropDown-Resources-Container").height = "280px";
  DBZ.$s("DropDown-Contact-Container").height = "0px";
  DBZ.$s("DropDown-Home").height = "140px";
  DBZ.$s("DropDown-Services").height = "450px";
  DBZ.$s("DropDown-Affiliates").height = "0px";
  DBZ.$s("DropDown-Resources").height = "280px";
  DBZ.$s("DropDown-Contact").height = "0px";

  DBZ.DropDownTop = 0;
  DBZ.DropDownTimerID = 0;

  DBZ.WindowRefArr = {"RTP":false,"ALV":false,"DBZ":false,"MLC":false};
  DBZ.WindowURLArr = {"RTP":"http://www.redtechpro.com/","ALV":"http://www.amplv.com/",
                     "DBZ":"http://www.DeepBuzz.com/","MLC":"http://www.magiclampcomputing.com/"};
  
  DBZ.HighLitedTab = DBZ.ActiveTab;
  DBZ.RolloverTab = "";
  DBZ.HighLitedTabOpacity = 0;
  DBZ.RolloverTabOpacity = 0;
  DBZ.HighLitedTop = 0;
  DBZ.RolloverTop = 0;
  DBZ.RolloverTimerIDArr = [];
  DBZ.RolloutTimerIDArr = [];
  DBZ.DropDownID = "";
 
  DBZ.HintTimeOutID = 0;
  DBZ.HintTimeSec = 3;
  DBZ.InputHintTOID = 0;
  DBZ.InputHintTime = 1500;
 
  DBZ.GuestName = "Guest Visitor";
  DBZ.LoginName = DBZ.GuestName;
  
  DBZ.CustomerIDIdx = 0;
  DBZ.PageTSIdx = 1;
  DBZ.PageCodeIdx = 2;
  DBZ.NameIdx = 3;
  DBZ.FirstNameIdx = 4;
  DBZ.LastNameIdx = 5;
  DBZ.CustomerEmailIdx = 6;
  DBZ.CustomerTelIdx = 7;
  DBZ.LoginArrSize = 8;
  DBZ.LoginArr = DBZ.InitArr(DBZ.LoginArrSize,"");

  DBZ.RegisterOKMsg = "";
  DBZ.SuspectEmail = "y";
  DBZ.ContinueToProfile = false;
  DBZ.ContactTypeCode = 0; //0 = no request,  >0 = specified subject
  DBZ.ContactSubjectArr = ["", //0 = no request
                           "", //1 = unspecified subject entered by user
                           "Info on Wireless Media Marketing",                        //2
                           "We're Interested in Becoming a DeepBuzz Affiliate",       //3
                           "Information About Hiring DeepBuzz",                       //4
                           "Information About Your 'Google Rank' book on SEO",        //5
                           "Request For Assistance",                                  //6
                           "We're Interested in Your Online Marketing Package Deals", //7
                           "Requesting More Info About Your Affiliate Program",       //8
                           "Sign in to text chat"];                                   //9
                           
  DBZ.ProfChangeAgentIdx = 0;
  DBZ.ProfSiteIDIdx      = 1;
  DBZ.ProfCustomerIDIdx  = 2;  
  DBZ.ProfEmailIdx       = 3;
  DBZ.ProfFirstNameIdx   = 4;
  DBZ.ProfLastNameIdx    = 5;
  DBZ.ProfFullNameIdx    = 6;
  DBZ.ProfCompanyIdx     = 7;
  DBZ.ProfAddressIdx     = 8;
  DBZ.ProfAddress2Idx    = 9;
  DBZ.ProfCityIdx        = 10;
  DBZ.ProfStateIdx       = 11;
  DBZ.ProfZipIdx         = 12;
  DBZ.ProfCountryIdx     = 13;
  DBZ.ProfTelephoneIdx   = 14;
  DBZ.ProfWebsiteIdx     = 15;
  DBZ.ProfOptimizedIdx   = 16;
  DBZ.ProfExpertiseIdx   = 17;
  DBZ.ProfBookVersionIdx = 18;
  DBZ.ProfBookDateIdx    = 19;
  DBZ.ProfEmailOptOutIdx = 20;
  DBZ.ProfNewsOptOutIdx  = 21;
  DBZ.ProfMoreInfoIdx    = 22;
  DBZ.ProfInfoSubjectIdx = 23;
  DBZ.ProfileArr =  DBZ.InitArr(24,"");
   
  // functions to initialize display               
  DBZ.RedrawWindow();
  window.scroll(0,0);
  DBZ.SelectTab(DBZ.ActiveTab);
  DBZ.PageKey = "";
  DBZ.VerifyPageKey();
};
DBZ.VerifyPageKey = function ()
{
  var URLArgs,URLArgsArr,ArgKey,ArgVal,PKStr,PKArr,i,PageKeyData,SendKey,Codes;
  PKArr = false;
  URLArgs = window.location.search;
  if (URLArgs != "")
  {
    URLArgsArr = URLArgs.substring(1).split("&");
    for (i = 0; i < URLArgsArr.length; i++)
    {
      ArgKey = URLArgsArr[i].substring(0,3);
      ArgVal = URLArgsArr[i].substring(3);
      if (ArgKey == "pk=")
      {
        PKArr = DBZ.DeformPK(ArgVal).split("|");
      }
      // else if (ArgKey == "xx=")
      //  { process another URL search argument}
    }
  }
  if (PKArr && PKArr.length == 3)
  {
    DBZ.LoginArr[DBZ.CustomerIDIdx] = PKArr[0];
    DBZ.LoginArr[DBZ.PageTSIdx] = PKArr[1];
    DBZ.LoginArr[DBZ.PageCodeIdx] = PKArr[2];
    PageKeyData = DBZ.LoginArr[DBZ.CustomerIDIdx] + "|" +
                      DBZ.LoginArr[DBZ.PageTSIdx] + "|" +
                      DBZ.LoginArr[DBZ.PageCodeIdx];
    SendKey = DBZ.GenSendKey();
    Codes = "Codes=" +
             DBZ.Encode(PageKeyData,SendKey) + "|" +
             DBZ.Encode(SendKey,"");
    DBZ.ROSourceArr[DBZ.VerifyROIdx] = "verifypagekey.php";
    DBZ.ROFunctionArr[DBZ.VerifyROIdx] = "DBZ.VerifyPageKey2()";
    DBZ.ROSendDataArr[DBZ.VerifyROIdx] = Codes;
    DBZ.OpenAsyncRO(DBZ.VerifyROIdx);
  }
  else
  {
    DBZ.LoginArr = DBZ.InitArr(DBZ.LoginArrSize,"");
    DBZ.LoginName = DBZ.GuestName;
    DBZ.FinishInit();
  }
};
DBZ.VerifyPageKey2 = function ()
{
  var ROResponse;

  ROResponse = DBZ.ROResponseArr[DBZ.VerifyROIdx];
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.LoginArr = ROResponse.substring(3).split("|");  
    DBZ.LoginName = DBZ.LoginArr[DBZ.NameIdx];
  }
  else
  {
    DBZ.LoginArr = DBZ.InitArr(DBZ.LoginArrSize,"");
    DBZ.LoginName = DBZ.GuestName;  
    if (ROResponse.substring(0,6) != "NOTOK:")
    {
      DBZ.ShowAlertBox(ROResponse);
    }
  }
  DBZ.FinishInit();
};
DBZ.FinishInit = function ()
{
  DBZ.SetPageLinks();
  DBZ.$("WelcomeName").innerHTML = DBZ.LoginName;
  if (DBZ.LoginName == DBZ.GuestName)
  {
    DBZ.$("LoginBtn1").innerHTML = "Login";
    DBZ.$("LoginBtn2").innerHTML = "Register";    
    DBZ.$("LoginBtn1").value = "Login";
    DBZ.$("LoginBtn2").value = "Register";    
  }
  else
  {
    DBZ.$("LoginBtn1").innerHTML = "Logout";
    DBZ.$("LoginBtn2").innerHTML = "Profile";    
    DBZ.$("LoginBtn1").value = "Logout";
    DBZ.$("LoginBtn2").value = "Profile";    
  }

  if (typeof(DBZ.AdditionalInitFunction) == 'function')
  {
    DBZ.AdditionalInitFunction();
  }
  DBZ.PlayHeaderBanner(DBZ.PlayImmediately);  
};
DBZ.TextChat = function ()
{
  //DBZ.OpenWindow("http://www.techcombine.com/chat/chat.html","Communicate","400,height=400",false);  
  
  var URLSearchStr;
  
  if (DBZ.LoginName == DBZ.GuestName)
  {
    DBZ.ContactTypeCode = 9;
    DBZ.ProcessCustomer("Chat");
  }
  else
  {
    URLSearchStr = "?pk=" + DBZ.PageKey;
    DBZ.OpenWindow("http://www.techcombine.com/chat/chat.html" + URLSearchStr,
                   "TextChat","430,height=480",true);  
  }
};
DBZ.RegisterTextChat = function ()
{ 
  var OK,OKMsg,ChatEmail,ChatFirstName,ChatLastName,ChatName,ChatTel,RegisterData;
  
  OK = true;      
  ChatEmail = DBZ.$("ChatEmailInp").value;
  ChatFirstName = DBZ.$("ChatFirstNameInp").value;
  ChatLastName = DBZ.$("ChatLastNameInp").value;
  ChatName = ChatFirstName + " " + ChatLastName;
  ChatPassword = "*";
  ChatTel = "";
  if (ChatEmail == "" || ChatName == "")
  {
    OK = false;
    DBZ.ShowAlertBox("Please enter your name and email address,\n" + 
                 "so that we can setup your chat session. Thank you.");
  }
  if (OK)
  {
    DBZ.RegisterOKMsg = "Your have been automatically registered.\n\n" + 
                        "An email was sent to you with a temporary password";
    RegisterData = DBZ.SiteID + "|" +
                   ChatEmail  + "|" +
                   ChatPassword  + "|" +
                   ChatName  + "|" +
                   ChatFirstName  + "|" +
                   ChatLastName  + "|" +
                   ChatTel;
    DBZ.RegisterCustomerContinued(RegisterData);
  }    
};
DBZ.Search = function ()
{
  var URLArgStr,SearchInp;
  SearchInp = DBZ.trim(DBZ.$("SearchInp").value);
  SearchInp = (SearchInp == "(search our websites)") ? "" : SearchInp;
  URLArgStr = "?ss=" + encodeURIComponent(SearchInp);
  DBZ.OpenWindow("search.html" + URLArgStr,"TechCombine_Search");
};
DBZ.ShowBadgesSealsBanner = function ()
{
  DBZ.RemoveFlashPlayer("SEOBookVideo","SEOBookVideoPlayer");
  DBZ.$sv("BadgesSealsBanner",true);
  DBZ.$sv("PoliciesValidations",false);
}
DBZ.HideBadgesSealsBanner = function ()
{
  DBZ.$sv("BadgesSealsBanner",false);
  DBZ.$sv("PoliciesValidations",true);
}
DBZ.InitLB = function () 
{ 
  DBZ.CloseDropDown();
  DBZ.RemoveFlashPlayer("SEOBookVideo","SEOBookVideoPlayer"); 
  DBZ.RemoveFlashPlayer("BannerVideo","BannerVideoPlayer");
  
  DBZ.LBTimerID = 0;
  DBZ.LBOpacity = 0;
  DBZ.$s("LBContainer").display = "none";
  DBZ.$s("LightBoxBG").filter = "alpha(opacity=0)";
  DBZ.$s("LightBoxBG").opacity = "0.0";
  DBZ.$s("LightBoxBG").display = "block";
  DBZ.$s("LBWindow").display = "block";
};
DBZ.ProcessCustomer = function (RequestType)
{
  DBZ.LBContainerBG = "#E8EDF1";
  DBZ.RequestType = RequestType;
  window.scroll(0,0);
  if (DBZ.RequestType == "verify")
  {
    DBZ.VerifyPageKey();
  }
  else if (DBZ.RequestType == "Login")
  {
    DBZ.LBContainerTop = 150;
    DBZ.LBContainerLeft = 250;
    DBZ.LBContainerHeight = 400;
    DBZ.LBContainerWidth = 400;
    DBZ.LBContainerBG = "#E8EDF1 url('images/LoginRegisterBG.gif') no-repeat top left";
    DBZ.ResetInput("LoginEmailInp");
    DBZ.$("LoginPasswordPass").value = "";
    DBZ.ResetInput("LoginPasswordPass");
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "Register")
  {
    DBZ.LBContainerTop = 150;
    DBZ.LBContainerLeft = 250;
    DBZ.LBContainerHeight = 400;
    DBZ.LBContainerWidth = 400;
    DBZ.LBContainerBG = "#E8EDF1 url('images/LoginRegisterBG.gif') no-repeat top left";
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "Logout")
  {
    DBZ.LogoutCustomer();
  }
  else if (DBZ.RequestType == "Forgot")
  {
    DBZ.LBContainerTop = 150;
    DBZ.LBContainerLeft = 250;
    DBZ.LBContainerHeight = 400;
    DBZ.LBContainerWidth = 400;
    DBZ.LBContainerBG = "#E8EDF1 url('images/LoginRegisterBG.gif') no-repeat top left";
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "Profile")
  {
    DBZ.LBContainerTop = 50;
    DBZ.LBContainerLeft = 70;
    DBZ.LBContainerHeight = 520;
    DBZ.LBContainerWidth = 770;
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "Request")
  {
    DBZ.$("RequestNameVal").innerHTML = DBZ.LoginName;
    DBZ.$("RequestTelephoneVal").innerHTML = DBZ.LoginArr[DBZ.CustomerTelIdx];
    DBZ.$("RequestFromEmailVal").innerHTML = DBZ.LoginArr[DBZ.CustomerEmailIdx];
    DBZ.$("RequestCustomerIDVal").innerHTML = DBZ.LoginArr[DBZ.CustomerIDIdx];
    DBZ.$("RequestSubjectInp").value = DBZ.ContactSubjectArr[DBZ.ContactTypeCode];
    DBZ.LBContainerTop = 50;
    DBZ.LBContainerLeft = 150;
    DBZ.LBContainerHeight = 350;
    DBZ.LBContainerWidth = 650;
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "Contact")
  {
    DBZ.LBContainerTop = 50;
    DBZ.LBContainerLeft = 150;
    DBZ.LBContainerHeight = 420;
    DBZ.LBContainerWidth = 650;
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "Chat")
  {
    DBZ.LBContainerTop = 75;
    DBZ.LBContainerLeft = 270;
    DBZ.LBContainerHeight = 250;
    DBZ.LBContainerWidth = 400;
    DBZ.ShowLightBox();
  }
  else if (DBZ.RequestType == "AboutUs")
  {
    DBZ.LBContainerTop = 50;
    DBZ.LBContainerLeft = 70;
    DBZ.LBContainerHeight = 520;
    DBZ.LBContainerWidth = 770;
    DBZ.ShowLightBox();
  }
};
DBZ.ProcessCustomer2 = function ()
{
  DBZ.HideLBForms();
  if (DBZ.RequestType == "Login")
  {
    DBZ.$sv("LoginForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else if (DBZ.RequestType == "Register")
  { 
    DBZ.$sv("RegisterForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else if (DBZ.RequestType == "Forgot")
  { 
    DBZ.$sv("ForgotForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else if (DBZ.RequestType == "Profile")
  { 
    DBZ.ShowProfile();
  }
  else if (DBZ.RequestType == "Request")
  { 
    DBZ.$sv("RequestForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else if (DBZ.RequestType == "Contact")
  { 
    DBZ.$sv("ContactForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else if (DBZ.RequestType == "Chat")
  { 
    DBZ.$sv("ChatForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else if (DBZ.RequestType == "AboutUs")
  { 
    DBZ.$sv("AboutUs",true);
    DBZ.$s("LBContainer").display = "block";
  }
};
DBZ.HideLBForms = function ()
{
  DBZ.$sv("LoginForm",false);
  DBZ.$sv("RegisterForm",false);
  DBZ.$sv("ForgotForm",false);
  DBZ.$sv("ProfileForm",false);
  DBZ.$sv("RequestForm",false);
  DBZ.$sv("ContactForm",false);
  DBZ.$sv("ChatForm",false);
  DBZ.$sv("AboutUs",false);
};
DBZ.ShowLightBox = function ()
{
  DBZ.$s("LBWindow").top = "0px";
  DBZ.$s("LBContainer").top =  DBZ.LBContainerTop + "px";
  DBZ.$s("LBContainer").left =  DBZ.LBContainerLeft + "px";
  DBZ.$s("LBContainer").height =  DBZ.LBContainerHeight + "px";
  DBZ.$s("LBContainer").width =  DBZ.LBContainerWidth + "px";
  DBZ.$s("LBContainer").background = DBZ.LBContainerBG;
  DBZ.InitLB();
  DBZ.$s("LightBoxBG").height = (DBZ.BodyHeight + 70) + "px";
  DBZ.$s("LightBoxBG").filter = "alpha(opacity=10)";
  DBZ.$s("LightBoxBG").opacity = ".10";
  DBZ.LBOpacity = 0.10;
  DBZ.LBTimerID = setInterval(DBZ.LBFadeIn,10);
};
DBZ.LBFadeIn = function ()
{
  var OpacityX100,OpacityFilter; 
  DBZ.LBOpacity = DBZ.LBOpacity + 0.03;
  OpacityX100 = DBZ.LBOpacity * 100;
  if (DBZ.LBOpacity > 0.6)
  {
    clearInterval(DBZ.LBTimerID);
    DBZ.ProcessCustomer2();
  }
  else
  {
    OpacityFilter = "alpha(opacity="+OpacityX100+")";
    DBZ.$s("LightBoxBG").filter = OpacityFilter;
    OpacityFilter = ""+DBZ.LBOpacity;
    DBZ.$s("LightBoxBG").opacity = OpacityFilter;
  }
};
DBZ.CloseLBWindow = function ()
{
  DBZ.HideLBForms();
  DBZ.$s("LBWindow").display = "none";
  DBZ.$s("LBContainer").display = "none";
  DBZ.$s("LightBoxBG").display = "none";
  DBZ.$s("LightBoxBG").filter = "alpha(opacity=0)";
  DBZ.$s("LightBoxBG").opacity = "0.0";
  DBZ.PlayHeaderBanner(false);
};
DBZ.PlayHeaderBanner = function (PlayImmediately)
{
  if (arguments.length == 0)
  {
    PlayImmediately = true;
  }
  DBZ.AnimationSrc = (!DBZ.AnimationSrc) ? "" : DBZ.AnimationSrc; // fix IE bug
  DBZ.StaticSrc = (!DBZ.StaticSrc) ? "" : DBZ.StaticSrc; // fix IE bug
  
  if (DBZ.AnimationSrc != "" || DBZ.StaticSrc != "")
  {
    if (DBZ.AnimationSrc != "")
    {    
      alert("DBZ.AnimationSrc: " + DBZ.AnimationSrc);
      DBZ.$("DBZ-Animation-animated").setAttribute("src",DBZ.AnimationSrc);
    }
    if (DBZ.StaticSrc != "")
    {
      DBZ.$("DBZ-Animation-static").setAttribute("src",DBZ.StaticSrc);
    }
    if (DBZ.AnimationSrc != "" && DBZ.StaticSrc != "")
    {
      setTimeout(function() {DBZ.Animate(false);},8000);
    }
  }
  else
  {
    if (!DBZ.IsEmpty(DBZ.BannerVideoSWFArr) &&
        !DBZ.IsEmpty(DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][1]))  // construction of 'if' statement due to IE bug
    {
      DBZ.$s("BannerVideoContainer").background = "#FFFFFF url('" + 
          DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][1] + 
          "') no-repeat top left";
    }
    if (!DBZ.IsEmpty(DBZ.BannerVideoSWFArr) &&
        !DBZ.IsEmpty(DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][0]) &&
        PlayImmediately) // construction of 'if' statement due to IE bug
    {
      DBZ.PlayBannerSWF();
      if (DBZ.RemoveAfterPlayTime > 0)
      {
        setTimeout("DBZ.RemoveFlashPlayer('BannerVideo','BannerVideoPlayer')",DBZ.RemoveAfterPlayTime);
      }     
    }      
  }
};
DBZ.DoBannerRequest = function (cmd,args)
{
  //alert("Banner Request");
};
DBZ.BannerOnClick = function ()
{
  var BannerOnClickFunction;
  if (!DBZ.IsEmpty(DBZ.BannerVideoSWFArr) &&
    !DBZ.IsEmpty(DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][2]) &&
    typeof(DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][2]) == "function")  // construction of 'if' statement due to IE bug
  {
    BannerOnClickFunction = DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][2];
    BannerOnClickFunction();
  }
};
DBZ.LoginCustomer = function ()
{
  var OK,CustomerEmail,CustomerPassword,LoginData,SendKey,Codes;
  
  OK = true;
  if (DBZ.IsEmptyInput("LoginEmailInp") || DBZ.IsEmptyInput("LoginPasswordPass"))
  {
    OK = false;
    DBZ.ShowAlertBox("Please enter both your login ID (Email or Customer ID)\n" + 
                     " and your password. Thank you.");
  }
  if (OK)
  {
    CustomerEmail = DBZ.trim(DBZ.$("LoginEmailInp").value); 
    CustomerPassword = DBZ.trim(DBZ.$("LoginPasswordPass").value);
    LoginData = CustomerEmail  + "|" + CustomerPassword;
    SendKey = DBZ.GenSendKey();
    Codes = "Codes=" +
             DBZ.Encode(LoginData,SendKey) + "|" +
             DBZ.Encode(SendKey,"");
    DBZ.ROSourceArr[DBZ.LoginROIdx] = "login.php";
    DBZ.ROFunctionArr[DBZ.LoginROIdx] = "DBZ.LoginCustomer2()";
    DBZ.ROSendDataArr[DBZ.LoginROIdx] = Codes;
    DBZ.OpenAsyncRO(DBZ.LoginROIdx);
  }
};
DBZ.LoginCustomer2 = function ()
{
  var ROResponse;
  ROResponse = DBZ.ROResponseArr[DBZ.LoginROIdx]; 
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.LoginArr = ROResponse.substring(3).split("|");
    DBZ.LoginName = DBZ.LoginArr[DBZ.NameIdx];
    DBZ.$("LoginBtn1").innerHTML = "Logout";
    DBZ.$("LoginBtn2").innerHTML = "Profile"; 
    DBZ.$("LoginBtn1").value = "Logout";
    DBZ.$("LoginBtn2").value = "Profile"; 
    DBZ.$("WelcomeName").innerHTML = DBZ.LoginName;
    DBZ.SetPageLinks();
    if (DBZ.ContinueToProfile)
    {
      DBZ.ContinueToProfile = false;
      DBZ.CloseLBWindow();                       
      DBZ.ProcessCustomer("Profile");
    }
    else
    {
      DBZ.CloseLBWindow();
    }
    DBZ.CheckContactByMsg();
  }
  else if (ROResponse.substring(0,6) == "NOTOK:") 
  {
    DBZ.ShowAlertBox(ROResponse.substring(6));
  }
  else
  {
    DBZ.ShowAlertBox(ROResponse);
    DBZ.CloseLBWindow();
  }
};
DBZ.ResetLogin = function ()
{
  document.LoginForm.reset();
  DBZ.InitInput("LoginEmailInp");
  DBZ.InitInput("LoginPasswordText");
  DBZ.InitInput("LoginPasswordPass");  
};
DBZ.ForgotPassword = function ()
{
  var OK,CustomerEmail,CustomerFirstName,CustomerLastName,LoginData,SendKey,Codes;
 
  OK = true; 
  if (DBZ.IsEmptyInput("ForgotEmailInp") || DBZ.IsEmptyInput("ForgotFirstNameInp") || 
      DBZ.IsEmptyInput("ForgotLastNameInp"))
  {
    OK = false;
    DBZ.ShowAlertBox("Please enter your Email Address and Name. Thank you.");
  } 
  if (OK)
  {
    CustomerEmail = DBZ.trim(DBZ.$("ForgotEmailInp").value); 
    CustomerFirstName = DBZ.trim(DBZ.$("ForgotFirstNameInp").value); 
    CustomerLastName = DBZ.trim(DBZ.$("ForgotLastNameInp").value);
    LoginData = CustomerEmail + "|" + CustomerFirstName + "|" + CustomerLastName;
    SendKey = DBZ.GenSendKey();
    Codes = "Codes=" +
             DBZ.Encode(LoginData,SendKey) + "|" +
             DBZ.Encode(SendKey,"");
    SendKey = DBZ.GenSendKey();
    Codes = "Codes=" +
             DBZ.Encode(LoginData,SendKey) + "|" +
             DBZ.Encode(SendKey,"");
    DBZ.ROSourceArr[DBZ.SendPasswordROIdx] = "sendpassword.php";
    DBZ.ROFunctionArr[DBZ.SendPasswordROIdx] = "DBZ.ForgotPassword2()";
    DBZ.ROSendDataArr[DBZ.SendPasswordROIdx] = Codes;
    DBZ.OpenAsyncRO(DBZ.SendPasswordROIdx);
  }
};
DBZ.ForgotPassword2 = function ()
{
  var ROResponse;
  
  ROResponse = DBZ.ROResponseArr[DBZ.SendPasswordROIdx];
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.ShowAlertBox(ROResponse.substring(3));
    DBZ.ProcessCustomer("Login");
  }
  else if (ROResponse.substring(0,6) == "NOTOK:")
  {
    DBZ.ShowAlertBox(ROResponse.substring(6));
  }
  else
  {
    alert(ROResponse);
  }
};
DBZ.ResetForgot = function ()
{
  document.LoginForm.reset();
  DBZ.InitInput("ForgotEmailInp");
  DBZ.InitInput("ForgotFirstNameInp");
  DBZ.InitInput("ForgotLastNameInp");  
};
DBZ.ShowProfile = function ()
{
  var ProfileData,SendKey,Codes;
  
  DBZ.$sv("ProfileForm",true);
  DBZ.$s("LBContainer").display = "block";
  ProfileData = DBZ.LoginArr[DBZ.CustomerIDIdx];
  SendKey = DBZ.GenSendKey();
  Codes = "Codes=" +
           DBZ.Encode(ProfileData,SendKey) + "|" +
           DBZ.Encode(SendKey,"");
  DBZ.ROSourceArr[DBZ.ShowProfileROIdx] = "getprofile.php";
  DBZ.ROFunctionArr[DBZ.ShowProfileROIdx] = "DBZ.ShowProfile2()";
  DBZ.ROSendDataArr[DBZ.ShowProfileROIdx] = Codes;
  DBZ.OpenAsyncRO(DBZ.ShowProfileROIdx);    
};
DBZ.ShowProfile2 = function ()
{  
  var ROResponse = DBZ.ROResponseArr[DBZ.ShowProfileROIdx];
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.ProfileArr = ROResponse.substring(3).split("|");
    DBZ.ResetProfileInput();
    DBZ.$sv("ProfileForm",true);
    DBZ.$s("LBContainer").display = "block";
  }
  else
  {
    DBZ.$sv("ProfileForm",true);
    DBZ.$s("LBContainer").display = "block";
    DBZ.ShowAlertBox(ROResponse);
    DBZ.CloseLBWindow();
  }  
};
DBZ.ResetProfileInput = function ()
{
  DBZ.$("ProfileCustomerID").innerHTML = DBZ.ProfileArr[DBZ.ProfCustomerIDIdx];
  DBZ.$("ProfileEmailInp").value = DBZ.ProfileArr[DBZ.ProfEmailIdx];
  DBZ.ResetInput("ProfileEmailInp"); 
  DBZ.$("ProfilePasswordPass").value = "";
  DBZ.ResetInput("ProfilePasswordPass");
  DBZ.$("Profile2PasswordPass").value = "";
  DBZ.ResetInput("Profile2PasswordPass");
  DBZ.$("ProfileFirstNameInp").value = DBZ.ProfileArr[DBZ.ProfFirstNameIdx];
  DBZ.ResetInput("ProfileFirstNameInp");
  DBZ.$("ProfileLastNameInp").value = DBZ.ProfileArr[DBZ.ProfLastNameIdx];
  DBZ.ResetInput("ProfileLastNameInp");
  DBZ.ProfileArr[DBZ.ProfFullNameIdx] = DBZ.ProfileArr[DBZ.ProfFirstNameIdx] + " " + 
                                        DBZ.ProfileArr[DBZ.ProfLastNameIdx];
  DBZ.$("ProfileCompanyNameInp").value = DBZ.ProfileArr[DBZ.ProfCompanyIdx];
  DBZ.ResetInput("ProfileCompanyNameInp");
  DBZ.$("ProfileAddressInp").value = DBZ.ProfileArr[DBZ.ProfAddressIdx];
  DBZ.ResetInput("ProfileAddressInp");
  DBZ.$("ProfileAddress2Inp").value = DBZ.ProfileArr[DBZ.ProfAddress2Idx];
  DBZ.ResetInput("ProfileAddress2Inp");
  DBZ.$("ProfileCityInp").value = DBZ.ProfileArr[DBZ.ProfCityIdx];
  DBZ.ResetInput("ProfileCityInp");
  DBZ.$("ProfileStateInp").value = DBZ.ProfileArr[DBZ.ProfStateIdx];
  DBZ.ResetInput("ProfileStateInp");
  DBZ.$("ProfileZipInp").value = DBZ.ProfileArr[DBZ.ProfZipIdx];
  DBZ.ResetInput("ProfileZipInp");
  DBZ.$("ProfileCountryInp").value = DBZ.ProfileArr[DBZ.ProfCountryIdx];
  DBZ.ResetInput("ProfileCountryInp");
  DBZ.$("ProfileTelNoInp").value = DBZ.ProfileArr[DBZ.ProfTelephoneIdx];
  DBZ.ResetInput("ProfileTelNoInp");
  DBZ.$("ProfileWebsiteInp").value = DBZ.ProfileArr[DBZ.ProfWebsiteIdx];
  DBZ.ResetInput("ProfileWebsiteInp");
  if (DBZ.ProfileArr[DBZ.ProfOptimizedIdx] == "y")
  {
    DBZ.CheckTheRadio("OptimizedOpt","ProfileOptimizedYes");
  }
  else if (DBZ.ProfileArr[DBZ.ProfOptimizedIdx] == "n")
  {
    DBZ.CheckTheRadio("OptimizedOpt","ProfileOptimizedNo");
  }
  else if (DBZ.ProfileArr[DBZ.ProfOptimizedIdx] == "u")
  {
    DBZ.CheckTheRadio("OptimizedOpt","ProfileOptimizedUnknown");
  }
  else
  {
    DBZ.CheckTheRadio("OptimizedOpt","");
  }
  if (DBZ.ProfileArr[DBZ.ProfExpertiseIdx] == "h")
  {
    DBZ.CheckTheRadio("ExpertiseOpt","ProfileExpertiseHigh");
  }
  else if (DBZ.ProfileArr[DBZ.ProfExpertiseIdx] == "m")
  {
    DBZ.CheckTheRadio("ExpertiseOpt","ProfileExpertisedMedium");
  }
    else if (DBZ.ProfileArr[DBZ.ProfExpertiseIdx] == "l")
  {
    DBZ.CheckTheRadio("ExpertiseOpt","ProfileExpertiseLow");
  }
  else
  {
    DBZ.CheckTheRadio("ExpertiseOpt","");
  }
  
  DBZ.$("eBookLastVersion").innerHTML = DBZ.ProfileArr[DBZ.ProfBookVersionIdx];
  DBZ.$("eBookLastDownload").innerHTML = DBZ.YMDHMS2DDMMMYYYY(DBZ.ProfileArr[DBZ.ProfBookDateIdx]);

  if (DBZ.ProfileArr[DBZ.ProfEmailOptOutIdx] == "y")
  {
    DBZ.CheckTheRadio("EmailOpt","EmailSubscribe");
  }
  else
  {
    DBZ.CheckTheRadio("EmailOpt","EmailOptOut");
  }
  if (DBZ.ProfileArr[DBZ.ProfNewsOptOutIdx] == "y")
  {
    DBZ.CheckTheRadio("NewsletterOpt","NewsletterSubscribe");
  }
  else
  {
    DBZ.CheckTheRadio("NewsletterOpt","NewsletterOptOut");
  }
};    
       
DBZ.UpdateProfile = function ()
{
  var OK = true;
  var Today = new Date();
  var TodayYMDHMS = DBZ.Date2YMDHMS(Today);
  DBZ.ProfileArr[DBZ.ProfChangeAgentIdx] = DBZ.LoginArr[DBZ.CustomerIDIdx];

  if (DBZ.$("ProfilePasswordPass").value != "")
  {
    if (DBZ.$("ProfilePasswordPass").value != DBZ.$("Profile2PasswordPass").value)
    {
      DBZ.ShowAlertBox("Your new password does not match the reconfirmed password.\n\n" +
                       "Please reenter the passwords and resubmit. Thank you.");
      OK = false;            
    }    
  }
  if (OK)
  { 
    var SelectedOptID = DBZ.WhichRadioChecked("EmailOpt");   
    if (SelectedOptID == "EmailSubscribe") 
    {
      DBZ.ProfileArr[DBZ.ProfEmailOptOutIdx] = "y";
    } 
    else
    { 
      DBZ.ProfileArr[DBZ.ProfEmailOptOutIdx] = "n"; 
    }  
    var SelectedOptID = DBZ.WhichRadioChecked("NewsletterOpt"); 
    if (SelectedOptID == "NewsletterSubscribe") 
    { 
      DBZ.ProfileArr[DBZ.ProfNewsOptOutIdx] = "y";
    } 
    else   
    { 
      DBZ.ProfileArr[DBZ.ProfNewsOptOutIdx] = "n"; 
    }
    var SelectedOptID = DBZ.WhichRadioChecked("OptimizedOpt");
    if (SelectedOptID == "ProfileOptimizedYes") 
    { 
      DBZ.ProfileArr[DBZ.ProfOptimizedIdx] = "y";
    } 
    else if (SelectedOptID == "ProfileOptimizedNo")
    { 
      DBZ.ProfileArr[DBZ.ProfOptimizedIdx] = "n";
    }
    else if (SelectedOptID == "ProfileOptimizedUnknown")
    { 
      DBZ.ProfileArr[DBZ.ProfOptimizedIdx] = "u";
    }
    else 
    { 
      DBZ.ProfileArr[DBZ.ProfOptimizedIdx] = "";
    }
    var SelectedOptID = DBZ.WhichRadioChecked("ExpertiseOpt");
    if (SelectedOptID == "ProfileExpertiseHigh") 
    { 
      DBZ.ProfileArr[DBZ.ProfExpertiseIdx] = "h";
    } 
    else if (SelectedOptID == "ProfileExpertiseMedium")
    { 
      DBZ.ProfileArr[DBZ.ProfExpertiseIdx] = "m";
    }
    else if (SelectedOptID == "ProfileExpertiseLow")
    { 
      DBZ.ProfileArr[DBZ.ProfExpertiseIdx] = "l";
    }
    else 
    { 
      DBZ.ProfileArr[DBZ.ProfExpertiseIdx] = "";
    }    
    DBZ.ProfileArr[DBZ.ProfEmailIdx] = DBZ.SetUpdateValue("ProfileEmailInp");   
    DBZ.ProfileArr[DBZ.ProfFirstNameIdx] = DBZ.SetUpdateValue("ProfileFirstNameInp");
    DBZ.ProfileArr[DBZ.ProfLastNameIdx] = DBZ.SetUpdateValue("ProfileLastNameInp");
    DBZ.ProfileArr[DBZ.ProfFullNameIdx] = DBZ.ProfileArr[DBZ.ProfFirstNameIdx] + " " + 
                                          DBZ.ProfileArr[DBZ.ProfLastNameIdx];    
    DBZ.ProfileArr[DBZ.ProfCompanyIdx] = DBZ.SetUpdateValue("ProfileCompanyNameInp");
    DBZ.ProfileArr[DBZ.ProfAddressIdx] = DBZ.SetUpdateValue("ProfileAddressInp");
    DBZ.ProfileArr[DBZ.ProfAddress2Idx] = DBZ.SetUpdateValue("ProfileAddress2Inp");
    DBZ.ProfileArr[DBZ.ProfCityIdx] = DBZ.SetUpdateValue("ProfileCityInp");
    DBZ.ProfileArr[DBZ.ProfStateIdx] = DBZ.SetUpdateValue("ProfileStateInp");
    DBZ.ProfileArr[DBZ.ProfZipIdx] = DBZ.SetUpdateValue("ProfileZipInp");
    DBZ.ProfileArr[DBZ.ProfCountryIdx] = DBZ.SetUpdateValue("ProfileCountryInp");
    DBZ.ProfileArr[DBZ.ProfTelephoneIdx] = DBZ.SetUpdateValue("ProfileTelNoInp");
    DBZ.ProfileArr[DBZ.ProfWebsiteIdx] = DBZ.SetUpdateValue("ProfileWebsiteInp");
    
    var ProfileData = DBZ.ProfileArr.join("|") + "|" + DBZ.$("ProfilePasswordPass").value;

    var SendKey = DBZ.GenSendKey();
    var Codes = "Codes=" +
                DBZ.Encode(ProfileData,SendKey) + "|" +
                DBZ.Encode(SendKey,"");
    DBZ.ROSourceArr[DBZ.UpdateProfileROIdx] = "updateprofile.php";
    DBZ.ROFunctionArr[DBZ.UpdateProfileROIdx] = "DBZ.UpdateProfile2()";
    DBZ.ROSendDataArr[DBZ.UpdateProfileROIdx] = Codes;
    DBZ.OpenAsyncRO(DBZ.UpdateProfileROIdx);
  }
};
DBZ.UpdateProfile2 = function ()
{
  var ROResponse = DBZ.ROResponseArr[DBZ.UpdateProfileROIdx];  
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.LoginArr = ROResponse.substring(3).split("|");
    DBZ.LoginName = DBZ.LoginArr[DBZ.NameIdx];
    DBZ.$("WelcomeName").innerHTML = DBZ.LoginName;
    DBZ.SetPageLinks();
    DBZ.ShowAlertBox("Successfull profile update");
    DBZ.CloseLBWindow();
    DBZ.CheckContactByMsg();
  }
  else if (ROResponse.substring(0,6) == "NOTOK:") 
  {
    DBZ.ShowAlertBox(ROResponse.substring(6));
  }
  else
  {
    alert(ROResponse);
    DBZ.CloseLBWindow();
  }
};
DBZ.CheckContactByMsg = function (ContactTypeCode)
{
  if (arguments.length == 1)
  {
    DBZ.ContactTypeCode = ContactTypeCode;
  }
  if (DBZ.ContactTypeCode > 0) //  0 = no request,  ignore the call to this function
  {
    if (DBZ.ContactTypeCode == 9) // chat
    {
      DBZ.TextChat();
    }
    else if (DBZ.LoginName == DBZ.GuestName)
    {

      DBZ.ProcessCustomer("Contact");  //contact for guest visitors
    }
    else
    {
      DBZ.ProcessCustomer("Request");  //contact for logged-in customers
    }
  }
};
DBZ.SetUpdateValue = function (InputID)
{
  var InputVal = DBZ.$(InputID).value;
  var InitVal = DBZ.InitValArr[InputID];
  if (InputVal == InitVal)
  {
    return "";
  }
  else
  {
    return InputVal;
  }
};
DBZ.ContinueContactMsg = function ()
{
  var OK,OKMsg,CustomerID,CustomerEmail,CustomerFirstName,CustomerLastName,CustomerTel,
      CustomerName,CustomerPassword,RegisterData;
  
  OK = true;      
  CustomerID = "";
  CustomerEmail = DBZ.$("ContactEmailInp").value;
  CustomerFirstName = DBZ.$("ContactFirstNameInp").value;
  CustomerLastName = DBZ.$("ContactLastNameInp").value;
  CustomerTel = DBZ.$("ContactTelephoneInp").value;
  CustomerName = CustomerFirstName + " " + CustomerLastName;
  CustomerPassword = "*";
  if (CustomerEmail == "" || CustomerName == "")
  {
    OK = false;
    DBZ.ShowAlertBox("Please enter your name and email address\n" + 
                 "so that we may contact you.  Thank you.");
  }
  if (OK)
  {
    DBZ.RegisterOKMsg = "Your have been automatically registered.\n\n" + 
                        "An email was sent to you with a temporary password";
    RegisterData = DBZ.SiteID + "|" +
                   CustomerEmail  + "|" +
                   CustomerPassword  + "|" +
                   CustomerName  + "|" +
                   CustomerFirstName  + "|" +
                   CustomerLastName  + "|" +
                   CustomerTel;
    DBZ.RegisterCustomerContinued(RegisterData); 
  }
};
DBZ.ProcessContactMsg = function ()
{
  var   OK,CustomerID,CustomerEmail,CustomerFirstName,CustomerLastName,
        CustomerTelephone,MsgSubject,MsgText,MessageData,Name;
  
  OK = true;
  if (DBZ.ContactTypeCode > 0) // 0=no msg, ignore call to this function
  {
    CustomerID = DBZ.LoginArr[DBZ.CustomerIDIdx];
    CustomerEmail = DBZ.LoginArr[DBZ.CustomerEmailIdx];
    CustomerFirstName = DBZ.LoginArr[DBZ.FirstNameIdx];
    CustomerLastName = DBZ.LoginArr[DBZ.LastNameIdx];
    CustomerTelephone = DBZ.LoginArr[DBZ.CustomerTelIdx];
    MsgSubject = DBZ.$("RequestSubjectInp").value;
    MsgText = DBZ.$("RequestInfoTxt").value;
    
    var MessageData = DBZ.SiteID + "|" + DBZ.ContactTypeCode + "|" + CustomerID + "|" + 
                      CustomerEmail + "|" + CustomerFirstName + "|" + CustomerLastName + "|" + 
                      CustomerTelephone + "|" + MsgSubject + "|" + MsgText;
    var SendKey = DBZ.GenSendKey();
    var Codes = "Codes=" +
             DBZ.Encode(MessageData,SendKey) + "|" +
             DBZ.Encode(SendKey,"");
    DBZ.ROSourceArr[DBZ.SendMessageROIdx] = "sendmessage.php";
    DBZ.ROFunctionArr[DBZ.SendMessageROIdx] = "DBZ.ProcessContactMsg2()";
    DBZ.ROSendDataArr[DBZ.SendMessageROIdx] = Codes;
    DBZ.OpenAsyncRO(DBZ.SendMessageROIdx);   
  }
};
DBZ.ProcessContactMsg2 = function ()
{ 
  var ROResponse;
  
  ROResponse = DBZ.ROResponseArr[DBZ.SendMessageROIdx];
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.ContactTypeCode = 0;
    DBZ.ShowAlertBox(ROResponse.substring(3));
    DBZ.CloseLBWindow();
  }
  else if (ROResponse.substring(0,6) == "NOTOK:") 
  {
    DBZ.ShowAlertBox(ROResponse.substring(6));
  }
  else
  {
    DBZ.ContactTypeCode = 0;
    alert(ROResponse);
    DBZ.CloseLBWindow();
  }
};

DBZ.RegisterCustomer = function ()
{
  var OK,OKMsg,CustomerID,CustomerEmail,CustomerFirstName,CustomerLastName,CustomerTel,
      CustomerName,CustomerPassword,RegisterData;
  OK = true;
  if (DBZ.IsEmptyInput("RegisterEmailInp") || DBZ.IsEmptyInput("RegisterPasswordPass") || 
      DBZ.IsEmptyInput("Register2PasswordPass") || DBZ.IsEmptyInput("RegisterFirstNameInp") || 
      DBZ.IsEmptyInput("RegisterLastNameInp"))
  { 
    OK = false;
    DBZ.ShowAlertBox("All fields are required.\n\nPlease complete the form and resubmit.  Thank you.");
  }  
  if (OK)
  { 
    var CustomerPassword = DBZ.$("RegisterPasswordPass").value;
    var CustomerPassword2 = DBZ.$("Register2PasswordPass").value;
    if (CustomerPassword != CustomerPassword2)
    {
      OK = false;
      DBZ.ShowAlertBox("The password does not match the reconfirmed password.\n\n" + 
                       "Please reenter and submit again. Thank you.");
    }
  }
  if (OK)
  {
    DBZ.RegisterOKMsg = "Successfull registration.\n\n" +
                        "At any time while logged in you can update your\n" +
                        "information by clicking on the <strong>Profile</strong> button\n" +
                        "at the top of this page.";
    var CustomerEmail = DBZ.$("RegisterEmailInp").value;
    var CustomerFirstName = DBZ.$("RegisterFirstNameInp").value;
    var CustomerLastName = DBZ.$("RegisterLastNameInp").value;
    var CustomerName = CustomerFirstName + " " + CustomerLastName;
    var CustomerTel = DBZ.LoginArr[DBZ.CustomerTelIdx];
    var RegisterData = DBZ.SiteID + "|" +
                    CustomerEmail  + "|" +
                    CustomerPassword  + "|" +
                    CustomerName  + "|" +
                    CustomerFirstName  + "|" +
                    CustomerLastName  + "|" +
                    CustomerTel;
    DBZ.RegisterCustomerContinued(RegisterData);  
  }
};                    
                    
DBZ.RegisterCustomerContinued = function (RegisterData) 
{  
  var SendKey,Codes; 
  RegisterData += "|" + DBZ.SuspectEmail;
  SendKey = DBZ.GenSendKey();
  Codes = "Codes=" +
          DBZ.Encode(RegisterData,SendKey) + "|" +
          DBZ.Encode(SendKey,"");
  DBZ.ROSourceArr[DBZ.RegisterROIdx] = "register.php";
  DBZ.ROFunctionArr[DBZ.RegisterROIdx] = "DBZ.RegisterCustomerContinued2()";
  DBZ.ROSendDataArr[DBZ.RegisterROIdx] = Codes;
  DBZ.OpenAsyncRO(DBZ.RegisterROIdx);
};
DBZ.RegisterCustomerContinued2 = function ()
{
  var ROResponse = DBZ.ROResponseArr[DBZ.RegisterROIdx]; 
  if (ROResponse.substring(0,3) == "OK:")
  {
    DBZ.LoginArr = ROResponse.substring(3).split("|");
    DBZ.LoginName = DBZ.LoginArr[DBZ.NameIdx];
    DBZ.$("LoginBtn1").innerHTML = "Logout";
    DBZ.$("LoginBtn2").innerHTML = "Profile"; 
    DBZ.$("LoginBtn1").value = "Logout";
    DBZ.$("LoginBtn2").value = "Profile"; 
    DBZ.$("WelcomeName").innerHTML = DBZ.LoginName;
    DBZ.SetPageLinks();
    DBZ.ShowAlertBox(DBZ.RegisterOKMsg);
    DBZ.CloseLBWindow();
    DBZ.CheckContactByMsg();
  }
  else if (ROResponse.substring(0,7) == "NOTOK:1") 
  {
    DBZ.$("LoginEmailInp").value = DBZ.trim(ROResponse.substring(7)); 
    DBZ.ProcessCustomer("Login");
    DBZ.ShowAlertBox("A registered customer is already using this email address.\n" +
                     "If this is you, please enter your password to login.\n\n" + 
                     "<span class='Emphasis2'>Otherwise, if you suspect that someone is misusing your\n" + 
                     "email address, please report this to us immediately!</span>");  
  }
  else if (ROResponse.substring(0,7) == "NOTOK:2") 
  {
    DBZ.ShowAlertBox("Your email address is not valid.\n\n" + 
                     "Please reenter and try again.  Thank you.");  
  }
  else if (ROResponse.substring(0,7) == "NOTOK:3") 
  {
    DBZ.ShowAlertBox("Your email address is unusual.\n\n" + 
                     "Please double check it.  If necessary, make corrections.\n\n" +
                     "When you are sure that it is correct, submit again.");
    DBZ.SuspectEmail = "";                     
  }
  else
  {
    alert(ROResponse);
    DBZ.CloseLBWindow();
  }
};
DBZ.ResetRegister = function ()
{
  document.RegisterForm.reset();
  DBZ.InitInput("RegisterEmailInp");
  DBZ.InitInput("RegisterPasswordText");
  DBZ.InitInput("RegisterPasswordPass");
  DBZ.InitInput("Register2PasswordText");
  DBZ.InitInput("Register2PasswordPass");
  DBZ.InitInput("RegisterFirstNameInp");
  DBZ.InitInput("RegisterLastNameInp");  
};
DBZ.LogoutCustomer = function ()
{
  DBZ.LoginArr = DBZ.InitArr(DBZ.LoginArrSize,"");
  DBZ.LoginName = DBZ.GuestName;
  DBZ.$("LoginBtn1").innerHTML = "Login";
  DBZ.$("LoginBtn2").innerHTML = "Register";
  DBZ.$("LoginBtn1").value = "Login";
  DBZ.$("LoginBtn2").value = "Register";
  DBZ.$("WelcomeName").innerHTML = DBZ.LoginName;
  DBZ.SetPageLinks();
};
DBZ.OptOut = function ()
{
  if (DBZ.LoginName == DBZ.GuestName)
  {
    DBZ.ContinueToProfile = true;
    DBZ.ProcessCustomer("Login");           
    DBZ.ShowAlertBox("To set your email options:\n\n" + 
                     "1. First register or login.\n\n" +
                     "2. The 'Profile' panel will appear with a 'Preferences Settings' section.\n\n" +
                     "3. In that section, check the appropriate email option boxes." );
  }
  else
  {
    DBZ.ShowAlertBox("In the 'Preferences Settings' section check the appropriate email option boxes.\n\n" +
                     "Thank you.");
    DBZ.ProcessCustomer("Profile");          
  }
}

DBZ.CancelLB = function ()
{
  DBZ.CloseLBWindow();
  DBZ.ContactTypeCode = 0;
};
DBZ.AffiliateAdBanners = function ()
{
  alert("Affiliate Banners");
};
DBZ.Reseller = function ()
{
  alert("Reseller");
};

DBZ.SetPageLinks = function()
{
  var LinkArr,Link,PageKey,IsPageLink,ClassList,i;
  
  LinkArr = document.getElementsByTagName("a");
  Link = "";
  DBZ.PageKey = DBZ.FormPK();
  for (i=0; i<LinkArr.length; i++)
  {
    IsPageLink = false;
    ClassList = LinkArr[i].className;
    if (ClassList)
    {
      IsPageLink = (ClassList.indexOf("pagelink") >= 0) ? true : false;
    }
    if (IsPageLink)
    {
      Link = LinkArr[i].getAttribute("href");
      if (Link.substring(0,1) != "#")
      {
        Link += "?";
        Link = Link.substring(0,Link.indexOf("?"));
        if (DBZ.PageKey == "")
        {
          LinkArr[i].setAttribute("href",Link);
        }
        else
        {
          LinkArr[i].setAttribute("href",Link + "?pk=" + DBZ.PageKey);
        }
      }
    }
  }
};
DBZ.Animate = function (TurnOn)
{
  DBZ.RemoveFlashPlayer("BannerVideo","BannerVideoPlayer");
  if (TurnOn)
  {
    DBZ.$sv("DBZ-Animation-animated",true);
    DBZ.$sv("DBZ-Animation-static",false);
    setTimeout(function() {DBZ.Animate(false);},5000);
  }
  else  // turn off animation and show static image
  {
    DBZ.$sv("DBZ-Animation-animated",false);
    DBZ.$sv("DBZ-Animation-static",true);
  }
};
DBZ.PlayBannerSWF = function ()
{
  DBZ.$sv("DBZ-Animation-animated",false);
  DBZ.$sv("DBZ-Animation-static",false);
  var flashvars = {};
  var params = {
                allowScriptAccess: "always",
                quality: "high",
                swLiveConnect: "true",
                pluginspage: "http://www.macromedia.com/go/getflashplayer"
               };
  var attributes = {
                    name: "BannerVideo",
                    id: "BannerVideo"
                   };
  swfobject.embedSWF(DBZ.BannerVideoSWFArr[DBZ.BannerVideoSWFIdx][0], "BannerVideoPlayer", "780", "180", "8.0.0","flash/expressInstall.swf", flashvars, params, attributes); 
};

DBZ.PlaySEOBookVideo = function ()
{
  if (DBZ.$("SEOBookVideoPlayer",true))
  {
    var flashvars = {};
    var params = {
                  loop: "false",
                  allowScriptAccess: "always",
                  quality: "high",
                  swLiveConnect: "true",
                  pluginspage: "http://www.macromedia.com/go/getflashplayer"
                 };
    var attributes = {
                      name: "SEOBookVideo",
                      id: "SEOBookVideo"
                     };
    swfobject.embedSWF("flash/SEOBookVideo.swf", "SEOBookVideoPlayer", "355", "306", "8.0.0",
                       "flash/expressInstall.swf", flashvars, params, attributes); 
  }
};
DBZ.RedrawWindow = function ()
{
  var BrowserSizeArr = DBZ.BrowserSize();
  var FootingTop = DBZ.BodyHeight;
  if (BrowserSizeArr.Height > FootingTop+DBZ.FootingHeight)
  {
    FootingTop = BrowserSizeArr.Height - DBZ.FootingHeight; 
  }
  DBZ.$s("ContentBody").height = (FootingTop+DBZ.FootingHeight) + "px";
  DBZ.$s("Footer").top = FootingTop + "px";
};

DBZ.SelectTab = function (TabID)
{
  var TabEle,TabEleArr,i;
  
  // try to avoid IE bug causing intermittant error
  if (!DBZ.$("DBZTabs",true))
  {
    return;
  }
  
  TabEle = DBZ.$("DBZTabs");
  TabEleArr = TabEle.getElementsByTagName("a");

  for (i=0; i<TabEleArr.length; i++)
  {
    if (TabID == TabEleArr[i].id || DBZ.ActiveTab == TabEleArr[i].id)
    {
      TabEleArr[i].style.top = "7px";
      TabEleArr[i].style.filter = "alpha(opacity=100)";
      TabEleArr[i].style.opacity = "1.0";
    }
    else
    {
      TabEleArr[i].style.filter = "alpha(opacity=30)";
      TabEleArr[i].style.opacity = "0.3";
      TabEleArr[i].style.top = "12px";      
    }
  }
};

DBZ.TabRollover = function (TabID)
{ 
  DBZ.CloseDropDown();
  DBZ.DropDownID = "DropDown-" + TabID.substring(8);
  if (TabID == DBZ.ActiveTab)
  {
    DBZ.OpenDropDown(TabID);
  }
  else
  {
    DBZ.RolloverTab = TabID;
    DBZ.RolloverTabOpacity = 0.3;
    DBZ.RolloverTop = 12;
    DBZ.RolloverTimerIDArr.push(setInterval(function() {DBZ.RolloverFade();},10));
  }
};
DBZ.RolloverFade = function ()
{
  var Finished = true;

  if (DBZ.RolloverTabOpacity < 1)
  {
    DBZ.SetOpacity(DBZ.RolloverTab,DBZ.RolloverTabOpacity);
    DBZ.RolloverTabOpacity = DBZ.RolloverTabOpacity + 0.05;
    Finished = false;
  }

  if (DBZ.RolloverTop > 7)
  {
    DBZ.$s(DBZ.RolloverTab).top = DBZ.RolloverTop + "px";
    DBZ.RolloverTop = DBZ.RolloverTop - .4;
    Finished = false;
  }
  if (Finished)
  {
    DBZ.ClearRolloverTimer();
    DBZ.HighLitedTab = DBZ.RolloverTab;
    DBZ.OpenDropDown(DBZ.RolloverTab);
  }  
};
DBZ.TabRollOut = function ()
{
  // if (DBZ.ActiveTab != "")
  // {
    // DBZ.SelectTab(DBZ.ActiveTab);
  // }
  DBZ.HideDropDowns();
  DBZ.SelectTab(DBZ.ActiveTab);

};
DBZ.OpenDropDown = function (TabID)
{
  var DropDownContainerID;
  
  clearInterval(DBZ.DropDownTimerID);
  if (TabID != "" && DBZ.DropDownID != "")
  {
    DropDownContainerID = DBZ.DropDownID + "-Container";  
    DBZ.$sv(DropDownContainerID,true);
    DBZ.RemoveFlashPlayer("BannerVideo","BannerVideoPlayer");
    DBZ.RemoveFlashPlayer("SEOBookVideo","SEOBookVideoPlayer");  
    DBZ.DropDownTop = parseInt(DBZ.$s(DropDownContainerID).height,10) * -1;
    DBZ.$s(DBZ.DropDownID).top = DBZ.DropDownTop + "px"; 
    DBZ.$s(DropDownContainerID).zIndex = "11000";
    DBZ.DropDownTimerID = setInterval(DBZ.SlideDropDown,40);
  }    
};
DBZ.CloseDropDown = function ()
{
  var DropDownContainerID;
  
  DropDownContainerID = DBZ.DropDownID + "-Container";
  clearInterval(DBZ.DropDownTimerID);
  DBZ.TabRollOut();
  if (DBZ.DropDownID != "")
  {
    if (DBZ.$(DropDownContainerID,true))  //try to avoid IE bug causing error
    {
      DBZ.$s(DropDownContainerID).zIndex = "0";
      DBZ.$sv(DropDownContainerID,false);
    }  
    if (DBZ.PlayAfterDropDown)
    {
      DBZ.PlayHeaderBanner(true);
    }
    else
    {
      DBZ.PlayHeaderBanner(false);
    }
  }
  DBZ.DropDownID = "";
};
DBZ.ClearRolloverTimer = function ()
{
  if (DBZ.RolloverTimerIDArr.length > 0)
  {
    clearInterval(DBZ.RolloverTimerIDArr.shift());
  }
};
DBZ.SlideDropDown = function ()
{
  DBZ.DropDownTop = DBZ.DropDownTop + 15;
  if (DBZ.DropDownTop >= 0)
  {
    clearInterval(DBZ.DropDownTimerID);
    DBZ.DropDownTop = 0;
  }
  DBZ.$s(DBZ.DropDownID).top = DBZ.DropDownTop + "px";  
};
DBZ.HideDropDowns = function ()
{
  //DBZ.$s(DBZ.DropDownID).zIndex = "0";
  DBZ.$sv("DropDown-Home-Container",false);
  DBZ.$sv("DropDown-Services-Container",false);
  DBZ.$sv("DropDown-Affiliates-Container",false);
  DBZ.$sv("DropDown-Resources-Container",false);
  DBZ.$sv("DropDown-Contact-Container",false);
}

DBZ.PressRelease = function ()
{
  DBZ.OpenWindow("http://www.techcombine.com/rssfeed/client_rssfeeds.html","TechCombine_RSS_Feeds");
};
DBZ.GetSEOBook = function ()
{
  var URLSearchString;
  
  URLSearchString = "";
  if (DBZ.LoginName != DBZ.GuestName)
  {
    URLSearchString = (DBZ.PageKey == "") ? "" : "?pk=" + DBZ.PageKey;
  }    
  DBZ.ShowAlertBox("Please note that a new window (or tab) will open.");
  //DBZ.OpenWindow("http://192.168.1.101/techcombine/google-ranking-manual/getmanual.shtml" +
  DBZ.OpenWindow("http://www.techcombine.com/google-ranking-manual/getmanual.shtml" +
                 URLSearchString,
                 "Get_Google_Ranking_Manual",950,true); 
};
DBZ.HireUs = function ()
{
  DBZ.ContactTypeCode = 4;
  DBZ.CheckContactByMsg();
  DBZ.ShowAlertBox("Contact us to discuss your requirements - any thing\n" + 
                   "from a specific product or service to complete web\n" +
                   "design, marketing and maintenance projects.\n\n" +
                   "We're ready to help you with any aspect of developing\n" +
                   "a successful presence on the World Wide Web!");
 
};
DBZ.FreeWebsiteAnalysis = function ()
{
  DBZ.ShowAlertBox("under construction.");
};
DBZ.WirelessMediaMsg = function ()
{
  DBZ.ContactTypeCode = 2;
  DBZ.CheckContactByMsg();
  DBZ.ShowAlertBox("We're developing some great new tools and techniques\n" + 
                   "for Wireless Media Marketing.  Contact us for the latest\n" +
                   "on how we can help you in this exciting new field.");                   
};
DBZ.OpenGlossary = function ()
{
  DBZ.OpenWindow("seo-glossary.html","seoglossary",550,true);
};
DBZ.BecomeAffiliate = function ()
{
  var Msg;
  DBZ.ContactTypeCode = 3;
  DBZ.CheckContactByMsg();
  DBZ.ShowAlertBox("Tells us who you are, you're website URL and whether you\n" +
                   "are ready to join our Affiliate Program or just looking\n" +
                   " for more information.\n\n" + 
                   "Either way, we'll contact you immediately.\n\n" +
                   "<i>Take advantage of the most lucrative affiliate\n" +
                   "program in the industry!</i>");                     
};
DBZ.AffiliateMoreInfo = function ()
{
  DBZ.ContactTypeCode = 8;
  DBZ.ProcessCustomer("Contact");
};
DBZ.OpenAffiliateLearnMore = function ()
{
  DBZ.OpenWindow("affiliate-become-affiliate.html","become_affiliated",550,true);
};
DBZ.OpenBecomeReseller = function ()
{
  DBZ.OpenWindow("affiliate-become-reseller.html","become_reseler",550,true);
};
DBZ.OpenAffiliateHowWorks = function ()
{
  DBZ.OpenWindow("affiliate-how-it-works.html","affiliates_how_it_works",550,true);
};
DBZ.OpenMarketingPackages = function ()
{
  DBZ.OpenWindow("online-marketing-packages.html","online_marketing_packages",550,true);
  DBZ.ContactTypeCode = 7;
  DBZ.CheckContactByMsg();
  DBZ.ShowAlertBox("A new window should be open describing our Online Marketing\n" + 
                   "Package Deals.  Check out the best pricing in the industry,\n" +
                   "then tell us which packages you are interested in.\n\n" +
                   "We'll get back to you immediately.\n\n" +
                   "<i>Don't pass up the best deals in the industry!</i>"); 
};
DBZ.VisitWebsite = function (ThumbNailID)
{ 
  var SiteCode = ThumbNailID.substring(0,3);
  var WebsiteIsOpen = false;
  if (DBZ.WindowRefArr[SiteCode])
  {
    DBZ.WindowRefArr[SiteCode] = (DBZ.WindowRefArr[SiteCode].closed) ? false : DBZ.WindowRefArr[SiteCode];
    WebsiteIsOpen = (DBZ.WindowRefArr[SiteCode]) ? true : false;
  }
  if (!WebsiteIsOpen)
  {
    WebsiteIsOpen = (typeof(window.opener) == "undefined" || window.opener === null) ? false : true;
    if (WebsiteIsOpen)
    {
      WebsiteIsOpen = (window.opener.closed) ? false : true;
    }
    if (WebsiteIsOpen)
    {
      try
      {
        WebsiteIsOpen = (SiteCode in window.opener) ? true : false;
      }
      catch (e)
      {
        WebsiteIsOpen = false;
      }
    }
  }
  if (WebsiteIsOpen)
  {
    WebsiteIsOpen = !confirm(DBZ.WindowUrlArr[SiteCode] + " is already open in another window or tab.\n\n" +
                            "Open a new window anyway?");
  }
  if (!WebsiteIsOpen)
  {
     DBZ.WindowRefArr[Website] = DBZ.OpenWindow(DBZ.WindowUrlArr[SiteCode],SiteCode,0,true);
  }
};
DBZ.ShowInputHint = function (InputID,SectionID,FormID)
{
  var InputVal = DBZ.$(InputID).value;
  var InitVal = DBZ.InitValArr[InputID];
  if (InputVal != InitVal)
  {
    var SectionTop = parseInt(DBZ.ComputedStyle(SectionID,"top"),10);
    var FormTop = parseInt(DBZ.ComputedStyle(FormID,"top"),10);
    var SectionLeft = parseInt(DBZ.ComputedStyle(SectionID,"left"),10);
    var FormLeft = parseInt(DBZ.ComputedStyle(FormID,"left"),10);
    var InputTop = parseInt(DBZ.ComputedStyle(InputID,"top"),10) + SectionTop + FormTop - 17;
    var InputLeft = parseInt(DBZ.ComputedStyle(InputID,"left"),10) + SectionLeft +FormLeft;
    DBZ.$s("InputHint").top = InputTop + "px";
    DBZ.$s("InputHint").left = InputLeft + "px";
    DBZ.$("InputHint").innerHTML = InitVal;
    DBZ.$sv("InputHint",true);
    clearTimeout(DBZ.InputHintTOID);
    DBZ.InputHintTOID = setTimeout(DBZ.HideInputHint,DBZ.InputHintTime);
  }
};
DBZ.HideInputHint = function ()
{
  DBZ.$sv("InputHint",false);
};
DBZ.ShowHint = function (HintID)
{
  switch (HintID)
  {
    case "Hint001":
      var HintHeight = 11;
      var HintWidth = 180;
      var HintTop = parseInt(DBZ.ComputedStyle("BadgesSealsBanner","top"),10) + 120;
      var HintLeft = parseInt(DBZ.ComputedStyle("BadgesSealsBanner","left"),10) + 25;
      break;
    case "Hint002":
      var HintHeight = 11;
      var HintWidth = 180;
      var HintTop = parseInt(DBZ.ComputedStyle("BadgesSealsBanner","top"),10) + 120;
      var HintLeft = parseInt(DBZ.ComputedStyle("BadgesSealsBanner","left"),10) + 150;
      break;
  }
  var HintText = DBZ.$(HintID).innerHTML;
  clearTimeout(DBZ.HintTimeoutID);
  DBZ.$("Hint").innerHTML = HintText;
  DBZ.$s("Hint").width = HintWidth+"px";
  DBZ.$s("Hint").height = HintHeight+"px";
  DBZ.$s("Hint").top = HintTop + "px";
  DBZ.$s("Hint").left = HintLeft + "px";
  DBZ.$sv("Hint",true);
  DBZ.HintTimeoutID = setTimeout(function() { DBZ.HideHint() }, DBZ.HintTimeSec*1000);
  
  return;
};
DBZ.HideHint = function ()
{
  clearTimeout(DBZ.HintTimeoutID);
  DBZ.$s("Hint").visibility = "hidden";
};
DBZ.FreeAdvice = function ()
{
  if (DBZ.LoginName == DBZ.GuestName)
  {
    DBZ.ContinueToProfile = true;
    DBZ.ShowAlertBox("Telephone support for our free advice and help hot line\n" + 
                     "is only available to our registered members. You can quickly\n" + 
                     '<a href="#" onclick="DBZ.ProcessCustomer(' + "'Login')" + ';"' + ">Login (or Register)</a> " +
                     "to get our free telephone support (plus much more).\n\n" + 
                     "Or as a guest visitor you can " +
                     "<a href'#' onclick='DBZ.CheckContactByMsg(7);'>click here</a> " + 
                     "to send us your query by email.");                     
  }
  else
  {
    DBZ.ShowAlertBox("The telephone number for our free advice\n" + 
                     "and help hot line is " + DBZ.FreeAdviceTelephone + ".\n\n" +
                     "You can also " + 
                     "<a href'#' onclick='DBZ.CheckContactByMsg(7);'>click here</a> " + 
                     "to send us your query by email.");
  }
};
DBZ.BadgesSeals = function (BadgeSealID,PosArr)
{
  var BadgeSealMsg = "";
  
  BadgeSealMsg = DBZ.$(BadgeSealID+"Msg").innerHTML;
  DBZ.ShowAlertBox(BadgeSealMsg,PosArr);
};
DBZ.SetInput = function (InputID)
{
  var PassPos = InputID.indexOf("PasswordText");
  if (PassPos >= 0)
  {
    var BaseID = InputID.substring(0,PassPos);
    var PassID = BaseID + "PasswordPass";
    DBZ.$s(InputID).display = "none";
    DBZ.$s(PassID).display = "";    
    DBZ.$(PassID).focus();
  }
  else
  {
    var InitVal = DBZ.InitValArr[InputID];
    var InpVal = DBZ.$(InputID).value;
    DBZ.$(InputID).focus();
    if (InitVal == InpVal)
    {
      DBZ.$(InputID).value = "";
      DBZ.$s(InputID).fontSize = "12px";
      DBZ.$s(InputID).fontStyle = "normal";
      DBZ.$s(InputID).color = "#0A0A0A";
    }
  }
};
DBZ.ResetInput = function (InputID)
{
  var InpVal = DBZ.$(InputID).value;
  var PassPos = InputID.indexOf("PasswordPass");
  if (PassPos >= 0)
  {
    var BaseID = InputID.substring(0,PassPos);
    var TextID = BaseID + "PasswordText";
  
    if(InpVal=="") 
    {
      DBZ.$s(TextID).display = "";
      DBZ.$s(InputID).display = "none";
    }   
  }
  else
  {
    var InitVal = DBZ.InitValArr[InputID];
    var InpVal = DBZ.$(InputID).value;
    if (InpVal == "" || DBZ.$(InputID).value == InitVal)
    {
      DBZ.$(InputID).value = InitVal;
      DBZ.$s(InputID).fontSize = "12px";
      DBZ.$s(InputID).fontStyle = "italic";
      DBZ.$s(InputID).color = "#10359D";
    }
    else
    {
      DBZ.$s(InputID).fontSize = "12px";
      DBZ.$s(InputID).fontStyle = "normal";
      DBZ.$s(InputID).color = "#0A0A0A";
    }
  }
};
DBZ.InitInput = function (InputID)
{
  DBZ.$(InputID).value = DBZ.InitValArr[InputID];
  if (InputID.indexOf("PasswordText") >= 0)
  {
    DBZ.$s(InputID).display = "";  
  }
  else if (InputID.indexOf("PasswordPass") >= 0)
  {
    DBZ.$s(InputID).display = "none";  
  }
  else
  {
    DBZ.$s(InputID).fontSize = "12px";
    DBZ.$s(InputID).fontStyle = "italic";
    DBZ.$s(InputID).color = "#10359D";
  }
};
DBZ.IsEmptyInput = function (InputID)
{
  var IsEmpty, InputVal, InitVal;
  
  IsEmpty = false;
  InputVal = DBZ.trim(DBZ.$(InputID).value);
  InitVal = DBZ.InitValArr[InputID];
  if (InputVal == "" || InputVal == InitVal)
  {
    IsEmpty = true;
  }  
  return IsEmpty;
};
DBZ.FormPK = function ()
{
  var PKInp,PKOut,GroupArr,Char,Group,GroupNo,GroupLen,CodePos,Code,i;

  PKOut = "";
  if (DBZ.LoginArr[DBZ.PageTSIdx] != "")
  {
    PKInp = DBZ.LoginArr[DBZ.CustomerIDIdx] + "|" + 
            DBZ.LoginArr[DBZ.PageTSIdx] + "|" + DBZ.LoginArr[DBZ.PageCodeIdx];   
    GroupArr = ["lp0aqI","DEVF2","mko9iK","4QAZW","Ljnuh8","Obygvtf7","HY1UJM","Pcrdx6","zsew5","SXC3","RTGBN"];
    Char = "";
    Group = "";
    GroupNo = 0;
    GroupLen = 0;
    CodePos = 0;
    Code = "";
    for (i=0; i<PKInp.length; i++)
    {
      Char = PKInp.substring(i,i+1);
      GroupNo = (Char == "|") ? 10 : parseInt(Char,10);
      Group = GroupArr[GroupNo];
      GroupLen = Group.length;
      CodePos = Math.floor(Math.random() * GroupLen);
      Code = Group.substring(CodePos,CodePos+1);
      PKOut += Code;
    }
  }
  return PKOut;
};
DBZ.DeformPK = function (PKInp)
{
  var PKOut,GroupArr,Char,Group,GroupNo,GroupLen,CodePos,Code,i;
  
  PKOut = "";
  GroupArr = ["lp0aqI","DEVF2","mko9iK","4QAZW","Ljnuh8","Obygvtf7","HY1UJM","Pcrdx6","zsew5","SXC3","RTGBN"];
  Char = "";
  Group = "";
  GroupNo = 0;
  GroupLen = 0;
  CodePos = 0;
  Code = "";
  for (i=0; i<PKInp.length; i++)
  {
    Code = PKInp.substring(i,i+1);
    for (GroupNo=0; GroupNo<GroupArr.length; GroupNo++)
    {
      Group = GroupArr[GroupNo];
      if (Group.indexOf(Code) >= 0)
      {
        break;
      }      
    }
    Char = (GroupNo < 10) ? GroupNo + "" : "|";
    PKOut += Char;
  }
  return PKOut;
};

