/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initScrollLayer() {
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
  var wndo = new dw_scrollObj('wn', 'lyr1', 't1');
  // arguments: dragBar id, track id, axis ("v" or "h"), x offset, y offset
  // (x/y offsets of dragBar in track)
  wndo.setUpScrollbar("dragBar", "track", "h", 1, 1);
  
  // Read instructions if your scrolling layers are inside tables 
}


function changeImg(image, imageIndex){
	document.images[imageIndex].src = image;
	return false;
}

// Anfrage Form

function validateAnfrage(myform) {
	msg = "";
	if(myform.vn.value==""){
		msg = "Bitte geben Sie Ihren Vornamen ein.\n";
	}
	if(myform.nn.value==""){
		msg += "Bitte geben Sie Ihren Nachnamen Vornamen ein.\n";
	}
	if(myform.email.value==""){
		msg += "Bitte geben Sie Ihre E-Mail Adresse ein.\n";
	}else{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myform.email.value)){
			//OK
		}else{
			msg += "Bitte geben Sie Ihre korrekte E-Mail Adresse ein.\n";
		}
	}
	if(myform.tel.value==""){
		msg += "Bitte geben Sie Ihre Telefonnummer ein.\n";
	}
	if(msg!=""){
		alert(msg);
		return false;
	}
}

// Pop-Up Windows

function info(breite,hoehe,datei,fenstername,scrollbars) {
	var mittehorizontal=(screen.width-breite)/2;
	var mittevertikal=(screen.height-hoehe)/2;
	var eigenschaften="width="+breite+",height="+hoehe+",left="+mittehorizontal+",top="+ mittevertikal+",menubar=no, resizable=no, locationbar=no, statusbar=no, scrollbars="+scrollbars;
	window.open(datei,fenstername,eigenschaften);
}

function confirmwindow(question, gotourl){
	if(confirm(question)){
		top.location.replace(gotourl);
	}
}

function validateSearch(myform) {
	msg = "";
	if(myform.word.value==""){
		msg += "Bitte geben Sie einen Suchbegriff ein.\n";
	}
	if(msg!=""){
		alert(msg);
		return false;
	}
}
