/*
ColorSelector.js
09/28/2008
Rich Reuter
rich.reuter@us.sogeti.com

This is the functionality used to display the color selector popups.
*/

/*
This function opens the colors accesory popup based upon the name of the 
division passed in.  Only medical and dental currently have popups.
*/
function ShowColorsPopup(division_name)
{
    var opts = { src: '', width: 200, height: 200, window_name: '' };
    if (division_name.toLowerCase() == 'medical')
    {
        opts.src = '/assets/swf/ColorSelectors/Medical_Color_Selector/c0490st.swf';
        opts.window_name = 'Medical_Color_Selector';
        opts.width = 800;
        opts.height = 600;
    }
    else if (division_name.toLowerCase() == 'dental')
    {
        opts.src = '/assets/swf/ColorSelectors/Dental_Color_Selector/004-0489a.swf';
        opts.window_name = 'Dental_Color_Selector';
        opts.width = 800;
        opts.height = 600;
    }
     else if (division_name.toLowerCase() == 'veterinary')
    {
        opts.src = '/assets/swf/ColorSelectors/Veterinary_Color_Selector/004-0588.swf';
        opts.window_name = 'Veterinary_Color_Selector';
        opts.width = 800;
        opts.height = 600;
    }
    else
    {
        return;
    }    
    
    var params = 'width=' + opts.width + ',height=' + opts.height + ',resizable=0';
    try
    {
        window.open(opts.src, opts.window_name, params);
    } 
    catch (err)
    {
        alert("Couldn't open the color selector window.  Please contact customer support for assistance.");
    }
}