    /* Same as in .NET but it's made in js
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
    $.extend({
        GetRequestParams: function () {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        },
        GetRequestParam: function (name) {
            return $.GetRequestParams()[name];
        }
    });

    /* Check if placeholder
    ------------------------------------------------------------------------------------------------*/
    function supports_input_placeholder() {
        var i = document.createElement('input');
        return 'placeholder' in i;
    }

    var modalWindow = undefined;

    function modalWindowOpen(url, id) {
        if (url.indexOf("?") == -1)
            url += "?modal=true";
        else
            url += "&modal=true";

        if (id == undefined)
            id = 'modal-window';

        if (modalWindow != undefined && $(".modal-window-content").html() != "" && $(".modal-window-content").html() != null) {
            modalWindow.closewindow();
        }

        modalWindow = $.fn.modalWindow({
            id: id,
            url: url,
            theme: 'content-window',
            onOpen: modalInit
        });

    }

    function modalInit() {
        $(".modalwindow").unbind('click');
        $(".modalwindow").bind('click', function () {
            var url = $(this).attr("href");

            modalWindowOpen(url);

            return false;
        });
    }

    /* Body load
	------------------------------------------------------------------------------------------------*/

    $(document).ready(function () {
        //  When user clicks on tab, this code will be executed
        $("#tabs li").click(function () {
            //  First remove class "active" from currently active tab
            $("#tabs li").removeClass('active');

            //  Now add class "active" to the selected/clicked tab
            $(this).addClass("active");

            //  Hide all tab content
            $(".tab_content").hide();

            //  Here we get the href value of the selected tab
            var selected_tab = $(this).find("a").attr("href");

            //  Show the selected tab content
            $(selected_tab).fadeIn();

            //  At the end, we add return false so that the click on the link is not executed
            return false;
        });

        $('.admin-settings').bind('mouseover', function (e) {
            $('.admin-menu').css('display', 'block');
        });
        $('.admin-settings').bind('mouseout', function (e) {
            $('.admin-menu').css('display', 'none');
        });


        //IFRAME BREAKER
        if (window.top !== window.self) {
            document.write = "";
            window.top.location = window.self.location;
            setTimeout(function () { document.body.innerHTML = ''; }, 1);
            window.self.onload = function (evt) {
                document.body.innerHTML = '';
            };
        }

        var elements = $('input[placeholder], textarea[placeholder]')
        var restoreValue = function (e) {
            var element = $(e.target);
            if (element.val() == "") {
                element.addClass('has-placeholder').val(element.attr('placeholder'));
            }
        }
        var clearValue = function (e) {
            var element = $(e.target);
            if (element.val() == element.attr('placeholder')) {
                element.removeClass('has-placeholder').val("");
                //element.select()
            }
        };

        elements.each(function () {
            if ($(this).val() != "" || $(this).val() == $(this).attr('placeholder')) {
                $(this).addClass('has-placeholder');
            } else {
                $(this).addClass('has-placeholder').val($(this).attr('placeholder'));
            }
        });

        elements.bind('focus', clearValue);
        elements.bind('blur', restoreValue);

        modalInit();
    });

    
	
	
    /* Show / hide languages
	------------------------------------------------------------------------------------------------*/
	
	
	
