<!-- copyright 2006 by Art2Digital.com - Webdesign and Internet Marketing -->

function generate() {
  var txt="";
  var tmp1="";
  var tmp2="";
  
  if (document.mform.title.value!="")
    txt += '<meta name="title" content="'+document.mform.title.value+'">\n';
  if (document.mform.author.value!="")
    txt += '<meta name="author" content="'+document.mform.author.value+'">\n';
  if (document.mform.publisher.value!="")
    txt += '<meta name="publisher" content="'+document.mform.publisher.value+'">\n';
  if (document.mform.copyright.value!="")
    txt += '<meta name="copyright" content="'+document.mform.copyright.value+'">\n';
  if (document.mform.generator.value!="")
    txt += '<meta name="generator" content="'+document.mform.generator.value+'">\n';
  if (document.mform.description.value!="")
    txt += '<meta name="description" content="'+document.mform.description.value+'">\n<meta name="abstract" content="'+document.mform.description.value+'">\n';
  if (document.mform.contentlanguage.value!="")
    txt += '<meta http-equiv="content-language" content="'+document.mform.contentlanguage.value+'">\n';
  if (document.mform.charset.value!="")
    txt += '<meta http-equiv="content-type" content="text/html; charset='+document.mform.charset.value+'">\n';
  if (document.mform.pubdate.value!="")
    txt += '<meta name="date" content="'+document.mform.pubdate.value+'">\n';
  if (document.mform.expires.value!="")
    txt += '<meta name="expires" content="'+document.mform.expires.value+'">\n';

  if (document.mform.robots1.value!="")
    tmp1=document.mform.robots1.value;
  if (document.mform.robots2.value!="")
    tmp2=document.mform.robots2.value;
    if (tmp1!="" && tmp2!="") tmp1+=","
	if (tmp1!="" || tmp2!="") txt+='<meta name="robots" content="'+tmp1+tmp2+'">\n';
	tmp1="";
	tmp2="";

  if (document.mform.revisit.value!="")
    txt += '<meta name="revisit-after" content="'+document.mform.revisit.value+' days">\n<meta name="revisit" content="after '+document.mform.revisit.value+' days">\n';

  if (document.mform.original.checked==true)
    txt += '<meta http-equiv="expires" content="0">\n';
  if (document.mform.nocache.checked==true)
    txt += '<meta http-equiv="pragma" content="no-cache">\n';

  if (document.mform.dctitle.value!="")
    txt += '<meta name="DC.Title" content="'+document.mform.dctitle.value+'">\n';
  if (document.mform.dccreator.value!="")
    txt += '<meta name="DC.Creator" content="'+document.mform.dccreator.value+'">\n';
  if (document.mform.dccontributor.value!="")
    txt += '<meta name="DC.Contributor" content="'+document.mform.dccontributor.value+'">\n';
  if (document.mform.dcrights.value!="")
    txt += '<meta name="DC.Rights" content="'+document.mform.dcrights.value+'">\n';
  if (document.mform.dcpublisher.value!="")
    txt += '<meta name="DC.Publisher" content="'+document.mform.dcpublisher.value+'">\n';
  if (document.mform.dcdate.value!="")
    txt += '<meta name="DC.Date" content="'+document.mform.dcdate.value+'">\n';
  if (document.mform.dcsubject.value!="")
    txt += '<meta name="DC.Subject" content="'+document.mform.dcsubject.value+'">\n';
  if (document.mform.dcrelation.value!="")
    txt += '<meta name="DC.Relation" content="'+document.mform.dcrelation.value+'">\n';
  if (document.mform.dcdescription.value!="")
    txt += '<meta name="DC.Description" content="'+document.mform.dcdescription.value+'">\n';
  if (document.mform.dccoverage.value!="")
    txt += '<meta name="DC.Coverage" content="'+document.mform.dccoverage.value+'">\n';
  if (document.mform.dclanguage.value!="")
    txt += '<meta name="DC.Language" content="'+document.mform.dclanguage.value+'">\n';
  if (document.mform.dctype.value!="")
    txt += '<meta name="DC.Type" content="'+document.mform.dctype.value+'">\n';
  if (document.mform.dcformat.value!="")
    txt += '<meta name="DC.Format" content="'+document.mform.dcformat.value+'">\n';
  if (document.mform.dcidentifier.value!="")
    txt += '<meta name="DC.Identifier" content="'+document.mform.dcidentifier.value+'">\n';
  if (document.mform.dcsource.value!="")
    txt += '<meta name="DC.Source" content="'+document.mform.dcsource.value+'">\n';
 
  document.mform.source.value = txt + document.mform.temp.value;
}

function addkeywords() {
  var txt="";
  var lang="";
  if (document.mform.keywords.value!="") {
    lang=document.mform.keywordslanguage.value;
	if (lang!="") lang=' lang="'+lang+'"';
    txt += '<meta name="keywords"'+lang+' content="'+document.mform.keywords.value+'">\n';
    document.mform.source.value += txt;
    document.mform.temp.value += txt;
    document.mform.keywords.value="";
  }
}

function addself() {
  var txt="";
  var lang="";
  if (document.mform.selfname.value!="") {
    if (document.mform.selftext.value!="") {
      txt += '<meta name="'+document.mform.selfname.value+'" content="' + document.mform.selftext.value+'">\n';
      document.mform.source.value += txt;
      document.mform.temp.value += txt;
      document.mform.selfname.value="";
      document.mform.selftext.value="";
    }
  }
}

function getactdate() {
  var dd;
  var now = new Date();
  var yy = now.getYear();
  if(yy < 999) yy+=1900;
  var mm = "0"+now.getMonth();
  mm=mm.substring(mm.lenght-2,2);
  var dd = "0"+now.getDate();
  dd=dd.substring(dd.lenght-2,2);
  return(yy+"-"+mm+"-"+dd);
}

function setdate() {
  document.mform.pubdate.value = getactdate();
}

function setdcdate() {
  document.mform.dcdate.value = getactdate();
}

function setDC() {
  document.mform.dctitle.value=document.mform.title.value;
  document.mform.dccreator.value=document.mform.author.value;
  document.mform.dcrights.value=document.mform.copyright.value;
  document.mform.dcpublisher.value=document.mform.publisher.value;
  document.mform.dcdate.value=document.mform.pubdate.value;
  document.mform.dcdescription.value=document.mform.description.value;
  document.mform.dclanguage.value=document.mform.contentlanguage.value;

}