
function OnListBoxOver(object, cls) {
  if (object.className == cls+'_center_row') 
		object.className = cls+'_center_row_over';
}

function OnListBoxOut(object, cls) {
  if (object.className == cls+'_center_row_over') 
		object.className = cls+'_center_row';
}

function OnListBoxSelectedOver(object, cls) {
  if (object.className == cls+'_center_row_selected') 
		object.className = cls+'_center_row_selected_over';
}

function OnListBoxSelectedOut(object, cls) {
  if (object.className == cls+'_center_row_selected_over') 
		object.className = cls+'_center_row_selected';
}

function HintShow(id) {
  if (document.all) {
    if (document.all[id].style.visibility == 'hidden' || document.all[id].style.visibility == '') {
      document.all[id].style.left = event.clientX - 20; // (document.body.clientWidth/2) - (document.all[id].offsetWidth/2) + document.body.scrollLeft;
      document.all[id].style.top = event.clientY + document.body.scrollTop; //document.body.scrollTop + 10;
      document.all[id].style.visibility = 'visible';
    }
    return false;
  };
	
  if (document.getElementById) {
    if (document.getElementById(id).style.visibility == '' || document.getElementById(id).style.visibility == 'hidden') {
      document.getElementById(id).style.left = (window.innerWidth/2) - (document.getElementById(id).offsetWidth/2) + window.pageXOffset; //(document.body.clientWidth/2) - (document.all[id].offsetWidth/2) + document.body.scrollLeft;
      document.getElementById(id).style.top = window.pageYOffset + 10;
      document.getElementById(id).style.visibility = 'visible';
    }
    return false;
  }
}

function HintHide(id) {
  if (document.all) {
    document.all[id].style.visibility = 'hidden';
    return false;
  }
  if (document.getElementById) {
    document.getElementById(id).style.visibility = 'hidden';
    return false;
	}
}

function LanguageEdit(url) {
  win = window.open(url, "", "status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=480");
	win.focus();
	return true;
}

function OpenNewWindow(url) {
  var win = window.open(url);
	win.opener=window;
	win.focus();
	return true;
}

function IconSelect(form, field, dir) {
  var win = window.open('/system/icon_select.php?form='+form+'&field='+field+'&dir='+dir, "", "status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=300");
	win.opener=window;
	win.focus();
	return true;
}

function PopupWindow(url, param) {
  var win = window.open(url, "", param);
	win.opener=window;

	var width = 0;
	var height = 0;
	while (!win.document.body) {};
	if (is_ie) {
    width = win.document.body.clientWidth; 
    height = win.document.body.clientHeight; 
	} else {	
    width = win.innerWidth; 
    height = win.innerHeight;
	}
	win.moveTo((screen.width/2)-(width/2), (screen.height/2)-(height/2));
	win.focus();
	return true;
}

function CheckDomainSelect(form, name, isall) {
	if (isall) {
		for (i = 0; i < form.elements[name].length; i++)
			form.elements[name][i].checked = false;
		form.elements[name][0].checked = true;
	} else
		form.elements[name][0].checked = false;
}

function getAnchorPosition(anchorName) {
  if (document.layers) {
    var anchor = document.anchors[anchorName];
    return { x: anchor.x, y: anchor.y };
  }
  else if (document.getElementById) {
    var anchor = document.anchors[anchorName];
    var coords = {x: 0, y: 0 };
    while (anchor) {
      coords.x += anchor.offsetLeft;
      coords.y += anchor.offsetTop;
      anchor = anchor.offsetParent;
    }
    return coords;
  }
}
