/**
 * Displays an confirmation box beforme to submit a "DELETE" query.
 * This function is called while clicking links
 *
 * @param   object   message
 * @param   object   the link to delete
 * 
 */
function confirmLink(message, theLink)
{
    var is_confirmed = confirm(message);
    if (is_confirmed) 
   	{
        window.location.href = theLink;
   	}
}

function chkform()
{

	var nachname	= document.sendform.nachname.value;
	var strasse		= document.sendform.strasse.value;
	var plz				= document.sendform.plz.value;
	var ort				= document.sendform.ort.value;
	var telefon		= document.sendform.telefon.value;
	var lieferung	= document.sendform.lieferung;
	var selected	= false;
	
	if ( (nachname.length < 2) || xxx(nachname) )
	{
		alert("Bitte geben Sie ihren Nachnamen an!");
		document.sendform.nachname.focus();
		return false;
	}

	if ( (strasse.length < 4) || xxx(strasse) )
	{
		alert("Bitte geben Sie ihre Strasse an");
		document.sendform.strasse.focus();
		return false;
	}

	if ( (plz.length < 4) || xxx(plz) )
	{
		alert("Bitte geben Sie ihre Postleitzahl an");
		document.sendform.plz.focus();
		return false;
	}

	if ( (ort.length < 2) || xxx(ort) )
	{
		alert("Bitte geben Sie ihren Ort an");
		document.sendform.ort.focus();
		return false;
	}

	if ( (telefon.length < 4) || xxx(telefon) )
	{
		alert("Bitte geben Sie ihre Telefonnummer an");
		document.sendform.telefon.focus();
		return false;
	}
	
	for(i = 0; i < lieferung.length; i++)
  {
  	if (lieferung[i].checked  == true)
  		selected  = true;
	}
	if (!selected)
	{
		alert("Bitte wählen Sie die gewünschte Art der Lieferung aus");
		document.sendform.lieferung[0].focus();
		return false;
	}
	return true;
}

function xxx( str )
{
	result = true;
	firstchar = str.charAt(0);
	for ( var i=0; i < str.length; i++ )
	{
		if ( str.charAt(i) != firstchar )
		{ result = false }
	}
	return result;
}

function MM_openBrWindow(theURL,winName,features) 
{ 
	window.open(theURL, winName, features+",location=no,menubar=no,directories=no,toolbar=no,resizable=yes,status=no"); 
}

function right(e)
{
  if (navigator.appName == 'Netscape' &&
  (e.which == 3 || e.which == 2))
  return false;
  else if (navigator.appName == 'Microsoft Internet Explorer' &&
  (event.button == 2 || event.button == 3))
  {
    alert("Diese Funktion wird nicht unterstützt");
    return false;
  }
  return true;
}

document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
