///////////////////////////////////////////////////////////
// confirm something
function request(message)
{
  if(confirm(message)) return true;
  else return false;
}
///////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
// roll & expand
function expand(id)
{
  document.getElementById(id+'_opened').style.display = '';
  document.getElementById(id+'_closed').style.display = 'none';
}
function roll(id)
{
  document.getElementById(id+'_opened').style.display = 'none';
  document.getElementById(id+'_closed').style.display = '';
}
///////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
// show and close hint
function fshow(id)
{
	var el = document.getElementById('hint');

	if(id != '' && el.style.display == 'none') el.innerHTML = id;

	var x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
	var y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop + 25;
	
  el.style.left = x + 'px';
	el.style.top = y + 'px';
	
  if(el.style.display == 'none') el.style.display = '';
}

function fclose()
{
	document.getElementById('hint').style.display = 'none';
}
///////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////
// open w2 window
function w2(url, name, width, height, scroll)
{
  var w2 = window.open(url, name, 
'marginheight=0,marginweight=0,toolbar=no,width='+width+',height='+height+',left=20,top=20,resizable=no,scrollbars='+scroll);
  w2.focus();
}
///////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
// change image
function ci(id, iif, cond)
{
  if(cond==1) id.src = id.src.substr(0, id.src.length-7)+'-up.gif';
  else
  {
    if(iif==1) id.src = id.src.substr(0, id.src.length-4)+'-up.gif';
    else id.src = id.src.substr(0, id.src.length-7)+'.gif';
  }
  return true;
}
///////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
// preload images
function preload(i)
{ 
	var img = new Image(); 
	img.src = '/images/'+i;
  
  return img; 
}
///////////////////////////////////////////////////////////