// Version 20041106-01

function activate_link(url) {
	  //alert('document.location = '+ url);
	  document.location = url;
}

function activate_listlink(url, target, extra) {
	if (list_val) {
		//alert(url+'='+list_val);
		myURL = url+'?'+varReghist+'='+list_val+'&reghist='+varReghist;
		if (extra) {
			myURL = myURL+'&'+extra;
		}
		if (target == '_new' && MSIE == 5) {
			newWin = window.open()
			newWin.document.location = myURL;
		} else {
			document.location = myURL;
		}
	} else {
		alert(msgSelect);
	}
}

function set_list_val(elm, val) {
	if (val) {
		if (list_val != val) {
			list_val = val;
			if (listrow_current) {
				reset_row(listrow_current)
			}
			listrow_current = elm;
		}
	}
}

function check_list_val(val) {
	//alert('list_val:'+ list_val + ' val:'+ val);
	if (list_val == val) {
		return(true);
	} else {
		return(false);
	}
}

function reset_row(elm) {
	if (elm) {
		elm.style.backgroundColor = colorListRow[0];
	}
}

function confirm_delete(url) {
	if(list_val) {
		if(confirm(msgDelete)) {
			activate_listlink(url);
		} else {
			return(false);
		}
	} else {
		alert(msgSelect);
		return(false);
	}
}

//
// LISTROW.HTC
//
// listrow :: onmouseclick
function htc_listrow_oMClk(elm, val) {
	set_list_val(elm, val);
}

// listrow :: onmouseout
function htc_listrow_oMOut(elm, val) {
	var clr = colorListRow[0];
	if (!check_list_val(val)) {
		elm.style.backgroundColor = clr;
		elm.style.cursor = 'default';
	}
}

// listrow :: onmouseover
function htc_listrow_oMOvr(elm, val) {
	var clr = colorListRow[1];
	if (!check_list_val(val)) {
		elm.style.backgroundColor = clr;
		elm.style.cursor = 'hand';
	}
}

// listrow :: onmousedown
function htc_listrow_oMDwn(elm, val) {
	var clr = colorListRow[2];
	if (!check_list_val(val)) {
		elm.style.backgroundColor = clr;
	}
}

//
// NAVSUB.HTC
//
function htc_navsub_oMClk(elm, href, target) {
  if (href && href != '#') {
    //if (this.target) {
    //  activate_listlink(href);
    //} else {
      activate_listlink(href, target);
    //}
  }
}

// navsub :: onmouseout
function htc_navsub_oMOut(elm) {
	var clr = colorNavSub[0];
	htc_cbc(elm, clr);
	htc_cur(elm, 'default');
}

// navsub :: onmouseover
function htc_navsub_oMOvr(elm) {
	var clr = colorNavSub[1];
	htc_cbc(elm, clr);
	htc_cur(elm, 'hand');
}

// navsub :: onmousedown
function htc_navsub_oMDwn(elm) {
	var clr = colorNavSub[2];
	htc_cbc(elm, clr);
}

//
// NAVTOOLUP.HTC
//
function htc_navtool_oMOut(elm, status) {
	var clr = (status) ? colorNavTool[0] : colorNavTool[10];
	htc_cbc(elm, clr);
	htc_cur(elm, 'default');
}

function htc_navtool_oMOvr(elm, status) {
	var clr = (status) ? colorNavTool[1] : colorNavTool[11];
	htc_cbc(elm, clr);
	htc_cur(elm, 'hand');
}

function htc_navtool_oMDwn(elm, status) {
	var clr = (status) ? colorNavTool[2] : colorNavTool[12];
	htc_cbc(elm, clr);
}

function htc_navtool_oMClk(href) {
	activate_link(href);
}

//
// LISTFORMROW.HTC
//
// listformrow :: onmouseout
function htc_listformrow_oMOut(elm) {
	var clr = colorListRow[0];
	htc_cbc(elm, clr);
	htc_cur(elm, 'default');
}

// listformrow :: onmouseover
function htc_listformrow_oMOvr(elm) {
	var clr = colorListRow[1];
	htc_cbc(elm, clr);
	htc_cur(elm, 'hand');
}

//
// GENERAL
//
// change background-color
function htc_cbc(elm, clr) {
	elm.style.backgroundColor = clr;
}

// change cursor
function htc_cur(elm, type) {
	elm.style.cursor = type;
}