/* Init the header-logo */
function
init_schneiderei_edith() {
    hideBlock("edith",       "<img src='images/edith.png' alt='' />");
    hideBlock("schneiderei", "<img src='images/schneider.png' alt='' />");
}

function
init_weiter() {
    hideBlock("weiter", "<img src='images/index/weiter.png' alt='' />");
}

/* Init the webdesign/printdesign signature of Asklepios: */
function
init_webdesign() {
    hideBlock("webdesign_index", 
        "<a href=\"javascript:newwin('http://www.asklepios.at')\">" +
        "<img src='images/index/webdesign.png' /></a>");
}

/* Each time the page is called a random image from the available imgs inside
 * the gallery container is put in the gall_mainpic src. */
function
init_rand_img() {
    /* Get all image sources used in the gallery: */
    var images = document.getElementById("gallery").getElementsByTagName("a");

    var rimg   = Math.random();     /* Get a random value (between 0 and 1) */
    rimg      *= 100;               /* There'll be no more than 99 pics     */
    rimg       = Math.ceil(rimg);   /* Get rid of of ugly float             */
    rimg      %= images.length;     /* Calc img number                      */
    rimg      += 1;                 /* avoid zero value of rimg (foo!!)     */

    /* Copy the contents of the href attribute of the chosen link so the script
     * doesn't mess up the ACTUAL link! */
    var imgsrc = images[rimg].href;

    /* Strip javascript stuff from the anchor href attribute which has been
     * added by gallery.js.
     * The href attribute holds a string in the format: 
     *      javascript:flipImg('thumb_source.jpg', 'bigimg_src.jpg')
     * So by finding the position of the first occurence of a space, the string
     * can be split into two: */
    var first_space = imgsrc.indexOf(" ");              /* find first space */
    if(first_space != -1) {                             /* found? */
        first_space += 2;   /* raise, to strip single quotation mark too */
        /* strip some stuff from the start: */
        imgsrc = imgsrc.substr(first_space, imgsrc.length);
        /* Strip the stuff from the string ending: */
        var str_end = imgsrc.length - 2; /* calc end of str */
        imgsrc = imgsrc.substr(0, str_end);

        /* Set start img: */
        document.getElementById("gall_mainpic").src = imgsrc;
    }
}

addLoadEvent(initExLinks);
addLoadEvent(init_schneiderei_edith);
addLoadEvent(init_weiter);
addLoadEvent(init_webdesign);
//addLoadEvent(init_rand_img);

