function MapTabPanel(){}

//tab增加
MapTabPanel.initMainMenu= function(menuList,selectedlist){
  var tabArr = menuList;
  if(tabArr && tabArr.length){
	  $("#main-tab").tabs({
			onSelect:function(title,index){
				var panel =  $("#main-tab").tabs('getSelected')
				var id  = panel.panel("options").id;
				!panel.html() && panel.html('<iframe scrolling="auto" frameborder="0" id="iframe-'+ id +'" src="../szmap/business/base/item/iframe/'+ id +'-frame.jsp" style="width:100%;height:100%;"></iframe>')
			}
		});

		for(var i = 0;i<tabArr.length;i++){
		    $("#main-tab").tabs("add",{ 
		        title:tabArr[i].title,
		        selected:i==0,
		        border:true,
		        id:tabArr[i].id,
		        fit:true,
		        content:(i>0) ? "" :'<iframe scrolling="auto" frameborder="0" id="iframe-'+ tabArr[i].id +'" src="../szmap/business/base/item/iframe/'+ tabArr[i].id +'-frame.jsp" style="width:100%;height:100%;"></iframe>'
		     });
		 }
  }
  
  //加入所选Tab
  tabArr = selectedlist;
  for(var i = 0;i<selectedlist.length;i++){
	  $("#main-seletedTab").tabs("add",{
	         title:tabArr[i].title,
	         selected:i==0,
	         border:true,
	         id:tabArr[i].id,
	         fit:true,
	         height: "auto" ,
	         content:'<iframe scrolling="auto" frameborder="0" id="'+ tabArr[i].id +'" src="../szmap/business/base/item/iframe/'+ tabArr[i].id +'-frame.jsp" style="width:100%;height:100%;"></iframe>'
	   });
  }
  
}
//左侧收缩/展开切换
MapTabPanel.initMainTabSildeEvent= function(){
     //左侧收缩/展开
    $("#collapseBtn").click(function(){
        var p = $("#main-left").panel("panel")[0].clientHeight;
        if(p>0){
            $('#main-left').panel('collapse');
            $(this).css("left","0");
            $('.menu-rightarrow').css("background-position-x","-32px");
        }  
        else{
            $('#main-left').panel('expand'); 
            $(this).css("left","360px");
            $('.menu-rightarrow').css("background-position-x","-48px");
        }
    });
    //右上按钮行定位
    $("#main-left").panel({
        onCollapse:function(){
            $("#main-top").css({
              "left":"0",
              "width":"calc(100%)"
            });
            $("#leftDiv").css('display','none');
        },
        onExpand:function(){
            $("#main-top").css({
              "left":"360px",
              "width":"calc(100% - 360px)"
            });
            $("#leftDiv").css('display','block');
        }
    });
}