// JavaScript Document

function IncludeJavaScript(jsFile)
{
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></script>'); 
}
IncludeJavaScript('../../../media-global/Javascript/Lightbox/prototype.js');
IncludeJavaScript('../../../media-global/Javascript/Lightbox/scriptaculous.js?load=effects,builder');
IncludeJavaScript('../../../media-global/Javascript/Lightbox/lightbox.js');


var 
  FormName = 'ShopForm',
  InputName = new Array ('Schule', 'Strasse', 'PLZ', 'Ort', 'Lehrperson', 'Email', 'Telefon'),
  InputValue = new Array ('Schule', 'Strasse', 'PLZ', 'Ort', 'Lehrperson', 'Email', 'Telefon');

function CheckForm ()  {

	var Escape='';
	
	for (var i=0; i<InputName.length; i++) 
		if (document.getElementById(InputName[i]).value=='') Escape = Escape+InputValue[i]+', ';
	
	if (Escape == '') {
		
		if (document.getElementById('Bedingungen').checked==true) {
			return true;
		} else {
			alert ("Bitte zuerst Bestellbedingungen akzeptieren!");
			return false;
		}
	}
	else {
		if (Escape.match (/(.+)(, )(\w+),/)) Escape =  'Bitte '+ RegExp['$1'] +' und '+ RegExp['$3'] +' ausfüllen!';
		else if (Escape.match (/(.+),/)) Escape = 'Bitte '+ RegExp['$1'] +' ausfüllen!';
		
		alert (Escape);
		return false;
}	}

function SwapImage (action) {
	if (action=="show")
		document.getElementById('Abschicken').src = "media/Form/Send_active.gif";
	else
		document.getElementById('Abschicken').src = "media/Form/Send.gif";		
}
