
function img_swapImgRestore() { //v3.0
  var i,x,a=document.img_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}

function img_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.img_p) d.img_p=new Array();
    var i,j=d.img_p.length,a=img_preloadImages.arguments; for(i=0; i<a.length;
i++)
    if (a[i].indexOf("#")!=0){ d.img_p[j]=new Image; d.img_p[j++].src=a[i];}}
}

function img_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=img_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function img_swapImage() { //v3.0
  var i,j=0,x,a=img_swapImage.arguments; document.img_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
   if ((x=img_findObj(a[i]))!=null){document.img_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function nav_0_change(rno)
{
var tmp = document.getElementById(rno);
tmp.className='td2_nav0';
}

function nav_0_restore(rno)
{
var tmp = document.getElementById(rno);
tmp.className='td1_nav0';
}

function textCounterlimit(field,cntfield,maxlimit,str1,str2) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value =  str1 + ' ' + (maxlimit - field.value.length) + ' ' + str2;
}

function textStop(field,maxlimit) {
if (field.value.length > maxlimit)
    field.value = field.value.substring(0, maxlimit);
}

function textCounter(field,cntfield) {
cntfield.value = field.value.length + ' Zeichen';
}

function scrollto(dy) {
    	//window.scrollBy(0,200);
		window.scroll(0,dy);
}

function breitego() {
	   if(document.forms[0].Breite.value<20 || document.forms[0].Breite.value.indexOf('x')!=-1) {
	       document.forms[0].Querschnitt.value='';
		  }
		
		  else if(document.forms[0].Querschnitt.value<1) {
		      document.forms[0].Querschnitt.value=65;
		  }
}
function showhide(id)
{
var tmp = document.getElementById(id);
if(tmp.style.display=='block')
    tmp.style.display='none';
else if(tmp.style.display=='none')
    tmp.style.display='block';
}
function visibility(id,flag)
{
var tmp = document.getElementById(id);
if(flag=='block')
    tmp.style.display='block';
else if(flag=='none')
    tmp.style.display='none';
}
function submitfastsearchformchange(action)
{
  document.searchth.method="post";
  document.searchth.action=action+"search=n";
  document.searchth.submit();
  
  return true;
}
function submitfastsearchformsearch(action)
{
  document.searchth.method="post";
  document.searchth.action=action+"search=y";
  document.searchth.submit();
  
  return true;
}

function gotoURL(url)
{
  window.location=url;
}

function OnlyNumbers(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode;
	if (unicode!=8)
	{ //if the key isn't the backspace key (which we should allow)
		if (unicode<48||unicode>57) //if not a number
			return false; //disable key press
	}
}

//Only Letters
function OnlyLetters(e)
{
	var key = window.event ? e.keyCode : e.which;
	var keychar = String.fromCharCode(key);
	reg = /\d/;
	return !reg.test(keychar);
}
var bflag=false;
function glowunglow(id)
{
    var tmp = document.getElementById(id);
		
	if(!bflag)
	{
	    tmp.style.background="1px solid #FF6600";
		bflag^=1;
	}
	else
	{
	    tmp.style.background="1px none #FF6600";
		bflag&=0;
	}
		
}
function alternatesel(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("td");
   for(i = 0; i < rows.length; i++){
       urerestore = rows[i].className;
       rows[i].className = "ure";
   }
 }
}
function alternateunsel(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("td");  
   for(i = 0; i < rows.length; i++){
       urerestore = rows[i].className;
       rows[i].className = "whiteure";
   }
 }
}
function alternateunsel0(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("td");  
   for(i = 0; i < rows.length; i++){
       urerestore = rows[i].className;
       rows[i].className = "redure";
   }
 }
}
function makepopup(url,title,width,height) {
	width_height_string="height="+height+",width="+width;
	newwindow=window.open(url,title,width_height_string);
	if (window.focus) {newwindow.focus()}
	return false;
}
function PopUp(w,h,ziel) {
  h = h - 20; var x=0, y=0, parameter="";
  if (w < screen.availWidth || h < screen.availHeight) {
    x = (screen.availWidth - w - 12) / 2;
    y = (screen.availHeight - h - 104) / 2;
    if (window.opera) y = 0; // Opera positioniert unter den Symbolleisten
    if (x<0 || y<0) { x=0; y=0; }
    else parameter = "width=" + w + ",height=" + h + ",";
  }
  parameter += "left=" + x + ",top=" + y;
  parameter += ",menubar=no,location=no,toolbar=no,status=no";
  parameter += ",resizable=no,scrollbars=yes";
  var Fenster = window.open(ziel,"PopUp",parameter);
  if (Fenster) Fenster.focus();
  return !Fenster;
}

