﻿
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 buttonsOpts = {}
        buttonsOpts[strLang_AbortButton] = function () { $dialog.dialog('close'); };
        buttonsOpts[strLang_SendButton] = 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'); } } });
            };

        var FeedBackUrl = "/appmain/handler/feedbackHandler.asp"
        $dialog.load(FeedBackUrl + "?action=NewDialog");
        $dialog.dialog({ title: 'Feedback' });
        $dialog.dialog({ height: 350 });
        $dialog.dialog({ buttons: buttonsOpts });
        $dialog.dialog('open');
    }

    function createUserPasswordRecoveryDialog() {
        var buttonsOpts = {}
        buttonsOpts[strLang_AbortButton] = function () { $dialog.dialog('close'); };
        buttonsOpts[strLang_SendButton] = function () {
            $dialog.load(FeedBackUrl + "?action=CreateResetKey&UserID=" + encodeCharsForAjax(document.getElementById('UserID').value));
            $dialog.dialog({ buttons: { strLang_OKButton: function () { $dialog.dialog('close'); } } });
        };

        var FeedBackUrl = "/appmain/handler/passwordHandler.asp"
        $dialog.load(FeedBackUrl + "?action=NewDialog");
        $dialog.dialog({ title: strLang_PasswordResetTitle });
        $dialog.dialog({ height: 350 });
        $dialog.dialog({ buttons: buttonsOpts });
        $dialog.dialog('open');
    }


    function createVecViewStatsChart(VecID) {
        var buttonsOpts = {}
        buttonsOpts[strLang_CloseButton] = function () { $dialog.dialog('close'); };

        var dialogUrl = "/appmain/handler/VecViewChartLine.asp?omni=" + getUrlVars()["omni"] + "&id=" + VecID;
        $dialog.load(dialogUrl);
        $dialog.dialog({ title: strLang_StatsDialogTitle });
        $dialog.dialog({ height: 550 });
        $dialog.dialog({ width: 530 });
        $dialog.dialog({ buttons: buttonsOpts });
        $dialog.dialog('open');
    }
