﻿function showHide(idToShow, idToHide) {
    var el_1 = document.getElementById(idToShow);
    var el_2 = document.getElementById(idToHide);
    el_2.style.display = 'none';
    el_1.style.display = 'block';
}

function openPicture(productId) {
    /* calcultion of browser dimention*/
    var myWidth = 0, myHeight = 0;
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }

    var contentLeft = (myWidth - 981) / 2;
    var videoLeft = contentLeft + 210;

    /*page darker*/
    var browserWindow = document.getElementById('screen');
    browserWindow.style.display = 'block';

    /*video player showinh and positioning*/
    var videoWindow = document.getElementById(productId);
    videoWindow.style.display = 'block';
    videoWindow.style.left = videoLeft + 'px';
    //alert(contentLeft);
}

function closePicture(productId) {
    var videoWindow = document.getElementById(productId);
    videoWindow.style.display = 'none';

    var browserWindow = document.getElementById('screen');
    browserWindow.style.display = 'none';
} 
