function onoff(id) {
var item = document.getElementById(id);
if(item.style) {
	if(item.style.display == "none"){ item.style.display = ""; 
	}else {item.style.display = "none"; 
	}
}else{ item.visibility = "show"; item.style.zIndex = "3"; 
}
}

function on(){
var arguments = on.arguments;
var item = null;
for (var i=0; i < arguments.length; i++)
{
item = document.getElementById(arguments[i]);
if(item.style) {
	if(item.style.display == "none"){ item.style.display = ""; 
	}
}else{ item.visibility = "show"; item.style.zIndex = "99"; 
}
}
}

function off(){
var arguments = off.arguments;
var item = null;
for (var i=0; i < arguments.length; i++)
{
item = document.getElementById(arguments[i]);
if(item.style) {
	item.style.display = "none";
}else{ item.visibility = "none";
}
}
}

function ShowOrHide(d1, d2) {
	  if (d1 != '') onoff(d1);
	  if (d2 != '') onoff(d2);
}

function popwin(url,title){
var newwin = window.open(url, title, 'width=450,height=350,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
newwin.focus();
}

function movehtml(from,to){
document.getElementById(to).innerHTML=document.getElementById(from).innerHTML;
document.getElementById(from).innerHTML = '';
}
  
function posinwin(thediv,theoffset){
var winheight = document.documentElement.clientHeight;
var divpos = document.getElementById(thediv).offsetTop + theoffset;

if(divpos > winheight) return true;

}

function external() {
 if (document.getElementsByTagName) {
  var i, a;
  a = document.getElementsByTagName('a');
  for (i in a) {
   if (a[i].getAttribute('href') && 
       a[i].getAttribute('rel') == 'external') a[i].target = '_blank';
  }
 }
}

function tasks(){
//if(posinwin('crb', 30)) movehtml('crf','cra');
//if(posinwin('clb', 195)) movehtml('clf','cla');
//external();
}

function refresh(){
document.location=document.location;
}

function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function moveIt(obj, mvTop, mvLeft, minTop, minLeft) {
	obj.style.position = "absolute";
	if(mvTop) obj.style.top = mvTop+'px';
	if(mvLeft) obj.style.left = mvLeft+'px';
	if(minTop > mvTop) obj.style.top = minTop+'px';
	if(minLeft > mvLeft) obj.style.left = minLeft+'px';
}
