function timedRefresh(timeoutPeriod) {
        setTimeout("location.reload(true);",timeoutPeriod);
}
function auslesen(CookieName)
{
  var dc = "" + document.cookie;
  var Muster = 'dc.match(/' + CookieName + '=(.+)/)';
  eval(Muster);
  var Wert = unescape(RegExp.$1);
  return Wert;
}
function speichern(CookieName, CookieValue, CookieExpireDate)
{
  var EndDatum = '';
  if (CookieExpireDate != false)
  {
    var Datum = CookieExpireDate.split('-');
    var MyExpire = new Date();
    MyExpire.setDate(Datum[0]);
    MyExpire.setMonth(Datum[1] - 1);
    MyExpire.setYear(Datum[2]);
    EndDatum = ";expires=" + MyExpire.toGMTString();
  }
  document.cookie = CookieName + "=" + escape(CookieValue) + EndDatum;
}
function start(inputnr) {

var inputnr_global = auslesen('seminarcookie');
    if ( inputnr == 2 ) {
         if ( inputnr_global != "")
         {
           inputnr = inputnr_global;
           inputnr_global = parseInt(inputnr_global);
           inputnr_global = inputnr_global+1;
         speichern('seminarcookie', inputnr_global , false);
         }else
         {
         inputnr_global = inputnr+1;
         speichern('seminarcookie', inputnr_global , false);
         }
    }else{
    }
    createDiv(inputnr);
}

//function createTable(inputnr, row, col, id) {
function createDiv(inputnr) {

newdiv_right = document. createElement("div");
newdiv_right.setAttribute('style',"font-style:italic;float: right; margin-top:-20px;padding: 0px 0px;text-align: left;width: 180px;");
newdiv_right. innerHTML = "&nbsp;Beispiel: Teil "+inputnr+" Akupunktur<br>";

newdiv2_right = document. createElement("div");
newdiv2_right.setAttribute('style',"font-style:italic;float: right; margin-top:-20px;padding: 0px 0px;text-align: left;width: 180px;");
newdiv2_right. innerHTML = "&nbsp;Beispiel: 31.05.2010<br>";

newdiv3_right = document. createElement("div");
newdiv3_right.setAttribute('style',"font-style:italic;float: right; margin-top:-20px;padding: 0px 0px;text-align: left;width: 180px;");
newdiv3_right. innerHTML = "&nbsp;Beispiel: 31.05.2010<br>";

newdiv4_right = document. createElement("div");
newdiv4_right.setAttribute('style',"float: right;");


newdiv_middle = document. createElement("div");
newdiv_middle.setAttribute('style',"padding: 2px 0px;");
var input = document.createElement("input");
input.setAttribute("type","text");
                    input.setAttribute("name","Teil_Seminarname"+inputnr);
                    input.setAttribute("id","Teil_Seminarname"+inputnr);
                    newdiv_middle.appendChild(input)

newdiv2_middle = document. createElement("div");
newdiv2_middle.setAttribute('style',"padding: 2px 0px;");
var input2 = document.createElement("input");
input2.setAttribute("type","text");
                    input2.setAttribute("name","datum"+inputnr+"_tag1");
                    input2.setAttribute("id","datum"+inputnr+"_tag1");
                    newdiv2_middle.appendChild(input2)

newdiv3_middle = document. createElement("div");
newdiv3_middle.setAttribute('style',"padding: 2px 0px;");
var input3 = document.createElement("input");
input3.setAttribute("type","text");
                    input3.setAttribute("name","datum"+inputnr+"_tag2");
                    input3.setAttribute("id","datum"+inputnr+"_tag2");
                    newdiv3_middle.appendChild(input3)

newdiv4_middle = document. createElement("div");
var input4 = document.createElement("input");
input4.setAttribute("type","text");
                    input4.setAttribute("name","hidden");
                    input4.setAttribute("id","hidden");
                    input4.setAttribute("value",inputnr);
                    input4.setAttribute("type","hidden");
                    newdiv4_middle.appendChild(input4);

newdiv = document. createElement("div");
newdiv.setAttribute('style',"float: left;width: 50%;padding: 2px 0px;");
newdiv. innerHTML = "Teilseminar "+inputnr+": ";

newdiv2 = document.createElement("div");
newdiv2.setAttribute('style',"float: left;width: 50%;padding: 2px 0px;");
newdiv2. innerHTML = "Datum Tag 1:&nbsp;&nbsp;&nbsp;";

newdiv3 = document. createElement("div");
newdiv3.setAttribute('style',"float: left;width: 50%;padding: 2px 0px;");
newdiv3. innerHTML = "Datum Tag 2: ";

newdiv4 = document. createElement("div");
newdiv4.setAttribute('style',"float: left;width: 100%;padding-top:10px;");
newdiv4. innerHTML = "<hr style=\"background-color: #800031; color: #800031;border: 0;height: 1px; \">";

var position = document.getElementById("finaltest");
position.appendChild(newdiv);
position.appendChild(newdiv_middle);
position.appendChild(newdiv_right);

position.appendChild(newdiv2);
position.appendChild(newdiv2_middle);
position.appendChild(newdiv2_right);

position.appendChild(newdiv3);
position.appendChild(newdiv3_middle);
position.appendChild(newdiv3_right);

position.appendChild(newdiv4);
position.appendChild(newdiv4_middle);
}
function showFormSendWahl(ID, getShow){


        if(getShow == true){

            document.getElementById(ID).style.display = "inline";
        } else {
             document.getElementById(ID).style.display = "none";
        }
    }
function hideFormSendWahl(ID, getHide){


        if(getHide == true){

            document.getElementById(ID).style.display = "none";
        } else {
             document.getElementById(ID).style.display = "inline";
        }
    }
