<?
$pars = $_GET;
$file = fopen("admin/webconfig/makehtml.txt","r");
$makehtml = fgetss($file);
fclose($file);

if ($makehtml == 1)
{
	if (file_exists(realpath("EMS_ShowPicture".$pars["id"].$pars["bid"].$pars["sid"].$pars["tid"].$pars["fid"].".html")))
	{
		header("Location:"."EMS_ShowPicture".$pars["id"].$pars["bid"].$pars["sid"].$pars["tid"].$pars["fid"].".html");
		exit();
	}

}

?>
<?php include_once "EMS_Top.php";?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"  bgcolor="#FFFFFF" style="padding-top:10px; padding-bottom:10px;">
  <tr>
    <td width="200" valign="top" style="padding-left:5px;"><?php include_once("EMS_Left.php");?></td>
    <td width="780" valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #a1d0ec;">
      <tr>
        <td><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/appimages/news_bg.jpg">
          <tr>
            <td width="4%" height="34" style="padding-left:20px; font-size:12px; font-weight:bold; color:#43a6df"><img src="images/appimages/home.jpg" width="19" height="17" /></td>
            <td width="11%" align="left" style="padding-left:5px; font-size:12px; font-weight:bold; color:#43a6df"><?php echo Sublm($pars,0);?></td>
            <td width="85%" align="right" style=" padding-right:20px; font-size:12px;color:#43a6df">您的位置：
              <?php Sublm($pars["bid"],1); ?>
              <?php Sublm($pars["sid"],1); ?>
              <?php Sublm($pars["tid"],1); ?>
              <?php Sublm($pars["fid"],1); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php
		 

    $con_query = mysql_query("select * from `web_picture` where bid=".$pars["bid"]." and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"]." and id=".$pars["id"]);
	while ($con_rs = mysql_fetch_array($con_query))
	 {
		 
		 if (substr($pro_config,0,1) == 0)
		   {
	?>
          <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="40" align="center" style="font-size:14px; font-weight:bold;"><?php echo $con_rs["title"];?></td>
            </tr>
          </table>
          <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td  align="center" style="color:#666; font-size:12px;">
                <div id=article><?php
                    if ($con_rs["pic"] == NULL)
					{
						?>
                        <div id=article><img src="images/null.gif" /></div>
                        <?php
					}
					else
					{
					  ?>
                       <div id=article><img src="<?php echo $con_rs["pic"];?>" /></div>
                      <?php
					}
					?></div>
              </td>
            </tr>
            <tr>
              <td height="28"  align="left" style="color:#666; font-size:12px; border-bottom: 1px #999 dashed;">
                详细介绍:
              </td>
            </tr>
            <tr>
              <td><table width="95%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td style="line-height:25px; font-size:12px;"><?php echo $con_rs["content"];?></td>
                </tr>
              </table></td>
            </tr>
          </table>
          <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" style="font-size:12px;">
            <tr>
              <td height="40">上一篇:
                <?php GetArt($con_rs["sort"]+1,"web_picture","EMS_ShowPicture.php",$pars)?></td>
              <td align="right">下一篇:
                <?php GetArt($con_rs["sort"]-1,"web_picture","EMS_ShowPicture.php",$pars)?></td>
            </tr>
          </table>
          
          <?php
          if ($con_rs["comment"] == 1)
		   {
		  ?>
          <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><?php include_once "EMS_Comment.php";?></td>
            </tr>
          </table>
          <?php
		   }
		  ?>
          <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table>
          
          <?php
		   }
	 }
	 ?>
		  </td>
      </tr>
    </table></td>
  </tr>
</table>
    </td>
  </tr>
</table>

<script type="text/javascript" > 
 
//缩放图片到合适大小
function ResizeImages()
{
   var myimg,oldwidth,oldheight;
   var maxwidth=550;
   var maxheight=880
   var imgs = document.getElementById('article').getElementsByTagName('img');   //如果你定义的id不是article，请修改此处
 
   for(i=0;i<imgs.length;i++){
     myimg = imgs[i];
 
     if(myimg.width > myimg.height)
     {
         if(myimg.width > maxwidth)
         {
            oldwidth = myimg.width;
            myimg.height = myimg.height * (maxwidth/oldwidth);
            myimg.width = maxwidth;
         }
     }else{
         if(myimg.height > maxheight)
         {
            oldheight = myimg.height;
            myimg.width = myimg.width * (maxheight/oldheight);
            myimg.height = maxheight;
         }
     }
   }
}
//缩放图片到合适大小
ResizeImages();
</script>

<?php
UpdateView($pars["id"],"web_picture")
?>
<?php include_once "EMS_Bottom.php";?>