<!--
	var lngLast = 0;
	function LoadGallery( lngGalID )
	{
		if ( objClicked = document.getElementById( 'galLink' + lngGalID ) )
		{
			if ( objLast = document.getElementById( 'galLink' + lngLast ) )
			{
				objLast.style.backgroundImage = 'url( ./images/icoSquareBrown.gif )';
			}
			objClicked.style.backgroundImage = 'url( ./images/icoSquareBrownOn.gif )';
		}
		lngLast = lngGalID;
		var xmlHttp = AJAX_GetXMLHttp();
		if ( xmlHttp == null )
		{
			alert( "Error: Could not instantiate XmlHttp object." );
			return;
		}
		xmlHttp.open( 'GET', 'xml/photoGalleryXml.asp?ID=' + lngGalID, true );
		xmlHttp.send( 'ID=' + lngGalID );
		xmlHttp.onreadystatechange = function()
		{
			if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 )
			{
				//list the comparisons for the selected products
				ListPhotoGallery( xmlHttp.responseText, lngGalID );
			}
		}
	}
	function ListPhotoGallery( xmlString, lngGalID )
	{
		var xmlDoc;
		var galDataset;
		var lngImgID = 0;
		var lngThumb = 0;
		var lngImage = 0;
		var lngImgWidth = 0;
		var lngImgHeight = 0;
		var strGcName = '';
		var strGalName = '';
		var strImgName = '';
		var strHtm = '';
		var strHtmIcons = '';
		var i;
		var x;
		var lngCnt = 0;
		
		if ( xmlString.length <= 0 )
		{
			return;
		}
		// Instantiate the xml parser
		xmlDoc = AJAX_GetXMLParser();
		if ( xmlDoc == null )
		{
			alert( "Error: Could not instantiate XML parser." );
			return;
		}
		// Load the XML string
		xmlDoc = AJAX_LoadXML( xmlDoc, xmlString );
		if ( xmlDoc == null )
		{
			alert( "Error: Could not parse XML data." );
			return;
		}
		//get the data
		galDataset = xmlDoc.getElementsByTagName( 'NOVAGallery' );
		if ( galDataset.length != 0 )
		{
			//get the category and gallery name
			strGcName = galDataset[0].childNodes[6].firstChild.nodeValue;
			strGalName = galDataset[0].childNodes[7].firstChild.nodeValue;
			//place the title
			strHtm = '<h3>' + strGcName + ': ' + strGalName + '</h3>';
			strHtm += '<br>';
			//loop through the data
			for ( var i=0; i < galDataset.length; i++ )
			{
				//assign the variables
				lngImgID = parseInt( galDataset[i].childNodes[0].firstChild.nodeValue );
				lngThumb = parseInt( galDataset[i].childNodes[1].firstChild.nodeValue );
				lngImage = parseInt( galDataset[i].childNodes[2].firstChild.nodeValue );
				lngImgWidth = parseInt( galDataset[i].childNodes[3].firstChild.nodeValue );
				lngImgHeight = parseInt( galDataset[i].childNodes[4].firstChild.nodeValue );
				strImgName = galDataset[i].childNodes[5].firstChild.nodeValue;
				if ( lngThumb != 0 )
				{
					strHtm += '<div class=\"photoThumb\"><a href=\"javascript:OpenGalleryImage(' + lngImage + ',' + lngImgWidth + ',' + lngImgHeight + ');\" title=\"Click to Enlarge\"><img src=\"dataDownload.asp?ID=' + lngThumb + '\" alt=\"Click to Enlarge\" border=\"0\"></a></div>';
					lngCnt += 1;
				}
				if ( lngCnt == 2 )
				{
					lngCnt = 0;
					strHtm += '<br style=\"clear:left;\">';
				}
			}
			//place the data
			document.getElementById( 'photoGalleryBlock' ).innerHTML = strHtm;
			//add the icons
			strHtmIcons += '<img src=\"images/icoPhotoGalleryThumbs.gif\" width=\"35\" height=\"35\" alt=\"Thumbnail View\" border=\"0\" style=\"margin-right:20px;\">';
			strHtmIcons += '<a href=\"downloadsPhotoGallerySlideshow.asp?ID=' + lngGalID + '\" title=\"\"><img src=\"images/icoPhotoGallerySlides.gif\" width=\"35\" height=\"35\" alt=\"Slideshow View\" border=\"0\"></a>';
			//place the icons
			document.getElementById( 'photoGalleryIcons' ).innerHTML = strHtmIcons;
		}
	}
	
	function OpenGalleryImage( lngImage, lngWidth, lngHeight )
	{
		var	strProp;
		strProp = POPUP_MakeProperties( 100, 100, lngWidth, lngHeight, false, false, false, false, false, false, false );
		POPUP_OpenGet( 'downloadsImageView.asp?ID=' + lngImage, 'ProductImage' + lngImage, strProp );
	}
	window.onload = function()
	{
		if ( lngGallery != 0 )
		{
			LoadGallery( lngGallery );
		}
	}
//-->