/* HOMEPAGE IMAGE ROTATOR */
var maxImage = 3; // edit the maximum number of images rotated on the homepage ;; DON'T FORGET TO EDIT STYLESHEET (add classes) WITH ADDING NEW IMAGES
var currentImage = 1;

function homepage_image_init()
{
    document.getElementById("homepage_cont").className = "hpc_back1";
}

function next()
{
    if(currentImage == 3) {
        window.location="http://www.ilovedance.cz/nase-navrhy";
    } else {
        currentImage = currentImage + 1;
        checkCurrentImage();
        currstyle = "hpc_back" + currentImage;
        document.getElementById("homepage_cont").className = currstyle;

        hideDescriptions();
        divid = "hp_description_" + currentImage;
        emt = document.getElementById(divid);
        emt.className = "db hp_description";
    }
}

function previous()
{
    currentImage = currentImage - 1;
    checkCurrentImage();
    currstyle = "hpc_back" + currentImage;
    document.getElementById("homepage_cont").className = currstyle;

    hideDescriptions();
    divid = "hp_description_" + currentImage;
    emt = document.getElementById(divid);
    emt.className = "db hp_description";
}

function checkCurrentImage()
{
    if(currentImage > maxImage) currentImage = 1;
    if(currentImage < 1) currentImage = maxImage;
}

function hideDescriptions()
{
    for(var i = 1; i < 4; i++) {
        divid = 'hp_description_' + i;
        emt = document.getElementById(divid);
        emt.className = 'dn';
    }
}


function changeBGImage(whichImage)
{
    document.getElementById("homepage_cont").style.background = "background-image: url('" + backImage[whichImage] + "');";
}


/* PRODUCT LIST - HIDDEN INFOBOX */
function prd_show_hidden_info(id)
{
    divid = "prd_hidden_info_" + id;
    emt = document.getElementById(divid);
    emt.className = "db";
}

function prd_hide_hidden_info(id)
{
    divid = "prd_hidden_info_" + id;
    emt = document.getElementById(divid);
    emt.className = "dn";
}




/* PRODUCT DETAIL THUMBNAIL IMAGE CHANGE MACHINERY :: ROFL */

function test()
{
    alert(gpc[1]);
}

function concept_thumbnail_active(id, number)
{
    divid = "concept_thumb_" + number;
    emt = document.getElementById(divid);
    emt.innerHTML = '<img src="img/concepts/' + id + '/concept' + number + '_tn_clr.jpg">';
}

function concept_thumbnail_inactive(id, number)
{
    divid = "concept_thumb_" + number;
    emt = document.getElementById(divid);
    emt.innerHTML = '<img src="img/concepts/' + id + '/concept' + number + '_tn_bw.jpg">';
}


/* product photo gallery manipulation */
function concept_photo_change(id, number)
{
    hide_concept_photos();
    hide_detail_photos();
    divid = 'concept_photo_' + number;
    emt = document.getElementById(divid);
    emt.className = 'db';
}

function hide_concept_photos()
{
    for(var x = 1; x < galleryPhotos.length; x++) {
        divid = 'concept_photo_' + galleryPhotos[x];
        emt = document.getElementById(divid);
        emt.className = 'dn';
    }
}


/* product detail photo manipulation */
function detail_photo_change(id, number)
{
    hide_concept_photos();
    hide_detail_photos();
    divid = 'detail_photo_' + number;
    emt = document.getElementById(divid);
    emt.className = 'db';
}

function hide_detail_photos()
{
    for(var x = 0; x < detailPhotos.length; x++) {
        divid = 'detail_photo_' + detailPhotos[x];
        emt = document.getElementById(divid);
        emt.className = 'dn';
    }
}




/* client photo manipulation */
function client_photo_change(id, number)
{
    hide_client_photos();
    divid = 'client_photo_' + number;
    emt = document.getElementById(divid);
    emt.className = 'db';
}

function hide_client_photos()
{
    emtm = document.getElementById("client_photo_main");
    emtm.className = 'dn';
    for(var x = 0; x < clientPhotos.length; x++) {
        divid = 'client_photo_' + clientPhotos[x];
        emt = document.getElementById(divid);
        emt.className = 'dn';
    }
}



/* admin message */
function show_full_msg(id)
{
    hide_full_messages();
    divid = 'msg_full_' + id;
    emt = document.getElementById(divid);
    emt.className = 'db msg_full';
}

function hide_full_messages()
{
    for(var x = 0; x < msgIds.length; x++) {
        divid = 'msg_full_' + msgIds[x];
        emt = document.getElementById(divid);
        emt.className = 'dn';
    }
}
