// JavaScript Document

	window.onload = function () {
		var container = $('div.sliderGallery');
		var ul = $('ul', container);
		
		var itemsWidth = ul.innerWidth() - container.outerWidth();
		
		$('.slider', container).slider({
			min: 0,
			max: itemsWidth,
			handle: '.handle',
			stop: function (event, ui) {
				ul.animate({'left' : ui.value * -1}, 500);
			},
			slide: function (event, ui) {
				ul.css('left', ui.value * -1);
			}
		});
	};
	
var oldOne = "point1";
cachePoint = new Image(18,12);
cachePoint.src = "/images/scrolly/point.jpg";


	function appear(pointNum,divContent,displayState)
		{
		document.images[oldOne].src="/images/scrolly/tran.gif";	
		document.getElementById("displayIt").style.display=displayState;	
		document.images[pointNum].src="/images/scrolly/point.jpg";
		oldOne = pointNum;
		
		document.getElementById('titleHeading').innerHTML='<span class="theTitle">' + amps[divContent][0] + '</span><br />' + amps[divContent][2];
		document.getElementById('prodImage').style.backgroundImage='url(..' + amps[divContent][1] + ')';
		document.getElementById('feature1').innerHTML=amps[divContent][3];
		document.getElementById('feature2').innerHTML=amps[divContent][4];
		document.getElementById('feature3').innerHTML=amps[divContent][5];
		document.getElementById('learnMore2').innerHTML='<a onMouseOver="changeBgImage(\'/images/scrolly/on_circle.jpg\',\'learnMore2\')" onMouseOut="changeBgImage(\'/images/scrolly/off_circle.jpg\',\'learnMore2\')" href="/en/products/' + amps[divContent][6] + '">Learn More</a>';
		document.getElementById("productLink1").href="/en/products/" + amps[divContent][6];
		document.getElementById("productLink2").href="/en/products/" + amps[divContent][6];
		document.getElementById("productLink3").href="/en/products/" + amps[divContent][6];
		
		}
		
	function closeMe() 
	{
		document.getElementById('displayIt').style.display='none';
		document.images[oldOne].src="/images/scrolly/tran.gif";
	}	


	function changeBgImage (image, id) {
		var element = document.getElementById(id);
		element.style.backgroundImage = "url("+image+")";
	}

	function searchClear(theText) {
		if (theText.value == theText.defaultValue) {theText.value = ""}
	}
	function searchDefault(theText) {
		if (theText.value == "") { theText.value = theText.defaultValue}
	}
		/* $(document).ready(function() {
			// Autocomplete
			$("#searchfield").autocomplete(tags, { formatItem: function(item) { return item.text;}
				}).result(function(event, item) {location.href = "/EN/Products/" + item.url + ".aspx";
    		});
		}); */



