<!--
function SelectAll()
{
	var form = document.List;
	if (form.allbox.checked == true) {
		form.allbox.checked = false;
	}
	else {
		form.allbox.checked = true;
	}
	CheckAll();
}
function IsSel(){
	var form = document.List;
	var selected = null;
	for(var i=0; i<form.elements.length; i++){
		if(form.elements[i].type == "checkbox"){
			if((form.elements[i].name.substr(0,4) == "sel_") && (form.elements[i].checked)){
				selected = form.elements[i].name.substring(4,form.elements[i].name.length);
				break;
			}
		}
	}
	return selected;
}
function refresh_init(){
	if (r>0)
		setTimeout("refresh()",eval(r + "000"))
	return;
}
function refresh()
{
	var form = document.List;
	form.cmd.value = "reload_mail";
	form.submit();
}
function redirectx()
{
	var form = document.List;
	var sel;
	sel = IsSel();
	if(sel != null){
		form.cmd.value = "forwardsel";
		form.page.value = "redirect";
		form.submit();
	}else{
		alert(x_redirect);
	}
}

function del()
{
	var form = document.List;
	var sel;
	sel = IsSel();
	if(sel != null){
		form.cmd.value = "delsel";
		form.submit();
	}else{
		alert(x_delete);
	}
}

function movesel_y(fld)
{
	var form = document.List;
	var sel;
	sel = IsSel();
	if(sel != null){
		form.dstfld.value = fld;
		form.cmd.value = "movesel";
		form.submit();
	}else{
		alert(x_move);
		for(var i=0; i<form.elements.length; i++){
			if(form.elements[i].name == "fld_move"){
				form.elements[i][0].selected = true;
			}
		}
	}
}

function replysel(){
	var form = document.List;
	var sel = null;

	for(var i=0; i<form.elements.length; i++){
		if(form.elements[i].type == "checkbox"){
			if((form.elements[i].name.substr(0,4) == "sel_") && (form.elements[i].checked)){
				if (sel == null){
					sel = form.elements[i].name.substring(4,form.elements[i].name.length);
				}
				else{
					alert(x_reply2);
					return;
				}
			}
		}
	}
	if(sel != null){
		form.cmd.value = "msg_reply-"+sel;
		form.submit();
	}else{
		alert(x_reply);
	}
}

function resendsel(){
	var form = document.List;
	var sel;
	sel = IsSel();
	if(sel != null){
		form.cmd.value = "forward_edit-"+sel;
		form.resend.value = "true";
		form.submit();
	}else{
		alert(x_resend);
	}
}

function forward(){
	var form = document.List;
	var selected = null;

	for(var i=0; i<form.elements.length; i++){
		if(form.elements[i].type == "checkbox"){
			if((form.elements[i].name.substr(0,4) == "sel_") && (form.elements[i].checked)){
				if (selected == null){
					selected = form.elements[i].name.substring(4,form.elements[i].name.length);
				}
				else{
					form.cmd.value = "forwardsel";
					form.submit();
					return;
				}
			}
		}
	}

	if(selected != null){
		if (one_fwd.length)
			form.cmd.value = "forward-"+selected;
		else
			form.cmd.value = "forward_edit-"+selected;
		form.submit();
	}else{
		alert(x_fwd);
	}
}

function CheckAll()
{
	var form = document.List;
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'allbox')
			e.checked = form.allbox.checked;
	}
}
function getUID(){
	var now = new Date();
	var rnd = Math.random() + "";
	rnd = rnd.substring(0, rnd.indexOf('.')) + rnd.substring(rnd.indexOf('.')+1,rnd.length);
	return now.getMilliseconds() + "_" + rnd;
}
function I(i){
	if (iw){
		if(document.all) {
			innerWidth = document.body.offsetWidth;
		}
		if(innerWidth > 800){
			var width=850;
			var height=550;
			var left=80;
			var top=60;
		}
		else{
			var width=788;
			var height=480;
			var left=0;
			var top=10;
		}
		var str = "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,status=0,menubar=yes,scrollbars=yes,resizable=1,left=" + left + ",top=" + top;
		var winname = "item_" + getUID();
		var url = act+"item-"+i+ut+fld+"&_item_window=true&require_lock=true&java_email=true";
		var win = open(url, winname, str, 'POPUP');
		if (win.opener == null) win.opener = self;
		win.focus();
	}
	else
		G("item-"+i+"&require_lock=true&java_email=true");
}
-->