function addvolume()
{
	
	var addvol=document.edit.addvol.value;
	id='new_volumes';
	var el = document.all ? document.all(id) :
	document.getElementById ? document.getElementById(id) : null;
		
	var str1;
	var str2;
	
	if (addvol!="")
	{
		
		str1=el.innerHTML;		
		document.edit.addvol.value='';
	
		
		if(str1!='')
		{
			document.edit.newvol.value=document.edit.newvol.value +'|'+addvol;		
			if (el) el.innerHTML = str1+' + '+addvol;	
		}
		else
		{
			document.edit.newvol.value=addvol;		
			if (el) el.innerHTML = 	addvol;	
		}
		
		
		document.edit.addvol.focus();
		
	}
	else
	{
		alert('Bitte geben Sie ein ein Volum ein.');
	
	}
}

function clearvolume()
{
	id='new_volumes';
	var el = document.all ? document.all(id) :
	document.getElementById ? document.getElementById(id) : null;
	if (el) el.innerHTML = '';
	document.edit.newvol.value='';
}


function brau_all()
{
	
	
	if(!document.forms[0].F_ALLE.checked);
	{
		document.forms[0].F_GARANTEE.checked=false;
		document.forms[0].F_TROCKEN.checked=false;
		document.forms[0].F_ABSTAND.checked=false;
		
		document.forms[0].F_DURCHMESSER.selectedIndex=0;
	}
		
	
	
	
}

function brau_notall()
{
	
	document.forms[0].F_ALLE.checked=false;
	
}	

function was_behalt()
{

	id='mytext';
	

	var el = document.all ? document.all(id) :
	document.getElementById ? document.getElementById(id) : null;

	if(document.forms[0].F_BEHALTER[0].checked)
		str="Mündungsinnendurchmesser des Behälters (mm):";
	else
		str="Volumen (ml):";
		
	if (el) el.innerHTML = str;
}


function test_auf()
{
	
	id1='flus';
	id2='past';
	
	var el1 = document.all ? document.all(id1) : document.getElementById ? document.getElementById(id1) : null;
	var el2 = document.all ? document.all(id2) : document.getElementById ? document.getElementById(id2) : null;
	

	if(document.forms[0].F_AUF[0].checked)
	{
		if (el1) el1.style.display = 'block'; 
		if (el2) el2.style.display = 'none'; 
	}
	else
	{
		if (el1) el1.style.display = 'none'; 
		if (el2) el2.style.display = 'block'; 		
	}

}

function behalt()
{
	
	id1='durchmesser';
	id2='volume';
	
	var el1 = document.all ? document.all(id1) : document.getElementById ? document.getElementById(id1) : null;
	var el2 = document.all ? document.all(id2) : document.getElementById ? document.getElementById(id2) : null;
	

	if(document.forms[0].F_BEHALTER[0].checked)
	{
		//if (el1) el1.style.visibility = ''; 
		//if (el2) el2.style.visibility = 'hidden'; 
		if (el1) el1.style.display = 'block'; 
		if (el2) el2.style.display = 'none'; 
	}
	else
	{
		//if (el1) el1.style.visibility = 'hidden'; 
		//if (el2) el2.style.visibility = ''; 
		if (el1) el1.style.display = 'none'; 
		if (el2) el2.style.display = 'block'; 
		
	}

}
	
function dhide(myid)
{
	

	var el = document.all ? document.all(myid) :
	document.getElementById ? document.getElementById(myid) : null;
	if (el) el.style.display = 'none'; 
}

function dshow(myid)
{

	var el = document.all ? document.all(myid) :
	document.getElementById ? document.getElementById(myid) : null;
	if (el) el.style.display = 'block'; 
}

function test_behalt()
{

	if(document.forms[0].F_BEHALTER[0].checked)
	{		
		dshow('mytext1');	
		dshow('mytext2');	
		dshow('mytext3');	
		dshow('mytext4');	
	}
	else
	{
		dhide('mytext1');	
		dhide('mytext2');	
		dhide('mytext3');	
		dhide('mytext4');	
		document.forms[0].F_TEXT_TS.value="";
		document.forms[0].F_TROCKEN.checked=false;
		document.forms[0].F_GARANTEE.checked=false;
	}
	
}


function open_pdf(my_pdf) {
window.open(my_pdf);
}

function open_pic(my_pic) {
var width = 283;
var height = 283;
var leftpos = (screen.width) ? (screen.width-width)/2 : 0;
var toppos = (screen.height) ? (screen.height-height)/2 : 0;
picwin = window.open("../../../popup.htm?image="+my_pic,"bild","resizable=no,width="+width+",height="+height+",status=0,menubar=0,scrollbars=0,left="+leftpos+",top="+toppos+"");
//alert(my_pic);
}


function openwindow(my_window,num) {

var width = 640;
var height = 680;
var leftpos = (screen.width) ? (screen.width-width)/2 : 0;
var toppos = (screen.height) ? (screen.height-height)/2 : 0;
thiswin = window.open(my_window,num,"resizable=no,width="+width+",height="+height+",status=0,menubar=0,scrollbars=1,left="+leftpos+",top="+toppos+"");
//alert(my_pic);
}

function numeralsOnly(evt,lang) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
        ((evt.which) ? evt.which : 0));
    //alert(charCode);
    if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 44 && charCode != 46) 
    {
	    if(lang=='en')
        	alert("Please enter numerical values in this field.");   //alert(charCode);
            else
        	alert("Bitte geben Sie numerische Werte ein.");

	return false;

    }
    return true;
}

