
<!-- Hide code

//  Initialise the list of adjectives.

function set_adjectives()
{
    this[1]="vorweihnachtliche"
    this[2]="stimmungsvolle"
    this[3]="verführerische"
    this[4]="glückliche"
    this[5]="exklusive"
    this[6]="leckere"
    this[7]="niedliche"
    this[8]="engelhafte"
    this[9]="komplexe"
    this[10]="lustige"
    this[11]="fantastische"
    this[12]="verrückte"
    this[13]="absurde"
    this[14]="unvergessliche"
    this[15]="grandiose"
    this[16]="versnobte"
    this[17]="luxuriöse"
    this[18]="vollautomatische"
    this[19]="schnöde"
    this[20]="glamouröse"
    this[21]="festliche"
    this[22]="umwerfende"
    this[23]="illustre"
    this[24]="intergalaktische"
    this[25]="verheißungsvolle"
    this[26]="feinsinnige"
    this[27]="allerliebste"
    this[28]="geheimnisvolle"
    this[29]="fröhliche"
    this[30]="sündhaftteure"

    this.count = 30
}

//  Initialise the list of nouns.

function set_nouns()
{
    this[1]="Grüße"
    this[2]="Aufmerksamkeiten"
    this[3]="Schönredereien"
    this[4]="Verpflichtungen"
    this[5]="Spezereien"
    this[6]="Geschmacklosigkeiten"
    this[7]="Lobhudeleien"
    this[8]="Weihnachtsplaudereien"
    this[9]="Weihnachtslektüren"
    this[10]="Bonmots"

    this.count = 10
}

//  Return a random integer from 1 to n inclusive.

function rnum ( n )
{
    var ddd = new Date()
    var d = ddd.getSeconds()

    return ( ( d % n ) + 1 )
}

//  Get a random word from the "w" array, and set that array element to
//  null so that the same word isn't chosen again.

function getword ( w )
{
    var s = ""
    var i = 0

    while ( s == "" )
    {
        i = rnum ( w.count )

        if ( w[i] == "" )
        {
            i = ( i + 1 ) % w.count
        }
        else
        {
            s = w[i]
            w[i] = ""
        }
    }
    return s
}

//  Return a random adjective or noun.

function adj () { return getword ( adjs  ) }
function noun() { return getword ( nouns ) }

//  Capitalise each word in a string.

function cap ( s )
{
    var a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

    var shift = 1
    var res   = ""

    for ( i = 0; i < s.length; i++ )
    {
        ch = s.charAt(i)
        p  = a.indexOf ( ch )

        if ( p == -1 )
        {
            shift = 1
        }
        else if ( p < 26 )
        {
            if ( shift )
            {
                ch = a.charAt ( p + 26 )
                shift = 0
            }
        }
        else
        {
            shift = 0
        }
        res = res + ch
    }
    return res
}

//  --- MAIN ---

var adjs  = new set_adjectives()
var nouns = new set_nouns     ()

function DoIt ( info )
{
    var who   = info.who.value
    var org   = info.org.value
    var field = info.field.value
    var topic = info.subject.value

    var a1 = adj()
    var a2 = adj()
    var nn = noun()

    var title  = a1 + " " + a2 + " " + nn
    var ctitle = cap ( a1 ) + " " + cap ( a2 ) + " " + cap ( nn )

    win = window.open("","results","toolbar=no,width=600,height=690,directories=no,status=no,scrollbars=no,resize=no,menubar=no")
    win.document.writeln ( "<html><head><title>" + cap ( ctitle ) + "</title></head>" )
    win.document.writeln ( "<body bgcolor=\"#ffffff\">" )
    win.document.writeln ( "<center><table align=center width=\"90%\"><tr><td>" )
    win.document.writeln ( "<p align=center><i><font size=+3>" +  ctitle + "<br>für <br>" + cap ( who )  +  "" + "</font></i></p>" )
    win.document.writeln ( "<hr size=3 width=\"50%\">" )
    win.document.writeln ( "<p>Weihnachten und  " + topic + ", das erinnert mich an eine Begebenheit vor wenigen Tagen. " )
    win.document.writeln ( "Ich wollte in meiner " + adj() + "n Mittagspause eine Kleinigkeit besorgen, " )
    win.document.writeln ( "nach " + field + " stand mir der Sinn," )
    win.document.writeln ( "da sah ich in dem " + adj() + "n Laden nebenan ein " + adj() + "s Geschenk: " )
    win.document.writeln ( "" + org +", das wär's!" )
	win.document.writeln ( "<p>Da habe ich natürlich gleich an Sie gedacht, " + who + "." )
    win.document.writeln ( "Ob Ihnen wohl so ein " + org + "-Präsent gefallen würde? " )
    win.document.writeln ( "Oder wäre dies eine zu " + adj() + " Aufmerksamkeit? Ich war mir da nicht ganz sicher. " )
    win.document.writeln ( "<p>Und dann kam mir wieder " + topic + " in den Sinn. Und mir wurde schnell klar, " )
    win.document.writeln ( "... selbst mit den allergrößten Mühen lässt sich keine noch so " + adj() + " Verbindung " )
    win.document.writeln ( "zwischen " + topic + "  und " + org + " herstellen. " )
    win.document.writeln ( "Deshalb heute also weder " + org + " noch anderes Tandwerk von mir, " )
    win.document.writeln ( " sondern dieser von Herzen kommende vorweihnachtliche Gruß" )
	win.document.writeln ( "an Sie. <p>Ich wünsche Ihnen und Ihren Lieben eine " + adj() + " Zeit, " )
    win.document.writeln ( ""+adj() + " Festtage und denke mit " + field + "  in der Hand ganz fest an Sie! " )
    win.document.writeln ( "<p>Fröhliche Weihnachten, " + who + ""  )
	win.document.writeln ( "<br>Ihr" )
	win.document.writeln ( "<p><i>Unterschrift</i></p>" )
    win.document.writeln ( "<hr size=3 width=\"50%\">" )
    win.document.writeln ( "</td></tr></table></center>" )
    win.document.writeln ( "</body></html>" )
    win.document.close()
}
// -->
