function show()
{
    $("#popupDiv").show();
}

function hide()
{
    $("#popupDiv").hide();
}


$(document).ready(function(){
    setMainBG();
//    $("fa").fancybox();
})



function setMainBG() {

        var w = screen.width;
        var h = screen.height;
        var r = gcd (w, h);
        var ratio = Math.round(w/h*100)/100;
        var container = document.getElementById("backgroundDiv");

        if(ratio == 1.78)
        {

            container.style.backgroundImage = "url(images/backgrounds/jfwbg169.jpg)";
            container.style.width = w+"px";
        }
        if(ratio == 1.33)
        {
     
            
            container.style.backgroundImage = "url(../../images/backgrounds/jfwbg43.jpg)";
            container.style.height = h+"px";
        }

        //getAspectRatio(w,h);
}
function setFTBG() {

        var w = screen.width;
        var h = screen.height;
        var r = gcd (w, h);
        var ratio = Math.round(w/h*100)/100;
        var container = document.getElementById("backgroundDiv");

        if(ratio == 1.78)
        {
            container.style.backgroundImage = "url(images/backgrounds/ftbg169.jpg)";
            container.style.width = w+"px";
        }
        if(ratio == 1.33)
        {
            container.style.backgroundImage = "url(images/backgrounds/ftbg43.jpg)";
            container.style.height = h+"px";
        }

        //getAspectRatio(w,h);
}
function gcd (a, b)
{
    return (b == 0) ? a : gcd (b, a%b);
}
function getAspectRatio(width, height) {
    var ratio = width / height;
    var value =  ( Math.abs( ratio - 4 / 3 ) < Math.abs( ratio - 16 / 9 ) ) ? '4:3' : '16:9';
    alert(value);
}
