﻿function mouseOverWithText(number, path)
{
    hideText(number);
    mouseOver(number,path);
}
function mouseOver(number,path)
{
    changeBackground(number,path);    
    changeBorder(number);
    changeThumbnails(number,path);      
}
function hideText(to)
{
    for(var i = 1; i<=4; i++)
    {
        if(document.getElementById('showCase'+i)==null) {break;}
        else
        {
            document.getElementById('showCase'+i).style.display = "none";
        }
    }
    document.getElementById('showCase'+to).style.display = "inline"; 
}
function changeThumbnails(to,path)
{
    for(var i = 1; i<=5; i++)
    {
        if(document.getElementById('thumb'+i)==null && document.getElementById('thumb'+i+'Small')==null) {break;}
        else
        {
            var url2 = "/images/showcase/"+path+"/thumbnails/thumb"+i+"_off.jpg";
            if(document.getElementById('thumb'+i)!=null){
                document.getElementById('thumb'+i).style.backgroundImage = "url("+url2+")";
            }
            else {
                document.getElementById('thumb'+i+'Small').style.backgroundImage = "url("+url2+")";
            }
        }
    }
    var url = "/images/showcase/"+path+"/thumbnails/thumb"+to+"_on.jpg";
    if(document.getElementById('thumb'+to)!=null)
    {
        document.getElementById('thumb'+to).style.backgroundImage = "url("+url+")";
    }
    else if(document.getElementById('thumb'+to+'Small')!=null) 
    {
        document.getElementById('thumb'+to+'Small').style.backgroundImage = "url("+url+")";
    }
}
 function changeBorder(to)
{
    for(var i = 1; i<=4; i++)
    {
        if(document.getElementById('thumb'+i)==null && document.getElementById('thumb'+i+'Small')==null) {break;}
        else
        {
            if(document.getElementById('thumb'+i)!=null) {
                document.getElementById('thumb'+i).style.border = "solid 1px #747373";
            }
            else if(document.getElementById('thumb'+to+'Small')!=null) {
                document.getElementById('thumb'+i+'Small').style.border = "solid 1px #747373";
            }
        }
    }        
    if(document.getElementById('thumb'+to)!=null) 
    {
        document.getElementById('thumb'+to).style.border = "solid 1px #ffd21f";
    }
    else if(document.getElementById('thumb'+to+'Small')!=null) 
    {
        document.getElementById('thumb'+to+'Small').style.border = "solid 1px #ffd21f";
    }
}
function changeBackground(to,path)
{
    var url = "/images/showcase/"+path+"/background/background"+to+".jpg";
    document.getElementById('ShowCaseContainer').style.backgroundImage = "url("+url+")";
}
