<{if $isMine}>
  <script type="text/javascript" src="<{$xoops_url}>/modules/tadtools/jqueryCookie/jquery.cookie.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $("#tad_web_config_tabs").tabs({
        active   : $.cookie('activetab'),
        activate : function( event, ui ){
            $.cookie( 'activetab', ui.newTab.index(),{
                expires : 30
            });
        }
      });
    });
  </script>

  <div id="tad_web_config_tabs">
    <ul>
      <li><a href='#tad_web_config_tab-1'><{$smarty.const._MD_TCW_TOOLS}></a></li>
      <li><a href='#tad_web_config_tab-2'><{$smarty.const._MD_TCW_HEAD_TOOLS}></a></li>
      <li><a href='#tad_web_config_tab-3'><{$smarty.const._MD_TCW_LOGO_TOOLS}></a></li>
      <li><a href='#tad_web_config_tab-4'><{$smarty.const._MD_TCW_BG_TOOLS}></a></li>
      <li><a href='#tad_web_config_tab-5'><{$smarty.const._MD_TCW_COLOR_TOOLS}></a></li>
    </ul>

    <div id='tad_web_config_tab-1'>
      <div class="row">
        <div class="col-md-7">
          <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
            <h3><{$smarty.const._MD_TCW_CLASS_SETUP}></h3>
            <div class="form-group">
              <div class="col-md-10">
                <input type="text" name="WebName" value="<{$WebName}>" id="WebName" class="validate[required] form-control" placeholder="<{$smarty.const._MD_TCW_CLASS_WEB_NAME}>">
              </div>
              <div class="col-md-2">
                <input type="hidden" name="WebID" value="<{$WebID}>">
                <input type="hidden" name="op" value="update_tad_web">
                <button type="submit" class="btn btn-primary pull-right"><{$smarty.const._TAD_SAVE}></button>
              </div>
            </div>
          </form>

          <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
            <h3><{$smarty.const._MD_TCW_UPLOAD_MY_PHOTO}></h3>
            <div class="form-group">
              <div class="col-md-10">
                <{$upform}>
              </div>
              <div class="col-md-2">
                <input type="hidden" name="WebID" value="<{$WebID}>">
                <input type="hidden" name="op" value="update_photo">
                <button type="submit" class="btn btn-primary pull-right"><{$smarty.const._TAD_SAVE}></button>
              </div>
            </div>
          </form>
        </div>
        <div class="col-md-5">
          <{if $teacher_thumb_pic}>
            <img src="<{$teacher_thumb_pic}>" alt="photo" class="img-rounded img-polaroid img-responsive img-thumbnail">
          <{/if}>
        </div>
      </div>

      <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
        <h3>
          <{$smarty.const._MD_TCW_HEAD_TOOLS}>
          <small><{$smarty.const._MD_TCW_SELECT_TO_CANCEL}></small>
        </h3>
        <div class="form-group">
          <div class="col-md-11">
            <{$all_functions}>
          </div>
          <div class="col-md-1">
            <input type="hidden" name="WebID" value="<{$WebID}>">
            <input type="hidden" name="op" value="save_hide_function">
            <button type="submit" class="btn btn-primary pull-right"><{$smarty.const._TAD_SAVE}></button>
          </div>
        </div>
      </form>
    </div>

    <div id='tad_web_config_tab-2'>

      <div class="row">
        <div class="col-md-12">
          <script language="JavaScript">
            $().ready(function(){
              $(".thumb").click(function(){
                var bg=$(this).attr("id");
                $("#head_bg").attr("src","<{$xoops_url}>/uploads/tad_web/<{$WebID}>/head/"+bg);
                $.post("config.php", {op: "save_head" , filename: bg});
              });
            });
          </script>

          <h3>
            <{$smarty.const._MD_TCW_HEAD_TOOLS}>
            <small>
              <{$smarty.const._MD_TCW_CLICK_TO_CHANG}>
            </small>
          </h3>

          <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
            <div class="form-group">
              <div class="col-md-12">
                <{$upform_head}>
              </div>
            </div>

            <div class="form-group">
              <div class="col-md-12">
                <{if $all_head}>
                  <{foreach from=$all_head item=head}>
                    <div style="width:100px; height:96px; display:inline-block; margin:4px;">
                      <a href="#top">
                        <label style="width: 100px; height: 70px; background: #000000 url('<{$head.tb_path}>') center center no-repeat; border: 1px solid gray; background-size: contain;" id="<{$head.file_name}>" class="thumb">
                        </label>
                      </a>

                      <label class="del_img_box" style="font-size:12px;" id="del_img<{$head.files_sn}>">
                        <input type="checkbox" value="<{$head.files_sn}>" name="del_file[<{$head.files_sn}>]"> <{$smarty.const._TAD_DEL}>
                      </label>
                    </div>
                  <{/foreach}>
                <{/if}>
              </div>
            </div>

            <div class="text-center">
              <input type="hidden" name="WebID" value="<{$WebID}>">
              <input type="hidden" name="op" value="upload_head">
              <button type="submit" class="btn btn-primary"><{$smarty.const._TAD_SAVE}></button>
            </div>
          </form>
        </div>
      </div>
    </div>

    <div id='tad_web_config_tab-3'>

      <div class="row">
        <div class="col-md-12">
          <script language="JavaScript">
            $().ready(function(){
              $(".logo_thumb").click(function(){
                var logo=$(this).attr("id");
                $("#tad_web_logo").attr("src","<{$xoops_url}>/uploads/tad_web/<{$WebID}>/logo/"+logo);
                $.post("config.php", {op: "save_logo_pic" , filename: logo});
              });
            });
          </script>

          <h3>
            <{$smarty.const._MD_TCW_LOGO_TOOLS}>
            <small>
              <{$smarty.const._MD_TCW_CLICK_TO_CHANG}>
            </small>
          </h3>
          <div class="alert alert-info">
            <{$smarty.const._MD_TCW_GOOD_LOGO_SITE}>
          </div>

          <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
            <div class="form-group">
              <div class="col-md-12">
                <{$upform_logo}>
              </div>
            </div>

            <div class="form-group">
              <div class="col-md-12">
                <{if $all_logo}>
                  <{foreach from=$all_logo item=logo}>
                    <div style="width:150px; height:76px; display:inline-block; margin:4px;">
                      <a href="#top">
                        <label style="width: 150px; height: 50px; background: #000000 url('<{$logo.tb_path}>') center center no-repeat; border: 1px solid gray; background-size: contain;" id="<{$logo.file_name}>" class="logo_thumb">
                        </label>
                      </a>

                      <label class="del_img_box" style="font-size:12px;" id="del_img<{$logo.files_sn}>">
                        <input type="checkbox" value="<{$logo.files_sn}>" name="del_file[<{$logo.files_sn}>]"> <{$smarty.const._TAD_DEL}>
                      </label>
                    </div>
                  <{/foreach}>
                <{/if}>
              </div>
            </div>

            <div class="text-center">
              <input type="hidden" name="WebID" value="<{$WebID}>">
              <input type="hidden" name="op" value="upload_logo">
              <button type="submit" class="btn btn-primary"><{$smarty.const._TAD_SAVE}></button>
            </div>
          </form>
        </div>
      </div>
    </div>



    <div id='tad_web_config_tab-4'>

      <div class="row">
        <div class="col-md-12">
          <script language="JavaScript">
            $().ready(function(){
              $(".bg_thumb").click(function(){
                var bg=$(this).attr("id");
                if(bg=="none"){
                  $("body").css("background-image","none");
                  $.post("config.php", {op: "save_bg" , filename: ''});
                }else{
                  $("body").css("background-image","url('<{$xoops_url}>/uploads/tad_web/<{$WebID}>/bg/"+bg+"')");
                  $(this).css("border","2px solid blue");
                  $.post("config.php", {op: "save_bg" , filename: bg});
                }
              });
            });
          </script>

          <h3>
            <{$smarty.const._MD_TCW_BG_TOOLS}>
            <small>
              <{$smarty.const._MD_TCW_CLICK_TO_CHANG}>
            </small>
          </h3>
          <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
            <div class="form-group">
              <div class="col-md-12">
                <{$upform_bg}>
              </div>
            </div>

            <div class="form-group">
              <div class="col-md-12">
                <div style="width:100px; height:96px; display:inline-block; margin:4px;">
                  <label style="width: 80px; height: 80px; background: <{$bg_color}>; border: 1px solid gray; background-size: contain;" id="none" class="bg_thumb">
                  </label>

                  <label class="del_img_box" style="font-size:12px;" id="del_img<{$bg.files_sn}>">
                    <{$smarty.const._MD_TCW_CONFIG_NONE_BG}>
                  </label>
                </div>
                <{if $all_bg}>
                  <{foreach from=$all_bg item=bg}>
                    <div style="width:100px; height:96px; display:inline-block; margin:4px;">
                      <label style="width: 80px; height: 80px; background: #000000 url('<{$bg.tb_path}>') center center no-repeat; border: <{if $bg.file_name == $web_bg}>2px solid red<{else}>1px solid gray<{/if}>; background-size: contain;" id="<{$bg.file_name}>" class="bg_thumb">
                      </label>

                      <label class="del_img_box" style="font-size:12px;" id="del_img<{$bg.files_sn}>">
                        <input type="checkbox" value="<{$bg.files_sn}>" name="del_file[<{$bg.files_sn}>]"> <{$smarty.const._TAD_DEL}>
                      </label>
                    </div>
                  <{/foreach}>
                <{/if}>
              </div>
            </div>

            <div class="text-center">
              <input type="hidden" name="WebID" value="<{$WebID}>">
              <input type="hidden" name="op" value="upload_bg">
              <button type="submit" class="btn btn-primary"><{$smarty.const._TAD_SAVE}></button>
            </div>
          </form>
        </div>
      </div>
    </div>



    <div id='tad_web_config_tab-5'>
      <{$mColorPicker_code}>
      <div class="row">
        <div class="col-md-12">
          <script language="JavaScript">
            function change_color(selector,css_name,css_val){
              $(selector).css(css_name,css_val);
            }
            function save_color(col){
                $.post("config.php", {op: "save_color" , col_name: $(col).attr('id'), col_val: $(col).val()});
            }

            $(document).ready(function () {
              $('#container_bg_color').bind('colorpicked', function () {
                save_color(this);
              });
              $('#bg_color').bind('colorpicked', function () {
                save_color(this);
              });
              $('#navbar_bg_top').bind('colorpicked', function () {
                save_color(this);
              });
              $('#navbar_color').bind('colorpicked', function () {
                save_color(this);
              });
              $('#navbar_hover').bind('colorpicked', function () {
                save_color(this);
              });
              $('#navbar_color_hover').bind('colorpicked', function () {
                save_color(this);
              });

            });
          </script>

          <h3>
            <{$smarty.const._MD_TCW_COLOR_TOOLS}>
            <small>
              <{$smarty.const._MD_TCW_CLICK_TO_CHANG}>
            </small>
          </h3>
          <form action="config.php" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
            <div class="form-group">
              <label class="col-md-2 control-label">
                <{$smarty.const._MD_TCW_MAIN_NAV_TOP_COLOR}>
              </label>
              <div class="col-md-2">
                <input type="text" name="color_setup[navbar_bg_top]" class="form-control color" value="<{$navbar_bg_top}>" id="navbar_bg_top" data-text="true" data-hex="true" onChange="change_color('#tad_web_nav,.sf-menu li','background-color',this.value);" style="width:80px; display: inline-block;">
              </div>
              <div class="col-md-2">
                <{$smarty.const._MD_TCW_MAIN_DEFAULT_COLOR}>: <{$navbar_bg_top}>
              </div>

              <label class="col-md-2 control-label">
                <{$smarty.const._MD_TCW_MAIN_NAV_COLOR}>
              </label>
              <div class="col-md-2">
                <input type="text" name="color_setup[navbar_color]" class="form-control color" value="<{$navbar_color}>" id="navbar_color" data-text="true" data-hex="true" onChange="change_color('.sf-menu a','color',this.value);" style="width:80px; display: inline-block;">
              </div>
              <div class="col-md-2">
                <{$smarty.const._MD_TCW_MAIN_DEFAULT_COLOR}>: <{$navbar_color}>
              </div>
            </div>



            <div class="form-group">
              <label class="col-md-2 control-label">
                <{$smarty.const._MD_TCW_MAIN_NAV_HOVER_BG_COLOR}>
              </label>
              <div class="col-md-2">
                <input type="text" name="color_setup[navbar_hover]" class="form-control color" value="<{$navbar_hover}>" id="navbar_hover" data-text="true" data-hex="true" onChange="change_color('.sf-menu li:hover,.sf-menu li.sfHover','background-color',this.value);" style="width:80px; display: inline-block;">
              </div>
              <div class="col-md-2">
                <{$smarty.const._MD_TCW_MAIN_DEFAULT_COLOR}>: <{$navbar_hover}>
              </div>

              <label class="col-md-2 control-label">
                <{$smarty.const._MD_TCW_MAIN_NAV_HOVER_COLOR}>
              </label>
              <div class="col-md-2">
                <input type="text" name="color_setup[navbar_color_hover]" class="form-control color" value="<{$navbar_color_hover}>" id="navbar_color_hover" data-text="true" data-hex="true" onChange="change_color('.sf-menu a:hover','color',this.value);" style="width:80px; display: inline-block;">
              </div>
              <div class="col-md-2">
                <{$smarty.const._MD_TCW_MAIN_DEFAULT_COLOR}>: <{$navbar_color_hover}>
              </div>
            </div>


            <div class="form-group">
              <label class="col-md-2 control-label">
                <{$smarty.const._MD_TCW_CONTAINER_BG_COLOR}>
              </label>
              <div class="col-md-2">
                <input type="text" name="color_setup[container_bg_color]" class="form-control color" value="<{$container_bg_color}>" id="container_bg_color" data-text="true" data-hex="true" onChange="change_color('#container','background-color',this.value);" style="width:80px; display: inline-block;">
              </div>
              <div class="col-md-2">
                <{$smarty.const._MD_TCW_MAIN_DEFAULT_COLOR}>: <{$container_bg_color}>
              </div>

              <label class="col-md-2 control-label">
                <{$smarty.const._MD_TCW_MAIN_BG_COLOR}>
              </label>
              <div class="col-md-2">
                <input type="text" name="color_setup[bg_color]" class="form-control color" value="<{$bg_color}>" id="bg_color" data-text="true" data-hex="true" onChange="change_color('body','background-color',this.value);" style="width:80px; display: inline-block;">
              </div>
              <div class="col-md-2">
                <{$smarty.const._MD_TCW_MAIN_DEFAULT_COLOR}>: <{$bg_color}>
              </div>
            </div>


            <div class="text-center">
              <input type="hidden" name="WebID" value="<{$WebID}>">
              <input type="hidden" name="op" value="save_all_color">
              <button type="submit" class="btn btn-primary"><{$smarty.const._TAD_SAVE}></button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
<{/if}>