<style type="text/css">

#topNavWrapper {
 width: 100%;
 text-align: left;
 margin: 0px auto;
 z-index:100;
 _position: relative;
 _top:0;
}
#topNav {
 width: 100%;
 float: left;
 display: block;
 z-index: 100;
 overflow: visible;
 position: fixed;
 top: 0px; /* position fixed for IE6 */
 _position: absolute;
 _top: expression(documentElement.scrollTop + "px");
 background: url("images/admintoolbar_bg.gif") repeat-x;

 height: 31px;
}
</style>
<?php if (!defined('IN_CONTEXT')) die('access violation error!'); ?>
<div id="topNavWrapper">
  <ul class="jd_menu" id="topNav">
   <div class="admintoolbar_right">
    	&raquo; <a href="javascript:save_layout();"><?php _e('Save Layout'); ?></a>&nbsp;
        &raquo; <a href="index.php?<?php echo $_SERVER['QUERY_STRING']?$_SERVER['QUERY_STRING'].'&amp;':''; ?>_v=preview" target="_blank" title=""><?php _e('Preview'); ?></a>
        &raquo; <a href="<?php echo Html::uriquery('mod_auth', 'dologout'); ?>" title="<?php _e('Logout') ?>"><?php _e('Logout') ?></a>
    </div>
  </ul>
</div>

<script type="text/javascript" language="javascript">
<!--
    function save_layout() {
        var pos_form = document.forms["SAVE_POS"];
        save_position(pos_form, on_save_pos_success, on_save_pos_failure);
    }
    
    function on_save_pos_success(response) {
        var o_result = _eval_json(response);
        if (!o_result) {
            return on_failure(response);
        }
        
        if (o_result.result == "OK") {
            alert("<?php _e('Layout saved!'); ?>");
            return true;
        } else {
            return on_failure(response);
        }
    }

    function on_save_pos_failure(response) {
        alert("<?php _e('Request failed!'); ?>");
        return false;
    }
    
    function delayHide(jq_obj) {
        setTimeout(
            function() {
                jq_obj.children("div").hide("normal");
            },
            200
        );
    }
    
    function addHoverHide() {
        $("#admintoolbar_nav li").each(
            function() {
                $(this).hover(
	                function(){
	                    $(this).children("div").show("normal");
	                },
	                function(){
	                    delayHide($(this));
	                }
                );
            }
        );
    }
    addHoverHide();
//-->
</script>