﻿function openContactSeller(contactSellerUrl) {
    window.open(contactSellerUrl, "", "width=500,height=600");
    return false;
}

function ChangeMainImage(mainImgID, newImageURL, newFullImageURL, newWidth, newHeight) {
    var o = document.getElementById(mainImgID);

    if (o != null) {
        o.src = newImageURL;

        o.setAttribute('fullimageurl', newFullImageURL);
        o.style.height = newHeight + "px";
        o.style.width = newWidth + "px";
    }
}

function ListingEnlargeMainImage(mainImgID) {
    var o = document.getElementById(mainImgID);

    if (o != null && o.attributes["fullimageurl"] != null && o.attributes["fullimageurl"].value != null) {
        window.open( o.attributes["fullimageurl"].value );
    }

    return false;
}

function ToggleDisplayListingConditions(showConditions, tblListingConditionsId, lnkToggleListingConditionsShowId, lnkToggleListingConditionsHideId) {
    var tblListingConditions = document.getElementById(tblListingConditionsId);
    var lnkToggleListingConditionsShow = document.getElementById(lnkToggleListingConditionsShowId);
    var lnkToggleListingConditionsHide = document.getElementById(lnkToggleListingConditionsHideId);

    if (tblListingConditions == null || lnkToggleListingConditionsShow == null || lnkToggleListingConditionsHide == null)
        return;

    if (showConditions) {
        tblListingConditions.style.display = 'block';
        lnkToggleListingConditionsHide.style.display = 'block';
        lnkToggleListingConditionsShow.style.display = 'none';
    } else {
        tblListingConditions.style.display = 'none';
        lnkToggleListingConditionsHide.style.display = 'none';
        lnkToggleListingConditionsShow.style.display = 'block';
    }
    
    return false;
}

