// 
var ELEMENT_ID_FRAME = "workspace";
var ELEMENT_ID_IMAGE = "frameAdjuster";
// 
var frameStatus = 0;
var frameCols = new Array("0,*", "200,*");
var frameTitles = new Array("画面を広げる", "元に戻す");
var frameImages = new Array(
	new Array(
		"images/left_off.gif",
		"images/left_on.gif"),
	new Array(
		"images/return_off.gif",
		"images/return_on.gif"));
// 
function doInitFrame(cols) {
	// 
	var obj = document.getElementById(ELEMENT_ID_FRAME);
    if (obj == null) {
        return;
    }
	// 
	frameStatus = 0;
	frameCols[1] = cols;
	// 
	var img = document.getElementById(ELEMENT_ID_IMAGE);
    if (img == null) {
        return;
    }
	img.title = frameTitles[frameStatus];
    img.src = frameImages[frameStatus][0];
	// 
    if (obj.cols != cols) {
		doAdjustFrame(cols);
	}
}
// 
function doChangeFrameImage(index) {
	// 
	var img = document.getElementById(ELEMENT_ID_IMAGE);
    if (img == null) {
        return;
    }
    img.src = frameImages[frameStatus][index];
}
// 
function doAdjustFrame(cols) {
	// 
	var obj = top.workspace.document.getElementById(ELEMENT_ID_FRAME);
	if (obj == null) {
		return;
   	}
	if (cols != null) {
	   	obj.cols = cols;
		return;
	}
   	obj.cols = frameCols[frameStatus];
	frameStatus = 1 - frameStatus;
	// 
	var img = document.getElementById(ELEMENT_ID_IMAGE);
 	if (img == null) {
       	return;
   	}
   	img.title = frameTitles[frameStatus];
   	img.src = frameImages[frameStatus][1];
}
