﻿function webDesign_colourPickerDialog_onLoad() {
    // Set the source of the iFrame when the colour picker is loaded
    $('#iframeColourPicker').attr('src', '/Controls/WebDesign/ColourPicker.html?rnd=' + Math.random());
}

function webDesign_colourPickerDialog_getColour() {
    // Get the colour from the hidden field
    return $('.webDesign.colourPickerDialog input[id$="_HiddenFieldColour"]').val();
}

function webDesign_colourPickerDialog_selectColour() {
    // Get the selected colour from the colour picker and store it in the hidden field
    if (window.frames.iframeColourPicker) {
        var colourCode = $('#iframeColourPicker').contents().find("#cp1_Hex").val();
        var hiddenFieldColour = $('.webDesign.colourPickerDialog input[id$="_HiddenFieldColour"]');
        hiddenFieldColour.val(colourCode);
    }
}
