﻿// JScript File
		function toggleList(li)
		{
			if (document.getElementById(li).style.display == "none")
			{
				document.getElementById(li).style.display = "";
			}
			else
			{
				document.getElementById(li).style.display = "none";
			}
		}
		
		function toggleIcon(li)
		{
			if (document.getElementById(li).style.listStyleType == "circle")
			{
				document.getElementById(li).style.listStyleType = "none";
			}
			else
			{
				document.getElementById(li).style.listStyleType = "circle";
			}
		}

		function foo()
		{
//			document.getElementById('tblFoo').style.height = (window.innerHeight * .98) + "px";
//			document.getElementById('tblFoo').style.height = (document.body.clientHeight * .98) + "px";
		}
		
		function imgTo100(img, num)
		{
			document.getElementById(img).setAttribute('src', 'images/tn_' + num + '-100.jpg');
		}
		
		function imgTo30(img, num)
		{
			document.getElementById(img).setAttribute('src', 'images/tn_' + num + '-30.jpg');
		}
		
		function changeImgMain(num)
		{
			document.getElementById('imgMain').setAttribute('src', 'images/tn_' + num + '-100.jpg');
			document.getElementById('divContent').lastChild.nodeValue = num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num + ' ' + num;
		}
		
		function updateCatImage(tn, img)
		{
			
			document.getElementById(img).setAttribute('src', '../images/' + tn);
		}
		
		function preloadLightingPhotos(imgId, companyName, number)
		{
			var imgTarget = document.getElementById(imgId);
			imgTarget.setAttribute('style', 'display: none;');
			for(i=1; i <= number; i++)
			{
				imgTarget.setAttribute('src', '../images/lighting/' + companyName + i + '.jpg');
			}
			imgTarget.setAttribute('style', '');
		}
		
		function updateShowroomImage(tn, img, a, url)
		{
			
			document.getElementById(img).setAttribute('src', '../images/' + tn);
			document.getElementById(a).setAttribute('href', url);
		}
		
		function preloadShowroomPhotos()
		{
			preloadPhotos('showroom', 'imgShowroom_1', 'dining', '21');
			preloadPhotos('showroom', 'imgShowroom_1', 'occasional', '12');
			preloadPhotos('showroom', 'imgShowroom_1', 'barstools', '11');
			preloadPhotos('showroom', 'imgShowroom_2', 'casegoods', '25');
			preloadPhotos('showroom', 'imgShowroom_3', 'upholstery', '14');
			preloadPhotos('showroom', 'imgShowroom_3', 'leather', '11');
			preloadPhotos('showroom', 'imgShowroom_3', 'mountain', '11');
			preloadPhotos('showroom', 'imgShowroom_4', 'theater', '6');
			preloadPhotos('showroom', 'imgShowroom_4', 'theaterchair', '13');
			preloadPhotos('showroom', 'imgShowroom_5', 'rugs', '9');
			preloadPhotos('showroom', 'imgShowroom_6', 'bedroom', '14');
			preloadPhotos('showroom', 'imgShowroom_7', 'kids', '7');
		}
		
		function preloadHotelPhotos()
		{
		    // 2, 3, 4, 6, 8
		    preloadPhotos('hotel', 'imgHotel_2', 'hotelemu', '8');
		    preloadPhotos('hotel', 'imgHotel_3', 'hotelgar', '12');
		    preloadPhotos('hotel', 'imgHotel_4', 'hotelmts', '12');
		    preloadPhotos('hotel', 'imgHotel_6', 'sealy', '1');
		    preloadPhotos('hotel', 'imgHotel_8', 'hoteltucci', '8');
		}
		
		function preloadRestaurantPhotos()
		{
		
		    preloadPhotos('restaurant', 'imgRestaurant_1', 'restaurantemu', '8');
		    preloadPhotos('restaurant', 'imgRestaurant_2', 'restaurantgar', '12');
		    preloadPhotos('restaurant', 'imgRestaurant_3', 'restaurantmts', '6');
//		    preloadPhotos('restaurant', 'imgRestaurant_4', 'restaurantsandler', '1');
//		    preloadPhotos('restaurant', 'imgRestaurant_5', 'restauranttucci', '1');
		}
		
		function preloadPhotos(directoryName, imgId, sectionName, number)
		{
			var imgTarget = document.getElementById(imgId);
			imgTarget.setAttribute('style', 'display: none;');
			for(i=1; i <= number; i++)
			{
				imgTarget.setAttribute('src', '../images/' + directoryName + '/' + sectionName + i + '.jpg');
			}
			imgTarget.setAttribute('src', '../images/' + directoryName + '/' + sectionName + '1' + '.jpg');
			imgTarget.setAttribute('style', '');
		}