<!--#include file="conn.asp"-->
<%
dim carId, chepic(4), imgName
carId   = request.QueryString("id")
imgName = request.QueryString("imgName")

if cint(imgName) <= 0 then imgName="1"
if cint(imgName) >= 5 then imgName="5"

set rs_che = server.CreateObject("adodb.recordset")
rs_che.open "select * from product where id = "& carId &"",conn,1,1

if not rs_che.eof then

	if rs_che("smallImg") = "nothing" then	'汽车视图
		 chepic(0) = "img/car1.gif"
	else
		chepic(0) = rs_che("smallImg")
	end if
	
	if rs_che("smallImg2") = "nothing" then  '前方视图
		chepic(1) = "img/car1.gif"
	else
		chepic(1) = rs_che("smallImg2")	
	end if
	
	if rs_che("smallImg3") = "nothing" then	 '横图
		chepic(2) = "img/car1.gif"
	else
		chepic(2) = rs_che("smallImg3")
	end if
	
	if rs_che("smallImg4") = "nothing" then  '车内
		chepic(3) = "img/car1.gif"
	else
		chepic(3) = rs_che("smallImg4")	
	end if
	
	if rs_che("smallImg5") = "nothing" then    '车厢
		chepic(4) = "img/car1.gif"
	else
		chepic(4) = rs_che("smallImg5")	
	end if
end if

rs_che.close()
set rs_che = nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>查看汽车图片</title>
<script language="javascript">
var img = new Image();
var img2 = new Image();
var img3 = new Image();
var img4 = new Image();
var img5 = new Image();
img.src = "<%=chepic(0)%>";
img2.src = "<%=chepic(1)%>";
img3.src = "<%=chepic(2)%>";
img4.src = "<%=chepic(3)%>";
img5.src = "<%=chepic(4)%>";

function showhowimg(n)
{
		document.img1.className = "img2";
		document.img2.className = "img2";
		document.img3.className = "img2";
		document.img4.className = "img2";
		document.img5.className = "img2";

	if(n=="1")
	{
		showimg.src = img.src;
		document.img1.className = "img1";
	}
	
	if(n=="2")
	{
		showimg.src = img2.src;
		document.img2.className = "img1";
	}
	
	if(n=="3")
	{
		showimg.src = img3.src;
		document.img3.className = "img1";
	}
	
	if(n=="4")
	{
		showimg.src = img4.src;
		document.img4.className = "img1";
	}
	
	if(n=="5")
	{
		showimg.src = img5.src;
		document.img5.className = "img1";
	}
}
</script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
/*背选中图片样式*/
.img1{padding:3px; border:solid 3px #2F499F;}
/*未被选中图片的样式*/
.img2{padding:3px; border:solid 3px #C8E4FF;}
-->
</style></head>

<body>
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0" background="images/viewinfo/fangda002.jpg">
  <tr>
    <td colspan="3"><img src="images/viewinfo/fangda001.jpg" width="912" height="61" border="0" usemap="#Map" /></td>
  </tr>
  <tr>
    <td width="164" height="80" valign="top"><p>&nbsp;</p>
      <table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/ad.gif" width="149" height="445" /></td>
      </tr>
    </table></td>
    <td width="590" height="80"><table width="336" height="171" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="
		<%
		if imgName ="1" then
			response.write chepic(0)
		elseif imgName ="2" then
			response.write chepic(1)
		elseif imgName ="3" then
			response.write chepic(2)
		elseif imgName ="4" then
			response.write chepic(3)
		elseif imgName ="5" then
			response.write chepic(4)
		else
			response.write chepic(0)
		end if
		
		%>" alt="" name="showimg" width="520" height="390" id="showimg" /></td>
      </tr>
    </table></td>
    <td width="158" height="80" valign="top"><p>&nbsp;</p>
      <table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/ad.gif" />&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="3"><table width="600" border="0" align="center" cellpadding="3" cellspacing="0">
      <tr>
        <td align="center"><a href="viewCarImg.asp?id=<%=carId%>&imgName=<%=imgName-1%>"><img src="images/viewinfo/fangfa011.jpg" width="59" height="56" border="0" /></a></td>
        <td align="center" style="cursor:pointer;"><img name="img1" id="img1" src="<%=chepic(0)%>" width="56" height="54" alt="" onclick="showhowimg('1')" <%if imgName = "1" then response.write "class='img1'" else response.write "class='img2'"%> /></td>
        <td align="center" style="cursor:pointer;"><img name="img2" id="img2" src="<%=chepic(1)%>" width="56" height="54" alt="" onclick="showhowimg('2')" <%if imgName = "2" then response.write "class='img1'" else response.write "class='img2'"%> /></td>
        <td align="center" style="cursor:pointer;"><img name="img3" id="img3" src="<%=chepic(2)%>" width="56" height="54" alt="" onclick="showhowimg('3')"  <%if imgName = "3" then response.write "class='img1'" else response.write "class='img2'"%>/></td>
        <td align="center" style="cursor:pointer;"><img name="img4" id="img4" src="<%=chepic(3)%>" width="56" height="54" alt="" onclick="showhowimg('4')"  <%if imgName = "4" then response.write "class='img1'" else response.write "class='img2'"%>/></td>
        <td align="center" style="cursor:pointer;"><img name="img5" id="img5" src="<%=chepic(4)%>" width="56" height="54" alt="" onclick="showhowimg('5')"  <%if imgName = "5" then response.write "class='img1'" else response.write "class='img2'"%>/></td>
        <td align="center"><a href="viewCarImg.asp?id=<%=carId%>&imgName=<%=imgName+1%>"><img src="images/viewinfo/fangfa012.jpg" width="59" height="56" border="0" /></a></td>
      </tr>
      
    </table></td>
  </tr>
</table>

<map name="Map" id="Map"><area shape="rect" coords="3,0,191,59" href="default.asp" />
</map></body>
</html>
