




/**
* Function is used to set the current navigation
* item. It resets the previous selected item.
*
* @param navID
*/
function setNavi( navID ){
    if(curNavID != navID){
//		document.images[arr_navi[navID]["pic_name"]].src 	= arr_navi[navID]["pic_on"];
        document.getElementById(navID).style.display = "block";
        if(curNavID != 0){
//			document.images[arr_navi[curNavID]["pic_name"]].src = arr_navi[curNavID]["pic_off"];
            document.getElementById(curNavID).style.display = "none";
        }
    }
    curNavID = navID;
}

/**
* Function changes header image of website.
*/
function switchHeader(){
    document.images["headerPic"].src = arr_navi[curNavID]["pic_header"];
}

/**
* Function sets the position to middle of page, right bottom corner
* of given DIV container.
*/
function setDivPos(divID,posType){
    if(posType == "pageMiddle"){
        // get screen resolution
        if(window.innerWidth){
            scrHalfWidth  = window.innerWidth / 2;
            scrHalfHeight = window.innerHeight / 2;
        }else{
            scrHalfWidth  = document.body.offsetWidth / 2;
            scrHalfHeight = document.body.offsetHeight / 2;
        }
        // get box sizes
        divHalfWidth  = document.getElementById(divID).offsetWidth / 2;
        divHalfHeight = document.getElementById(divID).offsetHeight / 2;
        // get new position for DIV
        newPosX = Math.round(scrHalfWidth - divHalfWidth);
        newPosY = Math.round(scrHalfHeight - divHalfHeight);
        // set DIV to new position
        document.getElementById(divID).style['position'] = 'absolute';
        document.getElementById(divID).style['left'] = newPosX + 'px';
        document.getElementById(divID).style['top']  = newPosY + 'px';
    }
}