"use strict";

function on_body_load (e) {
	if (screen.orientation.type.substring (0,9) == "landscape") {
		pan1_pan2.addEventListener("mousedown", resizePan1Pan2);
		src_doc.addEventListener("mousedown", resizeSrcDoc);
	}
}

function resizePan1Pan2 (e) {
	function resize (e) { pan1.style.flexBasis = event.clientX + "px"; }
	function end (e) {
		document.body.removeEventListener("mousemove", resize);
		document.body.removeEventListener("mouseup", end);
	}
	document.body.addEventListener("mousemove", resize);
	document.body.addEventListener("mouseup", end);
}

function resizeSrcDoc (e) {
	function resize (e) { src.style.flexBasis = event.clientY + "px"; }
	function end (e) {
		document.body.removeEventListener("mousemove", resize);
		document.body.removeEventListener("mouseup", end);
	}
	document.body.addEventListener("mousemove", resize);
	document.body.addEventListener("mouseup", end);
}
