function openPopup(aURL, aWidth, aHeight, aName) {
  var winWidth = '573';
  var winHeight = '717';
  var popUpName = 'Popup';
  if(aHeight && aHeight != undefined) {
    winHeight = aHeight;
  }
  if(aWidth && aWidth != undefined) {
    winWidth = aWidth;
  }
  if(aName && aName != undefined) {
    popUpName = aName;
  }
  
  var posX = '100';
  var posY= '100';
  var popupWin = window.open(aURL, popUpName, 'width='+winWidth+',height='+winHeight+',left='+posX+',top='+posY+',scrollbars=yes,resizable=yes');
  popupWin.focus();
}

function changeURL(aURL) {
   window.location.href = aURL;
}
function openBranchenbuch() {
  var str = "http://vfb.rts-webserver.de/branchenbuch-web-vfb/Branchenbuch/index.php"; 
  var NewWin=window.open(str,"","toolbars=no,status=no,scrollbars=auto,height=650,width=800,left=0,top=0");
} 

/* js fuer suche (knowledgeminer) */
function prepareSearchAndSubmit() {
    window.name="vfb";
    var winObj = window.open("", "KMinerSearch", "width=1100,height=800,scrollbars=yes,resizable=no");
    if( winObj != null )  // Notwendig !!!
    {
      winObj.focus();
      return true;
    }
    else
    {
      alert('Das Fenster konnte nicht geoeffnet werden! Popup-Blocker ?')
      return false;
    }
}

function handleSubmitOnReturn(event)
{
  var keyCode;

  keyCode = (window.event && window.event.keyCode) ? window.event.keyCode : event.which;
  if (keyCode == 13) {
    if (navigator.appName.indexOf('Microsoft') != -1) {
      //setTimeout("document.Queryform.Submit.click()",500);   //wichtig, um Click-Event einzeln auswerten zu lassen und nicht als Folgeaufruf des KeyDown-Events
      return true;
    }
  }
}

function changeImageDSL (imageID, dsl, hover){
		
	if(dsl == "dsl1"){
		if(hover == true){
			document.getElementById(imageID).src = "/pics/vfbTV/dsl_1_1.gif";
		}else{
			document.getElementById(imageID).src = "/pics/vfbTV/dsl_1_0.gif";
		}
	}else{
		if(hover == true){
			document.getElementById(imageID).src = "/pics/vfbTV/dsl_2_1.gif";
		}else{
			document.getElementById(imageID).src = "/pics/vfbTV/dsl_2_0.gif";
		}
	}		
}

function showTable(toshow, hohide, astate) {
  
  var elem = document.getElementById(toshow);
  var elem2 = document.getElementById(hohide);
  /*
  if(elem)    elem.style.display = (astate == true) ? 'block' : 'none';
  */
  if(elem) elem.style.display = 'block';
  if(elem2) elem2.style.display = 'none';
  
  
}
