<?php
include("../../includes/db.inc.php");
include("../../includes/config.php");
$msql=new SHARP_SQL;
$fsql=new SHARP_SQL;
$msql->query("select * from auto_user where userid='$userid'");
if($msql->next_record()){
$urlname=$msql->f('urlname');
$sitename=$msql->f('sitename');
$ensitename=$msql->f('ensitename');
$name=$msql->f('name');
$email=$msql->f('email');
$tel=$msql->f('tel');
$fax=$msql->f('fax');
$addr=$msql->f('addr');
$zip=$msql->f('zip');
$size1=$msql->f('size1');
$size2=$msql->f('size2');
$intro=$msql->f('intro');
$code=$msql->f('code');
$bannerurl=$msql->f('bannerurl');
$intro=str_replace("\n","<br>",$intro);
}
?>
<HTML>
<HEAD><title><?php echo "$sitename"; ?></title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
<STYLE>HTML {TEXT-DECORATION: none}
A:link {COLOR: #000000; TEXT-DECORATION: none}
A:hover {COLOR: rgb(0,147,43); TEXT-DECORATION: none}
A:active {COLOR: #000000; TEXT-DECORATION: none}
A:visited {COLOR: #000000; TEXT-DECORATION: none}
</STYLE>
</HEAD>
<BODY LEFTMARGIN="0" MARGINWIDTH="0" TOPMARGIN="0" MARGINHEIGHT="0" bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<table width="776" border="0" cellspacing="0" cellpadding="0" align="center" background="images/mod_1.gif">
  <tr> 
    <td height="101" width="258"><img src="images/mod_0.gif" width="279" height="101"></td>
    <td height="101" width="518" valign="top"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr> 
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td height="77"> 
            <div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="468" height="60">
                <param name=movie value="images/Movie1%5B1%5D.swf">
                <param name=quality value=high>
                <embed src="images/Movie1%5B1%5D.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60">
                </embed> 
              </object></div>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="776" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td><img src="images/mod_3.gif" width="776" height="25"></td>
  </tr>
</table>
<table width="776" border="0" cellspacing="0" cellpadding="0" align="center" background="images/mod_4.gif">
  <tr> 
    <td height="12">&nbsp;</td>
  </tr>
  <tr valign="top"> 
    <td height="165"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="23%" height="288" valign="top"> 
            <script language="JavaScript">

NS4 = (document.layers) ? 1 : 0;

IE4 = (document.all) ? 1 : 0;

ver4 = (NS4 || IE4) ? 1 : 0;

if (ver4) {

    with (document) {

        write("<STYLE TYPE='text/css'>");

        if (NS4) {

            write(".parent {position:absolute; visibility:visible}");

            write(".child {position:absolute; visibility:visible}");

            write(".regular {position:absolute; visibility:visible}")

        }

        else {

            write(".child {display:none}")

        }

        write("</STYLE>");

    }

}

function getIndex(el) {

    ind = null;

    for (i=0; i<document.layers.length; i++) {

        whichEl = document.layers[i];

        if (whichEl.id == el) {

            ind = i;

            break;

        }

    }

    return ind;

}

function arrange() {

    nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;

    for (i=firstInd+1; i<document.layers.length; i++) {

        whichEl = document.layers[i];

        if (whichEl.visibility != "hide") {

            whichEl.pageY = nextY;

            nextY += whichEl.document.height;

        }

    }

}

function initIt(){

    if (!ver4) return;

    if (NS4) {

        for (i=0; i<document.layers.length; i++) {

            whichEl = document.layers[i];

            if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";

       }

        arrange();

    }

    else {

        divColl = document.all.tags("DIV");

        for (i=0; i<divColl.length; i++) {

            whichEl = divColl(i);

            if (whichEl.className == "child") whichEl.style.display = "none";

        }

    }

}

function expandIt(el) {

    if (!ver4) return;

    if (IE4) {

        whichEl = eval(el + "Child");

        if (whichEl.style.display == "none") {

            whichEl.style.display = "block";

        }

        else {

            whichEl.style.display = "none";

        }

    }

    else {

        whichEl = eval("document." + el + "Child");

        if (whichEl.visibility == "hide") {

            whichEl.visibility = "show";

        }

        else {

            whichEl.visibility = "hide";

        }

        arrange();

    }

}

onload = initIt;

</script>
            <?php

$msql->query("select * from auto_dir where userid='$userid' and parentid=0 order by xuhao");

$mainnum=1;

while($msql->next_record()){

$dirid=$msql->f('dirid');

$ifson=$msql->f('ifson');

$dirname=$msql->f('dirname');

$mod=$msql->f('mod');

?> 
            <table  id=<?php echo "ta_".$mainnum; ?> width="179" border="0" cellspacing="0" cellpadding="0" background="images/mod_5.gif">
              <tr> 
                <td height="34" align="center" width="33">&nbsp;</td>
                <td height="34"> <?php

if($ifson=='0'){

include("../../includes/dir11.php3");

}elseif($ifson=='1'){

		echo "<div id='KB".$mainnum."Parent' class='parent'><a onMouseOver=\"ta_".$mainnum.".background='images/mod_6.gif';\" onMouseOut=\"ta_".$mainnum.".background='images/mod_5.gif';\" href=# onClick=\"expandIt('KB".$mainnum."'); return false\" >$dirname</a></div>";

}

?> </td>
              </tr>
            </table>
            <?php

echo "<div id='KB".$mainnum."Child' class='child'>";

$fsql->query("select * from auto_dir where parentid='$dirid' order by xuhao");

while($fsql->next_record()){

$dirid=$fsql->f('dirid');

$dirname=$fsql->f('dirname');

$mod=$fsql->f('mod');

?> 
            <table width="179" border="0" cellspacing="0" cellpadding="0" background="images/mod_6.gif">
              <tr> 
                <td height="35" width="33" align="center">&nbsp;</td>
                <td height="35"> <?php

include("../../includes/dir.php3");

?> </td>
              </tr>
            </table>
            <?php

}

echo "</div>";

$mainnum++;

}

?> <br>
            <script language="JavaScript">

if (NS4) {

        firstEl = "KB1Parent";

        firstInd = getIndex(firstEl);

        arrange();

}

</script>
            <table width="100" border="0" cellspacing="4" cellpadding="0" align="center">
              <tr align="center"> 
                <td height="27"> <marquee scrolldelay="60" scrollamount="2"><font color="#FFFFFF"> 
                  </font> </marquee> </td>
              </tr>
              <?php

$msql->query("select * from auto_link where userid='$userid'  order by xuhao");

while($msql->next_record()){

$linkname=$msql->f('linkname');

$mod=$msql->f('mod');

$url=$msql->f('url');

$linkid=$msql->f('linkid');

?> 
              <tr> 
                <td> 
                  <div align="center"><?php

$linkimg="../../link/".$linkid.".jpg";

if(file_exists($linkimg)){

echo "<a href=$url target=_blank><img src=$linkimg border=0 width=88 ></a>"; 

}else{

echo "<a href=$url target=_blank>$linkname</a>"; 

}

?> </div>
                </td>
              </tr>
              <?php

}

?> 
            </table>
            <div align="center"><br>
              <font color="#FF6666"><font face="Courier New, Courier, mono"><font color="#FFFFFF"><font face="Arial Black" color="#FFCC66"><font color="#CCCCCC"><font color="#FFFFFF"> 
              <script src="../../includes/count.php3?userid=<?php echo "$userid"; ?>"></script>
              </font></font></font></font></font></font></div>
          </td>
          <td width="77%" height="288" valign="top"> 
            <table width="100%" border="0" cellspacing="8" cellpadding="0">
              <tr> 
                <td>
                  <table width="100%" border="0" cellspacing="10" cellpadding="0">
                    <tr valign="top"> 
                      <td height="295"> 
                        <p align="center">&nbsp;</p>
                        <form method=post action=../../sendmail.php3>
                          <table width="87%" cellspacing="0" cellpadding="0" align="center">
                            <tr> 
                              <td height="24" width="29%"> 
                                <div align="right"><font size="2">主題(Subject)：</font></div>
                              </td>
                              <td height="24" width="71%"> 
                                <div align="left"> 
                                  <input type="text" name="title" size="40">
                                </div>
                              </td>
                            </tr>
                            <tr> 
                              <td height="82" width="29%" valign="top"> 
                                <div align="right"><font size="2">內容(Message)：</font></div>
                              </td>
                              <td height="82" width="71%" valign="top"> 
                                <div align="left"> 
                                  <textarea name="con" cols="38" rows="8"></textarea>
                                  <input type="hidden" name="step" value="send">
                                  <input type="hidden" name="userid" value="<?php echo "$userid"; ?>">
                                  <input type="hidden" name="email" value="<?php echo "$email"; ?>">
                                </div>
                              </td>
                            </tr>
                            <tr> 
                              <td height="5" width="29%"> 
                                <div align="right"><font size="3"><font size="2"><font size="2">電子郵件(E-mail):</font></font></font></div>
                              </td>
                              <td height="5" width="71%"> 
                                <input type="text" name="frommail" size="40">
                              </td>
                            </tr>
                            <tr> 
                              <td height="28" width="29%"> 
                                <div align="right"><font size="2"><font size="2"></font></font></div>
                              </td>
                              <td height="28" width="71%"> 
                                <input type="submit" name="Submit" value="發送">
                              </td>
                            </tr>
                          </table>
                        </form>
                        <p></p>
                        <font color="#000000"></font></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr align="center"> 
                <td><font color="#333333"><?php echo "$code"; ?></font></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="776" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr bgcolor="#B6B6B6"> 
    <td>&nbsp;</td>
  </tr>
  <tr bgcolor="#000000"> 
    <td height="8"><img src="images/dot.gif" width="11" height="6"></td>
  </tr>
</table>
</BODY>
</HTML>
