	
	// script for filling goods-basket
	// mod = table
	// tbl_type = shop
	
		function check_news(){
	
		if (document.abo.email.value == "") {
      alert("Bitte geben Sie Ihre E-Mail Adresse ein! \nPlease enter your email address!");
      document.abo.email.focus();
      return false;
    }
		
		if (document.abo.vname.value == "") {
      alert("Bitte geben Sie Ihren Vornamen ein! \nPlease enter your firstname!");
      document.abo.vname.focus();
      return false;
    }		

		if (document.abo.nname.value == "") {
      alert("Bitte geben Sie Ihren Vornamen ein! \nPlease enter your lastname!");
      document.abo.nname.focus();
      return false;
    }				
		
  return true;	
	}		

		function check_anmeldung(){
	
		if (document.anmeldung.company.value == "") {
      alert("Bitte füllen Sie Firma, Vorname, Nachname aus! \nPlease complete company, last name, firstname!");
      document.anmeldung.company.focus();
      return false;
    }
		
		if (document.anmeldung.street.value == "") {
      alert("Bitte füllen Sie Straße, Hausnummer aus! \nPlease complete street, house no.!");
      document.anmeldung.street.focus();
      return false;
    }

		if (document.anmeldung.city.value == "") {
      alert("Bitte füllen Sie PLZ Ort, Bundesland aus! \nPlease complete post-code, area-code, city, state, country.!");
      document.anmeldung.city.focus();
      return false;
    }
		
		if (document.anmeldung.fon.value == "") {
      alert("Bitte geben Sie ihre Telefonnummer an! \nPlease enter your telephone number!");
      document.anmeldung.fon.focus();
      return false;
    }
		
		if (document.anmeldung.verdor.value == "") {
      alert("Bitte füllen Sie Bank des Verkäufers aus! \nPlease complete verdor's bank!");
      document.anmeldung.verdor.focus();
      return false;
    }
		
		if (document.anmeldung.bankadress.value == "") {
      alert("Bitte geben Sie die Bankadresse an! \nPlease enter bank's address!");
      document.anmeldung.bankadress.focus();
      return false;
    }
		
		if (document.anmeldung.accountnumber.value == "") {
      alert("Bitte geben Sie die Kontonummer an! \nPlease enter the accountnumber!");
      document.anmeldung.accountnumber.focus();
      return false;
    }
		
		if (document.anmeldung.blz.value == "") {
      alert("Bitte geben Sie die BLZ an! \nPlease enter the IBAN (bank code)!");
      document.anmeldung.blz.focus();
      return false;
    }
	
		if (document.anmeldung.bic.value == "") {
      alert("Bitte geben Sie die BIC an! \nPlease enter the SWIFT-CODE!");
      document.anmeldung.bic.focus();
      return false;
    }
		
		if (document.anmeldung.pferd_geschlecht1.value == "") {
      alert("Bitte geben Sie das Geschlecht des ersten Pferdes an! \nPlease enter the sex of the first horse!");
      document.anmeldung.pferd_geschlecht1.focus();
      return false;
    }		

		if (document.anmeldung.day_1.selectedIndex == "0") {
      alert("Bitten geben Sie den Geburtstag des ersten Pferdes an! \nPlease enter the day of bith for the first horse!");
      document.anmeldung.day_1.focus();
      return false;
    }
		
		if (document.anmeldung.month_1.selectedIndex == "0") {
      alert("Bitten geben Sie den Geburtsmonat des ersten Pferdes an! \nPlease enter the month of bith for the first horse!");
      document.anmeldung.month_1.focus();
      return false;
    }
		
		if (document.anmeldung.year_1.selectedIndex == "0") {
      alert("Bitten geben Sie den Geburtsjahr des ersten Pferdes an! \nPlease enter the year of bith for the first horse!");
      document.anmeldung.year_1.focus();
      return false;
    }
		
		if (document.anmeldung.pferd_bday1.value == "") {
      alert("Bitte geben Sie das Geburtsland des ersten Pferdes an! \nPlease enter the land of birth of the first horse!");
      document.anmeldung.pferd_bday1.focus();
      return false;
    }

		if (document.anmeldung.pferd_vater1.value == "") {
      alert("Bitte geben Sie den Vater des ersten Pferdes an! \nPlease enter the name of the sire of the first horse!");
      document.anmeldung.pferd_vater1.focus();
      return false;
    }
		
		if (document.anmeldung.pferd_mutter1.value == "") {
      alert("Bitte geben Sie den Mutter des ersten Pferdes an! \nPlease enter the name of the mother of the first horse!");
      document.anmeldung.pferd_mutter1.focus();
      return false;
    }

		if (document.anmeldung.agb.selectedIndex != "1") {
      alert("Bitten geben akzeptieren Sie unsere AGBs! \nPlease accept our conditions!");
      document.anmeldung.agb.focus();
      return false;
    }																																													
		
  return true;	
	}	
	
	function changebg(ID, WHAT){
	 
   if(WHAT == "in"){
	  
		switch(ID){
	  
		case "1":
		 var bgcolor = "#C4E3B2";
		break;
	  
		case "2":
		 var bgcolor = "#D0F1FC";
		break;
	  
		case "3":
		 var bgcolor = "#F3DDA8";
		break;
	 }
	 
	  document.getElementById(ID).style.background = bgcolor;
	 }
	 
   if(WHAT == "out"){
	  
		switch(ID){
	  
		case "1":
		 var bgcolor = "#D3EAC5";
		break;
	  
		case "2":
		 var bgcolor = "#DCF5FD";
		break;
	  
		case "3":
		 var bgcolor = "#F6E6BE";
		break;
	 }
	 
	  document.getElementById(ID).style.background = bgcolor;
	 }	 
	
	}
	
	function fill (PAGE_ID, TBL_ID, TD_ID) {
		
		var quantity = document.getElementById('qua' + TD_ID).value;
		
		document.location.href = 'index.php?page_id=' + PAGE_ID + '&action=filltd&tbl_id=' + TBL_ID + '&td_id=' + TD_ID + '&quantity=' + quantity;
	
	}
	
	function del (PAGE_ID, TBL_ID, TD_ID) {
			
		var quantity = document.getElementById('qua' + TD_ID).value;
		
		document.location.href = 'index.php?page_id=' + PAGE_ID + '&action=deltd&tbl_id=' + TBL_ID + '&td_id=' + TD_ID + '&quantity=' + quantity;
	
	}
	
	function cookie_save() {
		
		if (!document.tbl_order)
			return;
		
		var FORM	 = document.tbl_order;
		
		for (var num = 0; num < FORM.length; num++)
			document.cookie = FORM[num].name + "=" + FORM[num].value + ";";
		
	}
	
	function cookie_load() {
		
  	var COOKIE = document.cookie.split(";");
  	
  	for (var cn = 0; cn < COOKIE.length; cn++) {
  		
  		var TEMP 				= COOKIE[cn].split("=");
  		var TEMP_COOKIE = TEMP[0].replace(/ /, "");
  		
  		if (document.getElementById(TEMP_COOKIE) && TEMP[1] && document.getElementById(TEMP_COOKIE).type != 'hidden')
  			eval('document.tbl_order.' + TEMP_COOKIE + '.value = "' + TEMP[1] + '";');
  	
  	}
  }
	
	function browse(DIRECTION) {
		
		document.browse_form.action.value = 'browse' + DIRECTION + 'td';
		document.browse_form.submit();
		
	}
	
	function browse_link(UP, DOWN) {
	
		document.getElementById('bup').style.display 		= (UP == 1) ? 'inline' : 'none' ;
		document.getElementById('bdown').style.display 	= (DOWN == 1) ? 'inline' : 'none' ;
		
	}
	
	/* bbag */
	
	function selectc2p (LIST, PAGE_ID) {
		
		document.forms[0].submit();
		//document.location.href = "index.php?page_id=" + PAGE_ID + "&list=" + LIST;
	
	}

	function selectc2pPlus (LIST, PAGE_ID, PLUS, VALUE) {
	
		document.location.href = "index.php?page_id=" + PAGE_ID + "&list=" + LIST  + "&plus=" + PLUS + "&value=" + VALUE;
	
	}	
