id='metatag';

function taggenerator() {

//MetaTag Titel
  var tag1 = document.meta.title.value;
  if (tag1 == ''){
  title = '';
  } else {
  title = '<META NAME="Title" CONTENT="' + tag1 + '">\n';
  }

//MetaTag Autor
  var tag2 = document.meta.author.value;
  if (tag2 == ''){
  author = '';
  } else {
  author = '<META NAME="Author" CONTENT="' + tag2 + '">\n';
  }

//Meta Tag Publisher
  var tag3 = document.meta.publisher.value;
  if (tag3 == ''){
  publisher = '';
  } else {
  publisher = '<META NAME="Publisher" CONTENT="' + tag3 + '">\n';
  }

//MetaTag Copyright
  var tag4 = document.meta.copyright.value;
  if (tag4 == ''){
  copyright = '';
  } else {
  copyright = '<META NAME="Copyright" CONTENT="' + tag4 + '">\n';
}

//MetaTag Revisit
  var tag5 = document.meta.revisited.value;
  if (tag5 == ''){
  revisited = '';
  } else {
  revisited = '<META NAME="Revisit" CONTENT="After ' + tag5 + ' days">\n';
  }


//MetaTag Verfallsdatum 
  var tag6 = document.meta.expires.value;
  if (tag6 == ''){
  expires = '';
  } else {
  expires = '<META NAME="Expires" CONTENT="' + tag6 + '">\n';
  }

//MetaTag Keywords
  var tag7 = document.meta.keywords.value;
  if (tag7 == ''){
  keywords = '';
  } else {
  keywords = '<META NAME="Keywords" CONTENT="' + tag7 + '">\n';
  }

//MetaTag Beschreibung (Description und Abstract)
  var tag8 = document.meta.description.value;
  if (tag8 == ''){
  description = '';
  abstrct = '';
  } else {
  description = '<META NAME="Description" CONTENT="' + tag8 + '">\n';
  abstrct = '<META NAME="Abstract" CONTENT="' + tag8 + '">\n';
  }

//MetaTag Themengebiet
  var tag9 = document.meta.pagetopic.value;
  select1 = document.meta.pagetopic.options.selectedIndex;
  value1 = document.meta.pagetopic.options[select1].value;
  if (value1 == '1'){
  pagetopic = '';
  } else {
  pagetopic = '<META NAME="page-topic" CONTENT="' + value1 + '">\n';
  }

//MetaTag Seitentyp
  var tag10 = document.meta.pagetype.value;
  select2 = document.meta.pagetype.options.selectedIndex;
  value2 = document.meta.pagetype.options[select2].value;
  if (value2 == '1'){
  pagetype = '';
  } else {
  pagetype = '<META NAME="page-topic" CONTENT="' + value2 + '">\n';
  }


//MetaTag Zielgruppe
  var tag11 = document.meta.audience.value;
  select3 = document.meta.audience.options.selectedIndex;
  value3 = document.meta.audience.options[select3].value;
  if (value3 == '1'){
  audience = '';
  } else {
  audience = '<META NAME="audience" CONTENT="' + value3 + '">\n';
  }

//MetaTag Robots
  var tag12 = document.meta.robots.value;
  select4 = document.meta.robots.options.selectedIndex;
  value4 = document.meta.robots.options[select4].value;
  if (value4 == '1'){
  robots = '';
  } else {
  robots = '<META NAME="Robots" CONTENT="' + value4 + '">\n';
  }

//MetaTag Sprache
  var tag13 = document.meta.sprache.value;
  select5 = document.meta.sprache.options.selectedIndex;
  value5 = document.meta.sprache.options[select5].value;
  if (value5 == '1'){
  language = '';
  } else {
  language = '<META NAME="Language" CONTENT="' + value5 + '">\n';
  }

if (tag1 == '' && tag2 == '' && tag3 == '' && tag4 == '' && tag5 == '' && tag6 == '' && tag7 == '' && tag8 == '' &&value1 =='1' &&value2 =='1' &&value3 =='1' &&value4 =='1' &&value5 =='1') {
alert('Ohne Eingaben kann man keine Metadaten generieren!');

} 

else {
	
  output = (title);
  output = (output + author);
  output = (output + publisher);
  output = (output + copyright);
  output = (output + revisited);
  output = (output + expires);
  output = (output + keywords);
  output = (output + description);
  output = (output + abstrct);
  output = (output + pagetopic);
  output = (output + pagetype);
  output = (output + audience);
  output = (output + robots);
  output = (output + language);

	document.meta.tags.value=output;
  }
}
