
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


function setDisplay(id, how) {
	obj = document.getElementById(id);

	if (how == 1) {
		obj.style.display = "block"
	} else {
		obj.style.display = "none"
	}
}


function toggleDisplay(id) 
{
	obj = document.getElementById(id);
      obj.style.display = (obj.style.display != "block"  ) ? "block" : "none";
 }		   

function toggleDisplay2(id1, id2) 
{
	obj1 = document.getElementById(id1);
	obj2 = document.getElementById(id2);

      obj1.style.display = "block";
      obj2.style.display = "none";
 }		   



function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function layout() {
	var m = getMiddlePoint();
	var x = new getObj('idxLogin');
	
	x.style.left = m[0] -10;
	x.style.top = 320;
	x.style.visibility = "visible";
	
}

function getMiddlePoint() {
	var sizes = null;
	sizes = getWidthandHeight();
	
	middlePoint = new Array(2);
	middlePoint[0] = sizes[0]/2;
	middlePoint[1] = sizes[1]/2;
	
	return middlePoint;
}

function getAvailWidthAndHeight()
{

}


function getWidthandHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  sizes = new Array(2);
  sizes[0] = myWidth;
  sizes[1] = myHeight;
  return sizes;
}

function getBodyWidth() {
	var measures = new Array(2);
	measures = getWidthandHeight();
	return measures[0];
}

function getBodyHeight() {
	var measures = new Array(2);
	measures = getWidthandHeight();
	return measures[1];
}


function selAll(_v) {
for(var i=0;i<document.exf1.s1.length;i++)
  document.exf1.s1[i].selected=_v;
}


function pause(millisecondi)
{
var now = new Date();
var exitTime = now.getTime() + millisecondi;

while(true)
{
    now = new Date();
    if(now.getTime() > exitTime) return;
}

}

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


function confirmDelete(location, msg)
{
  confirmed = confirm(msg);

  if (confirmed) {
      window.location = location;
  } else {
      return 0;
  }
}


function doNothing()
{
    return 0;
}
