$(function(){
//快捷菜单
//bindQuickMenu();
//菜单切换(测试)
bindAdminMenu();
//ChangeNav("common");
//菜单开关
LeftMenuToggle();
//全部功能开关
//AllMenuToggle();
//取消菜单链接虚线
$(".head").find("a").click(function(){
$(this).blur();
});
$(".menu_left").find("a").click(function(){
$(this).blur();
});
}).keydown(function(event){//快捷键
if(event.keyCode ==116 ){
url = $("#main").attr("src");
main.location.href = url;
return false;
}
if(event.keyCode ==27 ){
$("#qucikmenu").slideToggle("fast");
}
});
function bindQuickMenu(){//快捷菜单
$("#ac_qucikmenu").bind("mouseenter",function(){
$("#qucikmenu").slideDown("fast");
}).dblclick(function(){
$("#qucikmenu").slideToggle("fast");
}).bind("mouseleave",function(){
hidequcikmenu=setTimeout('$("#qucikmenu").slideUp("fast");',700);
$(this).bind("mouseenter",function(){clearTimeout(hidequcikmenu);});
});
$("#qucikmenu").bind("mouseleave",function(){
hidequcikmenu=setTimeout('$("#qucikmenu").slideUp("fast");',700);
$(this).bind("mouseenter",function(){clearTimeout(hidequcikmenu);});
}).find("a").click(function(){
$(this).blur();
$("#qucikmenu").slideUp("fast");
$("#ac_qucikmenu").text($(this).text());
});
}
function bindAdminMenu(){
$("#nav").find("a").click(function(){
ChangeNav($(this).attr("_for"));
});
$("#menu_left").find("dt").click(function(){
$(this).closest("dl").siblings("dl").each(function(i,bean){
$(bean).find("dd").slideUp("fast");
});
dt = $(this);
dd = $(this).next("dd");
if(dd.css("display")=="none"){
dd.slideDown("fast");
dt.css("color","#333");
}else{
dd.slideUp("fast");
}
});
$("#menu_left dd ul li a").click(function(){
$(this).addClass("thisclass").blur().parents("#menu_left").find("ul li a").not($(this)).removeClass("thisclass");
});
}
function ChangeNav(nav){//菜单跳转
$("#nav").find("a").removeClass("thisclass");
$("#nav").find("a[_for='"+nav+"']").addClass("thisclass").blur();
$("body").attr("class","showmenu");
$("#menu_left").find("div[id^=items]").hide();
$("#menu_left").find("#items_"+nav).find("dl").each(function(){
$(this).find("dd").hide();
});
$("#menu_left").find("#items_"+nav).find("ul li a").removeClass("thisclass");
$("#menu_left").find("#items_"+nav).show().find("dd ul li a").eq(0).addClass("thisclass").blur();
var dl=$("#menu_left").find("#items_"+nav).find("dl:first");
$(dl).find("dd").css("display","block");
var url=$("#menu_left").find("#items_"+nav).find("dd ul li a.thisclass").attr("href");
if(url==null || url==""){
}else{
$("#menu_left").find("#items_"+nav).show();
$("#main").attr("src",url);
return false;
}
}
function LeftMenuToggle(){
var rw = document.body.clientWidth ;
$(".lr_line").click(function(){
if($("body").attr("class")=="showmenu"){
$("body").attr("class","hidemenu");
$(this).attr("title","隐藏菜单");
$("#menu_left").animate({left:"-198px"});
$(".right").css("left","8px");
$(".right").css("width",parseInt(rw-12));
}else{
$("body").attr("class","showmenu");
$(this).attr("title","显示菜单");
$("#menu_left").animate({left:"5px"});
$(".right").css("left","211px");
$(".right").css("width",parseInt(rw-215));
}
});
};
$(function(){
changeDivHeight();
});
window.onresize=function(){
changeDivHeight();
};
function changeDivHeight(){
var h = document.documentElement.clientHeight;
var w = document.documentElement.clientWidth;
$('.menu_left').height(parseInt(h-110)); //
$('.right').width(parseInt(w-215)); //
$('.right').height(parseInt(h-110)); //
if ((navigator.userAgent.indexOf('MSIE') >= 0)
&& (navigator.userAgent.indexOf('Opera') < 0)){
// alert('你是使用IE');
}else{
// alert('你是使用其他的浏览器浏览网页!');
if(window.frames["main"].document.getElementsByClassName('search_condition').length>0 && window.frames["main"].document.getElementById("t_r_content") && window.frames["main"].document.getElementById("order_bottom") && window.frames["main"].document.getElementsByClassName('scroll_con2').length>0){
// alert("搜索,列表,命令,弹框");
window.frames["main"].document.getElementById('t_r_content').style.height = parseInt(h)-260+'px';
window.frames["main"].document.getElementById('cl_freeze').style.height = parseInt(h)-278+'px';
window.frames["main"].document.getElementById('iff').style.height = parseInt(h)-234+'px';
window.frames["main"].document.getElementById('t_r_content2').style.height = parseInt(h)-300+'px';
window.frames["main"].document.getElementById('cl_freeze2').style.height = parseInt(h)-317+'px';
window.frames["main"].document.getElementById('order_bottom2').style.width = parseInt(w)-171+'px';
}else if(window.frames["main"].document.getElementsByClassName('search_condition').length>0 && window.frames["main"].document.getElementById("t_r_content") && window.frames["main"].document.getElementById("order_bottom")){
// alert("搜索,列表,命令");
window.frames["main"].document.getElementById('t_r_content').style.height = parseInt(h)-260+'px';
window.frames["main"].document.getElementById('cl_freeze').style.height = parseInt(h)-278+'px';
}else if(window.frames["main"].document.getElementsByClassName('search_condition').length>0 && window.frames["main"].document.getElementById("t_r_content") && window.frames["main"].document.getElementsByClassName('scroll_con2').length>0){
// alert("搜索,列表,弹框 ");
window.frames["main"].document.getElementById('t_r_content').style.height = parseInt(h)-231+'px';
window.frames["main"].document.getElementById('cl_freeze').style.height = parseInt(h)-248+'px';
window.frames["main"].document.getElementById('iff').style.height = parseInt(h)-234+'px';
window.frames["main"].document.getElementById('t_r_content2').style.height = parseInt(h)-300+'px';
window.frames["main"].document.getElementById('cl_freeze2').style.height = parseInt(h)-317+'px';
window.frames["main"].document.getElementById('order_bottom2').style.width = parseInt(w)-171+'px';
}else if(window.frames["main"].document.getElementsByClassName('search_condition').length>0 && window.frames["main"].document.getElementById("t_r_content")){
//alert("搜索,列表");
window.frames["main"].document.getElementById('t_r_content').style.height = parseInt(h)-230+'px';
window.frames["main"].document.getElementById('cl_freeze').style.height = parseInt(h)-248+'px';
}else if(window.frames["main"].document.getElementById("t_r_content") && window.frames["main"].document.getElementById("order_bottom")){
//alert("列表,命令");
window.frames["main"].document.getElementById('t_r_content').style.height = parseInt(h)-222+'px';
window.frames["main"].document.getElementById('cl_freeze').style.height = parseInt(h)-229+'px';
}else if(window.frames["main"].document.getElementById("t_r_content")){
//alert("列表");
window.frames["main"].document.getElementById('t_r_content').style.height = parseInt(h)-194+'px';
window.frames["main"].document.getElementById('cl_freeze').style.height = parseInt(h)-203+'px';
}else if(window.frames["main"].document.getElementsByClassName('scroll_con').length>0 && window.frames["main"].document.getElementsByClassName('wrap_left').length>0){
// alert("树 wrap_left");
window.frames["main"].document.getElementById('scroll_con').style.height = parseInt(h)-152+'px';
window.frames["main"].document.getElementById('wrap_left').style.height = parseInt(h)-267+'px';
window.frames["main"].document.getElementById('wrap_right').style.width = parseInt(w)-715+'px';
}else if(window.frames["main"].document.ge