<!-- #include file="include/con_vouch.asp" -->
<!-- #include file="include/jk_emoney.asp" -->
<%
dim id,name,pic,emoney,view_true,v_width,v_height,vtit,sqladd
id=trim(request.querystring("id"))
if not int_true(id) then
  call format_redirect("gallery.asp")
end if
sql="select top 1 name,pic,power,emoney from gallery where hidden=1 and id="&id
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
  rs.close
  call format_redirect("gallery.asp")
end if
name=rs("name")
pic=rs("pic")
page_power=rs("power")
emoney=rs("emoney")
rs.close

n_sort="gall"
types="paste"
sqladd=""
tit=joekoe_cms.code_html(name,1,0)&vtit

call web_head(0,0,5,0,0)
call emoney_notes(page_power,emoney,n_sort,id,1,"gallery.asp")

  dim id1,id2
  id1=0
  sql="select top 1 id from gallery where hidden=1 and id<"&id&sqladd&" order by id desc"
  set rs=joekoe_cms.exec(sql,1)
  if not(rs.eof) then
    id1=rs(0)
  end if
  rs.close
  
  if id1=0 then
  	sql="select top 1 id from gallery where hidden=1 and id>"&id&sqladd&" order by id desc"
  	set rs=joekoe_cms.exec(sql,1)
  	if not(rs.eof) then
	    id1=rs(0)
  	end if
  end if
  
  id2=0  
  sql="select top 1 id from gallery where hidden=1 and id>"&id&sqladd&" order by id"
  set rs=joekoe_cms.exec(sql,1)
  if not(rs.eof) then
    id2=rs(0)
  end if
  rs.close

dim picurl1,picurl2
picurl1="#"
picurl2="#"
if id1>0 then picurl1="gallery_slide.asp?id="&id1
if id2>0 then picurl2="gallery_slide.asp?id="&id2

%>
<script language="JavaScript" >
var bw=500
var bh=500
var pic="<%=pic_url(pic,0)%>"
var thisH=600
var thisW=620
function picHW(url)
{
newimg=new Image();　
newimg.src=url
w=newimg.width;
h=newimg.height;
if (w<500)
{
   bw=w　　
   bh=h
  }
  else
  {
s=w/bw
bh=h/s
}
if (bh>500)
{　　
bh=500
s=w/bh
bw=bw/s
}
pic="<a href="+url+" target=_blank><img src="+url+" width="+bw+"  height="+bh+"  border=0 align=center alt='在新窗口中浏览此图片'></a>"

if(450>bh&bh>180){thisH=bh+150};
if(bw>180){thisW=bw+40};
if(bh<180){thisH=300};
}
</script>
<script src="resizewin.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
picHW(pic);
dolion = new resizeWin(thisW,thisH);
dolion.stayCentered();
//-->
</script> 
<%
if id1>0 then
  call turn_url(picurl1)
end if

call web_js()
%>

<BODY topmargin=0 leftmargin=0 onresize="dolion.onResize()"><center>

<table cellspacing=1 cellpadding=4 width='98%' align=center bgcolor='#FFFFFF'>
<tr><td align=center><%response.write joekoe_cms.code_html(name,1,0)%></b></td></tr>
<tr><td align=center>
<script language="javascript">document.write(pic);</script>
</td></tr>
<tr><td align=center><img src="yjcity_tm/tm/slideMenu.gif" border="0" usemap="#slideMap">
</td></tr>
</table>
    <map name="slideMap" id="slideMap">
      <area shape="circle" coords="27,25,10" href="<%=picurl2%>" alt="上一帧">
      <area shape="circle" coords="58,25,10" href="javascript:startstop();" alt="开始幻灯片播放">
      <area shape="circle" coords="89,25,10" href="javascript:startstop();" alt="停止幻灯片播放">
      <area shape="circle" coords="119,25,10" href="gallery_view.asp?types=paste&id=<%=id%>" target="_blank" alt="详细浏览">
      <area shape="circle" coords="150,25,10" href="<%=pic_url(pic,0)%>" target="_blank" alt="浏览大图">
      <area shape="circle" coords="181,25,10" href="<%=picurl1%>" alt="下一帧">
    </map>
<%
call joekoe_cms.exec("update gallery set counter=counter+1 where id="&id,0)
'----------------------------中间 结束----------------------------
call web_copy()
response.write "</center></body></html>"
call web_clears(1)


sub turn_url(url)
%>
<SCRIPT language=JavaScript><!--
// Copyright 2001

function go(what) {
  value = what.options[what.selectedIndex].value;
  if (value == "") return;
  window.location.href = value;
}

var SecondsLeft = 5;
var Running = true;
var ShowStatus = true;
var OldStatus = "";

function Stat(StatusText) {
  if ((OldStatus == "") && (ShowStatus == true)){
    window.status = StatusText;
  }
  else {
    OldStatus = StatusText;
  }
}

function startstop() {
  if (Running == false) {
    Running = true;
  }
  else {
    Running = false;
    Stat("幻灯片停止");
  }
}

function CountDown() {
  if (Running == true) {

    if (SecondsLeft > 0) {
      SecondsLeft--;
    }
    else {
      document.location = "<% response.write url %>";
    }

    if (SecondsLeft == 0) {
      Stat("下一页将自动导入在 " + (SecondsLeft + 1) + " 秒");
    }
    else {
      Stat("下一页将自动导入在 " + (SecondsLeft + 1) + " 秒");
    }
  }

  setTimeout("CountDown()",1000);
}

function PageLoaded() {
  CountDown();
  dolion.initWin();
}
window.onload=PageLoaded;
//-->
</SCRIPT>
<%
end sub
%>