// JavaScript für die mittige Anordnung eines Bildes im Popup.
// weltie.com | the modern web-design
// Februar 2005

function PicPopup()
{
  this.lastWidth = 0;
  this.lastHeight = 0;
  this.childWin = null;
  this.showImageInSize = showImageInSize;
}
function showImageInSize(src, target, width, height){
  if(document.layers || window.opera){
    var x=y=-8;
  } else{
  	var x=y=-0;
  }
  
  var html='<HTML><HEAD><title>weltie.com</title>' +
           ' <style type="text/css"> ' + 
           '   body {margin-left:'+x+'px; margin-top:'+y+'px; ' + 
           '         margin-right:0px; margin-bottom:0px; ' + 
           '         text-align : center;} ' +
           ' </style> ' + 
           '</HEAD>' + 
           '<body>' + 
           '<img onClick="window.close();" width="'+width+'" alt="Zum Schliessen klicken!" src="' + src + '" border="0">' +
           '</body> </html>';

  if( this.childWin && !this.childWin.closed) {
    diffX = width - this.lastWidth;
    diffY = height - this.lastHeight;
    this.childWin.resizeBy(diffX, diffY);
  } else {
    this.childWin = window.open("dummy.html",target,"scrollbars=yes,width="+width+",height="+height+",resizable=1");
  }
  this.lastWidth = width;
  this.lastHeight = height;
  
  with(this.childWin.document){
    open(); write(html); close();
  }
  sh=screen.availHeight-height;
  sw=screen.availWidth-width;
  this.childWin.moveTo(sw/2,sh/2);
  this.childWin.focus();
}
var picpop=new PicPopup();

// JavaScript für Färbung der Navigation.
// weltie.com | the modern web-design
// Februar 2005
function over(td) {
td.style.backgroundColor = "#D7420F";  
td.firstChild.style.color = "#FFFFFF";  
td.style.cursor='hand';
}
function out(td) {
td.style.backgroundColor = "#FFFFFF";   
td.firstChild.style.color = "#D7420F";
}

// JavaScript zur Überprüfung ob alle Pflichtfelder ausgefüllt sind.
// weltie.com | the modern web-design
// Mai 2005 

function form_check(obj,layout)
{
aus=true;
ausgabe="";
form_name=obj["name"];
form=document.forms[form_name].elements;
	
for(x=0;x<form.length;x++)
{
	name=form[x].name;
	besch=form[x].alt;
	value=form[x].value;
	last=name.lastIndexOf('_')+1;
	if(last!=-1)
	{
		end=name.substr(last);	
		//alert(name+" "+end+" "+form[x].selected);
		if((end=='N' && value=="") || (end=='Nselect' && value=="0"))
		{
			if(besch==undefined || besch=="")
			{
			alert("schwerer Fehler!"+"\n"+"Input "+name+" hat keine Beschreibung! (alt=\" \")"+"\n\n"+"Bitte Kontakt mit Service aufnehmen!");
			}
			else
			{
			ausgabe=ausgabe+besch+"<br>";
			aus=false;
			}
		}
	}
}

if(!aus)
{
	switch (layout)
	{
		case 0: 
		begin="<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>&nbsp;</td></tr><tr><td class=\"rahmen_orange\"><table width=\"98%\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"schrift_orange\">";
		end="</td></tr></table></td></tr><tr><td>&nbsp;</td></tr></table>";
		break;
		case 1: 
		begin="<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td class=\"orange_schrift\"><table width=\"98%\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"schrift_orange\">";
		end="</td></tr></table></td></tr></table>";
		break;
		default : 
		begin="<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>&nbsp;</td></tr><tr><td class=\"rahmen_orange\"><table width=\"98%\"  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"schrift_orange\">";
		end="</td></tr></table></td></tr><tr><td>&nbsp;</td></tr></table>";
	} 
	
output=form_name+"_out";
ok=document.getElementById(output) || document.all.output;
ok.innerHTML=begin+ausgabe+end;
return false;
}
else
{
return true;
}
}