// JavaScript Document

function searchquery(Wert)
{
	Wert = escape(Wert);
	Link	= "search.php?query=" + Wert;
	window.open(Link, 'Suche','scrollbars=yes,resizable=yes,width=550,height=530');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function pnow()
{	for(i=0;i<document.images.length;i++)
	{	if ( document.images[ i ].src == "http://img.map24.com/map24/portal/de-en/16_print.gif" )
			document.images[ i ].style.width=0;
	}
	window.print();
}

function validate_form() {
  validity = true; // assume valid
  if (!check_empty(document.agbform.agb.checked))
        { validity = false; alert('Sie müssen den AGB zustimmen um die Bestellung abzuschließen!'); }
  
  return validity;
}

function check_empty(status) {
  return (status == 1); // gibt false zurück wenn leer
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function pnow()
{	for(i=0;i<document.images.length;i++)
	{	if ( document.images[ i ].src == "http://img.map24.com/map24/portal/de-en/16_print.gif" )
			document.images[ i ].style.width=0;
	}
	window.print();
}
//-->
<!-- //cell functions

function number_format(number, laenge, sep, th_sep ) {

  number = Math.round( number * Math.pow(10, laenge) ) / Math.pow(10, laenge);
  str_number = number+"";
  arr_int = str_number.split(".");
  if(!arr_int[0]) arr_int[0] = "0";
  if(!arr_int[1]) arr_int[1] = "";
  if(arr_int[1].length < laenge){
    nachkomma = arr_int[1];
    for(i=arr_int[1].length+1; i <= laenge; i++){  nachkomma += "0";  }
    arr_int[1] = nachkomma;
  }
  if(th_sep != "" && arr_int[0].length > 3){
    Begriff = arr_int[0];
    arr_int[0] = "";
    for(j = 3; j < Begriff.length ; j+=3){
      Extrakt = Begriff.slice(Begriff.length - j, Begriff.length - j + 3);
      arr_int[0] = th_sep + Extrakt +  arr_int[0] + "";
    }
    str_first = Begriff.substr(0, (Begriff.length % 3 == 0)?3:(Begriff.length % 3));
    arr_int[0] = str_first + arr_int[0];
  }
  return arr_int[0]+sep+arr_int[1];
}




function resize_window(){
		var Breite = 625;
		var Hoehe = 570;
		var FBreite = screen.width;
		var FHoehe = screen.height;
		var pos_x = (FBreite-Breite)/2;
		var pos_y = (FHoehe-Hoehe)/2;
		window.resizeTo(Breite,Hoehe);
		window.moveTo(pos_x,pos_y);
		window.focus();
}

function refreshPreis(curOption) { //v2.0


	var newOptionscount = parseFloat(document.Shop.Optionscount.value);
	var derWertneu	= new Array();
	var newPreis	= parseFloat(document.Shop.Grundpreis.value);

	for(tt=1; tt<=newOptionscount; tt++) {
		eval("derWertneu = document.Shop.Option_"+ tt + ".value.split('|');");
		eval("newPreis += parseFloat(derWertneu[1]);");
		
		if(curOption == tt) {
			if(derWertneu[2] == "true") {
				document.Hauptmotiv.src = "bilder/beitraege/beitrag_" +  derWertneu[4] + "g.gif";
			}
			eval("curSelect2 = document.Shop.Option_" + tt +".options;");
			eval("TestWert = document.Shop.Option_"+ tt + ".value;");

			for(i=0;i<curSelect2.length;i++) {

				eval("derWertneu2 = curSelect2[i].value.split('|');");

				if(curSelect2[i].value == TestWert) {
					eval("document.MiniBild" + derWertneu2[0] + ".src = 'bilder/template/produkt_hover.gif'");
					eval("document.Bildform1.Bildbeschreibung.value = '" + derWertneu2[5] + "'");
				} else {
					eval("document.MiniBild" + derWertneu2[0] + ".src = 'bilder/shim.gif'");
				}
			}

		}

	}

	document.Shop.Endpreis.value = "EUR "+ number_format(newPreis,2,".","");
	document.Shop.DerPreis = "EUR "+ number_format(newPreis,2,".","");

}


function t4c_change_Option(derEineWert, derAndereWert) {
		
		eval("curSelect = document.Shop.Option_" + derAndereWert +".options;");
		for(i=0;i<curSelect.length;i++) {
			if(curSelect[i].value == derEineWert) {
				curSelect[i].selected = true;
			}
		}

		refreshPreis(derAndereWert);

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}