function OpenWindow(url,bb,hh) {
var win;
if (hh >screen.height) hh=hh/2;
if (bb >screen.width) bb=bb/2;
b=0;b+=bb+40;h=0;h+=hh+40;
text = "width=";text += b.toString();
text += ",height=";
text+= h.toString();
text+=",resizable=1,status=0,scrollbars=1"
win =window.open(url,"",text);
}

function PopupMessage(msg) {
	OpenWindow("/msgbox.php/?msg="+msg, 300,150);
}

function PopupMessage64(msg) {
	OpenWindow("/msgbox.php/?msg64="+msg, 300,150);
}

function confirmClick(question, url) {
  if (confirm(question)) {
    document.location.href = url;
    return false;
  }
}

function show(id) {
element=document.getElementById(id);
if (element)
	element.style.visibility = 'visible';
}

function hide(id) {
element=document.getElementById(id);
if (element)
	element.style.visibility = 'hidden';
}

function hide_boolean_checked(check, depid) {
checkbox=document.getElementById(check);
	if (checkbox.checked) {
		hide(depid);		
	} else {
		show(depid);
	}
}

function show_boolean_checked(check, depid) {
checkbox=document.getElementById(check);
	if (checkbox.checked) {
		show(depid);		
	} else {
		hide(depid);
	}
}

function mail(name, domain, params)
{
	var at_="@";
	var fat_="(at)";
	document.write('<a href="mailto:'+name+at_+domain+params+'">'+name+fat_+domain+'</a>');
}

function mail_link(name, domain, params, link)
{
	var at_="@";
	document.write('<a href="mailto:'+name+at_+domain+params+'">'+link+'</a>');
}

function set_parent_fields(myform,kfield,ifield, key, id, close) {
        window.opener.document[myform][kfield].value = key;
        window.opener.document[myform][ifield].value = id;
        if (close) window.close();
}


