
function CreateCookie(name,value,days,useLang) 
{
  var langString = useLang ? ndeGetLang() : '';
  var cookie = name + langString + '=' + value + ';';
  if (days) 
  {
    var date = new Date();
    var ndeMilliSecondsInDay = 86400000; // 24*60*60*1000
    date.setTime(date.getTime()+(days*ndeMilliSecondsInDay));
    cookie += ' expires=' + date.toGMTString() + ';';
  }
  cookie += ' path=/';
  document.cookie = cookie;
}

function NavFixieren(fixieren,inline,logo,balken,navigation,zeile,schrift,farbprofil) {
	if (schrift == "") {
		if (window.name.substr(6,1) == "") {
			schrift = 1;
		} else {
			schrift = window.name.substr(6,1);
		}
	}
	if (farbprofil == "") {
		if (window.name.substr(7,1) == "") {
			farbprofil = 0;
		} else {
			farbprofil = window.name.substr(7,1);
		}
	}
	if (screen.height >= 768){
		if(fixieren==1) {
			
			//if (window.name.substr(0,1) == "1") {
				window.name = "000000"+schrift+farbprofil;
			/*
			} else {
				window.name = "101111"+schrift+farbprofil;
			}
			*/
		} else if(inline==1) {
			if (window.name.substr(1,1) == "1") {
				window.name = "000000"+schrift+farbprofil;
			} else {
				window.name = "010000"+schrift+farbprofil;
			}
		} else {
			if (logo==1) {
				if(window.name.substr(2,1) == "1") {
					logo = 0;
				} else {
					logo = 1;
				}
			} else {
				logo = window.name.substr(2,1);
			}
			if (balken==1) {
				if(window.name.substr(3,1) == "1") {
					balken = 0;
				} else {
					balken = 1;
				}
			} else {
				balken = window.name.substr(3,1);
			}
			if (navigation==1) {
				if(window.name.substr(4,1) == "1") {
					navigation = 0;
				} else {
					navigation = 1;
				}
			} else {
				navigation = window.name.substr(4,1);
			}
			if (zeile==1) {
				if(window.name.substr(5,1) == "1") {
					zeile = 0;
				} else {
					zeile = 1;
				}
			} else {
				zeile = window.name.substr(5,1);
			}
			if (navigation == 1 || balken == 1 || logo == 1 || zeile == 1) {
				inline = 0;
			} else {
				inline = window.name.substr(1,1);
			}
			window.name = window.name.substr(0,1)+inline+logo+balken+navigation+zeile+schrift+farbprofil;
		}
	}
	window.location.reload(false);
	//window.name = "00000020";
	CreateCookie('vgt-layout', window.name, 365, false);
	//document.write (ReadCookie('vgt-layout') + window.name);
	if (ReadCookie('vgt-layout') != window.name)
	{	alert('Um die Einstellung für weitere Besuche der Seite zu speichern müssen Sie Cookies aktiviert haben.');	}
}

