var popUpWin=0;


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+'');
}

 
/*
**	Automatic Rollover Script
**	©2002-2004 Slava Subbass
*/
//config
var suffix="-over"; //"-down"; //can be "-over" (Imageready defaults) etc.
var suffixlength = suffix.length;
// 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);
}
// Register ONLOAD
window.onload = assign_rollover_handlers;
// HANDLERS
function assign_rollover_handlers(){
/*
	@version 0.9.2
	@desc assign handlers for imgs having "btn" in .name
*/
    for ( var x = 0; x < document.images.length; x++ ) {
        var obj = document.images[x];
        if(!obj.name)
            continue;
        if(obj.name.indexOf("current")>-1) {
            var j = chomp (obj.src,4)+suffix+strlast(obj.src,4);
			obj.src = j;		
        }
        if(obj.name.indexOf("btn")==0) {
            var j = chomp (obj.src,4)+suffix+strlast(obj.src,4);
            preload(j);
            obj.onmouseover=function(e) {						
                                var dsj = chomp (this.src,4)+suffix+strlast(this.src,4);
								this.src_over = this.src;
                                this.src = dsj;
                                    };
            obj.onmouseout=function (e) {
								if(this.src_over) this.src = this.src_over;
                           };
        }
    }
}



function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

var preloadFlag = false;


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 == 'pr3'){ // kontakt
	 if (frm.f2.value=='') good=false;
	 if (frm.f3.value=='') good=false;
	 if (frm.f5.value=='') good=false;
	 if (frm.f6.value=='') good=false;
	 if (frm.f7.value=='') good=false;
 }

 if(frm.name == 'pr4'){ //contracting-anfrage
	 if (frm.f1.value=='') good=false;
	 if (frm.f2.value=='') good=false;
	 if (frm.f20.value=='') good=false;
	 if (frm.f22.value=='') good=false;
	 if (frm.f23.value=='') good=false;
 	 if (frm.f24.value=='') good=false;
 } 
 
  if(frm.name == 'pr5'){ //Zahlerstandsmeldung
	 if (frm.f3.value=='') good=false;
	 if (frm.f5.value=='') good=false;
	 if (frm.f11.value=='') good=false;
	 if (frm.f12.value=='') good=false;
	 if (frm.f13.value=='') good=false;
 	 if (frm.f14.value=='') good=false;
	 if (frm.f15.value=='') good=false;
 } 

 if(frm.name == 'pr6'){ // email
	 if (frm.f1.value=='') good=false;
	 if (frm.f3.value=='') good=false;
	 if (frm.f4.value=='') good=false;
	 if (frm.f5.value=='') good=false;
 } 


 if(frm.name == 'form10'){ // email
	 if (frm.f1.value=='') good=false;
	 if (frm.f3.value=='') good=false;
	 if (frm.f4.value=='') good=false;
	 if (frm.f5.value=='') good=false;
	 if (frm.f6.value=='') good=false;
	 if (frm.f7.value=='') good=false;

	 if (frm.f19.value=='') good=false;
	 if (frm.f20.value=='') good=false;

	 if (frm.f23.value=='') good=false;
	 if (frm.f24.value=='') good=false;
	 if (frm.f25.value=='') good=false;

	 if (frm.f26.value=='') good=false;
	 if (frm.f27.value=='') good=false;
	 if (frm.f28.value=='') good=false;
	 if (frm.f29.value=='') good=false;
	 if (frm.f30.value=='') good=false;
	 if (frm.f31.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=0.75*screen.availWidth;
var defHeight=0.75*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();
}
}

<!--Tarifrechner

function calc(tarifegas){
var tarif,lpreis,vpreis,gpreis,ergebnis,normal,sonder,i=0;

normal=0.1906;
sonder=0.1718;

lpreis=22.54;
vpreis=24.91;
gpreis=73.20;

tarif=new Array (3);

ergebnis=Dez2(tarif[i]);

h = KP(tarifegas.verbrauch.value);               // h = <Eingabe, Komma in Punkt umgewandelt>

if (isNaN(h)) {
   alert("Sie haben leider ungültige Zeichen eingegeben");
return;
}

tarif [0]=normal * h + lpreis + vpreis;
tarif [1]=sonder * h + gpreis;


if (tarifegas.verbrauch.value==""){
alert("Sie müssen schon etwas eingeben!");
return;
}

if (h>1370){
(ergebnis=Dez2(tarif[1]),tarifegas.heisst.value="H 2002",tarifegas.diff.value=Dez2(tarif[0]-tarif[1]))
}
else if (h<=1370){
(ergebnis=Dez2(tarif[0]),tarifegas.heisst.value="normaler Haushaltstarif",tarifegas.diff.value=Dez2(tarif[1]-tarif[0]))
}

tarifegas.kosten.value=ergebnis;
}
// ===========================================

function Dez2(ss) {                              // Ausgabe von 2 Dezimalstellen gerundet
        var i, v, h, s1, a;

        s1 = rund2(ss*1.0);

        a = s1.toString();
        i = a.indexOf(".");
        if (i == -1)
        {
                return(a);
        }
        else {
                a = a + "0";
                v = a.substring(0,i);
                h = a.substring(i,i+3);
        }
        return (PK(v + h));
}

// ===========================================

function KP(w) {                                    // Komma -> Punkt
var z, l, i, lo, hi;

         z = w.toString();
         l = z.length;
         i = z.indexOf(",");
         if (i == -1) {
              return(z);
         }
         else {
              hi = z.substring(0,i);
              lo = z.substring(i+1,l);
         }
         return(hi + "." + lo);
}

// ===========================================

function PK(z) {                                    // Punkt -> Komma
var z, l, ii, lo, hi;

         l = z.length;
         ii = z.indexOf(".");
         if (ii == -1) {
              hi = z;
              lo = 0;
         }
         else {
              hi = z.substring(0,ii);
              lo = z.substring(ii+1,l);
         }
         return(hi + "," + lo);
}

// ===========================================

function rund2(xx) {                                // Runden auf 2 Dezimalstellen

        xx = Math.round(xx*100);
        xx /=100;
        return(xx);
}


// ===========================================
//-->
