

	lastel='details';

	var images = new Array();
	var flash="";

	function reveal(name){

		identity=document.getElementById(lastel);
		identity.className='hiddentab';

		identity=document.getElementById(name);
		identity.className='showntab';
		lastel=name;

		divid=name+'div';

		document.getElementById('contentdiv').innerHTML=document.getElementById(divid).innerHTML;

	}



	function addImage(fullPath){

		lastSlash = fullPath.lastIndexOf("/");
		fileName = fullPath.substring(lastSlash+1,fullPath.length);
		images.push(fileName);

	}


	function setFlash(fname){

		flash=fname;

	}

	function deleteFlash(id,filename){

		newLoc='http://humanedgetech.com/shop/delete_flash.php?productid=id&flashfile=filename';
		alert(newLoc);
	}


	function showImageSelector(){

		imgViewerHtml="<br>";


		if(images.length>0){


			imgViewerHtml+='\
\
	<div width="100%" align="center" valign="middle" height="100%">																				\
		<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="280" id="AutoNumber1">	\
			<tr>																																\
				<td colspan="4">																												\
					<div id="detailedImageDiv" class="detailedImageDiv"></div>																	\
				</td>																															\
			</tr>																																\
			<tr>																																\
				<td>																															\
					<table border="0" cellpadding="0" cellspacing="0" style="padding-bottom: 6px;border-collapse: collapse" width="100%">		\
						<tr>																													\
							<td width="180" valign="bottom">																					\
								<font class="viewproduct">More images<img border="0" src="images/downarrow.gif" width="7" height="5"></font>	\
							</td>																												\
							<td width="10">&nbsp;</td>																							\
							<td width="70" align="center" valign="bottom">';


			if(!flash==""){
				imgViewerHtml+='<font class="viewproduct">Play video</font>';
			}


			imgViewerHtml+='\
\
							</td>																												\
							<td width=""></td>																									\
\
						</tr>																													\
\
						<tr>																													\
							<td align="left">																									\
								<div class="detailedImageSelectorDiv">';


			imgHtml="";

			for(x=0;x<images.length;x++){

				imgName=images[x];

				imgUrl='/shop/images/nav/'+imgName;

				imgHtml+='<img src="'+imgUrl+'" class="detailSelectorCell" ';

				imgHtml+=' onmouseover="this.className='+"'"+'detailSelectorCellOver'+"'"+';this.style.cursor='+"'"+'hand'+"'"+'" ';
				imgHtml+=' onmouseout="this.className='+"'"+'detailSelectorCell'+"'"+';this.style.cursor='+"'"+'text'+"'"+'"';
				imgHtml+=' onclick="'+"loadImg('"+imgName+"')"+'"';	

				imgHtml+=' title="Click to show image">';


			}

			imgViewerHtml+=imgHtml;

			imgViewerHtml+='</div></td><td width="10">&nbsp;</td><td width="70" align="center"><p align="center">';

			if(!flash==""){
				imgViewerHtml+='<img border="0" src="images/start.jpg" width="30" height="30" onclick="showVideo()" alt="Show video" onmouseover="this.style.cursor=\'hand\';"	onmouseout="this.style.cursor=\'text\'">';
			}

			imgViewerHtml+='</td><td width=""> &nbsp;</td></tr></table></td></tr></table></div>';


		}


		document.getElementById('ImageViewer').innerHTML=imgViewerHtml;

// images[0] = 't_198_01.jpg';
		imgUrl='images/product/'+ images[0];
		fullUrl='images/detailed/'+ images[0];
		document.getElementById('detailedImageDiv').innerHTML='<img src="'+imgUrl+'" border="0" onclick="showProductImage(\''+fullUrl+'\')" 		alt="Click to view fullsizeimage" onmouseover="this.style.cursor=\'hand\';"	onmouseout="this.style.cursor=\'text\'">';

	}








	function showProductImage(url){

		window.open (url, 'newwindow', config='height=600, width=600, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no')
	}



	function loadImg(imgName){


		imgUrl='images/product/'+ imgName;
		fullUrl='images/detailed/'+ imgName;
		document.getElementById('detailedImageDiv').innerHTML='<img src="'+imgUrl+'" border="0" onclick="showProductImage(\''+fullUrl+'\')" 		alt="Click to view fullsizeimage" onmouseover="this.style.cursor=\'hand\';"	onmouseout="this.style.cursor=\'text\'">';


	}

	function showVideo(){
		document.getElementById('detailedImageDiv').innerHTML=document.getElementById('flashdiv').innerHTML;
	}

