/*
This is the javascript file for the automotive page for The Junction, Inc. - KJP
Created July 14, 2009
*/

/* objectives:

The main areas for adjustment are automotiveCategoryTitle, automotiveCategoryPics, and automotiveCategoryText.
Go through array to find specific item and display all images(logos) and text

*/

var automotiveCategoryArray = new Array(

	/* first item is for page entry */
	['1',
	'Our Garage Area - Where it all happens',
	'garagePan.gif',
	'Our shop is staffed with PROFESSIONALS who make sure they get the job done right, the FIRST time!',
	],
	
	['2',
	'Audio / Video',
	'AudioVideoSplash2.gif',
	'We have been in this business long enough to realize that QUALITY electronics are invaluable to customer satisfaction and long service life. We use brands that are leaders in their industry, pursuing perfection and continuous research for improvement.',
	],
	
	['3',
	'Body Kits / Molds',
	'bodyKitsMoldsSplash.gif',
	'Want to dress up your ride? Want your ride to turn heads? Body kits give your auto a distinctive look that is guaranteed to attract attention. We only us the finest kits that employ the latest technology.',
	],
	
	['4',
	'Collision Repair',
	'',
	'',
	],
		
	['5',
	'Custom Enclosures',
	'customEnclosuresSplash.gif',
	'They\'re gonna know you\'re coming! We pack some of the loudest equipment from the top names in power. We custom design rock solid speaker enclosures that fit perfectly in your ride.',
	],
	
	['6',
	'Custom Paint',
	'',
	'',
	],
	
	['7',
	'Lift Kits',
	'LiftLowerSplash.gif',
	'We can go as high or as low as you want.',
	],
	
	['8',
	'Starters / Alarms',
	'StartersAlarmsSplash.gif',
	'Tired of getting into a freezing car in the Northern NY winters. Why not have your car already heated up.',
	],
	
	['9',
	'Wheels / Tires',
	'WheelsTiresSplash.gif',
	'Some of the HOTTEST names in wheels and we got em\'. We have a full assortment of every kind of wheel on the market. Any size, style, color; it\'s up to you. We have the expertise and experience to show you what size wheels will fit on your ride. Full warranty for as long as you own them.',
	]
)

var automotiveBodyArray = new Array(

	/* first item is for page entry */
	['1','',
	'Our shop is staffed with PROFESSIONALS who make sure they get the job done right, the FIRST time!'
	],
	['1','',
	'It is our pleasure to get your vehicle the exact way you would like it. After all, we want you to be proud of the vehicle you drive.'
	],
	['2','rockford_fosgate_logo.gif',
	'Rockford Fosgate is terrifying to those that don\’t understand. Why would a person want thousands of watts of Rockford Fosgate power in an amplifier that is bigger than most cars are wide? Because sometimes – too much is perfect!'
	],
	['2','rockford_fosgate_logo.gif',
	'Rockford Fosgate is ready for the future. We incorporate some of the most state-of-the-art facilities in the audio business. Best of all, our Amplifiers, Signal Processors and Woofers are designed and engineered in Tempe, AZ, USA!'
	],
	['2','rockford_fosgate_logo.gif',
	' The consistent theme here is not just music or technology but the brilliant use of technology and circuit design to enjoy impactful and passionate music. A real passion for the experience of music. Obviously, Jim Fosgate is still pursuing his dream. He was awarded an Emmy(Registered) Award for his work in developing surround sound technology for television. Yeah, this guy has defined himself with music and technology.'
	],
	['2','Kickerlogo.jpg',
	'In 1980, KICKER Audio invented the high-performance stereo enclosure market when company founder and President Steve Irby developed the Original KICKER(Registered), the first full-range speaker box designed specifically for automotive use. From the day Kicker put the power to that first KICKER, Livin\’ Loud(Registered) has always been the KICKER way - staying one step ahead of the pack, driven to create components that consistently raise the world\'s expectations for stereo performance.'
	],
	['2','Kickerlogo.jpg',
	'As a continually evolving brand, KICKER reaches new heights in 2008 with the development of its first home audio product – digital stereo systems specifically for iPod(Registered) and Zune(Trade Mark) media players. As it has striven for excellence on the road the past quarter-century, KICKER will work to become a future driving force under the roof as well.'
	],
	['2','Focallogo.gif',
	'Innovation is key to the Focal sound. For 25 years, through the pursuit of constant new advances in technology, Focal has been able to develop a harmonious research and production system that enables Focal to continuously improve their products and introduce now ones, all with the same goal: the most faithful reproduction of music. The latest example of this philosophy has been the introduction of Beryllium in their top products, which has become a new reference worldwide.'
	],
	['2','farenheitLogo.jpg',
	'Epsilon Electronics is the parent company of Farenheit Technologies and is celebrating 26 years of excellence. Since the beginning we have had one guiding principal... the want to be the most innovative and best engineered video product in the market place. Product reliability and customer satisfaction is the foundation our company has been built on. Our success with this approach has propelled our image even further than our unique American engineering and designs could ever have. Today our in-dash DVD players and ceiling mount combos are known for their superior quality. All other manufacturers are being measured by our current standards. It doesn’t matter if you\’re purchasing audio or video product for the car we have the best built solution as recognized by many customers who left us at one point for price considerations only to return due to quality issues. Take a look at the long list of exciting new items in this year\’s catalog, including our new Navigation Systems with Navteq mapping software (US & Canada), a 433mHz processor for blazing fast recalculation times and Linux based software platform which renders simplicity of function and user interface.'
	],
	['2','pioneer_logo.gif',
	'Pioneer was founded in 1938 in Tokyo, Japan by Nozomu Matsumoto - a man with a passion for music that he hoped to share with the world through high quality audio speakers. That passion began with a small operation to repair and manufacture speakers in Matsumoto\'s garage. It has since grown to international stature as a manufacturer of audio and video products for use at home, in the car and in business environments. The element that has not changed in nearly 70 years is the passion for audio and video products that we hope to share with the world. From the employees at our research labs looking for the "next big thing" to the engineers at our factories focused on quality assurance to our product trainers explaining the new technology to our customers - we remain passionate about creating an unbeatable entertainment experience. We invite you to spend some time surfing our Web site. Check out the newest product line, learn more about the technology and how it can impact your life. We think that we\'ll capture your passion for entertainment. And that you\'ll want to see ... and hear more.'
	],
	['2','kenwood_logo.gif',
	'Kenwood USA is a leading developer and manufacturer of consumer electronics and communications equipment. Founded in the United States in 1961, Kenwood USA is the largest sales subsidiary of Kenwood Corporation of Japan and is recognized by consumers and industry professionals for providing products known for quality, performance, and value. Kenwood USA has a reputation for bringing important new products to the consumer electronics market. The company built the first audio/video amplifier for home theater back in 1981. Kenwood also created the first anti-theft car cassette deck that could be slid out of the dash; the first with an automatic broadcast sensor system and automatic noise reduction; the first with 24 presets; and the first polypropylene speaker cones. Over the years, Kenwood engineers have invented dozens of new technologies later copied by others.'
	],
	['3','extremeDimensions.gif',
	'Extreme Dimensions, Inc. is a world renowned automotive aerodynamic company headquartered in the United States. With a 50,000 square foot distribution center, we currently manufacture and distribute over 6,000 products globally including North America, Europe, Asia, and South America. From our humble foundations in 2000, we have striven to offer the largest variety of premium aerodynamic products at the most affordable prices. Through the years, we have surpassed industry standards by dedicating ourselves to excellent customer service. '
	],
	['3','extremeDimensions.gif',
	'Since the beginning, Extreme Dimensions has been designing, manufacturing, and distributing aerodynamic products for the Sport Compact, Domestic, European, Truck, and SUV industries. What sets us apart from our competitors is that we only manufacture high quality fiberglass, carbon fiber, and polyurethane composites. Recently, we stormed the industry with our new hybrid DuraFlex fiberglass line while Carbon Creations continued to set the standard in premium carbon fiber aerodynamics. In 2009, look for us to further expand our new luxury polyurethane line for the serious enthusiast. '
	],
	['3','extremeDimensions.gif',
	'With over 6,000 products, we distribute the most innovative and largest selection of aerodynamic products in the industry. To find a complete line of our products please call 1-888-611-AERO or visit us online at www.extremedimensions.com, www.carbon-creations.com, and www.couturestyling.com. We are proud to present the 2009 Extreme Dimensions catalog and extend our gratitude for your future business. '
	],

	['4','',
	''
	],
	['5','speakerEnclosure1.gif',
	'It all begins with a layout based on the contours of your vehicle. We design the speaker layout to maximize the air space inside the enclosure to produce some killer thumpin\'.'
	],
	['5','speakerEnclosure2.gif',
	''
	],
	['5','speakerEnclosure3.gif',
	''
	],
	['5','speakerEnclosure4.gif',
	''
	],
	['6','dupontLogoOnWhite.gif',
	'DuPont Performance Coatings is the world\'s leading provider of innovative products, services, and solutions aimed at improving the efficiency and effectiveness of the vehicle refinish process. From the back of the shop to the front of the shop, no one does more to help refinishers improve productivity.'
	],
	['6','hotHues.jpg',
	'DuPont Hot Hues(Trade Mark) is an offering of custom finishing products, including special two- and three-stage basecoat colors and concentrated candy color products. The system also features undercoats that make vehicle preparation simple, and easy-to-use clearcoats for outstanding appearance.'
	],
	['6','paintColors.jpg',
	'Customizers can create colors using the Hot Hues(Trade Mark) color offering by adding any of the Hot Efx(Trade Mark) pearls and other special effect pigments to the hundreds of Hot Colors Basecoats.'
	],
	['7','logo_skyjacker.gif',
	'At Skyjacker(Registered), we\'re listening! By hosting, sponsoring, supporting and participating in a vast array of outdoor events, Skyjacker(Registered) is extending a helping hand to the total sport of off-roading. Look for our "Rock Ready Tour Team" at the events. That\'s right, "We Test Where You Ride". By designing, testing, up grading and then more testing, Skyjacker(Registered) is surpassing the demands of both our customers and the harshest terrain.'
	],
	['7','logo_skyjacker.gif',
	'Skyjacker(Registered) builds quality suspension products...the best on the market. Skyjacker(Registered) offers a huge range of lift heights and levels of performance for most Chevrolet\GMC, Dodge, Ford, Jeep and Toyota vehicles. So go beyond the basic "lift kit" and get into a Skyjacker(Registered) performance suspension package. Ask for Skyjacker(Registered), Rock Ready(Registered), Softride(Registered), Flex Series(Registered) and Softride(Registered) Shocks by name. '
	],
	['8','compustarlogo.gif',
	'Firstech\'s product engineers are dedicated to the research and development of new and innovative technologies. Thousands of hours were spent perfecting the art of radio signal modulation and applying it to security and remote start systems on automatic and manual transmission vehicles!'
	],
	['8','compustarlogo.gif',
	'In 2008, Firstech introduced another innovation to the vehicle security and convenience, interchangable remote kits and systems. This means you can upgrade your system by purchasing different kits with better features.'
	],
	['9','MazziLogos.jpg',
	''
	],
	['9','logo_veloche.jpg',
	''
	],
	['9','ionForged.jpeg',
	''
	],
	['9','dip-logo.JPG',
	''
	],
	['9','sacchi-logo.JPG',
	''
	]

)



function gotoAutomotive(item) {
	var itemNum = item;
	clearAutomotiveAreas();
	
	document.getElementById('automotiveCategoryTitle').innerHTML = automotiveCategoryArray[itemNum][1];
	var splashImage = document.createElement("IMG");
	splashImage.setAttribute("id","splashImage");
	splashImage.setAttribute("src","http://www.thejunctioninc.com/burgundyUpdateGraphics/"+automotiveCategoryArray[itemNum][2]);
	document.getElementById('automotiveCategorySplash').appendChild(splashImage);

	document.getElementById('automotiveCategoryBlurb').innerHTML = automotiveCategoryArray[itemNum][3];
	
	var tableElement = document.createElement("TABLE");
	tableElement.setAttribute("id","tableBody");
	tableElement.width="100%";
	tableElement.setAttribute("cellspacing","0");
	tableElement.setAttribute("cellpadding","15");
	tableElement.cellspacing="0";
	tableElement.cellpadding="15";
	tableElement.border="0";
	var innerTableBody = document.createElement("TBODY");
	innerTableBody.setAttribute("id","innerTableBody");
	
	tableElement.appendChild(innerTableBody);
	var placeHolder = 0;
	var itemNumBody = itemNum-(-1);
	var currentItem = 0;
	var previousItem = 0;
	var masterCount = 0;

	var tableRow = document.createElement("TR");
	var tableCell1 = document.createElement("TD"); //to hold images
	var tableCellImage = document.createElement("IMG");
	var tableCell2 = document.createElement("TD"); //to hold text
	var tableCellP = document.createElement("P");

	//cycle through to see what needs to be added
	for (var it =0;it<automotiveBodyArray.length;it++){
		placeHolder = it;
		if (automotiveBodyArray[placeHolder][0]==itemNumBody){
		
			currentItem = automotiveBodyArray[placeHolder][1];
			if (currentItem!=previousItem){		
				if (masterCount>0){
					//need to close out the data cell and row and start new row

					tableRow.appendChild(tableCell2);
					innerTableBody.appendChild(tableRow);

					var tableRow = document.createElement("TR");
					var tableCell1 = document.createElement("TD"); //to hold images
					var tableCellImage = document.createElement("IMG");
					var tableCell2 = document.createElement("TD"); //to hold text
					var tableCellP = document.createElement("P");

				}
				tableCell1.setAttribute("valign","top");
				tableCell1.valign="top";
				tableCellImage.setAttribute("src","http://www.thejunctioninc.com/burgundyUpdateGraphics/"+automotiveBodyArray[placeHolder][1]);
				tableCell1.appendChild(tableCellImage);
				tableRow.appendChild(tableCell1);
		
				tableCell2.setAttribute("valign","top");
				tableCell2.valign="top";
	
				var tableCellPData = document.createTextNode(automotiveBodyArray[placeHolder][2]);
				tableCellP.appendChild(tableCellPData);
				tableCell2.appendChild(tableCellP);

			} else {
				var tableCellP2 = document.createElement("P");
				var tableCellP2Data = document.createTextNode(automotiveBodyArray[placeHolder][2]);
				tableCellP2.appendChild(tableCellP2Data);
				tableCell2.appendChild(tableCellP2);
			}
			previousItem = currentItem;
			
		}
		masterCount++;
	}
	tableRow.appendChild(tableCell2);
							
	innerTableBody.appendChild(tableRow);

	tableElement.appendChild(innerTableBody);
	document.getElementById('automotiveCategoryBody').appendChild(tableElement);
	
	
}

function clearAutomotiveAreas(){
	document.getElementById('automotiveCategoryTitle').innerHTML = "";
	document.getElementById('automotiveCategoryBlurb').innerHTML = "";
	
	var splashArea = document.getElementById("automotiveCategorySplash");
	try {
		var dropImage = document.getElementById("splashImage");
		if (dropImage!=null){
			//remove all rows
			splashArea.removeChild(dropImage);
		}
	} catch (e) {}
	
	var spanArea = document.getElementById("automotiveCategoryBody");

	try {
		var dropp = document.getElementById("tableBody");
		if (dropp!=null){
			//remove all rows
			spanArea.removeChild(dropp);
		}
	} catch (e) {}

}

function createListElement(u){
	var listElement = document.createElement("li");
	image = document.createElement("img");
	image.setAttribute("src","../burgundyUpdateGraphics/"+automotiveImageArray[u][1]);
	image.setAttribute("border","0");

	listElement.appendChild(image);
	
	return listElement;

}




