function addCSSClass(obj, class_name)
{
  if (obj.className.indexOf(class_name) == -1)
    obj.className += ' ' + class_name;
}

function removeCSSClass(obj, class_name)
{
  if (obj.className.indexOf(class_name) != -1)
    obj.className = obj.className.replace(class_name, '');
}

function activate_input(obj)
{
  addCSSClass(obj, 'hover');
  val = obj.title;
  if (obj.value == val)
    obj.value = '';
  obj.focused = true;
}

function deactivate_input(obj)
{
  removeCSSClass(obj, 'hover');
  val = obj.title;
  if (obj.value == '')
    obj.value = val;
  obj.focused = false;
}

function mouseover_input(obj)
{
  addCSSClass(obj, 'hover');
}

function mouseout_input(obj)
{
  if (document.activeElement != obj)
    removeCSSClass(obj, 'hover');
}

function fixScroll() {
  var s = document.body.scrollTop;
  document.body.focus();
  document.body = s;
}

function numeric_KeyFilter(event) {
   var charCode = (navigator.appName == "Netscape") ? event.which : event.keyCode;

   // only numbers
   if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;
   return true;
}

function basename(filepath)
{    
    var res = filepath.match(/[\/|\\]([^\\\/]+)$/);
    return (res) ? res[1] : filepath; 
}

function jumpTo(targ, selObj, restore)
{
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  //if (restore) selObj.selectedIndex=0;
}








function getElementHeight (elm)
{
  if (!elm)
    return 0;

  if (document.layers)
  {
    if (!elm.height)
      elm.height = elm.clip.height;
    return elm.height;
  }
  else if (typeof(elm.style && elm.style.height) == 'number')
  {
    return elm.style.height;
  }
  else if (typeof(elm.style && elm.style.height) == 'string' && !isNaN(parseInt(elm.style.height)))
  {
    return parseInt(elm.style.height);
  }
  else if (elm.offsetHeight)
  {
    return elm.offsetHeight;
  }
  else if (typeof(elm.style && elm.style.pixelHeight) == 'number')
  {
    return elm.style.pixelHeight;
  }
  else if (elm.clientHeight)
  {
    return elm.clientHeight;
  }

  return 0;
}

function setElementHeight(id, elementHeight) 
{
	var vid = document.getElementById(id);
	vid.style.height = elementHeight + 'px';
	return 0;
}

function surfto(form)
{
	var myindex = form.jumptosubmit.selectedIndex;
	if (form.jumptosubmit.options[myindex].value != "0")
	{
		location = form.jumptosubmit.options[myindex].value;
	}
}

function addNet(url,titel) 
{
	if ((typeof window.sidebar=="object") && (typeof window.sidebar.addPanel=="function"))
	{
		window.sidebar.addPanel(titel,url,"");
	} 
	else 
	{
		alert("Sie Nutzen eine veralterte Netscape Version!\nLesezeichen hinzufügen ist nicht möglich!");
	}
}

function bookmark()
{
	var url=window.location.href, t=document.title, ap=navigator.appName;
	
	if (ap=="Microsoft Internet Explorer")
	{
		window.external.AddFavorite(url,t);
	} 
	else
	{
		if(ap=="Netscape")
		{
			addNet(url,t);
		}
		else
		{
			alert("Mit ihren Browser ist kein Lesezeichen über Javascript möglich.\nBitte legen sie das Lesezeichnen manuel an.\nURL:"+url);
		}
	}
}

function pageprint()
{
	if (window.print)
	{
		parent.frameName.focus();
		parent.frameName.print();
	}
		return;
}

