﻿// JScript File

function OpenSite()
{
    var height
    height = document.documentElement.clientHeight - 210;
    document.getElementById('div_main').style.height = height + "px";       
    document.getElementById('div_menu').style.height = height - 150 + "px";      
}

function OpenAbout()
{
    OpenSite()
    SetDivMiddle()
}   

function OpenProduct()
{
    OpenSite()
    SetDivMiddle()
    SetDivProdinfo()
    setTimeout("OpenProduct()", 500);
}

function SetDivMiddle()
{
    var height
    height = document.documentElement.clientHeight - 310;
    document.getElementById('div_middle').style.height = height + "px";           
}

function SetDivProdinfo()
{
  var o = document.getElementById('div_prodinfo');
  if (o)
    {
        var height
        var width
        width = document.documentElement.clientWidth - 300;
        height = document.documentElement.clientHeight - 100;
        document.getElementById('div_prodinfo').style.height = height + "px";           
        document.getElementById('div_prodinfo').style.width = width + "px";               
    }
}

function ShowInfo(e, text)
{
    if (text.length >1)
    {    
        if(document.all) // browser IE
        { 
            document.all.D_Info.style.visibility = 'visible';
            document.all.D_Info.style.top =  event.clientY + 10;
            document.all.D_Info.style.left = event.clientX + 10;
            D_Info.innerHTML = text; 
             
        }
        if(!document.all && document.getElementById) // browser NS/FF
        {
            document.getElementById('D_Info').style.visibility = 'visible';
            document.getElementById('D_Info').style.top = e.pageY + 10 + "px";
            document.getElementById('D_Info').style.left = e.pageX + 10 + "px";
            document.getElementById('D_Info').innerHTML = text;              
        }         
    }
    document.body.style.cursor = 'hand';
}
    
function HideInfo()
{
    if(document.all) // browser IE
    { 
        D_Info.innerHTML = '';
        document.all.D_Info.style.visibility = 'hidden';
        document.body.style.cursor = 'default';
    }
    if(!document.all && document.getElementById)    
    {
        document.getElementById('D_Info').innerHTML = '';
        document.getElementById('D_Info').style.visibility = 'hidden';
        document.body.style.cursor = 'default';    
    }
}

function ChangeImg(img_name, url, cur)
{
    if(document.all) // browser IE
    {
        document.all[img_name].src=url;
        document.body.style.cursor = cur;
    }
    if(!document.all && document.getElementById) // browser NS/FF
    {    
        document.getElementById(img_name).src=url;
        document.body.style.cursor = cur;    
    }   
}

function ShowProdImg(img_name, img_text)
{
    if(document.all) // browser IE
    {
        document.all.ProdImg.style.visibility = 'visible';
        document.all.ProdImg.src = img_name;
        D_ProdImgText.innerHTML = img_text;
    }
    if(!document.all && document.getElementById) // browser NS/FF
    {   
        document.getElementById('ProdImg').style.visibility = 'visible';
        document.getElementById('ProdImg').src = img_name;
        document.getElementById('ProdImg').innerHTML = img_text;       
    }    
}

