﻿function imageOver(obj) {
    srcname = obj.src.toString();
    srcname = srcname.replace("-down", "");
    srcname = srcname.substring(0, srcname.length - 4) + "-over" + srcname.substring(srcname.length - 4);
    obj.src = srcname;
}

function imageOut(obj) {
    srcname = obj.src.toString();
    srcname = srcname.replace("-over", "");
    srcname = srcname.replace("-down", "");
    obj.src = srcname;
}

function imageDown(obj) {
    srcname = obj.src.toString();
    srcname = srcname.replace("-over", "");
    srcname = srcname.substring(0, srcname.length - 4) + "-down" + srcname.substring(srcname.length - 4);
    obj.src = srcname;
}

var coverTimeout;
var defaultCover = 'cover';

function resetCover() {
    coverTimeout = setTimeout("setCover('"+ defaultCover +"')", 250);
}
function setCover(img) {
    clearTimeout(coverTimeout);
    var x = document.getElementById("coverImg");
    var path = catalogCulture + "/img/app/" + img + ".jpg";
    x.src = path;
}
function productOver(obj) {
    srcname = obj.src.toString();
    srcname = srcname.substring(0, srcname.length - 4) + "-over" + srcname.substring(srcname.length - 4);
    document.getElementById("product").src = srcname;
}

function productReset() {
    document.getElementById("product").src = "img/sectionheader/placeholder.gif";
}

function popup(mypage, myname, w, h) {

    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
    mypagepath = 'video/' + mypage;
    window.showModalDialog(mypagepath, myname, "dialogHeight:550px;dialogWidth:480px;center:Yes;help:No;resizable:No;status:No;scroll:No;");
}

function popupCulture(mypage, myname, w, h) {
    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
    mypagepath = 'en-US/video/' + mypage;
    window.showModalDialog(mypagepath, myname, "dialogHeight:550px;dialogWidth:480px;center:Yes;help:No;resizable:No;status:No;scroll:No;");
}
function popupEN(mypage, myname, w, h) {
    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
    mypagepath = '../en-US/video/' + mypage;
    window.showModalDialog(mypagepath, myname, "dialogHeight:550px;dialogWidth:480px;center:Yes;help:No;resizable:No;status:No;scroll:No;");
}

var menuTimeout;

function hideMenu() {
    menuTimeout = setTimeout("toggleMenu(false)", 100);
}
function toggleMenu(display) {
    clearTimeout(menuTimeout);
    var x = document.getElementById("popupIndex");
    if (display)
        x.style.display = 'inline';
    else
        x.style.display = 'none';
}
function showMenu(display) {
    toggleMenu(true);
}
