﻿function ProductBox_enterProduct_Medium(div, colorSchema) {
    div.className = 'ProductBox_ProductHover_Medium' + " " + colorSchema;
}
function ProductBox_exitProduct_Medium(div) {
    div.className = 'ProductBox_ProductNormal_Medium';
} 
function ProductBox_enterProduct_Small(div, colorSchema) {
    div.className = 'ProductBox_ProductHover_Small' + " " + colorSchema;
}
function ProductBox_exitProduct_Small(div) {
    div.className = 'ProductBox_ProductNormal_Small';
}
function Product_enterAlternativImage(div, colorSchema) {
    div.className = 'Product_AlternativeContainerHover';
    if (div.children[1] != null) {
        div.children[1].className = div.children[1].className + " " + colorSchema;
    }
}
function Product_exitAlternativImage(div) {
    div.className = 'Product_AlternativeContainer';
    if (div.children[1] != null) {
        div.children[1].className = div.children[1].className.split(' ')[0];
    }
}
function TopMenuButton_press(bline, shadow, inner) {
    //document.getElementById(bline).style.display = "block";
    document.getElementById(shadow).style.backgroundImage = "url('/images/Buttons/Topmenu_Shadow_2.png')";
    document.getElementById(inner).style.top = "1px";
}
function TopMenuButton_release(bline, shadow, inner) {
    //document.getElementById(bline).style.display = "none";
    document.getElementById(shadow).style.backgroundImage = "url('/images/Buttons/Topmenu_Shadow_1.png')";
    document.getElementById(inner).style.top = "0px";
}
function SearchToggleToProducts(assortmentID) {
    document.getElementById('SearchToggleToProducts_' + assortmentID).style.display = 'none';
    document.getElementById('SearchToggleToCategories_' + assortmentID).style.display = 'block';
    document.getElementById('CategoryListing_' + assortmentID).style.display = 'none';
    document.getElementById('ProductListing_' + assortmentID).style.display = 'block';
    SIFrReplaceSearchToggle();
}
function SearchToggleToCategories(assortmentID) {
    document.getElementById('SearchToggleToCategories_' + assortmentID).style.display = 'none';
    document.getElementById('SearchToggleToProducts_' + assortmentID).style.display = 'block';
    document.getElementById('ProductListing_' + assortmentID).style.display = 'none';
    document.getElementById('CategoryListing_' + assortmentID).style.display = 'block';
    
}
function ChangeToClass(div, className) {
    div.className = className;
}
var alternativeImagesWidth = 320;
var alternativeImagesPreIDString = 'content_0_';
function moveAlternativeImagesPrevious(colorSchema) {
    var images = document.getElementById(alternativeImagesPreIDString + 'ProductAlternativeImages');
    if (images.offsetLeft < 0) {
        images.style.left = images.offsetLeft + alternativeImagesWidth + 'px';
        setLeftPosition(images.offsetLeft);
        alternativeImagesCheck(colorSchema);
    }
}
function moveAlternativeImagesNext(colorSchema) {
    var images = document.getElementById(alternativeImagesPreIDString + 'ProductAlternativeImages');
    if (images.offsetLeft + images.offsetWidth > alternativeImagesWidth) {
        images.style.left = images.offsetLeft - alternativeImagesWidth + 'px';
        setLeftPosition(images.offsetLeft);
        alternativeImagesCheck(colorSchema);
    }
}
function alternativeImagesCheck(colorSchema) {
    var images = document.getElementById(alternativeImagesPreIDString + 'ProductAlternativeImages');
    if (images.offsetLeft >= 0) {
        disableAlternativeImagesPrevious();
    } else {
        enableAlternativeImagesPrevious(colorSchema);
    }
    if (images.offsetLeft + images.offsetWidth <= alternativeImagesWidth) {
        disableAlternativeImagesNext();
    } else {
        enableAlternativeImagesNext(colorSchema);
    }
}
function disableAlternativeImagesPrevious() {
    var button = document.getElementById(alternativeImagesPreIDString + 'Product_AlternativeImagesButtonsPrevious');
    button.disabled = true;
    button.src = '/images/buttons/arrows/round/smallRoundArrowLeft.png';
}
function enableAlternativeImagesPrevious(colorSchema) {
    var button = document.getElementById(alternativeImagesPreIDString + 'Product_AlternativeImagesButtonsPrevious');
    button.disabled = false;
    button.src = '/images/buttons/arrows/round/smallRoundArrowLeft_' + colorSchema + '.png';
}
function disableAlternativeImagesNext() {
    var button = document.getElementById(alternativeImagesPreIDString + 'Product_AlternativeImagesButtonsNext');
    button.disabled = true;
    button.src = '/images/buttons/arrows/round/smallRoundArrowRight.png';
}
function enableAlternativeImagesNext(colorSchema) {
    var button = document.getElementById(alternativeImagesPreIDString + 'Product_AlternativeImagesButtonsNext');
    button.disabled = false;
    button.src = '/images/buttons/arrows/round/smallRoundArrowRight_' + colorSchema + '.png';
}
function setLeftPosition(position) {
    var span = document.getElementById(alternativeImagesPreIDString + 'ProductAlternativeImagesHiddenLeftPosition');
    span.value = position;
}
var mt;
function delaypage(div) {
    clearTimeout(mt);
    mt = setTimeout("showproduct('" + div + "')", 1000);
}

function showproduct(div) {
    if(document.getElementById(div) != null)
        document.getElementById(div).style.visibility = 'visible';
}
