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

var x = 200;
var y = 250;

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

var offset = 0;

function resize_screen()
{
// Remove out since this causes netscape to crash
//	document.body.style.overflow='hidden';  

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

        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("config_menu").style.width = (x) +"px";

	dx = (x+2) +"px";
	document.getElementById("config_profile").style.left = dx;
	document.getElementById("config_frame").style.left = dx;

	document.getElementById("config_address").style.left = dx;
	document.getElementById("config_list").style.left = dx;
	document.getElementById("config_spam").style.left = dx;
	document.getElementById("config_trust").style.left = dx;

	dx = (screenx-x-2+offset) +"px";
	document.getElementById("config_profile").style.width = dx
	document.getElementById("config_frame").style.width = dx;

	document.getElementById("config_address").style.width = dx;
	document.getElementById("config_list").style.width = dx;
	document.getElementById("config_spam").style.width = dx;
	document.getElementById("config_trust").style.width = dx;
}

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

	dx = (screeny+2-offset) +"px";
	document.getElementById("config_menu").style.height = dx;
	document.getElementById("config_profile").style.height = dx;
	document.getElementById("config_frame").style.height = dx;

	document.getElementById("config_address").style.height = dx;
	document.getElementById("config_list").style.height = dx;
	document.getElementById("config_spam").style.height = dx;
	document.getElementById("config_trust").style.height = dx;
}

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

// Change Screen to display in selected mode:
// 0 - Your Details
// 10 - Signatures
// 20 - Change Password
// 22 - Spam Control

// 30 - Message Settings
// 40 - Redirect/Auto Reply (Holiday Settings)
// 50 - Aliases
// 60 - SMS Message
// 70 - Archiving

// 80 - Friends Settings
// 90 - Sever Spam Settings
// 100 - Filter Rules
// 110 - Exceptions (SurgeMail)
// 120 - WebMail Exceptions (WebMail Spam)

// 130 - Check Other EMail Accounts
// 140 - Centpaid
// 150 - PGP Profile
// 160 - Global Address Book

// 200 - SurgePlus
// 210 - SPF
// 220 - POP Folder Conversion
// 250 - DBabble


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

	display_mode = mode;

	if (display_mode == 0) {	// Your Details
		document.getElementById("config_menu").style.visibility = 'visible';
		document.getElementById("config_profile").style.visibility = 'visible';
		document.getElementById("config_frame").style.visibility = 'hidden';
	
		document.getElementById("config_address").style.visibility = 'hidden';
		document.getElementById("config_list").style.visibility = 'hidden';
		document.getElementById("config_spam").style.visibility = 'hidden';
		document.getElementById("config_trust").style.visibility = 'hidden';
	}
	else if (display_mode == 160) {	// Global Address Book
		document.getElementById("config_profile").style.visibility = 'hidden';
		document.getElementById("config_frame").style.visibility = 'hidden';
	
		document.getElementById("config_address").style.visibility = 'visible';
		document.getElementById("config_list").style.visibility = 'hidden';
		document.getElementById("config_spam").style.visibility = 'hidden';
		document.getElementById("config_trust").style.visibility = 'hidden';
	}
	else if (display_mode == 30) {	// Message Settings
		document.getElementById("config_profile").style.visibility = 'hidden';
		document.getElementById("config_frame").style.visibility = 'hidden';
	
		document.getElementById("config_address").style.visibility = 'hidden';
		document.getElementById("config_list").style.visibility = 'visible';
		document.getElementById("config_spam").style.visibility = 'hidden';
		document.getElementById("config_trust").style.visibility = 'hidden';
	}
	else if (display_mode == 25) {	// Trusted Site Settings
		document.getElementById("config_profile").style.visibility = 'hidden';
		document.getElementById("config_frame").style.visibility = 'hidden';
	
		document.getElementById("config_address").style.visibility = 'hidden';
		document.getElementById("config_list").style.visibility = 'hidden';
		document.getElementById("config_spam").style.visibility = 'hidden';
		document.getElementById("config_trust").style.visibility = 'visible';
	}

	else if (display_mode == 120) { // WebMail Exceptions (WebMail Spam)
		document.getElementById("config_profile").style.visibility = 'hidden';
		document.getElementById("config_frame").style.visibility = 'hidden';
	
		document.getElementById("config_address").style.visibility = 'hidden';
		document.getElementById("config_list").style.visibility = 'hidden';
		document.getElementById("config_spam").style.visibility = 'visible';
		document.getElementById("config_trust").style.visibility = 'hidden';
	}
/* Frame display */
	else {
		document.getElementById("config_profile").style.visibility = 'hidden';
		document.getElementById("config_frame").style.visibility = 'visible';
	
		document.getElementById("config_address").style.visibility = 'hidden';
		document.getElementById("config_list").style.visibility = 'hidden';
		document.getElementById("config_spam").style.visibility = 'hidden';
		document.getElementById("config_trust").style.visibility = 'hidden';
	}
	

	set_x_bar();
	set_y_bar();		
}

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

// -->
