// JavaScript Document
function BegleitCheck(Nvalidated, Fvalidated) {
	if (document.VarioForm.Begleit.checked == true) {
		var deaktiviert = false;
		bg1 = Nvalidated;
		bg2 = Fvalidated;
	} 
	else {
		var deaktiviert = true;
		var bg1 = "#d6d5d9";
		var bg2 = "#d6d5d9";
	}
  	document.VarioForm.Be_Name.disabled = deaktiviert;
 	document.VarioForm.Be_Name.style.background = bg1; 
 	document.VarioForm.Be_Firma.disabled = deaktiviert;
	document.VarioForm.Be_Firma.style.background = bg2;
}

function menuAuf (zahl) {
	for (var i=1; i <= 7; i++) {
		var name = "sub_"+i;
		document.getElementById(name).style.visibility="hidden";
	}
	var aktobj = "sub_"+zahl;
   	document.getElementById(aktobj).style.visibility="visible";
}
function menuZu (event) {
	if ((event.pageY < 240)||(event.pageY > 320)) {
		for (var i=1; i <= 7; i++) {
		var name = "sub_"+i;
		document.getElementById(name).style.visibility="hidden";
	}
	}
}

var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h,s) {
	var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
	if (!url) return true;
	w = (w) ? w += 20 : 150;  // 150px*150px is the default size
	h = (h) ? h += 25 : 150;
	var args = 'width='+w+',height='+h+',resizable'+',scrollbars=yes,location=no';
	popdown();
	pop = window.open(url,"Information",args);
	return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;


function setAktiv (zahl) {
  for (i=1; i<= 7; i++) {
	  i==zahl ? aktiv = zahl : '';
  }		
}
function hover (zahl) {
menuAuf(zahl);
  for (i=1; i<= 7; i++) {
	if(i==zahl) {
	  if(i!=aktiv){
	   document.getElementById("button"+i).src =("gfx/buttons/menu/button"+i+"_over.gif");
	  }
	} 
  }
}
function mouseOut (zahl) {
 for (i=1; i<= 7; i++) {
	if(i==zahl){
	   if(i!=aktiv) {
	   document.getElementById("button"+i).src =("gfx/buttons/menu/button"+i+"_roh.gif");
	   }
	}
  }  
}


function BilderVorladen()
{
    document.Vorladen = new Array("gfx/buttons/menu/button1_aktiv","gfx/buttons/menu/button2_aktiv", "gfx/buttons/menu/button3_aktiv", "gfx/buttons/menu/button4_aktiv","gfx/buttons/menu/button5_aktiv","gfx/buttons/menu/button6_aktiv","gfx/buttons/menu/button7_aktiv",				"gfx/buttons/menu/button1_over","gfx/buttons/menu/button2_over","gfx/buttons/menu/button3_over","gfx/buttons/menu/button4_over",		"gfx/buttons/menu/button5_over","gfx/buttons/menu/button6_over","gfx/buttons/menu/button7_over");

    if(document.images)
    {
        for(var i = 0; i < BilderVorladen.arguments.length; i++)
        {
            document.Vorladen[i] = new Image();
            document.Vorladen[i].src = BilderVorladen.arguments[i];
        }
    }
}

