var popUpWin=0;

function radio_check(img){
 radio = document.getElementsByName(img.name);
 for(i=0;i<=radio.length-1;i++){
 	radio[i].src = radio[i].src.replace(/_c/,'_u');
	radio[i].nextSibling.value=0;
 }
 img.src = img.src.replace(/_u/,'_c');
 img.nextSibling.value=1;
}

function DelAnm(){
  this.document.EingabeMaske.name.value = '';
  document.EingabeMaske.vorname.value = '';
  document.EingabeMaske.email.value = '';
}

function DelAend(){
  document.EingabeMaske.aend_email.value = '';
}

function DelAbm(){
  document.EingabeMaske.del_email.value = '';
}

function Aend(){
  document.location.href = 'http://www.nasa.de/mailing.php?aend_email=' + escape(document.EingabeMaske.aend_email.value);
}

function sh_popup(URLStr,widthw,heightw)
{
  var width=(widthw>0) ? widthw:380;
  var height=(heightw>0) ? heightw:470;
  var left = parseInt((screen.availWidth/2) - (width/2));
  var top = parseInt((screen.availHeight/2) - (height/2));

  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr+'?popup', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

// UTILITY FUNCTIONS
var preload_img = new Array();
function preload(a){
var x=preload_img.length;
preload_img[x] = new Image();
preload_img[x].src = a;
}

function chomp (a,n){
//trim last N chars
return a.substr(0,a.length-n);
}

function strlast (a,n){ 
//return last N chars
return a.substr(a.length-n);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

	
function setHeight(){
var a1 = document.getElementById('textureFixBody').clientHeight;
var a2 = document.getElementById('table_source').clientHeight;
var b1 = a1 % 4;
	if (b1!=1) a1=a1-b1+5;
	document.getElementById('textureFixBody').height=a1;
    document.getElementById('lockal_banner_1').height = a2;
}

function setHeight_index(){
var a1 = document.getElementById('textureFixBody').clientHeight;
var b1 = a1 % 4;
	if (b1!=1) a1=a1-b1+5;
	document.getElementById('textureFixBody').height=a1;
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}



var timer;




function check_form(frm) {
 var good=true;
 
 if (frm.name == 'pr2'){

 if (frm.f1.value=="" || frm.f2.value=="" || frm.f3.value=="" || frm.f3a.value=="" || frm.f4.value=="" || frm.f4a.value=="" || frm.f5.value=="" || frm.f5a.value=="" || frm.f6.value=="" || frm.f9.value=="" || frm.f10.value=="" || frm.f11.value=="" || frm.f12.value=="" || frm.f13.value=="" || frm.data.value=="" || frm.f19.value=="")  good=false;
 
 if (frm.elements['f15a'].value != 0 &&
     frm.elements['f16'].value == "")  good=false;
		 
 if (frm.elements['f17a'].value != 0 &&
	 frm.elements['f18'].value == "")  good=false;


 }
 

if (frm.name == 'pr1'){ // kontakt
	 
	 if (frm.cb_1_id.value=="0" &&
		 frm.cb_2_id.value=="0" &&
		 frm.cb_3_id.value=="0" &&
		 frm.cb_4_id.value=="0" &&
    	 frm.cb_5_id.value=="0" &&
		 frm.cb_6_id.value=="0" &&
		 frm.cb_7_id.value=="0" &&
		 frm.cb_8_id.value=="0" &&
		 frm.elements['form_data[f18]'].value == "")  good=false;
	 
	 	 if (frm.elements['form_data[f19a]'].value == 0 &&
			 frm.elements['form_data[f19b]'].value == 0 &&
			 frm.elements['form_data[f19c]'].value == 0 &&
			 frm.elements['form_data[f19d]'].value == 0 )  good=false;
		 
	 	 if (frm.elements['form_data[f20a]'].value == 0 &&
			 frm.elements['form_data[f20b]'].value == 0 &&
			 frm.elements['form_data[f20c]'].value == 0 &&
			 frm.elements['form_data[f20d]'].value == 0 )  good=false;

	 	 if (frm.elements['form_data[f21a]'].value == 0 &&
		 frm.elements['form_data[f21b]'].value == 0 &&
 		 frm.elements['form_data[f21c]'].value == 0)  good=false;

	 	 if (frm.elements['form_data[f22a]'].value != 0 &&
		 frm.elements['form_data[f22]'].value == "")  good=false;

			if (frm.elements['form_data[f3]'].value == "")  good=false;
			if (frm.elements['form_data[f4]'].value == "" )  good=false;
			if (frm.elements['form_data[f5]'].value == "" )  good=false;
			if (frm.elements['form_data[f6]'].value == "" )  good=false;
			if (frm.elements['form_data[f7]'].value == "" )  good=false;
			if (frm.elements['form_data[f8]'].value == "" )  good=false;			

 }

 if (!good) alert('Gehen Sie auf Nummer sicher, dass alle Pflichtfelder ausgefüllt wurden!');
 return good; 
}
	
function popImage(imageURL,imgTitle){
imageURL=location.protocol+'//'+location.host+imageURL;
var defWidth=screen.availWidth;
var defHeight=screen.availHeight;
var defWidth1=10;
var defHeight1=10;
var f="width="+defWidth1+",height="+defHeight1;	
f+=",left="+((screen.availWidth-defWidth)/2)+",scrollbars=yes,resizable=yes,top="+((screen.availHeight-defHeight)/2);
imgWin=window.open('about:blank','',f);
imDoc=imgWin.document;
with (imDoc) {
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);if (width>0.75*screen.availWidth) width=0.75*screen.availWidth;');
writeln('height=100-(document.body.clientHeight-document.images[0].height);if (height>0.75*screen.availHeight) height=0.75*screen.availHeight;');
writeln('window.resizeTo(width,height);}');writeln('else {');       
writeln('window.innerWidth=document.images["George"].width<0.75*screen.availWidth ? document.images["George"].width:0.75*screen.availWidth;');
writeln('window.innerHeight=document.images["George"].height<0.75*screen.availHeight ? document.images["George"].height:0.75*screen.availHeight;}}');
writeln('function doTitle(){document.title="'+imgTitle+'";}');writeln('</sc'+'ript>');
writeln('</head><body bgcolor="#FFFFFF" onload="reSizeToImage();doTitle();self.focus()">')
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');

close();
}
}
