function ComticaShowHide(obj){
	var elBody = document.all(obj);
	if ( elBody != null ){
		if ( elBody.style.display == "none" ){
			elBody.style.display = "";
		}
		else{
			elBody.style.display = "none";
		}
	}
}
function ShowHide2(obj){
	var elBody = document.all(obj);
	if ( elBody != null )
		if ( elBody.style.display == "none" )
			elBody.style.display = "";
		else
			elBody.style.display = "none";
}
function layerWrite(id,text){ 
	if (document.layers){ 
		var lyr = document.layers[id].document; lyr.open(); 
		lyr.write(text); lyr.close(); 
	} 
	else 
		document.getElementById(id).innerHTML = text; 
}

function okienko(url,width,height,scroll){ 
	 window.open(url,'','align=center,toolbar=0,status=0,location=0,directories=0,width='+width+',height='+height+',menubar=no,scrollbars=' + scroll)
}
			
			
/* Hash table */

function Hash ()
{
  /* internal object */
  this.array = new Array();
  this.loop = 0;

  /* property */
  this.length = 0;

  /* method */
  this.add = Hash_Add;
  this.remove = Hash_Remove;
  this.upsert = Hash_Upsert;
  this.keyof = Hash_Keyof;
  this.valueof = Hash_Valueof;
  this.pop = Hash_Pop;
  this.element = Hash_Element;
}

function Hash_Pair(key, value)
{
  this.key = key;
  this.value = value;
}

function Hash_Pop ()
{
  if(this.loop < this.array.length){
    this.loop++;
    return this.array[this.loop-1];
  }
  else{
    this.loop = 0;
    return;
  }
}

function Hash_Element (i)
{
  if(i >= 0 && i < this.array.length) {    
    return this.array[i];
  }
  else {
    return;
  }
}

function Hash_Add (foo, bar)
{
    this.array[this.array.length] = new Hash_Pair (foo, bar);
    this.length = this.array.length;
}

function Hash_Upsert (foo, bar)
{
   for (i=0; i < this.array.length; i++){
    if( this.array[i].key == foo){
       this.array[i].value = bar;
       this.length = this.array.length;
       return i; 
    }
   }  
   this.add(foo,bar);
}

function Hash_Remove (foo)
{
  for (i=0; i < this.array.length; i++){
    if( this.array[i].key == foo){
       var res = this.array.splice(i,1);
       this.length = this.array.length;
       return res;
    }
  }  
  return "";
}

function Hash_Valueof (foo)
{
  for(i=0; i < this.array.length; i++){
    if( this.array[i].key == foo){
			return (this.array[i].value);
    }
  }
  return;
}

function Hash_Keyof (foo)
{
  for(i=0; i < this.array.length; i++){
    if( this.array[i].value == foo){
       break;
    }
  }
  if (i == this.array.length){
    return;
  }
  else{
    return (this.array[i].key);
  }
}

/* end of Hash table */
function buttonOver(eButton){
	eButton.style.backgroundColor = "#CBE3F9";
	eButton.style.borderColor = "#134D8C";	
}
function buttonOut(eButton, aCompareValue){
	if(eval(aCompareValue) == null || eval(aCompareValue) != eButton.id){
		eButton.style.backgroundColor = "";
		eButton.style.borderColor = "";	
	}
	else
		buttonClick(eButton);
}
function buttonClick(eButton){
	eButton.style.backgroundColor = "#9FC4F1";
	eButton.style.borderColor = "#134D8C";
}
function opCl(obj1, obj2){
	document.all[obj1].style.display = "none";
	document.all[obj2].style.display = "block";
}