

function setHomePage() {
    if (document.all){
        testHomePage.style.behavior='url(#default#homepage)';
        testHomePage.setHomePage('http://www. .com');
    }
}

function addToFavourites() {
    var bookmarkurl="http://www. .com"
    var bookmarktitle=" "

    window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function agentLogin(frm) {
    var agentName = frm.agentName.value;
    var agentPassword = frm.agentPassword.value;

    if (agentName != "" && agentPassword != "") {
        //document.agentLogin.submit();
        return true;
    } else {
        alert("Please enter your user name and password.");
        return false;
    }
}

function propertySearch() {

    var propertyId = document.propertySearch.propertyId.value;

    if (propertyId != "") {
        document.propertySearch.submit();
    }
}

function reminder() {
    win = window.open('reminder.jsp', '', 'width= 195,height= 200,scrollbars= no');
    if (win.focus) win.focus();
}

function swapImage(newImage) {
    document.mainImage.src=newImage;
}

function swapPreviewImage(imageNumber) {
    eval("newSource = document.all.photo" + imageNumber + ".src");
    document.sidePhoto.mainImage.src=newSource;
}

function previewNewImage() {
    document.sidePhoto.mainImage.src=document.all.resource_url0.value;
}

function previewImage(imageNumber) {
    eval("newSource = document.all.resource_url" + imageNumber + ".value");
    document.all.mainImage.src=newSource;
}

function removePhoto(propertyId,photoId) {
    eval("pageLocation = 'photoMaint.jsp?propertyId=" + propertyId + "&photoId=" + photoId + "&formAction=Remove'");
    //alert(pageLocation);
    window.location = pageLocation;
}

// FUNCTION IS NO LONGER NEEDED AS EACH ROW IS A FORM
function updatePhoto(propertyId,photoId,imageUrl) {
    eval("photoUrl = document.all." + imageUrl + ".value");
    eval("pageLocation = 'photoMaint.jsp?propertyId=" + propertyId + "&imageUrl=" + photoUrl + "&photoId=" + photoId + "&formAction=UPDATE'");
    //alert(pageLocation);
    window.location = pageLocation;
}

function displayNumberRange (range_start,range_end) {

    var numberString = "";

    for(i=range_start;i<=range_end;i++){
        numberString += ", " + i;
    }
    numberString = numberString.substring('2',numberString.length);
    numberString += "<br/><br/>";
    document.writeln(numberString);
    //alert (numberString);
}

function assignPropertyId(propertyId){
    document.propertyMaint.propertyId.value = propertyId;
}