/* Inwin */
var Inwin = function() {
    var _self = this,
        _jqDialog,
        _originalContent,
        _contentWrapper;

    var _settings = {
        "bgiframe": true,
        "modal": true,
        "resizable": false,
        "width": 390,
        "close": function() { Inwin.hide(); }
    }
var _settingsMap = {
        "bgiframe": true,
        "modal": true,
        "resizable": false,
        "width": 736,
        "close": function(){Inwin.hide();}
        
    }

    return {
        show: function(contentWrapperId, targetContainer) {
            // Save original content
            _contentWrapper = $("#" + contentWrapperId);
            _originalContent = _contentWrapper.html();

            // Create dialog
           if(contentWrapperId == "inwin_map")
            {
                _jqDialog = _contentWrapper.dialog(_settingsMap);
            }
            else
            {
                _jqDialog = _contentWrapper.dialog(_settings);
            }

            // Place overlay inside ASPNET FORM and modify it
            var overlayEl = $(".ui-widget-overlay");
            $(targetContainer).prepend(overlayEl);
            overlayEl.css("marginLeft", -1 * parseInt(overlayEl.width() / 2, 10) + "px");
            overlayEl.css("left", "50%"); // Misha - move this to the CSS file!

            var dialogEl = _contentWrapper.parent();
            targetContainer.appendChild(dialogEl[0]);
            dialogEl.css("left", "256px"); // Misha - move this to the CSS file!
        },

        hide: function() {
            // Destroy dialog
            _jqDialog.dialog("destroy");

            // Restore orginal content
            _contentWrapper.html(_originalContent);
        }
    }
} ();

function clearTextField(textField, value)
{
    if (textField.value == value)
    {
        textField.value = "";
    }
}

function fillTextField(textField, value)
{
    if (textField.value == "")
    {
        textField.value = value;
    }
}
$(document).ready(function(){
    $('.question').click(function() {
        $($(this).parent()).toggleClass("open");
        });
});   

function submitSearch(url)
{
document.forms[1].action = url;
document.forms[1].submit();
}




