﻿function SyncImages()
{
if (confirm("This will delete any image records in the database that do not have a corresponding image in the upload folder. Also, it will display a list of new images in the upload folder to add to the database. Do you want to continue?"))
{
    location.href = "synchroniseimagefiles.aspx?CameFrom=MenuBar&FolderID=-1&ReturnURL=UploadImage.aspx%3fHasSearched%3dyes%26File%3d%26Description%3d%26DisplayThumb%3dFalse";
}
else
{
alert("Image synchronisation cancelled.")
}
}

function UploadImage()
{
var ImageWindow;
ImageWindow = window.open('UploadImageNewEdit.aspx?CameFrom=General&Function=Add&ShowMenu=False', 'ImageFile', 'toolbar=no,width=830,height=600,resizable, scrollbars');
}

function UploadNewImageForAdvert()
{
UploadImage();
}

function UploadNewImageForWidget()
{
UploadImage();
}

function UploadNewImageForNews()
{
UploadImage();
}

function autoIframe(frameId) {
    try {
        frame = document.getElementById(frameId);
        innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
        objToResize = (frame.style) ? frame.style : frame;
        objToResize.height = innerDoc.body.scrollHeight + 500;
    }
    catch (err) {
        window.status = err.message;
    }
}

