function error_show(error_id){show_div(error_id);}
function el(el_id_s){return document.getElementById(el_id_s);}

function hide_object(ID){
  object_id = el(ID);  
  if (object_id == null) {return false;} 
  object_id.style.display = 'none';
}

function show_object(ID,display){
  object_id = el(ID);  
  if (object_id == null) {return false;}
  if (display != null)
  {
    object_id.style.display = display;  
  }
  else
  {
    object_id.style.display = 'block';  
  }
}

function show_hide_object(ID,show){
  if (show){show_object(ID)}
  else     {hide_object(ID)}
}

function show_div(div_id)
{
  div_id_ = '#'+div_id;
  $(div_id_).slideDown();
}

function hide_div(div_id)
{
  div_id_ = '#'+div_id;
  $(div_id_).slideUp();
}
function show_hide_div(ID,show){
  if (show){show_div(ID)}
  else     {hide_div(ID)}
}

function SetCheckBox(CHB_ID,Checked){
  CheckBoxName_id = el(CHB_ID);
  if (CheckBoxName_id != null)
  {
    CheckBoxName_id.checked = Checked; 
  }
  
}
function GetCheckBox(CHB_ID){
  CheckBoxName_id = el(CHB_ID);
  if (CheckBoxName_id != null)
  {
    return CheckBoxName_id.checked; 
  }
  return false;
}
function Enabled_CheckBox(CHB_ID){
  CheckBoxName_id = el(CHB_ID);
  if (CheckBoxName_id != null)
  {
    return !CheckBoxName_id.disabled; 
  }
  return false;
  
}
function Enable_CheckBox(CHB_ID,Enable){
  CheckBoxName_id = el(CHB_ID);
  if (CheckBoxName_id != null)
  {
    CheckBoxName_id.disabled = !Enable;
  }
  
}

function Enabled_El(El_ID_){
  El_ID = el(El_ID_);
  if (El_ID != null)
  {
    return !El_ID.disabled;
  }
  
}
function Enable_El(El_ID_,Enable){
  El_ID = el(El_ID_);
  if (El_ID != null)
  {
    El_ID.disabled = !Enable;
  } 
}

function Set_Element_Value(El_ID,Value){
  ElementName_id = el(El_ID);
  if (ElementName_id != null)
  {
    if (Value == false) {ElementName_id.value = '0';}
    else if (Value == true){ElementName_id.value = '1';}
    else {ElementName_id.value = Value;} 
  }
  
}
function Get_Element_Value(El_ID){
  ElementName_id = el(El_ID);
  if (ElementName_id != null)
  {return ElementName_id.value;}
  return 0;
}

function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}

function dialog(show,dialog_name,e){
  obj_others = document.getElementById('others');
  if (show)
  {
    //obj_others.style.position = 'absolute';
    obj_others.style.height = '100%';
    
    obj = document.getElementById('others_in');
    obj.style.position = 'absolute';
    obj.style.height = '100%';
    //obj.style.top = '1px';
    //obj.style.display = 'block';
    dialog_id = document.getElementById(dialog_name);
    dialog_parent = dialog_id.parentNode;
    //if (dialog_parent.id != 'others')
    //{
    
    dialog_object = dialog_parent.removeChild(dialog_id);
    obj.appendChild(dialog_object);
    //}
    if (!e) {var e=window.event}
      
      //alert (document.documentElement.scrollLeft);
      //right = e.clientX;
      bottom = e.clientY;
      
      
      dialog_id.style.position = 'absolute';
      //alert (menu_creator_links_add_id.parentNode.nodeName);
      //dialog_id.style.left = (document.documentElement.scrollLeft + right) + 'px';
      //--others_blank_id = el('others_blank');
      //--others_blank_id.style.height = document.documentElement.scrollTop + bottom;
      //dialog_id.style.top = (document.documentElement.scrollTop + bottom - 10) + 'px';
    //show_hide_object('others',show)  
    show_object(dialog_name);
  }
  else
  {
    
    //obj_others.style.position = 'absolute';
    obj_others.style.height = '0px';
    hide_object(dialog_name);
    //show_hide_object('others',show) 
  }
//Enable_El();
return true;         
}

