// produktfinder bei select wird neue seite geladen
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// produktfinder bei select wird neue seite geladen
function MM_jumpMenuArchive(targ,selObj,restore){
	var jumpLocation;
	var type;
	var marke;
	var produkt;
	var template_name;
	var area;

  // HIDDEN Felder	
	template_name = window.document.infofinder.template_name.value;
	area = window.document.infofinder.area.value;

  // SELECT Felder
	type = window.document.infofinder.type.value;
	marke = window.document.infofinder.marke.value;
	produkt = window.document.infofinder.produkte.value;
	
  if (marke == 'alle' && area == 'selfmedic') 
    jumpLocation = '/ewms';
  else {
    if (marke == 'alle') 
      jumpLocation = '/ewms/'+area;
    else 
      jumpLocation = marke;
  }

	// wenn eine neue marke ausgewählt wird muss das Produkt gelöscht werden
	// (taucht nicht mehr in der URL auf)
	if ((produkt != 'alle') && (selObj.name == 'produkte' || selObj.name == 'type')) 
		jumpLocation = jumpLocation+'/'+produkt;

	jumpLocation = jumpLocation+'/'+template_name;
	jumpLocation = jumpLocation+'?type='+type;
	jumpLocation = jumpLocation+'&stay='+area

  eval(targ+".location='"+jumpLocation+"'");
  if (restore) selObj.selectedIndex=0;
}

// produktfinder bei select wird neue seite geladen
function MM_jumpMenuBildDB(targ,selObj,restore){
	var jumpLocation;
	var marke;
	var produkt;
	var template_name;
	var area;

  // HIDDEN Felder	
	template_name = window.document.bilddbfinder.template_name.value;
	area = window.document.bilddbfinder.area.value;

  // SELECT Felder
	marke = window.document.bilddbfinder.marke.value;
	produkt = window.document.bilddbfinder.produkte.value;
	
  if (marke == 'alle') 
    jumpLocation = '/ewms/'+area;
  else 
    jumpLocation = marke;

	// wenn eine neue marke ausgewählt wird muss das Produkt gelöscht werden
	// (taucht nicht mehr in der URL auf)
	if (produkt != 'alle' && selObj.name == 'produkte') 
		jumpLocation = jumpLocation+'/'+produkt;

	jumpLocation = jumpLocation+'/'+template_name;

  eval(targ+".location='"+jumpLocation+"'");
  if (restore) selObj.selectedIndex=0;
}

function jumpMarke() {
	var jumpLocation = window.document.produktfinder.line1.options[window.document.produktfinder.line1.selectedIndex].value;
	//eval(targ+".location='"+jumpLocation+"'");
	document.location.href = jumpLocation;
}

// standard popup funktion
var winID = 0;
var popUp = new Array();

function fensterAufScroll(inhalt, breite, hoehe, winname, scrollbar) {
  var xOff = 10;
  var yOff = 10;
  if (parseInt(navigator.appVersion)>=4) {
    xOff = (screen.width-breite)/2;
    yOff = (screen.height-(hoehe))/2;
    yOff -= 20;
  }
  
  popUp[winID] = window.open(inhalt, winname, 'toolbar=no,status=no,location=no,directories=no,resizable=no,scrollbars='+scrollbar+',width='+breite+',height='+hoehe+',left='+xOff+',top='+yOff);
  winID++;
}

function openPopupWindow(inhalt, attr) {
  popUp[winID] = window.open(inhalt, 'popup', attr);
  winID++;
}


// confirm-dialog beim löschen von mein-konto mitbenutzern
var msg = "Wollen Sie dieses Mitbenutzer unwiderruflich löschen?";
function confirmDelete() {
  if(confirm(msg)) {
    return true;
  }
  else {
    return false;
  };
}

function checkSearchForm(obj) {
  if(!obj.filter.value) {
    alert('Bitte geben Sie ein Suchwort ein!');
    obj.filter.focus();
    return false;
  } else return true;
}