function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}



function openplan(url) 
{   var neu = window.open(url,"infoplus","toolbar=0,menubar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=580,height=450");

    browserName=navigator.appName;
    browserVersion=parseInt(navigator.appVersion);
    if ((browserName == "Netscape") && (browserVersion >=2) )       
    neu.focus()    
    else { }
}

function openMobileDownload(code) {
    url = "mobile_order.php?code=" + code;
	winWidth = 660;
	winHeight = 580;
	_left = ((screen.width-winWidth)/2);
	_top = ((screen.height-winHeight)/2)-50;
	
	popupWin = window.open(	url,'Bestellung','toolbar = 0, left = ' + _left + ', top = ' + _top + ', status = 0, menubar = 0, scrollbars = 1, resizable = 0, width =  ' + winWidth + ', height = ' + winHeight);
	popupWin.focus();
}


function centerPop(url, width, height) {
	winWidth = width;
	winHeight = height;
	_left = ((screen.width-winWidth)/2);
	_top = ((screen.height-winHeight)/2)-50;
	
	popupWin = window.open(	url,'popup','toolbar=0,left=' + _left + ',top=' + _top + ',status=0,menubar=0,scrollbars=1,resizable=0,width=' + winWidth + ', height=' + winHeight);
	popupWin.focus();
}
	
function validate_orderform() {
if (isEmpty("Bestell_Name")) {
   alert("Bitte geben Sie Ihren Namen ein.");
   setFocus("Bestell_Name");
   return false;
}
if (isEmpty("Bestell_Vorname")) {
   alert("Bitte geben Sie Ihren Vornamen ein.");
   setFocus("Bestell_Vorname");
   return false;
}
if (isEmpty("Bestell_Strasse")) {
   alert("Bitte geben Sie Strasse und Hausnummer ein.");
   setFocus("Bestell_Strasse");
   return false;
}
if (isEmpty("Bestell_PLZ") || isEmpty("Bestell_Ort")) {
   alert("Bitte geben Sie PLZ und Ort ein.");
   setFocus("Bestell_PLZ");
   return false;
}
if (isEmpty("Bestell_Land")) {
   alert("Bitte geben Sie Ihr Land ein.");
   setFocus("Bestell_Land");
   return false;
}
/*
if (isEmpty("Bestell_E-Mail")) {
   alert("Bitte geben Sie Ihre E-Mail-Adresse ein.");
   setFocus("Bestell_E-Mail");
   return false;
}
*/
/*
if (isEmpty("Buch1_Anzahl") && isEmpty("Buch2_Anzahl") && isEmpty("Buch3_Anzahl") && isEmpty("Buch4_Anzahl") && isEmpty("Buch5_Anzahl") && isEmpty("Buch6_Anzahl")) {
   alert("Bitte geben Sie eine Bestellmenge ein.");
   setFocus("Buch1_Anzahl");
   return false;
}
if (isEmpty("Buch1_Titel") && isEmpty("Buch2_Titel") && isEmpty("Buch3_Titel") && isEmpty("Buch4_Titel") && isEmpty("Buch5_Titel") && isEmpty("Buch6_Titel")) {
   alert("Bitte geben Sie einen Bestelltitel ein.");
   setFocus("Buch1_Titel");
   return false;
}
*/
/* NEU FÜR BESTELLUNG */
for(i=1; i<=8; i++) {
	var anzahl = "Buch" + i + "_Anzahl";
	var titel = "Buch" + i + "_Titel";
	if(!isEmpty(anzahl) && !validateOrder(titel)) {
		alert("Bitte wählen Sie einen Bestelltitel aus.");
		setFocus(titel);
		return false;
	}
	if(isEmpty(anzahl) && validateOrder(titel)) {
		alert("Bitte geben Sie eine Bestellmenge ein.");
		setFocus(anzahl);
		return false;
	}
}
/* NEU FÜR BESTELLUNG ENDE */

if (!isChecked("Zahlungsweise")) {
  alert("Bitte wählen Sie eine Zahlungsweise und füllen Sie alle erforderlichen Felder aus.");
  return false;
}
if (!isChecked("AGB")) {
  alert("Bitte bestätigen Sie unsere AGBs.");
  return false;
}
return true;
}

function validate_mailform() { 
  if (isEmpty("realname")) {
   alert("Bitte geben Sie Ihren Namen an.");
   setFocus("realname");
   return false;
  }
  if (!isEmail("email")) {
   alert("Bitte eine gültige Email-Adresse angeben.");
   setFocus("email");
   return false;
  }
  if (isEmpty("subject")) {
   alert("Bitte geben Sie einen Betreff an.");
   setFocus("subject");
   return false;
  }
  if (isEmpty("mail")) {
   alert("Bitte eine Nachricht angeben.");
   setFocus("mail");
   return false;
  }
return true;
}

/*
function toggleMore(title_id) {
  if (document.getElementById(title_id).style.display != "block") {
    document.getElementById(title_id).style.display = "block";	
  } else {
	document.getElementById(title_id).style.display = "none";  
  }
}

*/

function toggleMore(icon_id, title_id) {
	var title = $(title_id);
	
	if (document.getElementById(icon_id).className != "info_extended") {
	   	document.getElementById(icon_id).className = "info_extended";
	} else {
		document.getElementById(icon_id).className = "info_icon";
	}
	
	title.hidden = title.hidden == null ? true : title.hidden;
	//for other effects, see http://wiki.script.aculo.us/scriptaculous/show/CombinationEffectsDemo
	if (title.hidden) {
		title.style.height = "auto";
		title.style.display = "none";
		new Effect.BlindDown(title);
		
	} else {
		new Effect.BlindUp(title);
		
	}
	title.hidden = !title.hidden;
}


function showLess(title_id) {
  document.getElementById(title_id).style.display = "none";
}