$(document).ready(function() {
	var picWidth = $(window).width() - 240;
	$("#middlediv").css("width", picWidth);
	$("#main_right").css("width", picWidth);

	var picHeight = $(window).height() - 30;
	$("#main_right").css("height", picHeight);

	var treeHeight = $(window).height() - 65;
	$("#tree").css("min-height", treeHeight);
	$("#tree").css("max-height", treeHeight);
	document.getElementById("main_right").src = "offwtqs";
	$("#middlesrc").val('offwtqs');
})

$('#offwtqs').click(function() {
	document.getElementById("main_right").src = "offwtqs";
	$("#middlesrc").val('offwtqs');
})

$('#offxbpp').click(function() {
	document.getElementById("main_right").src = "offxbpp";
	$("#middlesrc").val('offxbpp');
})

$('#offword').click(function() {
	document.getElementById("main_right").src = "offword";
	$("#middlesrc").val('offword');
})

$("#pointInfo").click(function(){
	var lineIndex = $("#lineIndex").val();
	preInfo(lineIndex);
})

function preInfo(indexdd) {
    layer.open({
        type: 2,
        title: '监测点详情',
        maxmin: false,
        shadeClose: true, // 点击遮罩关闭层
        area: ['65%', '60%'],
        content: 'pointInfo',
        scrollbar: false,
        success: function (layero, index) {
            $(layero).find("iframe")[0].contentWindow.getPointData(indexdd);
        }
    });
}

function offlineTree() {
	getData();
	zTreeOnAsyncSuccess();
}

function yearTree() {
	getyearData();
	zTreeOnAsyncSuccess();
}

function loadtypeTree() {
	gettypeData();
	zTreeOnAsyncSuccess();
}