﻿$(document).ready(function () {
    try {
        if (screen.height < 1000) {
            var imagePath = document.getElementById('frontpageImageId').getAttribute("src", 0);
            temp = imagePath.replace(/\/\w+\/\w+\//, "");
            imageName = temp.replace(/\.\w+/, "");
            document.getElementById('frontpageImageId').setAttribute("src", "/umbraco/images/" + imageName + "_lille.jpg");
            var backgroundImagePath = "/umbraco/images/" + imageName + "_tile_lille.jpg";
            var styleString = "background-image:url(" + backgroundImagePath + ");background-repeat:repeat-x;";
            document.getElementById('fpiwrapperId').setAttribute("style", styleString);            
        }
        else {
            var imagePath = document.getElementById('frontpageImageId').getAttribute("src", 0);
            temp = imagePath.replace(/\/\w+\/\w+\//, "");
            imageName = temp.replace(/\.\w+/, "");
            var backgroundImagePath = "/umbraco/images/" + imageName + "_tile.jpg";
            var styleString = "background-image:url(" + backgroundImagePath + ");background-repeat:repeat-x;";
            document.getElementById('fpiwrapperId').setAttribute("style", styleString);
        }
    }
    catch (e) {

    }
});
