﻿
function togglediv(divtotoggle)
		{
			
			if (document.getElementById(divtotoggle).style.display == "none") {
				document.getElementById(divtotoggle).style.display = "block";
			}
			else
			{
				document.getElementById(divtotoggle).style.display = "none";
			}
		}
		
function setDivDisplay(divtotoggle, DivDisplay)
		{ 
			if (DivDisplay == true) {
				document.getElementById(divtotoggle).style.display = "";
			}
			else
			{
				document.getElementById(divtotoggle).style.display = "none";
			}

}


function createUserFeedbackDialog() {
        var FeedBackUrl = "/appmain/handler/feedbackHandler.asp"
        $dialog.load(FeedBackUrl + "?action=NewDialog");
        $dialog.dialog({ title: 'Feedback' });
        $dialog.dialog({ height: 350 });
        $dialog.dialog({ buttons: {
            'Avbryt': function() { $dialog.dialog('close'); },
            'Skicka': function() {
                $dialog.load(FeedBackUrl + "?action=addfeedback&text=" + encodeCharsForAjax(document.getElementById('FeedBackText').value) + "&Ue=" + encodeCharsForAjax(document.getElementById('UserEmail').value) + "&UserID=" + encodeCharsForAjax(document.getElementById('UserID').value));
                $dialog.dialog({ buttons: { 'OK': function() { $dialog.dialog('close'); } } });
            } 
        }
        });
        $dialog.dialog('open');
    }

    function createUserPasswordRecoveryDialog() {
        var FeedBackUrl = "/appmain/handler/passwordHandler.asp"
        $dialog.load(FeedBackUrl + "?action=NewDialog");
        $dialog.dialog({ title: 'Återställning av lösenord' });
        $dialog.dialog({ height: 350 });
        $dialog.dialog({ buttons: {
            'Avbryt': function () { $dialog.dialog('close'); },
            'Skicka': function () {
                $dialog.load(FeedBackUrl + "?action=CreateResetKey&UserID=" + encodeCharsForAjax(document.getElementById('UserID').value));
                $dialog.dialog({ buttons: { 'OK': function () { $dialog.dialog('close'); } } });
            }
        }
        });
        $dialog.dialog('open');
    }