// CONFIG.JS updated by installer
//GENERAL CONFIGURATION
//ActivDirectory Version
var version = "5.1.6";

//-Geographic name of directory, publisher, and product to appear on titlebar and results page
var title = "Electronic Brunei Telephone Directory"; 	// -- Enter title from requisition
var trakVal = "GTEBRN08";
var traip = "gtebrunei.innovectra.net";
var bookLoc = trakVal;					// -- Enter build folder name (e.g.: "champaign05")
var spinecode = trakVal;
var issuedate = "05";
var year = "2008";
var corp = "GTE Directories (B) SDN BHD";
var publisher = "GTE";
var brandname = "Electronic Directory";
var product = "Electronic Directory";
var corplink = "www.yp.com.bn";
var orderNumber = "" // -- none for this publisher
var atkOff = 0;
var uniqueID = "";

//--- ADD SECTIONS IN THE DROP-DOWN HERE (IF YOU NEED TO ADD A SECTION THAT IS NOT HERE, ---
//--- ADD IT HERE, IN TREE.HTM AND IN TREE.JS. ALSO IN THE SEARCH.JS FILES IF IT IS      ---
//--- A WHITE OR YELLOW SECTION)						         ---

//- About Us
	var aboutSection = new Array();
	aboutSection[0] = new Array("About Us", "about", 1, 1);

//- Coupons -- in most books
	var couponSection = new Array();
	couponSection[0] = new Array("Front Cover", "featured", 0, 0);		//- Switch on if there are coupons

//- 20 Popular Headings & Front Cover
	var coverSection = new Array();
	coverSection[0] = new Array("20 Popular Headings Front Cover", "cover", 1, 1);

//- Front Cover only -- Needed if 20 Headings is switched off
	var frontSection = new Array();
	frontSection[0] = new Array("Front Cover", "cover", 1, 0);

//- GUIDES
	var guidesSection = new Array();
	guidesSection[0] = new Array("Auto Guide", "guide01", 1, 1);
	guidesSection[1] = new Array("Financial Guide", "guide02", 1, 1);
	guidesSection[2] = new Array("Health Guide", "guide03", 1, 1);
	guidesSection[3] = new Array("Home Living", "guide04", 1, 1);
	guidesSection[4] = new Array("Menu Pages", "guide05", 1, 1);

//- Emergency Numbers
	var emerSection = new Array();
	emerSection[0] = new Array("Important Numbers", "comm", 1, 1);
	emerSection[1] = new Array("Emergency Calls", "comm", 1, 1);
	emerSection[2] = new Array("Important Services", "comm", 1, 1);
	emerSection[3] = new Array("Telephone Service Numbers", "comm", 2, 1);


//- Customer & Community Information
	var commSection = new Array();
	commSection[0] = new Array("Information Pages", "comm", 3, 1);	//- Main link
	commSection[1] = new Array("An Announcement", "comm", 0, 0);	//- Main link
	commSection[2] = new Array("Table of Contents", "comm", 3, 1);
	commSection[3] = new Array("Telekom Brunei Berhad", "comm", 4, 1);
	commSection[4] = new Array("Public Service Information", "comm", 22, 1);
	commSection[5] = new Array("District Maps", "comm", 19, 1);
	commSection[6] = new Array("Prayer Times", "comm", 23, 1);
	commSection[7] = new Array("Auto Guide", "comm", 29, 0);
	commSection[8] = new Array("Menu Pages", "comm", 43, 0);
	commSection[9] = new Array("Home Living", "comm", 69, 0);
		
//- Customer Guide - in some books instead of Cust & Comm Information 
	var custSection = new Array();
	custSection[0] = new Array("Customer Guide", "cust", 29, 1);				//- Main link

	
//- TelBru Listings
	var gov2Section = new Array();
	gov2Section[0] = new Array("TelBru Listings", "gov02", 1, 1);

//- Government Pages
	var govSection = new Array();
	govSection[0] = new Array("Government Listings", "gov", 1, 1);
	govSection[1] = new Array("Government Index", "gov02", 6, 1);
	govSection[2] = new Array("Government Listings", "gov", 1, 1);

//- White Pages - Switch on and name the white pages sections.
//- If you need more than 20 sections, they must be added here, in tree.htm, tree.js, tab.htm, and search.js files
	var whiteSection = new Array();
	whiteSection[0] = new Array("Business White Pages", "b01", 1, 0);
	whiteSection[1] = new Array("Brunei / Muara District", "w01", 1, 1);
	whiteSection[3] = new Array("Belait District", "w02", 191, 1);
	whiteSection[2] = new Array("Bernait District", "w03", 1, 0);
	whiteSection[4] = new Array("Tutong District", "w03", 239, 1);
	whiteSection[5] = new Array("Temburong District", "w04", 261, 1);
	whiteSection[6] = new Array("Pager Subscribers", "w05", 267, 1);
	whiteSection[7] = new Array("White Pages", "w06", 1, 0);
	whiteSection[8] = new Array("White Pages", "w07", 1, 0);
	whiteSection[9] = new Array("White Pages", "w08", 1, 0);
	whiteSection[10] = new Array("White Pages", "w09", 1, 0);
	whiteSection[11] = new Array("White Pages", "w10", 1, 0);
	whiteSection[12] = new Array("White Pages", "w11", 1, 0);
	whiteSection[13] = new Array("White Pages", "w12", 1, 0);
	whiteSection[14] = new Array("White Pages", "w13", 1, 0);
	whiteSection[15] = new Array("White Pages", "w14", 1, 0);
	whiteSection[16] = new Array("White Pages", "w15", 1, 0);
	whiteSection[17] = new Array("White Pages", "w16", 1, 0);
	whiteSection[18] = new Array("White Pages", "w17", 1, 0);
	whiteSection[19] = new Array("White Pages", "w18", 1, 0);
	whiteSection[20] = new Array("White Pages", "w19", 1, 0);
	whiteSection[21] = new Array("White Pages", "w20", 1, 0);

//- Yellow Page Index sections -- usually just one. Switch on others, if nec.
	var indexSection = new Array();
	indexSection[0] = new Array("Fast Find Index", "index", 1, 1);		//- Generally needed
	indexSection[1] = new Array("Second Headings Index", "index02", 1, 0);	//- Switch on if nec.
	indexSection[2] = new Array("Third Headings Index", "index03", 1, 0);	//- Switch on if nec.

//- Coupons -- in most books
	var websitesSection = new Array();
	websitesSection[0] = new Array("Business Website Listings", "websites", 1, 1);		//- Switch on if there are coupons

//- Yellow Pages in Asia - ADPAI
	var adpaiSection = new Array();
	adpaiSection[0] = new Array("Yellow Pages In Asia", "adpai", 1, 1);	
//- Featured
	var featuredSection = new Array();
	featuredSection[0] = new Array("Dividers", "featured", 1, 0);	//- Main link

//- Yellow Sections (Although generally not in the drop-down, these are used by other areas of the GUI
	var ypSection = new Array();
	ypSection[0] = new Array("Yellow Pages", "yp01", 1, 1);
	ypSection[1] = new Array("Yellow Pages", "yp02", 1, 0);
	ypSection[2] = new Array("Yellow Pages", "yp03", 1, 0);
	
//-Featured Advertisers
// Enter number of banner ads (not including Superpages) or maxFeaturedAdvertisers
var bannernumber = 7;

//- add banners here
var advertisers = new Array();
advertisers[0] = new Array("mercedes_benz", 95, "yp01",0,0);
advertisers[1] = new Array("toyota", 96, "yp01",0,0);
advertisers[2] = new Array("gleneagles_jpmc", 74, "yp01",0,0);
advertisers[3] = new Array("bsm", 4, "featured",0,0);
advertisers[4] = new Array("royal_catering", 28, "guide05",0,0);
advertisers[5] = new Array("televisyen_brunei", 6, "yp01",0,0);
advertisers[6] = new Array("bruneitourism", 9, "featured",0,0);



// --- SET THESE ONCE PER PUBLISHER ---
//-Rotating logos & associated links
var link = new Array();
link[0] = new Array("www.brunet.bn", 1);
link[1] = new Array("www.telecom.gov.bn/", 2);
link[2] = new Array("www.brunet.bn", 3);

//-Background GUI color; tab colors
var color = "fdf5ad";
var tabbkg = "C2D3FC";
var tabtext = "9EBCFA";
var noTabSections = new Array('comm',
				'cover',
				'coupon',
				'brand',
				'cust',
				'emerg',
				'featured',
				'gov',
				'inside',
				'urban',
				'guide01',
				'guide02',
				'guide03',
				'guide04',
				'guide05',
				'term',
				'extras',
				'adpai',
				'websites',
				'gov02',
				'w04',
				'w05');
				

//GUI and results links text sizes (in pts) and colors
var links800 = 7;
var links = 7;
var categoryColor= "CC6600"; //Match text color in keyword searches
var activeLinksColor = "663300";  //Color of active sub-sections in section list
var linksColor = "815e42";  //Color of sub-sections in section list
var resultColor = "663300"; //Color of matches in searches
var headingColor= "000000"; // Color of heading below results
var nomatchColor= "663300"; //Color of text if no matches found
var searchItemColor = "663300"; //Search item in keyword searches
var doubleTruckResultColor = "660066"; //Search item in keyword searches for DT ads
var secColor0 = "815e42";
var secColor1 = "000000";
var secColor2 = "993300";
var secColor3 = "330033";
var secColor4 = "660000";
var secColor5 = "660000";
var secColor6 = "993300";
var secColor7 = "663300";
var secColor8 = "660066";
var secColor9 = "CCFFCC";
var secColor10 = "CCCC33";
var secColor11 = "FF99FF";
var secColor12 = "FF9999";
var secColor13 = "996600";
var secColor14 = "00FF00";
var secColor15 = "CC0033";
var secColor16 = "FFFF00";

// - Add even page numbers of double truck pairs here --
//Double truck ads
var doubleTrucks = new Array();

//- Enter which section the 911 pages appear in; Enter number of coupon index pages;
//- If coupon page numbers are the same on the front and back of pages, change 'doubleCoupon' to true --
var emergSection = 'comm';
var numCouponIndex = 2;
var doubleCoupon = false;

//-Featured Advertisers links color
var featuredColor = "663300";
var pageWidth = 693;

//USERHELP PAGE CONFIGURATION
var textcolor = "0054BD"

//NUMBER OF BACK/FORWARD STEPS
var maxNumSpots = 10;

// Enter first page and number before first page of Yellow Page section here
var section="featured";
var number = 0;
var page = 0;

//- Yellow Pages end page number, default section selection
// PAGE RANGES START HERE
var maxCover = -1;
var minCover = -1;
var maxCust = 52;
var minCust = 29;
var maxComm = 26;
var minComm = 1;
var maxIndex = 7;
var minIndex = 1;
var maxWebsites = 3;
var minWebsites = 1;
var maxGuide01 = 20;
var minGuide01 = 1;
var maxGuide02 = 6;
var minGuide02 = 1;
var maxGuide03 = 6;
var minGuide03 = 1;
var maxGuide04 = 18;
var minGuide04 = 1;
var maxGuide05 = 38;
var minGuide05 = 1;
var maxW01 = 190;
var minW01 = 1;
var maxW02 = 238;
var minW02 = 191;
var maxW03 = 260;
var minW03 = 239;
var maxW04 = 266;
var minW04 = 261;
var maxW05 = 268;
var minW05 = 267;
// Enter first page and number before first page of Yellow Page section here
var twobeforefirst = 0;
var beforefirst = 0;
var firstpage = 1;
var maxYP01 = 159;
var minYP01 = 1;
var maxAdjusted = -1;
var minAdjusted = -1;
var maxGov = 115;
var minGov = 1;
var maxAdpai = 1;
var minAdpai = 1;
var maxIndex02 = -1;
var minIndex02 = -1;
var maxGov02 = 7;
var minGov02 = 1;
var maxFastfind = 7;
var minFastfind = 1;
var maxFeatured = 11;
var minFeatured = 0;



/**
 * Don't touch the following code
 * Added by WLIU 07/07/2008 to solve browser problems
 */
var browser = new Browser();
var href = new Href();
var pathPrefix = solvePathPrefix();

function solvePathPrefix(){
    pathPrefix = "";
    if (browser.app == "Firefox" && browser.version > 2 && href.protocol == "file:"){
        pathPrefix = "data/";
    }
    
    return pathPrefix;
}

function Href(){
    this.protocol = window.location.protocol
    this.host = window.location.host
    this.pathname = window.location.pathname
    this.search = window.location.search
}

function Browser() {
    var name = navigator.appName;
    if (name == "Netscape"){
        this.name = "ns";
    }else if (name == "Microsoft Internet Explorer"){
        this.name = "ie";
    }else{
        this.name = "other";
    }
    var agent = navigator.userAgent;
    if (/Firefox[\/\s](\d+\.\d+)/.test(agent)){
        this.version = new Number(RegExp.$1);
        this.app = "Firefox";
    }else if (/MSIE (\d+\.\d+);/.test(agent)){
        this.version = new Number(RegExp.$1);
        this.app = "IE";
    }else if (/Opera[\/\s](\d+\.\d+)/.test(agent)){
        this.version = new Number(RegExp.$1);
        this.app = "Opera";
    }else if (/Version[\/\s](\d+\.\d+)(\.\d+)?\sSafari/.test(agent)) {
        this.version = new Number(RegExp.$1);
        this.app = "Safari";
    }else{
        this.version = 0;
        this.app = "other";
    }
      
    this.isDOM   = (document.createElement
                    && document.appendChild
                    && document.getElementsByTagName) ? true : false;

    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf ("win") > - 1){
        this.platform = "win";
    }else if (ua.indexOf("mac") > -1){
        this.platform = "mac";
    }else{
        this.platform="other";
    }
}