function focusField(feld){feld.style.border = 'solid #bb0000 1px';feld.style.background = '#fcf8e1';}
function blurField(feld){feld.style.border = 'solid #D1CEC9 1px';feld.style.background = '#fafafa';}
function focusImage(feld){feld.style.border = 'solid #B5BED6 1px';}
function blurImage(feld){feld.style.border = 'solid #0E057F 1px';}
function toggle(row){if( document.getElementById(row).style.display=='none' ){document.getElementById(row).style.display = '';}else{document.getElementById(row).style.display = 'none';}}
function windowopen(theURL,winName,features){window.open(theURL,winName,features);}
function clearHistoryAlert(theAlert,theURL){alert(theAlert);location.replace(theURL);}
function GenerateCarKey(){
	var dt,MM,DD,hh,mm,key;
	dt = new Date();
	DD = dt.getDate();
	MM = (dt.getMonth() + 1);
	hh = dt.getHours();
	mm = dt.getMinutes();

	if(DD < 10) DD = "0" + String(DD);
	if(MM < 10) MM = "0" + String(MM);
	if(hh < 10) hh = "0" + String(hh);
	if(mm < 10) mm = "0" + String(mm);

	key = String(MM) + String(DD) + String(hh) + String(mm);
	key = Number(key) * 39441;
	key = String(hh) + key + String(mm);

	document.forms['bwform'].prvid.value=key;
	document.forms['bwform'].submit();
}
function hide(elem,elem2){document.getElementById(elem).style.visibility = 'hidden';document.getElementById(elem2).style.visibility = 'visible';}
function hide2(elem,elem2,elem3)
{
	if(navigator.appName != "Microsoft Internet Explorer")
	{
		document.getElementById(elem).style.display = '';
	  document.getElementById(elem2).style.display = 'none';
	  document.getElementById(elem3).style.display = 'none';
	}
	else if(navigator.appVersion == "4.0 (compatible; MSIE 6.0; Windows NT 5.1 SV1)")
	{
		document.getElementById(elem).style.display = '';
	  document.getElementById(elem2).style.display = 'none';
	  document.getElementById(elem3).style.display = 'none';		
	}
	else
	{
		document.getElementById(elem).style["display"]=""; 
		document.getElementById(elem2).style["display"]="none";
		document.getElementById(elem3).style["display"]="none";
	}
}
function hide3(elem,elem2,elem3,elem4)
{
	if(navigator.appName != "Microsoft Internet Explorer")
	{
		document.getElementById(elem).style.display = '';
	  document.getElementById(elem2).style.display = 'none';
	  document.getElementById(elem3).style.display = 'none';
	  document.getElementById(elem4).style.display = 'none';
	}
	else if(navigator.appVersion == "4.0 (compatible; MSIE 6.0; Windows NT 5.1 SV1)")
	{
		document.getElementById(elem).style.display = '';
	  document.getElementById(elem2).style.display = 'none';
	  document.getElementById(elem3).style.display = 'none';		
	  document.getElementById(elem4).style.display = 'none';		
	}
	else
	{
		document.getElementById(elem).style["display"]=""; 
		document.getElementById(elem2).style["display"]="none";
		document.getElementById(elem3).style["display"]="none";
		document.getElementById(elem4).style["display"]="none";
	}
}
function checkall(formname,checkname,thestate){
  var el_collection=eval("document.forms."+formname+"."+checkname)
  for (c=0;c<el_collection.length;c++)
  	el_collection[c].checked=thestate
}
function surfto(form) {
  var myindex=form.help_index.selectedIndex
  if (form.help_index.options[myindex].value != "0") { parent.frames[1].location=form.help_index.options[myindex].value; }
}
var Fenster = null;
function popUp(target, name, options)
{
	Fenster = window.open(target,name,options)
	Fenster.focus();
}
function setSubmit(nameForm, nameField, source) { document.getElementById(nameField).value = document.getElementById(source).options[document.getElementById(source).selectedIndex].value; document.getElementById(nameForm).submit(); }
function confirmLink(theLink, message, article)
{
  var confirmMsg = new Object(); var confirmMsg = message;

  if (typeof confirmMsg == "undefined"){return false;}

  var is_confirmed = confirm(confirmMsg + '\n' + article)
  return is_confirmed;
}

function startbanner() {
var x = document.getElementById("CommercialDHTML");
setTimeout('document.getElementById("CommercialDHTML").style.visibility = "visible";',1500);
endebannerTime();
}

function endebanner() { var x = document.getElementById("CommercialDHTML").style.visibility = "hidden";}

function endebannerTime() {
var x = document.getElementById("CommercialDHTML");
setTimeout('document.getElementById("CommercialDHTML").style.visibility = "hidden";',25000);
}

//This array is used to remember mark status of rows in browse mode
var marked_row = new Array;

//Sets/unsets the pointer and marker in browse mode
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined'){return false;}
    if (typeof(document.getElementsByTagName) != 'undefined'){theCells = theRow.getElementsByTagName('td');}
    else if (typeof(theRow.cells) != 'undefined'){theCells = theRow.cells;}
    else {return false;}

    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') { currentColor = theCells[0].getAttribute('bgcolor'); domDetect = true; }
    else { currentColor = theCells[0].style.backgroundColor; domDetect = false; }

    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
      if (theAction == 'over' && thePointerColor != '') { newColor = thePointerColor; }
      else if (theAction == 'click' && theMarkColor != '') { newColor = theMarkColor; marked_row[theRowNum] = true; }
    }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') { newColor = theDefaultColor; }
        else if (theAction == 'click' && theMarkColor != '') { newColor = theMarkColor; marked_row[theRowNum] = true;}
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '') ? thePointerColor : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])? true : null;
        }
    }
    if (newColor) {
        var c = null;
        if (domDetect) { for (c = 0; c < rowCellsCnt; c++) { theCells[c].setAttribute('bgcolor', newColor, 0); }}
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    }

    return true;
}
function countPrice(feld)
{

	if(document.getElementsByName(feld)[0].checked)	{document.getElementById("counter").value = parseInt(document.getElementById("counter").value) + 1;	}
	else{document.getElementById("counter").value = parseInt(document.getElementById("counter").value) - 1;}
	
	if(document.getElementById("counter").value != 0)
	{
		var price = document.getElementById("price["+document.getElementById("counter").value+"]").value;
		document.getElementById("priceTotal").value = document.getElementById("counter").value*price;
	}
	else{document.getElementById("priceTotal").value = 0;}
	
	var priceTotal = document.getElementById("priceTotal").value;
	
	if(priceTotal.indexOf(".") != "-1")
	{
		var leftNum = priceTotal.substring(0,priceTotal.indexOf("."));
		var rightNum = priceTotal.substring(priceTotal.indexOf(".")+1,priceTotal.indexOf(".")+3);
	}else{
		var leftNum = priceTotal;
		var rightNum = "";
	}
	
	if(rightNum.length < 2){rightNum = rightNum+"00";}else{rightNum = rightNum.substring(0,2);}

	priceTotal = leftNum+","+rightNum.substring(0,2);
	document.getElementById("priceTotal").value = priceTotal;
	
	if(document.getElementById("submit"))
	{
		document.getElementById("submit").style.display = "none";
		document.getElementById("submit1").style.display = "";
	
		if(document.getElementById("counter").value != 0)
		{
			document.getElementById("submit").style.display = "";
			document.getElementById("submit1").style.display = "none";
		}
	}
}
function handleEPSPayment(bank){document.eps.bank.value = bank;document.eps.submit();}
function submitEPSPayment(){window.open('','pay');document.epsPayment.submit();}
function loginValues(fieldname, fieldpassword, defaultValue, option)
{

	if (document.getElementById(fieldname).value == defaultValue)
		document.getElementById(fieldname).value = "";

	if (option == 'pass')
	{
		document.getElementById(fieldname).style.display = "none";
		document.getElementById(fieldpassword).style.display = "block";
		document.getElementById('passwd').focus();
	}
}

/**
	clears the the default-values of the login-box
**/
function changeField(e) {
	if(e.name == 'username' && e.value == 'Username') {
		e.value = '';
	}
	else if(e.name == 'passwd1' && e.value == 'Passwort') {
		document.getElementById('passwd1').style.display = 'none';
		document.getElementById('passwd').style.display = 'block';
		document.getElementById('passwd').focus();
	}
}
