var DHTML = (document.getElementById || document.all || document.layers);

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 invi(who, flag)
{
	if (!DHTML) return;
	var x = window.parent.frames['left'].document.getElementById(who);
	if (flag == '1') x.style.visibility = 'visible';
	if (flag == '0') x.style.visibility = 'hidden';
}

function togglecheckbox(box, who)
{
  var the_box = window.document.getElementById(box);
  var x = window.document.getElementById(who);
  if (the_box.checked == false) {
    x.style.visibility = 'hidden';
  } else {
    x.style.visibility = 'visible';
  }
}

function inviall() 
{
    var argv = inviall.arguments;
    var argc = argv.length;
    for (var i = 0; i < argc; i++) {
	var x = window.parent.frames['left'].document.getElementById(argv[i]);
	x.style.visibility = 'hidden';
    }
}


var texttop = 400;

function move(amount)
{
	if (!DHTML) return;
	var x = new getObj('active');
	texttop += amount;
	x.style.top = texttop;
}


function changeCol(x, col)
{
	if (!DHTML) return;
	x.style.color = col;
}

function changeW()
{
	if (!DHTML) return;
	var x = new getObj('active');
	x.style.color = '#ffffff';
}

function undrln(x, whet)
{
	if (!DHTML) return;
	if (whet=='yes') x.style.textDecoration='underline';
	if (whet=='no') x.style.textDecoration='none';
}

function swap(newname)
{
	if (!DHTML) return;
	window.parent.frames['rtop'].document.getElementById('hd').src = newname;
}

function clearhistory()
{
history.replace('http://www.gmx.net');
}

function clearText(el) 
{
	if (el.defaultValue==el.value) el.value = "";
}

function checkDate(date, hour) 
{
	if (window.document.getElementById(date).value.substring(0, 3) != window.document.getElementById(hour).value.substr(0, 3)) {
		alert("The date and the day that you selected do not match!");
	}


}

function checkHour(day, hour)
{
	if (window.document.getElementById(day).value.substring(4, 9) > window.document.getElementById(hour).value.substring(0, 5)) {
		alert("The time you selected is outside the time frame provided.");
	}
		if (window.document.getElementById(day).value.substring(12, 17) < window.document.getElementById(hour).value.substring(0, 5)) {
		alert("The time you selected is outside the time frame provided.");
	}
	
}
