var imgpresrc = new Array();
var imgpre = new Array();
var linkopen;

function wopen(curl,cname,cpara)
{
   linkopen = window.open("",cname,cpara);
   linkopen.location.href = curl;
   //self.onfocus=keepOnTop();
}

function keepontop()
{
if(!linkopen.closed)
mywindow.focus();
}
function imgswp(img,csrc){
 document.images[img].src=csrc;
  }


function preloadimg()
{
  
  for( i=0 ; i < imgpresrc.length; i++)
  {
	imgpre[i] = new Image();
	imgpre[i].src = imgpresrc[i];
  }
	
}

function urljump(curl,cself,ctarget,cnpara){
  
  if( curl == '' ) return (false);
  
  if( curl.indexOf('cp_tpl='+cself,curl) >= 0){
  	eval("window.location='"+curl+"'");
  }
  else{

  	eval("window.parent.frames['"+ctarget+"'].location='"+curl+"'");

	if( !(cnpara == '') ){
		regex = new RegExp(cnpara+"=(.+)") ;
		cstr = window.location.href;
		if( cstr.indexOf(cnpara+'=') >= 0 ){
			cnewstr = cstr.replace(regex, curl.substr(curl.indexOf(cnpara+'=')));
	  		eval("window.location='"+cnewstr+"'");
	  	}
	}
  }

}


 // map navigation-------------------------------------------------------------
 

 function Goshop(x)
 {
    if (x!="nix")
    {
     shopopen = window.open(x,"Hans_Sauer_GmbH","");
    }
 }
 
 
 
 
 // return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function setClassName(objId,className)
{
document.getElementById(objId).className =className;
}


	
    
    
function showAnhFrage(vk,lie,zahlbed)
{
var show=false;
if(!(vk||lie))
show=true;
if(zahlbed==3)
show=false;
if(show)
     {
     document.getElementById('anhfrage').style.display = '';
      document.getElementById('in_anh').disabled =false;
      
     }
     else
     {
     document.getElementById('anhfrage').style.display = 'none';
      document.getElementById('in_anh').disabled =true; 
     
     }

}


function showUSTID(land)
    {
     if(land=='D'||!land)
     {
     if(document.getElementById('ustid'))
     document.getElementById('ustid').style.display = 'none';
      if(document.getElementById('in_ustid'))
      document.getElementById('in_ustid').disabled =true;
     }
     else
     {
     if(document.getElementById('ustid'))
     document.getElementById('ustid').style.display = '';
      if(document.getElementById('in_ustid'))
      document.getElementById('in_ustid').disabled =false;	
     }
    }
    
function showLA(land)
{
if(land!='D')
{
document.getElementById('la').style.display = 'none';
document.getElementById('la_name').disabled =true;
document.getElementById('la_vorname').disabled =true;
document.getElementById('la_strasse').disabled =true;
document.getElementById('la_ort').disabled =true;
document.getElementById('la_land').disabled =true;
document.getElementById('la_telefon').disabled =true;
}
else
{
document.getElementById('la').style.display = '';
document.getElementById('la_name').disabled =false;
document.getElementById('la_vorname').disabled =false;
document.getElementById('la_strasse').disabled =false;
document.getElementById('la_ort').disabled =false;
document.getElementById('la_land').disabled =false;
document.getElementById('la_telefon').disabled =false;
}




}

function showCC(zahlart)
{
if(zahlart==3)
{
document.getElementById('kklist').style.display = '';
document.getElementById('kkname').style.display='';
document.getElementById('kkemail').style.display='';
document.getElementById('cardIcon').style.display='';
document.getElementById('cclist').disabled=false;
document.getElementById('ccname').disabled =false;
document.getElementById('ccemail').disabled =false; 
}
else
{
document.getElementById('kklist').style.display = 'none';
document.getElementById('kkname').style.display='none';
document.getElementById('kkemail').style.display='none';
document.getElementById('cardIcon').style.display='none';
document.getElementById('cclist').disabled=true;
document.getElementById('ccname').disabled =true;
document.getElementById('ccemail').disabled =true; 
}
}


function replaceErrImg(img,changeURL){
img.src=changeURL;
}