﻿$(document).ready(function() {
    // Hidden field
    $('#hdnUrl').val(window.parent.document.location);

    // Apply rounded background
    if (not_ie6()) {
        $('#content').addClass('rounded');
    }

    // Choice buttons
    if ($('#content ul.choices').length) {
        $('#content ul.choices').each(function() {
            // Continue
            var queryString = location.search.substr(1).split("&");
            var destination = queryString[0].split("=")[1];
            $('a.continue', this).attr('href', destination).attr('target', '_blank');

            // Both
            $('a.continue, a.cancel', this).click(function() {
                parent.tb_remove();
                if ($(this).is('.cancel')) {
                    return false;
                }
            });
        });
    }
});
