/* author: Golant */
/* Creation date: 25.10.2004 */
/* Update date: 02.08.06  */

var IntBatNo =""

function start(){
	document.getElementById('I1').src= "0.html";
	document.getElementById('I3').src= "0.html";
}

function filtrstatusoem(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Filter_SCT/1" + top.I1.document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:45.5; dialogHeight:41.1; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function bremstatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Bremse/1" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:46; dialogHeight:43; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function kerzstatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Kerzen_SCT/" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:46; dialogHeight:42; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function lampstatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Lamps/" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:46; dialogHeight:42; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function bladestatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Blades/" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:28; dialogHeight:28; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function amortstatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Amort/" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:46; dialogHeight:43; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function podstatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Podsh/" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:46; dialogHeight:43; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function andstatus(){
	i = document.forms.myform.product.options.selectedIndex;
	y = "../Andere/" + document.forms.myform.product.options[i].value;
	i_WIN = window.showModalDialog(y, "i_WINNAME", "dialogWidth:46; dialogHeight:42; center:yes; location:0; directories:0; status:0; menubar:0; copyhistory:0; resizable:1");
}

function ClickRadio (IntBatNo) {
	if (sct == "1"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEM.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRef.html";
			document.getElementById('I3').src= "0.html";
		}
	}
	if (sct == "2") {
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEMbr.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefbr.html";
			document.getElementById('I3').src= "0.html";
		}
	}
	if (sct == "4"){
		if (IntBatNo == "1")	 {
			document.getElementById('I1').src= "Start/StartOEMbel.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefbel.html";
			document.getElementById('I3').src= "0.html";
			}
		}
	if (sct == "3"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEMker.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefker.html";
			document.getElementById('I3').src= "0.html";
			}
		}
	if (sct == "5"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEMlamp.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartReflamp.html";
			document.getElementById('I3').src= "0.html";
		}
	}
	if (sct == "6"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Filter/notfound.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefblade.html";
		}
	}
	if (sct == "7"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEMamort.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefamort.html";
			document.getElementById('I3').src= "0.html";
		}
	}
	if (sct == "9"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEMand.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefand.html";
			document.getElementById('I3').src= "0.html";
		}
	}
	if (sct == "8"){
		if (IntBatNo == "1") {
			document.getElementById('I1').src= "Start/StartOEMpod.html";
			document.getElementById('I3').src= "0.html";
		}
		if (IntBatNo == "2") {
			document.getElementById('I1').src= "Start/StartRefpod.html";
			document.getElementById('I3').src= "0.html";
		}
	}
}

function FilOpen_onclick(){
	sct = "1";
	document.getElementById('I1').src= "Start/StartOEM.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr1.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm1.R2[0].checked = "1";
}

function Br_Open_onclick(){
	sct = "2";
	document.getElementById('I1').src= "Start/StartOEMbr.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake1.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm.R2[0].checked = "1";
}

function Ker_Open_onclick(){
	sct = "3";
	document.getElementById('I1').src= "Start/StartOEMker.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze1.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm.R2[0].checked = "1";
}

function Bel_Open_onclick(){
	sct = "4";
	document.getElementById('I1').src= "Start/StartOEMbel.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt1.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm.R2[0].checked = "1";
}

function Lamp_Open_onclick(){
	sct = "5";
	document.getElementById('I1').src= "Start/StartOEMlamp.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe1.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm.R2[0].checked = "1";
}

function Blade_Open_onclick(){
	sct = "6";
	document.getElementById('I1').src= "Start/StartRefblade.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade1.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	R2[1].checked = "1";
}

function Amort_Open_onclick(){
	sct = "7";
	document.getElementById('I1').src= "Start/StartOEMamort.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort1.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm.R2[0].checked = "1";
}

function Pod_Open_onclick(){
	sct = "8";
	document.getElementById('I1').src= "Start/StartOEMpod.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod1.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and2.gif";
	document.forms.ButForm.R2[0].checked = "1";
}

function And_Open_onclick(){
	sct = "9";
	document.getElementById('I1').src= "Start/StartOEMand.html";
	document.getElementById('I3').src= "0.html";
	document.forms.ButForm.B1_i.src = "images/Bilder_anw/filtr2.gif";
	document.forms.ButForm.B2_i.src = "images/Bilder_anw/brake2.gif";
	document.forms.ButForm.B3_i.src = "images/Bilder_anw/belt2.gif";
	document.forms.ButForm.B4_i.src = "images/Bilder_anw/kerze2.gif";
	document.forms.ButForm.B5_i.src = "images/Bilder_anw/lampe2.gif";
	document.forms.ButForm.B6_i.src = "images/Bilder_anw/blade2.gif";
	document.forms.ButForm.B7_i.src = "images/Bilder_anw/amort2.gif";
	document.forms.ButForm.B8_i.src = "images/Bilder_anw/pod2.gif";
	document.forms.ButForm.B9_i.src = "images/Bilder_anw/and1.gif";
	document.forms.ButForm.R2[0].checked = "1";
}


/*==================================================*
 $Id$
 Copyright 2003 Patrick Fitzgerald
 http://www.barelyfitz.com/webdesign/articles/filterlist/

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *==================================================*/

function filterlist(selectobj) {

  // VARIABLES

  // HTML SELECT object
  this.selectobj = selectobj;

  // Flags for regexp matching.
  // "i" = ignore case; "" = do not ignore case
  this.flags = "i";

  // Make a copy of the options array
  this.optionscopy = new Array();
  for (var i=0; i < selectobj.options.length; i++) {
    this.optionscopy[i] = new Option();
    this.optionscopy[i].text = selectobj.options[i].text;
    this.optionscopy[i].value = selectobj.options[i].value;
  }

  //==================================================
  // METHODS
  //==================================================

  //--------------------------------------------------
  this.reset = function() {
  // This method resets the select list to the original state.
  // It also unselects all of the options.

    this.set("");
  }

  //--------------------------------------------------
  this.set = function(pattern) {
  // This method removes all of the options from the select list,
  // then adds only the options that match the pattern regexp.
  // It also unselects all of the options.
  // In case of a regexp error, returns false

    var loop=0, index=0, regexp, e;

    // Clear the select list so nothing is displayed
    this.selectobj.options.length = 0;

    // Set up the regular expression
    try {
      regexp = new RegExp(pattern, this.flags);
    } catch(e) {
      return;
    }

    // Loop through the entire select list
    for (loop=0; loop < this.optionscopy.length; loop++) {

      // Check if we have a match
      if (regexp.test(this.optionscopy[loop].text)) {

        // We have a match, so add this option to the select list
        this.selectobj.options.length = index + 1;
        this.selectobj.options[index].text = this.optionscopy[loop].text;
        this.selectobj.options[index].value = this.optionscopy[loop].value;
        this.selectobj.options[index].selected = false;

        // Increment the index
        index++;
      }
    }
  }

  //--------------------------------------------------
  this.set_ignore_case = function(value) {
  // This method sets the regexp flags.
  // If value is true, sets the flags to "i".
  // If value is false, sets the flags to "".

    if (value) {
      this.flags = "i";
    } else {
      this.flags = "";
    }
  }

}

