//  Section type variables:
var luthiersSection;
var bodyStylesSection;
var bracingSection;
var neckJointSection;
var soundPortsSection;
var soundboardsSection;
var bridgeFingerboardSection;
var nutSaddleSection;
var bridgePinsSection;
var finishesSection;
var bindingSection;
var purflingSection;
var inlaySection;
var headplateSection;
var rosetteSection;
var endGraftSection;
var pickGuardsSection;
var scaleLengthSection;
var stringWidthSpacingSection;
var actionAndReliefSection;
var cutawaysSection;
var neckProfileSection;
var maintenanceSection;
var stringsSection;
var picksSection;
var casesSection;
var tunersSection;


//  Subsection type variables (arrays of all the subsections belonging to a section): 
var luthiersSubsections;
var bodyStylesSubsections;
var bracingSubsections;
var neckJointSubsections;
var soundPortsSubsections;
var soundboardsSubsections;
var backSidesSubsections;
var bridgeFingerboardSubsections;
var nutSaddleSubsections;
var bridgePinsSubsections;
var finishesSubsections;
var bindingSubsections;
var purflingSubsections;
var inlaySubsections;
var headplateSubsections;
var rosetteSubsections;
var endGraftSubsections;
var pickGuardsSubsections;
var scaleLengthSubsections;
var stringWidthSpacingSubsections;
var actionAndReliefSubsections;
var cutawaysSubsections;
var neckProfileSubsections;
var maintenanceSubsections;
var stringsSubsections;
var picksSubsections;
var casesSubsections;
var tunersSubsections;

// Intro paragraph text
var luthiersIntro = "Without question, the most significant factor affecting the tone of a guitar is the luthier who builds it. Though body shapes, design elements, and tonewoods all impart their own tonal characteristics, the process of building a guitar is a highly individualized and consequently each luthier can produce a finished product that is a significant departure from conventional wisdom on how a guitar with a given configuration should sound. For this reason, it's imperative that you take the time to find out a little about the person who made or will be making your instrument...information we always do our best to provide. A very short overview of the luthiers we feature here at GuitarMatch.com is below.";

var bodyStylesIntro = "Though almost every guitar maker from independent luthiers to major guitar manufacturers has developed signature body styles, in general these many body shapes and sizes can be understood in the terms of a few archetypical body styles.";

var bracingIntro = "The soundboard is, as the name suggests, the primary sound-producing element of a guitar. Consequently, the tonewood  and  bracing design used are critical decisions when planning your custom guitar. The placement of the x brace and tone bars in combination with their thickness and shape alters every element of a guitar's sound. Every luthier places and shapes braces in a highly individual manner, but the following are a couple of general categories.";

var neckJointIntro = "Wide disagreement exists over the extent of the guitar body/neck joint's effect on tone. That a good joint is essential for structural stability and playability is an incontrovertible fact. Because of the high tension of the steel strings, over time a guitar is likely to need a neck reset. In this typically expensive repair a guitar's neck is removed and the joint is altered slightly to return the neck angle of the guitar to an optimal position. Many of the newer joint techniques listed below were developed to attempt to expedite and simplify this common repair when it's needed down the road.";

var soundPortsIntro = "A fairly recent innovation in guitar design, a sound port is a small opening in the side of an acoustic guitar, usually on the upper bout. An acoustic guitar with a round soundhole in its typical location in the center of the body is designed to project sound forward, out towards the listener. In reality, however, most of the time we non-professionals spend playing our instrument is at home where often the only audience interested in listening is... well... us! A sound port allows the sound to also escape the body of the guitar directly towards the ear of the player where it belongs.";

var soundboardsIntro = "";

var backSidesIntro = "";

var bridgeFingerboardIntro = "Many luthiers feel that the material used for the bridge and fingerboard of a guitar plays a significant part in creating the unique tone of the instrument. Unfortunately this variable is one of the more difficult to pin down and no clear consensus exists on the exact acoustic properties of each choice. In most cases the fingerboard and bridge are made of the same material but that's certainly not a rule.";

var nutSaddleIntro = "One quick way to alter the tone of your guitar is to change the nut, which spaces the strings at the beginning of the fretboard, and the saddle, which sits in the bridge and serves to transmit the vibrations of the strings to the top.";

var bridgePinsIntro = "An essential part of the transmission of vibration from the strings to the guitar top, bridge pins can significantly affect a guitar's sound.";

var finishesIntro = "As the name suggests, the final step in guitar building is the application and final preparation of a wood finish. Several quality options are available to modern guitar builders and any are quite capable producing a beautiful instrument with a wonderful tone. The two broad categories of finishes are high gloss and matte/satin finishes. In general, this distinction is not brought about by the use of different finish chemicals but rather by the buffing and polishing process.";

var bindingIntro = "The outermost material on the top and bottom edges of the guitar, binding helps protect the guitar as well as looking great. Bindings can be synthetic (ivoroid or tortoise) or natural (wood).";

var purflingIntro = "Purfling is the name given to the decorative inner layers of a guitar's edging, when present.";

var inlayIntro = "";

var headplateIntro = "Also known as the headstock veneer, the headplate is the thin layer of wood added to the front of the headstock for cosmetic purposes. Often it matches the back and side woods of the guitar or the fingerboard and bridge, but that is by no means universally true.";

var rosetteIntro = "The rosette is the decorative circle inlaid around the soundhole of the guitar. Classical rosettes tend to be thick and colorful with a pattern made up of many small squares of color. Rosettes are one of the most noticeable aesthetic appointments on a guitar and every maker has their own preferred look. A few general categories are mentioned below.";

var endGraftIntro = "";
var pickGuardsIntro = "";
var scaleLengthIntro = "";

var stringWidthSpacingIntro = "Nut width refers to the measurement of the width of a guitar's neck/fingerboard at the nut. Though classical guitars are often as wide as 2\" at the nut, most steel strings are between 1 11/16\" and 1 3/4\". String spacing refers to the width of the strings at the saddle of the guitar. This can range from 2 1/8\" to 2 3/8\" on steel string guitars. Establishing your preferred nut width and string spacing is absolutely essential to the process of buying or ordering an instrument as few factors affect playability as much as these.";

var actionAndReliefIntro = "Action refers to the height of the unfretted strings above the fingerboard and is probably the most important aspect of a guitar's playability. If action is lowered too much, if significant humidity changes occur, or if a guitar is aggressively picked, unpleasant fret buzzing will occur. Though a higher action typically allows for more dynamic range, volume, and in some cases better tone, most guitarists prefer an action \"as low as you can get it\".  Relief is the amount of bow in the neck. Contrary to popular belief, a straight neck is not always the most desirable.";

var cutawaysIntro = "";
var neckProfileIntro = "";
var maintenanceIntro = "";
var stringsIntro = "";
var picksIntro = "";
var casesIntro = "";
var tunersIntro = "";

// Subsection paragraph text
// --Luthiers--
var kronbauerText = "Trevor began building guitars on his own in 2001 after two years with luthier Ted Thompson. His shop is located in British Columbia and he's currently building about 30 guitars each year with a waiting list of 11 months. Trevor's guitars are mainly geared towards fingerstyle guitarists and are distinguishable by tremendous sustain and projection.";

var rockbridgeText = "Rockbridge guitars are a joint project between two outstanding young luthiers who live about 130 miles apart in the state of Virginia. Brian and Randall feel that their approach is ideal because it allows each to focus on the areas of guitarmaking that they excel at and ensures that each guitar goes through two careful inspections before reaching the buyer. Rockbridge gained prominence through their association with dreadnought guitars for bluegrass/flatpicking guitarist though they're constantly expanding in the fingerstyle market as well. Rockbridge guitars are known for their volume and strong balance across the tonal spectrum.";

// --Body Styles--
var dreadText = "The shape most people think of when you say guitar, the dreadnought was unquestionably king in the United States for a large part of the mid to late twentieth century. Its pronounced bass and rich tradition in acoustic music makes the dreadnought the preferred body style of the bluegrass/flatpicking crowd as well as many rock and rollers. Typically, the lower bout of a dreadnought is around 16\" in width and the upper bout is round or square shouldered with a width of 11 1/2\" and a body depth of just less than 5\".";

var jumboText = "Largest of the standard guitar body styles, jumbos are characterized by a large lower bout of greater than 16\".";

var smallJumboText = "Smaller than a jumbo, as the name suggests, and with a narrower waist than dreadnought guitars, Small Jumbo/Grand Auditorium sized guitars have become extremely possible with fingerstyle players who desire volume and bass but demand comfort and playability.";

var om000Text = "Though originally a specific Martin guitar company model which featured a long scale length, the OM designation has become common when referring to guitars that are narrower and less deep than a dreadnought but not small enough to qualify as parlor guitars. While OMs typically have less bass and overall volume than dreadnought guitars, they feature more clear and pronounced trebles. Typical measurements for an OM guitar include a little over 15\" wide lower bout, an upper bout of under 10\", and a depth of just over 4\".";

var parlorText = "So-called because of their popularity as parlor instruments in the early 20th century, parlor guitars are the smallest of the steel string body styles and have a distinctive appearance because of their narrow waist and upper and lower bouts. Parlor guitars can range from 10.5\" to 14\" in lower bout width and are rarely much deeper than 4\".";

var classicalText = "Over time, famous classical guitars makers such as Ramirez, Hauser, and others have developed signature body sizes and shapes, but in the steel-string focused U.S. market, these sizes are rarely differentiated. Classical guitars tend to be much smaller than steel string guitars."

// --Bracing--      
var forwardXBracingText = "The golden era Martins of the 1930s used this bracing placement. The braces cross only 1\" behind the soundhole, leaving a large area of the lower bout free to vibrate.";

var standardXBracingText = "Found on Martin guitars since the 1940s and many Gibson guitars is placed back from the soundhole. This makes for a stronger guitar structurally but some feel it sacrifices tone.";

var unscallopedBracingText = "Unscalloped braces are thicker. Like the standard x-brace location, this makes a top more structurally sound but sacrifices some bass response.";

var scallopedBracingText = "Scalloping removes material from the braces at strategic points to lighten the guitar and to allow for greater soundboard vibration.";

var partiallyScallopedBracingText = "A compromise made popular by Dana Bourgeois in which only the bass side braces are scalloped. The intent is to enhance the trebles while keeping the bass response of fully scalloped braces.";

// --Neck Joint--
var gluedCompoundNeckJointText = "The traditional joint of Martin and Gibson instruments, a compound dovetail is a time-consuming to cut and fit and can be difficult to remove when a neck reset is needed. Many purists insist, however, that no other joint offers the stability and tone of this historical standard.";

var gluedMortiseNeckJointText = "A simplified joint, a mortise and tenon is similar to a dovetail but uses a straight sided mortise in place of the angled, wedge-shaped dovetail.";

var boltDovetailNeckJointText = "A compromise approach in which the dovetail is cut and fitted as in a traditional joint but the fit is maintained by bolts rather than glue to allow for easier and quicker neck adjustments when needed.";

var boltMortiseNeckJointText = "Probably the most common bolt-on neck joint. Strong and easy to reset.";

var flushBoltNeckJointText = "A newer approach in which the flat surfaces of the neck and body are joined with bolts. Proponents insist there is no quicker and easier joint to build and repair and find no adverse effects on tone.";

var soundPortsText = "Common sense would suggest that allowing sound to exit the box in a second location would greatly reduce the projection out the soundhole, but many people who have added sound ports to their guitars after they were made suggest that there is little discernible difference in volume or projection for the listener.";


//...

// --Soundboards--
var adirondackSoundboardText = "Adirondack/Red Spruce - This native spruce is found on the majority of the early Martin and Gibson guitars. Overharvesting rendered it very difficult to find for several decades but quality wood is again available and many makers now offer Adirondack spruce as their premium soundboard choice. Because of its relative rarity and high cost, cosmetic standards for Adirondack are very noticeably different than the other spruces. In general Adirondack tops are very stiff and can be driven very hard by the player without \"breaking up\" or losing quality of tone. Adirondack is known for its pure and cutting tone that can be more bell-like than the generally warmer Sitka spruce. A popular choice for bluegrass/flatpicking guitarists who demand maximum volume from their instrument but a less ideal choice for fingerstyle players with a light touch.";

var sitkaSpruceSoundboardText = "Without question the most common soundboard choice over the last 50 years, Sitka is an abundant Canadian spruce species that exhibits excellent stiffness and a beautiful slightly warmer tone. Beautifully colored, tight grained tops are widely available because of the high number of old growth Sitka logs that are cut each year. An excellent wood for both fingerstyle and flatpicking guitarists, Sitka tends to be more responsive to a lighter touch than Adirondack but remains suitable for loud, aggressive picking.";

var engelmannSoundboardText = "An intriguing Canadian spruce choice, Engelmann is lighter in color than the other spruces and is considered to produce a very pure tone reminiscent of Adirondack but with more responsiveness.  Found most often on high end fingerstyle instruments but also quite suitable for flatpickers.";

var westernRedCedarSoundboardText = "The preferred wood of many modern classical guitar makers, red cedar offers a warmth and responsiveness that makes it an ideal choice for fingerstyle guitars. Conventional wisdom says that red cedar has the greatest tendency towards being overdriven and \"breaking up\" but some luthiers contest that claim and argue that with proper bracing and thicknessing, red cedar can stand up to the most aggressive of pickers. Its color ranges from a chocolate brown to a slightly reddish tan often called \"blonde\".";

var redwoodSoundboardText = "One of the newest options for soundboards, redwood offers a distinct appearance and a pleasing tone. Though the appearance is somewhat similar to red cedar, the tone of redwood tops seems to fall more closely to the spruces.";

// --Back/Sides--
var brazRosewoodText = "Traditionally, the finest and most sought after of guitar tonewoods. Produces a lush, robust bass but is also capable of clear, almost metallic trebles. Considerable overtones can give Brazilian rosewood a piano or bell-like quality. Overharvest severely threatened the Brazilian rosewood population and after strict regulations were put in place through the CITES treaty, supply has been severely limited. For that reason, the standards for aesthetically and structurally acceptable wood are considerably lower for Brazilian than all other woods.";

var cocoboloText = "A true rosewood from Central America, cocobolo has enjoyed a tremendous surge in popularity as its beauty and its tonal similarities to Brazilian rosewood have become widely recognized. A very heavy, dense wood, cocobolo varies from purple to red to orange in color and is frequently flatsawn, as large diameter cocobolo trees are nearly impossible to find.";

var hondRosewoodText = "Another Brazilian rosewood substitute from Central America, Honduran rosewood is popular in part because of its oft-cited history as the preferred wood for marimbas.";

var indianRosewoodText = "The most common substitute for Brazilian, Indian rosewood generally imparts similar tonal qualities. Because of its greater availability, Indian is considerably cheaper and cosmetically or structurally inferior pieces typically don't make it to the market.";

var hondMahoganyText = "For many years, Honduran mahogany has provided a tonal counterpoint to the rosewoods, typically at a cheaper price...though increasingly limited supplies suggest that the price gap will close in the near future. Mahogany imparts a drier, more woody sound than rosewood and tends to be especially strong in the mids range.";

var mapleText = "More popular in banjos, mandolins, and violins than in guitars, maple is a beautiful light-colored wood that tends to give a very bright, focused tone without the richness of a rosewood or the woodiness of mahogany.";

var walnutText = "Claro and black walnut, popular choices for fine furniture, are growing in popularity as tonewoods. Typically rich light or dark brown in color and often displaying beautiful curly figure, walnut has a tone that, like koa, falls somewhere between mahogany and rosewood on the spectrum. It is woodier and richer than maple but not as lush as rosewood.";

//--Bridge/Fingerboard--
var brazRosewoodFingerboardText = "More visually interesting than ebony, Brazilian rosewood is also less hard and dense so these fingerboards will be more likely to show wear over time. Some makers insist on using Brazilian for the bridge, fingerboard or both because they feel it adds a certain color to the tone of the guitar.";

var cocoRosewoodFingerboardText = "Harder and denser than Brazilian rosewood and often even more colorful, cocobolo is becoming more and more popular as a fingerboard and bridge wood.";

var ebonyFingerboardText = "The standard on top quality guitars for many years due to its hardness, density, and striking black coloration.";

// --Nut/Saddle--
var plasticNutText = "Typically used only on inferior quality production guitars.";

var boneNutText = "The standard for high-end guitars, bone gives a cleaner, brighter tone than plastic, with more sustain.";

var ivoryNutText = "Another traditional high-end guitar material. Is to bone as bone is to plastic.";

// --Bridge Pins--
var plasticPinsText = "Plastic is often used on production guitars and typically gives a bright sound.";

var ebonyPinsText = "Ebony pins are often preferred by small shops for their improved aesthetics and the darker tone they often impart.";

var ivoryPinsText = "Ivory pins are an expensive option that many guitarists insist are necessary to derive the optimal tone from an instrument.";

var hornPinsText = "Horn pins offer a cheaper alternative to ivory but are more expensive than wood pins.";

//--Finishes--

var lacquerFinishText = "Nitrocellulose lacquer is the most common finish for steel string guitars historically. Traditionalists claim that it imparts a special quality to the tone of the guitar but most builders feel that properly applied finishes of other types can prove the equal of lacquer without the health hazards. Over time or when exposed to dramatic temperature change, lacquer will often develop crazing, tiny cracks in the guitar's finish. Though some consider them unsightly, others accept crazing as an inevitable and not unattractive element of unrefinished vintage instruments.";

var varnishFinishText = "Varnish or French Polish is the traditional finishing method for fine violins. Some luthiers feel that a varnished or French polished instrument has less material impeding the vibration of the tonewoods. Unfortunately these finishes lack some of the protective qualities found in other finishes like Polyurethane or Nitrocellulose Lacquer and consequently will show wear much more quickly.";

var polyurethanesFinishText = "Water-based Polyurethanes used in instrument making have been specifically tailored to this application and allow a durable high gloss at acceptable thicknesses.";

var polyesterFinishText = "Polyester finishes are increasingly popular among small shops as they allow a high gloss finish with minimal thickness.";


// --Binding--
var plasticBindingText = "An inexpensive, durable, and consequently very popular choice.";

var ivoroidBindingText = "Found on many valuable vintage guitars, ivoroid is an early plastic that has a distinct look.";

var tortoiseBindingText = "Tortoise binding is another option frequently found on highly desirable vintage guitars but is no longer legal now that Eastern Hawksbill sea turtles are considered an endangered species. Synthetic tortoise shell gives the same appearance and is inexpensive and durable.";

var rosewoodBindingText = "East Indian or Brazilian, rosewood is perhaps the most popular dark wood binding. Wood binding is attractive but does not have the \"ding\" resistance of plastics.";

var curlyMapleBindingText = "A striking light wood binding option.";
var curlyKoaBindingText = "An attractive but more expensive medium colored binding.";
var snakewoodBindingText = "An attractive but more expensive medium colored binding.";

// --Purfling--
var linePurflingText = "Purfling may be as simple as thin/white black lines that help to set apart the binding material from the top or back woods.";

var herringbonePurflingText = "Popular since its use on vintage Martin dreadnoughts in the \"holy grail\" period around world war two, herringbone purfling is attractive but not overly flashy.";

var abaloneTrimPurflingText = "High end instruments through the years have sported glitzy pearl or abalone trim.  Some have theorized that the pearl breaks from the top over time, thereby freeing it and allowing for greater soundboard movement but in general abalone trim is considered strictly \"just for looks\".";

// --Headplate--
var ebonyHeadplateText = "";
var brazRosewoodHeadplateText = "";
var flamedKoaHeadplateText = "";

// --Rosette--
var herringboneRosetteText = "Often paired with herringbone purfling, herringbone rosettes have been found on steel string guitars for many years. The herringbone pattern has become closely associated with the highly collectible prewar Martin D-28s that are popular in bluegrass music and herringbone trim has subsequently become perhaps the most common option for bluegrass/flatpicking dreadnoughts.";

var lineRosetteText = "Made of thin veneers of various colors and thicknesses, these rosettes come in innumerable varieties, though most of the time you'll simply see these rosettes made with alternating black and white lines.";

var abalonePearlRosetteText = "An attention getting option with or without complementary abalone/pearl purfling.";

var woodRosetteText = "A beautiful but understated choice, wood rosettes are available in many styles. Koa, walnut, and maple are some of the most prevalent.";


// --Action & Relief--
var actionRelief1Text = "Action should be raised or lowered by shaving or shimming a guitar's saddle and nut... NEVER by adjusting the truss rod.";

var actionRelief2Text = "Relief can be checked by placing a capo at the first fret and then fretting the strings where the neck meets the body - the amount of space between the lower edge of the strings and the 7th fret is the relief.";

var actionRelief3Text = "Relief is adjusted by tightening or loosening the truss rod. Though it's ostensibly a simple task, truss rods only require tiny adjustments and are easily stripped or otherwise damaged...so please leave adjustment to your local guitar technician!";

//---- Other Functions ----
// Show the appropriate submenu on the menuBar
function show(myMenuBarItem) {
	//Find the child of the menuBarItem that is the actual menu and make it visible
	for (i=0; i<myMenuBarItem.childNodes.length; i++) {
		if (myMenuBarItem.childNodes[i].className == "menu") {
			myMenuBarItem.childNodes[i].style.visibility = "visible";
			return;
		}
	}
}
// Hide the appropriate submenu on the menuBar
function hide(myMenuBarItem) {
	//Find the child of the menuBarItem that is the actual menu and make it hidden
	for (i=0; i<myMenuBarItem.childNodes.length; i++) {
		if (myMenuBarItem.childNodes[i].className == "menu") {
			myMenuBarItem.childNodes[i].style.visibility = "hidden";
			return;
		}
	}
}




function showBigImage (image) {
	//window.open(image, "bigImage", "0,0,0,0,0,0,0,100,350");
	myWindow = window.open(image, "bigImage", "0,0,0,0,0,0,0,400,400");
	myWindow.focus();

	//window.open(image, image, "0,0,0,0,0,0,0,100,350");
	//myWindow.document.writeln(image);
	return false;
}
/*
function open_win(url_add)
   {
   window.open(url_add,'welcome',
   'width=300,height=200,menubar=yes,status=yes,
   location=yes,toolbar=yes,scrollbars=yes');
   }

function poponload()
{
	testwindow= window.open ("http://www.guitarmatch.com/images/noimage.jpg", "mywindow", "location=1,status=1,scrollbars=0,resize=1");
//testwindow= window.open ("", "mywindow", "location=1,status=1,scrollbars=1,width=100,height=100");
//testwindow.moveTo(0,0);
}
*/

//---- Constructor Functions for the section and subsection types ----
function BGSubsection (title, text, thumbnail, largeImage) {
	this.title = title || "";
	this.text = text || "";
	this.thumbnail =  "images/findYourMatch/" + thumbnail || "";    //Path to the thumbnail
	this.largeImage = "images/findYourMatch/" + largeImage || "";  //Path to the large image
}

function BGSection (title, text, subsections) {
	this.title = title || "No Title";
	this.text = text || "";
	this.subsections = subsections || []; //An array of the subsections
}

//----- Initialize Globals -----
function init() {

      //Arrays of Subsections (1 array per section)
      luthiersSubsections = new Array();
      bodyStylesSubsections = new Array();
      bracingSubsections = new Array();
      neckJointSubsections = new Array();
      soundPortsSubsections = new Array();
      soundboardsSubsections = new Array();
	backSidesSubsections = new Array();
      bridgeFingerboardSubsections = new Array();
      nutSaddleSubsections = new Array();
      bridgePinsSubsections = new Array();
      finishesSubsections = new Array();
      bindingSubsections = new Array();
      purflingSubsections = new Array();
      inlaySubsections = new Array();
      headplateSubsections = new Array();
      rosetteSubsections = new Array();
      endGraftSubsections = new Array();
      pickGuardsSubsections = new Array();
      scaleLengthSubsections = new Array();
      stringWidthSpacingSubsections = new Array();
      actionAndReliefSubsections = new Array();
      cutawaysSubsections = new Array();
      neckProfileSubsections = new Array();
      maintenanceSubsections = new Array();
      stringsSubsections = new Array();
      picksSubsections = new Array();
      casesSubsections = new Array();
      tunersSubsections = new Array();

	//Initialize Subsection arrays (1 array element per subsection)
	//title, text, thumbnail, largeImage
      luthiersSubsections[0] = new BGSubsection("Trevor Kronbauer - Kronbauer Guitars", kronbauerText, 										"kronbauersmall.jpg", "kronbauerLarge.jpg");
      luthiersSubsections[1] = new BGSubsection("Brian Calhoun and Randall Ray - Rockbridge Guitars", 										rockbridgeText, "rockbridgesmall.jpg", "rockbridgeLarge.jpg");
  	//---------------------------------------------------------------------------
      bodyStylesSubsections[0] = new BGSubsection("Dread", dreadText, "dreadsmall.jpg", "dreadLarge.jpg");
      bodyStylesSubsections[1] = new BGSubsection("Jumbo", jumboText, "spacer.jpg", "spacer.jpg");
      bodyStylesSubsections[2] = new BGSubsection("Small Jumbo/Grand Auditorium", smallJumboText, 											  "sjsmall.jpg", "sjlarge.jpg");
      bodyStylesSubsections[3] = new BGSubsection("OM/000", om000Text, "omsmall.jpg", "omLarge.jpg");
      bodyStylesSubsections[4] = new BGSubsection("Parlor", parlorText, "parlorsmall.jpg", "parlorLarge.jpg");
      bodyStylesSubsections[5] = new BGSubsection("Classical", classicalText, "classicalsmall.jpg", 											  "classicalLarge.jpg");
	//---------------------------------------------------------------------------
      bracingSubsections[0] = new BGSubsection("Forward-Shifted X-Brace", forwardXBracingText, 										"spacer.jpg", "spacer.jpg");
      bracingSubsections[1] = new BGSubsection("Standard X-Brace", standardXBracingText, 											"spacer.jpg", 	"spacer.jpg");
      bracingSubsections[2] = new BGSubsection("Unscalloped", unscallopedBracingText, "spacer.jpg", 						"spacer.jpg");
      bracingSubsections[3] = new BGSubsection("Scalloped", scallopedBracingText, "spacer.jpg", 							"spacer.jpg");
      bracingSubsections[4] = new BGSubsection("Partially Scalloped", partiallyScallopedBracingText, 									"spacer.jpg", "spacer.jpg");
	//---------------------------------------------------------------------------
      neckJointSubsections[0] = new BGSubsection("Glued Compound Dovetail", gluedCompoundNeckJointText, 								"spacer.jpg", "spacer.jpg");
      neckJointSubsections[1] = new BGSubsection("Glued Mortise and Tenon", gluedMortiseNeckJointText, 								"spacer.jpg", "spacer.jpg");
      neckJointSubsections[2] = new BGSubsection("Bolt-On Dovetail", boltDovetailNeckJointText, 									"spacer.jpg", "spacer.jpg");
      neckJointSubsections[3] = new BGSubsection("Bolt-On Mortise and Tenon", boltMortiseNeckJointText, 								"spacer.jpg", "spacer");
      neckJointSubsections[4] = new BGSubsection("Flush Fit Bolt-On", flushBoltNeckJointText, 										"spacer.jpg", "spacer.jpg");
	//---------------------------------------------------------------------------
      soundPortsSubsections[0] = new BGSubsection("", soundPortsText, "soundPortsmall.jpg", "soundPortLarge.jpg");
	//---------------------------------------------------------------------------
      soundboardsSubsections[0] = new BGSubsection("Adirondack/Red Spruce", adirondackSoundboardText, 								"adismall.jpg", "adiLarge.jpg");
	soundboardsSubsections[1] = new BGSubsection("Sitka Spruce", sitkaSpruceSoundboardText, 										"sitkasmall.jpg", "sitkaLarge.jpg");
	soundboardsSubsections[2] = new BGSubsection("Engelmann Spruce", engelmannSoundboardText, 									"spacer.jpg", "spacer.jpg");
	soundboardsSubsections[3] = new BGSubsection("Western Red Cedar", westernRedCedarSoundboardText, 								"cedarsmall.jpg", "cedarLarge.jpg");
	soundboardsSubsections[4] = new BGSubsection("Redwood", redwoodSoundboardText, "redwoodsmall.jpg", 								   "redwoodLarge.jpg");

	//---------------------------------------------------------------------------
	backSidesSubsections[0] = new BGSubsection();
	//---------------------------------------------------------------------------
      bridgeFingerboardSubsections[0] = new BGSubsection("Brazilian rosewood", brazRosewoodFingerboardText, 							    "brazfbsmall.jpg", "brazfblarge.jpg");
	bridgeFingerboardSubsections[1] = new BGSubsection("Cocobolo rosewood", cocoRosewoodFingerboardText, 								    "cocobolofbsmall.jpg", "cocobolofbLarge.jpg");
	bridgeFingerboardSubsections[2] = new BGSubsection("Ebony", ebonyFingerboardText, "ebonyFbsmall.jpg", 						    "ebonyFbLarge.jpg");
	//---------------------------------------------------------------------------
      nutSaddleSubsections[0] = new BGSubsection("Plastic", plasticNutText, "plasticNutsmall.jpg", 									 		 "plasticNutLarge.jpg");
      nutSaddleSubsections[1] = new BGSubsection("Bone", boneNutText, "boneNutsmall.jpg", 									 			 "boneNutLarge.jpg");
      nutSaddleSubsections[2] = new BGSubsection("Ivory", ivoryNutText, "ivoryNutsmall.jpg", 									 			 "ivoryNutLarge.jpg");
	//---------------------------------------------------------------------------
      bridgePinsSubsections[0] = new BGSubsection("Plastic", plasticPinsText, "plasticPinsmall.jpg", 									 	  "plasticPinLarge.jpg");
      bridgePinsSubsections[1] = new BGSubsection("Ebony", ebonyPinsText, "ebonyPinsmall.jpg", 									 	  	  "ebonyPinLarge.jpg");
	bridgePinsSubsections[2] = new BGSubsection("Ivory", ivoryPinsText, "spacer.jpg", 									 	  	  "spacer.jpg");
      bridgePinsSubsections[3] = new BGSubsection("Horn", hornPinsText, "spacer.jpg", 									 	  		  "spacer.jpg");
	//---------------------------------------------------------------------------
      finishesSubsections[0] = new BGSubsection("Nitrocellulose Lacquer", lacquerFinishText, 												"spacer.jpg", "lacquerFinishLarge.jpg");
      finishesSubsections[1] = new BGSubsection("Varnish or French Polish", varnishFinishText, 												"spacer.jpg", "varnishFinishLarge.jpg");
      finishesSubsections[2] = new BGSubsection("Water-Based Polyurethanes", polyurethanesFinishText, 										"spacer.jpg", "polyurethanesFinishLarge.jpg");
      finishesSubsections[3] = new BGSubsection("Polyester", polyesterFinishText, "spacer.jpg", 									 	  		  "polyesterFinishLarge.jpg");
      //---------------------------------------------------------------------------
	bindingSubsections[0] = new BGSubsection("Plastic", plasticBindingText, "plasticBindsmall.jpg",
							     "plasticBindLarge.jpg");
      bindingSubsections[1] = new BGSubsection("Ivoroid", ivoroidBindingText, "spacer.jpg",
							     "ivoroidBindingLarge.jpg");
      bindingSubsections[2] = new BGSubsection("Synthetic Tortoise", tortoiseBindingText, 											     "tortoiseBindsmall.jpg", "tortoiseBindLarge.jpg");
      bindingSubsections[3] = new BGSubsection("Rosewood", rosewoodBindingText, "rosewoodBindsmall.jpg",
							     "rosewoodBindLarge.jpg");
      bindingSubsections[4] = new BGSubsection("Curly Maple", curlyMapleBindingText, "maplebindingsmall.jpg",
							     "MapleBindingLarge.jpg");
      bindingSubsections[5] = new BGSubsection("Curly Koa", curlyKoaBindingText, "spacer.jpg",
							     "curlyKoaBindingLarge.jpg");
      bindingSubsections[6] = new BGSubsection("Snakewood", snakewoodBindingText, "spacer.jpg",
							     "snakewoodBindingLarge.jpg");
      //---------------------------------------------------------------------------
	purflingSubsections[0] = new BGSubsection("Line Purfling", linePurflingText, "linePurfsmall.jpg", 									"linePurfLarge.jpg" );
	purflingSubsections[1] = new BGSubsection("Herringbone Purfling", herringbonePurflingText, 											"hbonePurfsmall.jpg", "hbonePurfLarge.jpg");
	purflingSubsections[2] = new BGSubsection("Abalone Trim", abaloneTrimPurflingText, 													"spacer.jpg", "spacer.jpg");
	//---------------------------------------------------------------------------

      inlaySubsections[0] = new BGSubsection();
	//---------------------------------------------------------------------------
      headplateSubsections[0] = new BGSubsection("Ebony headplate", ebonyHeadplateText, "ebonyHpsmall.jpg",
								 "ebonyHpLarge.jpg");
	headplateSubsections[1] = new BGSubsection("Brazilian Rosewood headplate", brazRosewoodHeadplateText,
								 "brazhpsmall.jpg", "brazhpLarge.jpg");
	headplateSubsections[2] = new BGSubsection("Flamed Koa headplate", flamedKoaHeadplateText, 											 "spacer.jpg", "flamedKoaHeadplateLarge.jpg");


	//---------------------------------------------------------------------------
      rosetteSubsections[0] = new BGSubsection("Herringbone",herringboneRosetteText, "hboneRosettesmall.jpg",
							     "hboneRosetteLarge.jpg");
      rosetteSubsections[1] = new BGSubsection("Line Rosettes",lineRosetteText, "lineRosettesmall.jpg",
							     "lineRosetteLarge.jpg");
      rosetteSubsections[2] = new BGSubsection("Abalone/Pearl",abalonePearlRosetteText, 												     "abRosettesmall.jpg", "abRosetteLarge.jpg");
      rosetteSubsections[3] = new BGSubsection("Wood",woodRosetteText, "woodRosetteThumb.jpg",
							     "woodRosetteLarge.jpg");



      endGraftSubsections[0] = new BGSubsection();
      pickGuardsSubsections[0] = new BGSubsection();
      scaleLengthSubsections[0] = new BGSubsection();
      //No Subsections for this one: stringWidthSpacingSubsections[0] = new BGSubsection();
	//---------------------------------------------------------------------------
      actionAndReliefSubsections[0] = new BGSubsection("", actionRelief1Text, "spacer.jpg", 											 "actionRelief1Large.jpg");
      actionAndReliefSubsections[1] = new BGSubsection("", actionRelief2Text, "spacer.jpg", 											 "actionRelief2Large.jpg");
      actionAndReliefSubsections[2] = new BGSubsection("", actionRelief3Text, "spacer.jpg", 											 "actionRelief3Large.jpg");
	//---------------------------------------------------------------------------
      cutawaysSubsections[0] = new BGSubsection();
      neckProfileSubsections[0] = new BGSubsection();
      maintenanceSubsections[0] = new BGSubsection();
      stringsSubsections[0] = new BGSubsection();
      picksSubsections[0] = new BGSubsection();
      casesSubsections[0] = new BGSubsection();
      tunersSubsections[0] = new BGSubsection();



	//....
	backSidesSubsections[0] = new BGSubsection("Brazilian Rosewood", brazRosewoodText, 
								     "brazsmall.jpg", "brazlarge.jpg");
	backSidesSubsections[1] = new BGSubsection("Cocobolo", cocoboloText, 
								     "cocobolosmall.jpg", "cocoboloLarge.jpg");
	backSidesSubsections[2] = new BGSubsection("Honduran Rosewood", hondRosewoodText, 
								     "spacer.jpg", "spacer.jpg");
	backSidesSubsections[3] = new BGSubsection("Indian Rosewood", indianRosewoodText, 
								     "eirsmall.jpg", "eirLarge.jpg");
	backSidesSubsections[4] = new BGSubsection("Honduran Mahogany", hondMahoganyText, 
								     "Mahoganysmall.jpg", "MahoganyLarge.jpg");
	backSidesSubsections[5] = new BGSubsection("Maple", mapleText, 
								     "spacer.jpg", "spacer.jpg");
	backSidesSubsections[6] = new BGSubsection("Walnut", walnutText, 
								     "spacer.jpg", "spacer.jpg");
	//....


	//Initialize Sections 
      luthiersSection = new BGSection("Luthiers", luthiersIntro, luthiersSubsections);
      bodyStylesSection = new BGSection("Body Styles", bodyStylesIntro, bodyStylesSubsections);
	bracingSection = new BGSection("Bracing", bracingIntro, bracingSubsections);
	neckJointSection = new BGSection("Neck Joint", neckJointIntro, neckJointSubsections);
	soundPortsSection = new BGSection("Sound Ports", soundPortsIntro, soundPortsSubsections);
	soundboardsSection = new BGSection("Soundboards", soundboardsIntro, soundboardsSubsections);
	backSidesSection = new BGSection("Back/Sides", backSidesIntro, backSidesSubsections);
 	bridgeFingerboardSection = new BGSection("Bridge/Fingerboard", bridgeFingerboardIntro, 												bridgeFingerboardSubsections);
      nutSaddleSection = new BGSection("Nut/Saddle", nutSaddleIntro, nutSaddleSubsections);
      bridgePinsSection = new BGSection("Bridge Pins", bridgePinsIntro, bridgePinsSubsections);
	finishesSection = new BGSection("Finishes", finishesIntro, finishesSubsections);
      bindingSection = new BGSection("Binding", bindingIntro, bindingSubsections);
      purflingSection = new BGSection("Purfling", purflingIntro, purflingSubsections);
	inlaySection = new BGSection("Inlay", inlayIntro, inlaySubsections);
      headplateSection = new BGSection("Headplate", headplateIntro, headplateSubsections);
	rosetteSection = new BGSection("Rosette", rosetteIntro, rosetteSubsections);
	endGraftSection = new BGSection("End Graft", endGraftIntro, endGraftSubsections);
	pickGuardsSection = new BGSection("Pick Guards", pickGuardsIntro, pickGuardsSubsections);
      scaleLengthSection = new BGSection("Scale Length", scaleLengthIntro, scaleLengthSubsections);
	stringWidthSpacingSection = new BGSection("Nut Width/String Spacing", stringWidthSpacingIntro, 											stringWidthSpacingSubsections);
      actionAndReliefSection = new BGSection("Action and Relief", actionAndReliefIntro, actionAndReliefSubsections);
      cutawaysSection = new BGSection("Cutaways", cutawaysIntro, cutawaysSubsections);
      neckProfileSection = new BGSection("Neck Profile", neckProfileIntro, neckProfileSubsections);
      maintenanceSection = new BGSection("Maintenance", maintenanceIntro, maintenanceSubsections);
      stringsSection = new BGSection("Strings", stringsIntro, stringsSubsections);
      picksSection = new BGSection("Picks", picksIntro, picksSubsections);
      casesSection = new BGSection("Cases", casesIntro, casesSubsections);
      tunersSection = new BGSection("Tuners", tunersIntro, tunersSubsections);
}
//----- Add a subsection to the existing sectionFrame -----
function loadSubsection(subsectionObject) {
	var subsectionHolder;
	var newSubsection;
	var newImage;
	var newLayoutBox;
	var newTitleBox;
	var newTextBox;
	var newTitle;
	var newText;
	var newAnchor;
	var i;

	subsectionHolder = document.getElementById("subsectionFrame");

	newSubsection = document.createElement("DIV");
	newLayoutBox = document.createElement("DIV");
	newImage = document.createElement("IMG");
	newTitleBox =  document.createElement("P");
	newTextBox =  document.createElement("P");
	newAnchor = document.createElement("A");
	newAnchor2 = document.createElement("A");

	newTitle = document.createTextNode(subsectionObject.title);
	newText = document.createTextNode(subsectionObject.text);
	
	//Set the attributes of each new element created
	newImage.setAttribute("src", subsectionObject.thumbnail);
	newImage.setAttribute("className", "bgSubsectionImage");
	newSubsection.setAttribute("className", "buyersGuideSubsection");
	newLayoutBox.setAttribute("className", "bgSubsectionLayoutBox");
	newTitleBox.setAttribute("className", "bgSubsectionTitle");
	newTextBox.setAttribute("className", "bgSubsectionText");

	newAnchor.setAttribute("href", "#");
	newAnchor.setAttribute("onclick", "return showBigImage(\"" + subsectionObject.largeImage + "\");");

	newAnchor2.setAttribute("href", "javascript:");
	newAnchor2.setAttribute("onclick", "showBigImage(\"http://www.guitarmatch.com/images/noimage.jpg\"); return false;");

	//newAnchor.setAttribute("onclick", "return showBigImage(&quot;" + subsectionObject.largeImage + "&quot;);");

	//Attach the new elements to the page
	newTitleBox.appendChild(newTitle);
	newTextBox.appendChild(newText);
	newLayoutBox.appendChild(newTitleBox);
	newLayoutBox.appendChild(newTextBox);



	/*
	newAnchor.appendChild(newImage);
	newAnchor2.appendChild(document.createTextNode("Testing TextNode"));

	newSubsection.appendChild(newAnchor);
	newSubsection.appendChild(newAnchor2);
	*/
	newSubsection.appendChild(newImage);

	newSubsection.appendChild(newLayoutBox);
	subsectionHolder.appendChild(newSubsection);

	//alert(newAnchor2.getAttribute("onclick"));

	//alert(subsectionHolder.innerHTML);


}

function unloadSubsections() {
	var subsectionHolder;

	subsectionHolder = document.getElementById("subsectionFrame");
	len = subsectionHolder.childNodes.length;

	//Remove all the old subsections in the subsectionHolder
	while (subsectionHolder.childNodes.length > 0) {
		subsectionHolder.removeChild(subsectionHolder.childNodes[0]);
	}  
}

//----- Load the appropriate page section -----
function loadSection(sectionObject) {
	var containerTitle; 
	var containerText;
	var i;

      //Fetch the container elements
	containerTitle = document.getElementById("sectionTitle").childNodes[0];
	containerText = document.getElementById("sectionText").childNodes[0];

	//Set the section title and text
	containerTitle.nodeValue = sectionObject.title;
	containerText.nodeValue = sectionObject.text;

	//Unload the old subsections
	unloadSubsections();

	//Load the new subsections
	for (i=0; i<sectionObject.subsections.length; i++) {
		loadSubsection(sectionObject.subsections[i]);
	}
}
