<!---
// Javascript code for moving Divs
// -------------------------------
var dragy,dragx=false;
var display_mode = 0;
var screenx, screeny;

var x = 170;
var y = 250;

var minx = 120, maxx = 200;
var miny = 230, maxy = 250;

var offset = 0;

function resize_screen()
{
	document.body.style.overflow='hidden';

	screenx = document.body.clientWidth-2;
	screeny = document.body.clientHeight-4;
	maxy = screeny-100;
	maxx = screenx-200;

        set_x_bar();
	set_y_bar();
}

function mouse_down(mx)
{
	document.getElementById("hiddendiv").style.display="";
	if (mx=="x") {
		dragx=true;
		document.getElementById("hiddendiv").style.cursor="w-resize";
	}
	else	{
		dragy=true;
		document.getElementById("hiddendiv").style.cursor="s-resize";
	}
}

function mouse_up()
{
	dragx=dragy=false;
	document.getElementById("hiddendiv").style.display="none";
}

function mouse_move(e)
{
	if (dragx) {
		if (!e) Pos = window.event.clientX;
		else 	Pos = e.pageX;

		if (Pos < minx)	Pos = minx;
		if (Pos > maxx) Pos = maxx;

		x= Pos-2;
		set_x_bar();
		set_y_bar();
	}
	else if (dragy) {
		if (!e) Pos = window.event.clientY;
		else 	Pos = e.pageY;

		if (Pos < miny) Pos = miny;
	        if (Pos > maxy)	Pos = maxy;

		y = Pos-2;
		set_y_bar();
	}
}

function set_x_bar()
{
	document.getElementById("hiddendiv").style.width = (screenx-offset) +"px";

	document.getElementById("xldap_books_menu").style.left = "3px";
	document.getElementById("ldap_books").style.left = "3px";


	document.getElementById("xldap_books_menu").style.width = (174-6+offset) +"px";
	document.getElementById("ldap_books").style.width = (174-6+offset) +"px";

	document.getElementById("ldap_select").style.left = "3px";
	document.getElementById("ldap_select").style.width = (screenx-3-1) +"px";

	x = "178px";
	document.getElementById("ldap_book_menu").style.left = x;
	document.getElementById("ldap_book").style.left = x;

	document.getElementById("ldap_entries_menu").style.left = x;
	document.getElementById("ldap_entries").style.left = x;

	document.getElementById("ldap_book").style.width = "240px";

	x = "419px";
	document.getElementById("ldap_book_sec").style.left = x;
	document.getElementById("ldap_book_select").style.left = x;

	x = (screenx-178-240-4) +"px";
	document.getElementById("ldap_book_sec").style.width = x;
	document.getElementById("ldap_book_select").style.width = x;

	x = (screenx-178-3) +"px";
	document.getElementById("ldap_book_menu").style.width = x;
	document.getElementById("ldap_entries_menu").style.width = x;
	document.getElementById("ldap_entries").style.width = x;
}

function set_y_bar()
{
	document.getElementById("hiddendiv").style.height = (screeny-offset) +"px";

	document.getElementById("xldap_books_menu").style.top = "3px";
	document.getElementById("xldap_books_menu").style.height = "17px";
	document.getElementById("ldap_books").style.height = (screeny-17-21-3+offset) +"px";

	document.getElementById("ldap_book_sec").style.height = (100-offset) +"px";
	document.getElementById("ldap_book_select").style.top = "121px";

	document.getElementById("ldap_book").style.height = (121-offset) +"px";

	document.getElementById("ldap_entries").style.height = (screeny-121-21-17-21-3-offset) +"px";

	document.getElementById("ldap_select").style.top = (screeny-20+offset) +"px";
}

// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------

// Change Screen to display in selected mode:
// 0 - Standard Display

function set_display_mode(mode)
{
	if (display_mode == mode)
		return ;

	display_mode = mode;
	set_x_bar();
	set_y_bar();		
}

// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------

// -->

