<!--
function preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() {
  var i,j=0,x,a=swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function newhtml(js_code) {
	document.form.text.value += js_code;
	document.form.text.focus();
}
function js_format(js_format) {
	if (js_format == 'strong') ptext="bold.";
	if (js_format == 'em') ptext="italic.";
	if (js_format == 'u') ptext="underlined.";
	if (js_format == 'center') ptext="centered.";
	if (js_format == 'big') ptext="big.";
	if (js_format == 'small') ptext="small.";
	text = prompt("Enter text to be "+ptext,"");     
	if (text != "" && text != null) {           
		js_code = "<"+js_format+">"+text+"</"+js_format+">";
		newhtml(js_code);
	}  
}
function js_align(js_format) {
	if (js_format == 'left') ptext="left.";
	if (js_format == 'center') ptext="centered.";
	if (js_format == 'right') ptext="right.";
	text = prompt("Enter text to be "+ptext,"");
	if (text != "" && text != null) {           
		js_code = "<div align=\""+js_format+"\">"+text+"</div>";
		newhtml(js_code);
	} 
}
function list(js_format) {
	text = prompt("Enter the first list item.","");     
	if (text != "" && text != null) { 
		js_code = "\n<"+js_format+">\n";
		while (text != "" && text != null) {
			js_code += " <li>"+text+"</li>\n";
			text = prompt("Enter the next list item. (leave empty to end list)","");
		}
		js_code += "</"+js_format+">";
		newhtml(js_code);
	}  
}
function js_link() {
	text = prompt("Enter the URL.","http://");
	if (text != "" && text != null) { 
		js_code = "<a href=\""+text+"\">";
		text2 = prompt("Enter the name or description.","");
		if (text2 == "" || text2 == null) text2 = text;
		js_code += text2+"</a>";
		newhtml(js_code);
	}  
}
function openPopup(img, width, height) {
   if (img && width && height) {
      width = Math.min(width, 640);
      height = Math.min(height, 480);
      var popUp = window.open(img,"popUp","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + width + ",height=" + height);
   }
   return;
}


function validateForm() {
  var i,p,q,nm,test,num,min,max,errors='',args=validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss aus einer E-Mailadresse bestehen.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' muss aus einer Nummer bestehen.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' muss eine Nummer zwischen '+min+' und '+max+' sein.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' muss ausgefüllt werden.\n'; }
  } if (errors) alert('Ein oder mehrere Fehler sind aufgetreten:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function categories_edit_eq_check() {
	if((document.form.action.value == "move") && (document.form.article_id.value == document.form.new_category.value)) {
		alert('Die Kategorie, in welche die Artikel verschoben werden sollen, und die bestehende Kategorie sind identisch!');
		return false;
	}
}
//-->