/*
function jumpTo(prod_id){
   var URL = 'index.php?todo=produkt_ausgeben&produkt_id='+prod_id+'&activeitem_1='+document.produkt.block_1.options[document.produkt.block_1.selectedIndex].value+'&activeitem_2='+document.produkt.block_2.options[document.produkt.block_2.selectedIndex].value;
   window.location.href = URL;
}
*/
function jumpTo(prod_id,bild_id){
    if (document.produkt.block_1) {
        var sel1='&activeitem_1='+document.produkt.block_1.options[document.produkt.block_1.selectedIndex].value;
    } else {
        var sel1='';
    }
    if (document.produkt.block_2) {
        var sel2='&activeitem_2='+document.produkt.block_2.options[document.produkt.block_2.selectedIndex].value;
    } else {
        var sel2='';
    }
    if (document.produkt.block_3) {
        var sel3='&activeitem_3='+document.produkt.block_3.options[document.produkt.block_3.selectedIndex].value;
    } else {
        var sel3='';
    }
    if (document.produkt.block_4) {
        var sel4='&activeitem_4='+document.produkt.block_4.options[document.produkt.block_4.selectedIndex].value;
    } else {
        var sel4='';
    }

   var URL = 'index.php?todo=produkt_ausgeben&bild_id='+bild_id+'&produkt_id='+prod_id+sel1+sel2+sel3+sel4;
   window.location.href = URL;
}


function galerieColorChange (AnzBilder,AktBild,setzFarbe,scrollFarbe) {
 var i = 0;
 while (i < AnzBilder) {
  if (i == AktBild) {
    document.getElementById("bild_td_"+i).bgColor = setzFarbe;
   } else {
    document.getElementById("bild_td_"+i).bgColor = scrollFarbe;
   }
  i++;
 }
}

//******************************************************************
function open_window(url,w,h,name) {
	if (name=="anzeigen" && w>800)
		{w=840;h=h+60;}
		else{
		if (name=="anzeigen" && h>650)
			{h=740;w=w+40;}
			else
			{w=w+40;h=h+100;}
		}
	abmasse = "width=" + w + ",height=" + h;
	paras = "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0";
	paras_gesamt = paras+","+abmasse;
    window.open(url,name,paras_gesamt);
    }
//******************************************************************
function small_window1(wname)
{
    newWindow=window.open('','test','menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=600,height=450');
    newWindow.location=wname;
}
//******************************************************************
function open_window_produkt(url,w,h,name) {
	if (name=="anzeigen" && w>800)
		{w=840;h=h+60;}
		else{
		if (name=="anzeigen" && h>650)
			{h=740;w=w+40;}
			else
			{w=w+40;h=h+100;}
		}
	abmasse = "width=" + w + ",height=" + h;
	paras = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	paras_gesamt = paras+","+abmasse;
    window.open(url,name,paras_gesamt);
    }
//******************************************************************

//******************************************************************
function open_window_druck(url,w,h,name) {
	abmasse = "width=" + w + ",height=" + h;
	paras = "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0";
	paras_gesamt = paras+","+abmasse;
    window.open(url,name,paras_gesamt);
    }
//******************************************************************
function BrowserSniffer() {
   var agent = navigator.userAgent;
   var browserName = navigator.appName;
   var version = parseInt(navigator.appVersion)
   if (browserName == "Microsoft Internet Explorer") this.brows = "IE"
   else if (browserName == "Netscape") this.brows = "NN"
   else this.brows = browserName
   if (agent.indexOf('MSIE 5') != -1) this.ver = 5
   else this.ver = version
   this.IE = (this.brows == "IE" && this.ver >= 4)
   this.IE4 = (agent.indexOf('MSIE 4') != -1)
   this.IE5 = (agent.indexOf('MSIE 5') != -1)
   this.NN = (this.brows == "NN" && this.ver >= 4)
   this.NN4 = (this.brows == "NN" && this.ver == 4)
   this.NN5 = (this.brows == "NN" && this.ver == 5)
}


//******************************************************************
//wird nur bei "Fenster schliessen" für grosse Objektbilder benutzt
function b_design(style,action,text) {
var is = new BrowserSniffer();
	if (is.NN4==true)
		{
		document.write('<font size=1 face=geneva,arial><a href="'+action+'"><b><font size=2 color=#000000>'+text+'</font></b></A></font>');
		}
		else
			{
			document.write('<button style="'+style+'" onClick="'+action+'">'+text+'</button>');
			}
    }
//******************************************************************

//******************************************************************

//******************************************************************
function validate_data_wk(vorname,name,email,plz,ort,strasse,hausnummer,agb) {
str_vorname=/^[0-9A-Za-z-. üäö]{1,50}$/;
str_name=/^[0-9A-Za-z-. üäö]{1,50}$/;
//str_telefon=/^[0-9-/\+ ]{1,50}$/;
//str_email=/^(\w+(\.\w+)*)@((\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(\.[a-z]{2})?)$/;
str_email=/^[0-9A-Za-z-._\@]{1,50}$/;

str_plz=/^[0-9A-Za-z- üäö]{1,50}$/;
str_ort=/^[0-9A-Za-z- üäö]{1,50}$/;
str_strasse=/^[0-9A-Za-z-ß üäö]{1,50}$/;
str_hausnummer=/^[0-9A-Za-z- ]{1,50}$/;

if (document.dataform.agb.checked==false)
		{
		alert('Hinweis: Sie haben unsere AGB nicht akzeptiert');
		document.dataform.agb.focus();
		return false;
		}

if (str_name.test(name)==false)
		{
		alert('Hinweis: Ihr Name ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.name.focus();
		return false;
		}

if (str_vorname.test(vorname)==false)
		{
		alert('Hinweis: Ihr Vorname ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.vorname.focus();
		return false;
		}


if (str_email.test(email)==false)
		{
		alert('Hinweis: Ihre E-Mailadresse ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.email.focus();
		return false;
		}

if (str_plz.test(plz)==false)
		{
		alert('Hinweis: Ihre Postleitzahl ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.plz.focus();
		return false;
		}

if (str_ort.test(ort)==false)
		{
		alert('Hinweis: Ihr Ort ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.ort.focus();
		return false;
		}

if (str_strasse.test(strasse)==false)
		{
		alert('Hinweis: Ihre Strasse ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.strasse.focus();
		return false;
		}
if (str_hausnummer.test(hausnummer)==false)
		{
		alert('Hinweis: Ihre Hausnummer ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.hausnummer.focus();
		return false;
		}


return true;
}

function validate_data_form(name,ort,email,anliegen) {
str_name=/^[0-9A-Za-z-. üäö]{1,50}$/;
str_ort=/^[0-9A-Za-z-. üäö]{1,50}$/;
str_email=/^[0-9A-Za-z-._\@]{1,50}$/;
str_anliegen=/\s/;

if (str_name.test(name)==false)
		{
		alert('Hinweis: Ihr Name ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.name.focus();
		return false;
		}

      if (str_name.test(ort)==false) {
        alert('Hinweis: Ihr Ort ist nicht angegeben oder enthält ungültige Sonderzeichen.');
        document.dataform.ort.focus();
        return false;
        }

if (str_email.test(email)==false)
		{
		alert('Hinweis: Ihre E-Mailadresse ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.email.focus();
		return false;
		}

if (str_anliegen.test(anliegen)==false)
		{
		alert('Hinweis: Ihre Anliegen ist nicht angegeben oder enthält ungültige Sonderzeichen.');
		document.dataform.anliegen.focus();
		return false;
		}


return true;
}

function validate_agb(agb) {

if (agb==false)
		{
		alert('Hinweis: Sie haben unsere AGB nicht akzeptiert');
		document.dataform.agb.focus();
		return false;
		}

return true;
}