﻿
function aboutusClick(clicked) {

    newImage = "url(/images/aboutus/aboutus" + clicked + ".jpg)";
    document.getElementById("welcomeAreaAboutUs").style.backgroundImage = newImage;

    switch (clicked) {
        case 1: document.getElementById("welcomeHeader").innerHTML = '&#34;Reputable family business&#34;';
            document.getElementById("welcomeBody").innerHTML = 'We pride ourselves on the individual service we offer to all our tenants, which encourages many of our student groups to stay with us for consecutive years.'; break;
        case 2: document.getElementById("welcomeHeader").innerHTML = '&#34;The right houses at the right prices&#34;';
            document.getElementById("welcomeBody").innerHTML = 'We provide well-located property, in popular student areas, which represents excellent value-for-money.'; break;
        case 3: document.getElementById("welcomeHeader").innerHTML = '&#34;Prompt and reliable maintenance&#34;';
            document.getElementById("welcomeBody").innerHTML = 'We are committed to maintaining our properties to the highest standard and our hand-on approach ensures that we can respond to tenants&#39; requirements with the utmost efficiency.'; break;
        case 4: document.getElementById("welcomeHeader").innerHTML = '&#34;The best student houses in Leeds&#34;';
            document.getElementById("welcomeBody").innerHTML = 'Our houses are located in the best student areas in Leeds, within walking distance of either Central Headingley, Leeds University or Becketts Park Campus.'; break;
        case 5: document.getElementById("welcomeHeader").innerHTML = '&#34;All houses owned by us&#34;';
            document.getElementById("welcomeBody").innerHTML = 'No agents or middle-men to deal with – just one telephone call and you’re speaking to the owner.'; break;
        default: result = 'unknown';
    }
}



function propertyListClick(clicked) {

    newImage = "url(/images/propertylist/property" + clicked + ".png)";   
    document.getElementById("welcomeAreaPropertyList").style.backgroundImage = newImage;
}


function gallerySetup(imageAddress, imageNumber,divname) {
    enlargeURL = imageAddress;
    enlargeURL = enlargeURL.substring(0, enlargeURL.length - 8);
    enlargeURL = enlargeURL + "big.png";

    document.getElementById(divname).style.backgroundImage = "url(" + imageAddress + ")";
    document.getElementById("imageURL").value = enlargeURL;
    document.getElementById("imageNumber").value = imageNumber;
}


function galleryPrevious() {
    document.getElementById("imagePrevious").value = document.getElementById("imageNumber").value;
}


function galleryClick(imageAddress, imageNumber) {
    enlargeURL = imageAddress;
    enlargeURL = enlargeURL.substring(0, enlargeURL.length - 8);
    enlargeURL = enlargeURL + "big.png";
    
    document.getElementById("welcomeAreaProperty").style.backgroundImage = "url(" + imageAddress + ")";
    document.getElementById("imageURL").value = enlargeURL;
    document.getElementById("imageNumber").value = imageNumber;

    current = document.getElementById("imageNumber").value;
    previous = document.getElementById("imagePrevious").value;
  
    document.getElementById("galleryThumb" + current).setAttribute("class", "welcomeThumbnailSelected");
    document.getElementById("galleryThumb" + previous).setAttribute("class", "welcomeThumbnail");
}


function mapClick(imageAddress) {
    enlargeURL = imageAddress;

    document.getElementById("welcomeAreaProperty").style.backgroundImage = "url(" + imageAddress + ")";
    document.getElementById("imageURL").value = enlargeURL;
    document.getElementById("imageNumber").value = imageNumber;
}


function galleryExpand() {
    clickExpand = document.getElementById("imageURL").value;
    window.open(clickExpand, 'mywindow');   
}

