www.club.hynobot.com Open in urlscan Pro
205.144.171.85  Public Scan

Submitted URL: https://www.club.hynobot.com/
Effective URL: https://www.club.hynobot.com/Home/AIAssistant.aspx
Submission: On July 31 via api from US — Scanned from CA

Form analysis 1 forms found in the DOM

Name: aspnetFormPOST ./AIAssistant.aspx

<form name="aspnetForm" method="post" action="./AIAssistant.aspx" id="aspnetForm">
  <div>
    <input type="hidden" name="ctl00_scriptManager1_HiddenField" id="ctl00_scriptManager1_HiddenField" value="">
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="">
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="">
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
      value="/wEPDwUJNTE1NjI2ODQ3DxQrAAMWAh4TVmFsaWRhdGVSZXF1ZXN0TW9kZQIBaGQWAmYPZBYCAgMPZBYCAgEPZBYCAgMPZBYIAgEPDxYCHgRUZXh0BR5QaGFyb3MgVW5pdmVyc2l0eSBBSSBBc3Npc3RhbnRkZAICDw8WAh8BZWRkAgMPZBYCZg9kFgICAQ9kFgICAQ8WAh4JaW5uZXJodG1sBbgFPGRpdiBjbGFzcz0iY2hhdC1tZXNzYWdlIGludHJvLW1lc3NhZ2UiPjxpbWcgc3JjPScuLi9JbWFnZXMvQ2hhdF9mYXJvcy5qcGcnIGNsYXNzPSdjaGF0LWltYWdlJyAvPjwvYnI+V2VsY29tZSB0byBQaGFyb3MgVW5pdmVyc2l0eSdzIEFJIEFzc2lzdGFudCE8YnIvPldlJ3JlIGV4Y2l0ZWQgdG8gaGF2ZSB5b3UhIFVzZSBvdXIgdmlydHVhbCBhc3Npc3RhbnQgZm9yIGFueSBoZWxwIG9yIGluZm8geW91IG5lZWQuIE91ciBBSSBpcyBoZXJlIHRvIGFzc2lzdCB5b3UgYXQgZXZlcnkgc3RlcC4gTGV0J3MgYmVnaW4hPGJyLz7Zhdix2K3YqNmL2Kcg2KjZg9mFINmB2Yog2YXYs9in2LnYryDYp9mE2LDZg9in2KEg2KfZhNin2LXYt9mG2KfYudmKINio2KzYp9mF2LnYqSDZgdin2LHZiNizITxici8+2YbYrdmGINiz2LnYr9in2KEg2KjZiNis2YjYr9mD2YUhINin2LPYqtiu2K/ZhdmI2Kcg2YXYs9in2LnYr9mG2Kcg2KfZhNin2YHYqtix2KfYttmKINmE2KPZiiDZhdiz2KfYudiv2Kkg2KPZiCDZhdi52YTZiNmF2KfYqiDYqtit2KrYp9is2YjZhtmH2KcuINin2YTYsNmD2KfYoSDYp9mE2KfYtdi32YbYp9i52Yog2YfZhtinINmE2YXYs9in2LnYr9iq2YPZhSDZgdmKINmD2YQg2K7Yt9mI2KkuINmE2YbYqNiv2KMhPC9kaXY+PGRpdiBjbGFzcz0ibWVzc2FnZS1pbmZvIj48c3BhbiBjbGFzcz0idXNlci1uYW1lIj48L3NwYW4+PC9kaXY+ZAIEDw8WAh4KSGVhZGVyVGV4dAUkUGxlYXNlIGNvcnJlY3QgdGhlIGZvbGxvd2luZyBlcnJvcnM6ZGRkZJYsCo30qpHBSRvUHpKzpr/67DC0UvivpYxoyVmH8uY=">
  </div>
  <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
      theForm = document.aspnetForm;
    }

    function __doPostBack(eventTarget, eventArgument) {
      if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
      }
    }
    //]]>
  </script>
  <script src="/WebResource.axd?d=kbkRvO2UjBWRQwt9l1mG_jXmivoFFuvcXBQkiXQJmhZgvIompbhlfe4eAYHGWAse7Fd7vjrwOuHFseSqCtt7QAfzSUkqd_ZcGKsjZapQTyk1&amp;t=638459986960000000" type="text/javascript"></script>
  <script language="javascript" type="text/javascript" src="/ApplicationWebForm.js"></script>
  <script language="javascript" type="text/javascript" src="/SetFocus.js"></script>
  <script language="javascript" type="text/javascript" src="/ApplicationWebUIValidation.js"></script>
  <script language="javascript" type="text/javascript" src="/JQuery.js"></script>
  <script language="javascript" type="text/javascript" src="/LegacyFunctions.js"></script>
  <script src="/ScriptResource.axd?d=J3PYARs1mszy32RREhAUkR2YssNjC0-pcPMZAUj_BsrOH4RC7ZI26PIMQLcsPWoIUFjN40_HEUlAyhIGIr1Y4IMNjtF1Fa_paXI4blg-E9XXOprxizWukdL3tWh0fTgz0&amp;t=7c776dc1" type="text/javascript"></script>
  <script src="/ScriptResource.axd?d=3hI_QMo4AhRpIaWdf-e-5qnxisDDhFxnH-DTs8YI3hIRoaJVfXpDoW0OOt7L79Rwo0ihUsGwWMwksAIY59_ZgvZRCLDza02An4RB2WWfjUTniKn7wtT7fOI2YYbo5a6SSrk2Vz--0SUq7GvzoyT5nw2&amp;t=7c776dc1" type="text/javascript"></script>
  <script type="text/javascript">
    //<![CDATA[
    var PageMethods = function() {
      PageMethods.initializeBase(this);
      this._timeout = 0;
      this._userContext = null;
      this._succeeded = null;
      this._failed = null;
    }
    PageMethods.prototype = {
      _get_path: function() {
        var p = this.get_path();
        if (p) return p;
        else return PageMethods._staticInstance.get_path();
      },
      SortListItems: function(str, succeededCallback, failedCallback, userContext) {
        return this._invoke(this._get_path(), 'SortListItems', false, {
          str: str
        }, succeededCallback, failedCallback, userContext);
      },
      GetRecordFieldValue: function(contextName, tableName, recordID, columnName, fieldName, title, closeBtnText, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar, succeededCallback, failedCallback, userContext) {
        return this._invoke(this._get_path(), 'GetRecordFieldValue', false, {
          contextName: contextName,
          tableName: tableName,
          recordID: recordID,
          columnName: columnName,
          fieldName: fieldName,
          title: title,
          closeBtnText: closeBtnText,
          persist: persist,
          popupWindowHeight: popupWindowHeight,
          popupWindowWidth: popupWindowWidth,
          popupWindowScrollBar: popupWindowScrollBar
        }, succeededCallback, failedCallback, userContext);
      },
      GetImage: function(contextName, tableName, recordID, columnName, title, closeBtnText, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar, succeededCallback, failedCallback, userContext) {
        return this._invoke(this._get_path(), 'GetImage', false, {
          contextName: contextName,
          tableName: tableName,
          recordID: recordID,
          columnName: columnName,
          title: title,
          closeBtnText: closeBtnText,
          persist: persist,
          popupWindowHeight: popupWindowHeight,
          popupWindowWidth: popupWindowWidth,
          popupWindowScrollBar: popupWindowScrollBar
        }, succeededCallback, failedCallback, userContext);
      }
    }
    PageMethods.registerClass('PageMethods', Sys.Net.WebServiceProxy);
    PageMethods._staticInstance = new PageMethods();
    PageMethods.set_path = function(value) {
      PageMethods._staticInstance.set_path(value);
    }
    PageMethods.get_path = function() {
      return PageMethods._staticInstance.get_path();
    }
    PageMethods.set_timeout = function(value) {
      PageMethods._staticInstance.set_timeout(value);
    }
    PageMethods.get_timeout = function() {
      return PageMethods._staticInstance.get_timeout();
    }
    PageMethods.set_defaultUserContext = function(value) {
      PageMethods._staticInstance.set_defaultUserContext(value);
    }
    PageMethods.get_defaultUserContext = function() {
      return PageMethods._staticInstance.get_defaultUserContext();
    }
    PageMethods.set_defaultSucceededCallback = function(value) {
      PageMethods._staticInstance.set_defaultSucceededCallback(value);
    }
    PageMethods.get_defaultSucceededCallback = function() {
      return PageMethods._staticInstance.get_defaultSucceededCallback();
    }
    PageMethods.set_defaultFailedCallback = function(value) {
      PageMethods._staticInstance.set_defaultFailedCallback(value);
    }
    PageMethods.get_defaultFailedCallback = function() {
      return PageMethods._staticInstance.get_defaultFailedCallback();
    }
    PageMethods.set_enableJsonp = function(value) {
      PageMethods._staticInstance.set_enableJsonp(value);
    }
    PageMethods.get_enableJsonp = function() {
      return PageMethods._staticInstance.get_enableJsonp();
    }
    PageMethods.set_jsonpCallbackParameter = function(value) {
      PageMethods._staticInstance.set_jsonpCallbackParameter(value);
    }
    PageMethods.get_jsonpCallbackParameter = function() {
      return PageMethods._staticInstance.get_jsonpCallbackParameter();
    }
    PageMethods.set_path("AIAssistant.aspx");
    PageMethods.SortListItems = function(str, onSuccess, onFailed, userContext) {
      PageMethods._staticInstance.SortListItems(str, onSuccess, onFailed, userContext);
    }
    PageMethods.GetRecordFieldValue = function(contextName, tableName, recordID, columnName, fieldName, title, closeBtnText, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar, onSuccess, onFailed, userContext) {
      PageMethods._staticInstance.GetRecordFieldValue(contextName, tableName, recordID, columnName, fieldName, title, closeBtnText, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar, onSuccess, onFailed, userContext);
    }
    PageMethods.GetImage = function(contextName, tableName, recordID, columnName, title, closeBtnText, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar, onSuccess, onFailed, userContext) {
      PageMethods._staticInstance.GetImage(contextName, tableName, recordID, columnName, title, closeBtnText, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar, onSuccess, onFailed, userContext);
    }
    //]]>
  </script>
  <div>
    <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="27387F5E">
  </div>
  <input type="hidden" name="isd_geo_location" id="isd_geo_location" value="<location>
<latitude>37.40</latitude>
<longitude>-121.93</longitude>
<unit>meters</unit>
<error>LOCATION_ERROR_DISABLED</error>
</location>
">
  <script type="text/javascript">
    <!--
    ISD_GeolocationInit();
    //
    -->
  </script>
  <input name="ctl00$pageLeftCoordinate" type="hidden" id="ctl00_pageLeftCoordinate"><input name="ctl00$pageTopCoordinate" type="hidden" id="ctl00_pageTopCoordinate">
  <span id="ctl00_PageSettings"></span>
  <script language="JavaScript" type="text/javascript">
    clearRTL()
  </script>
  <script type="text/javascript">
    //<![CDATA[
    Sys.WebForms.PageRequestManager._initialize('ctl00$scriptManager1', 'aspnetForm', ['tctl00$PageContent$Up2', ''], [], [], 90, 'ctl00');
    //]]>
  </script>
  <script language="JavaScript" type="text/javascript">
    avoidTabFocused();
  </script>
  <table cellspacing="0" cellpadding="0" border="0">
    <tbody>
      <tr>
        <td class="pcC">
          <a id="StartOfPageContent"></a>
          <div id="scrollRegion" class="scrollRegion">
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
            <table cellpadding="0" cellspacing="0" border="0">
              <tbody>
                <tr>
                  <td>
                    <div id="ctl00_PageContent_MenuContainer" class="menu-container-Restaurant-Ass">
                    </div>
                    <div class="start-header-RestaurantAss">
                      <span id="ctl00_PageContent_Label" class="text-center-RestaurantAss">Pharos University AI Assistant</span>
                    </div>
                    <div class="end-header">
                      <span id="ctl00_PageContent_Label1" class="text-right"></span>
                    </div>
                  </td>
                </tr>
                <tr>
                  <td><span id="ctl00_PageContent_Up2">
                      <div id="ctl00_PageContent_chatContainer" class="chat-container">
                        <div id="ctl00_PageContent_chatMessagesContent" class="chat-box">
                          <div class="chat-message intro-message"><img src="../Images/Chat_faros.jpg" class="chat-image"><br>Welcome to Pharos University's AI Assistant!<br>We're excited to have you! Use our virtual assistant for any help or info you
                            need. Our AI is here to assist you at every step. Let's begin!<br>مرحبًا بكم في مساعد الذكاء الاصطناعي بجامعة فاروس!<br>نحن سعداء بوجودكم! استخدموا مساعدنا الافتراضي لأي مساعدة أو معلومات تحتاجونها. الذكاء الاصطناعي هنا
                            لمساعدتكم في كل خطوة. لنبدأ!</div>
                          <div class="message-info"><span class="user-name"></span></div>
                        </div>
                        <div id="myspindiv" style="display:none;" class="fixed-position">
                          <div class="loaderText-robo">Thinking.... Please Wait</div>
                        </div>
                        <div class="textbox-container">
                          <input name="ctl00$PageContent$txtUserInput" type="text" id="ctl00_PageContent_txtUserInput" class="textbox" placeholder="Type a message..." onkeypress="handleEnter(event)">
                          <div class="action-container">
                            <input type="button" name="ctl00$PageContent$btnSend" value="Send" onclick="$('#myspindiv').show(); this.disabled=true;__doPostBack('ctl00$PageContent$btnSend','')" id="ctl00_PageContent_btnSend" class="send-button"
                              autopostback="false">
                            <input type="submit" name="ctl00$PageContent$btnVoice" value="Start Voice" onclick="toggleRecognition(); return false;" id="ctl00_PageContent_btnVoice" class="voice-button" autopostback="false">
                          </div>
                        </div>
                      </div>
                    </span>
                    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
                    <script>
                      function scrollToBottom() {
                        var chatContainer = document.getElementById("ctl00_PageContent_chatMessagesContent");
                        if (chatContainer) {
                          var scrollHeight = chatContainer.scrollHeight;
                          var containerHeight = chatContainer.clientHeight;
                          chatContainer.scrollTop = scrollHeight - containerHeight;
                        }
                      }
                    </script>
                    <script>
                      function handleEnter(e) {
                        if (e.keyCode === 13) {
                          e.preventDefault();
                          document.getElementById('ctl00_PageContent_btnSend').click();
                        }
                      }
                    </script>
                    <script>
                      function sendButtonResponse(response) {
                        document.getElementById('ctl00_PageContent_txtUserInput').value = response;
                        document.getElementById('ctl00_PageContent_btnSend').click();
                      }
                    </script>
                  </td>
                </tr>
                <tr>
                  <td>
                    <script>
                      // Child window script
                      window.onload = function() {
                        var bodyHeight = document.body.scrollHeight;
                        parent.postMessage(bodyHeight, '*');
                      };
                      window.addEventListener('message', function(event) {
                        if (event.origin !== window.location.origin) {
                          return;
                        }
                        var iframe = document.getElementById('<?php echo $iframeId; ?>');
                        if (iframe) {
                          iframe.style.height = event.data + 'px';
                        }
                      }, false);

                      function resizeIframe() {
                        var iframe = document.getElementById('<?php echo $iframeId; ?>');
                        if (iframe) {
                          iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
                        }
                      }
                      // Parent window script
                      window.onload = function() {
                        var iframe = document.getElementById('<?php echo $iframeId; ?>');
                        if (iframe) {
                          iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
                        }
                      };
                      window.addEventListener('message', function(event) {
                        if (event.origin !== window.location.origin) {
                          return;
                        }
                        var bodyHeight = event.data;
                        var iframe = document.getElementById('<?php echo $iframeId; ?>');
                        if (iframe) {
                          iframe.style.height = bodyHeight + 'px';
                        }
                      }, false);

                      function adjustIframeHeight(height) {
                        var iframe = document.getElementById('<?php echo $iframeId; ?>');
                        if (iframe) {
                          iframe.style.height = height + 'px';
                        }
                      }
                    </script>
                  </td>
                </tr>
                <tr>
                  <td>
                    <script>
                      function printResponse(buttonElement) {
                        var messageDiv = buttonElement.parentElement.nextElementSibling;
                        var messageText = messageDiv.innerHTML; // Get inner HTML to keep formatting
                        var messageImages = messageDiv.querySelectorAll('img'); // Get all image elements in the message
                        // Create a hidden iframe
                        var iframe = document.createElement('iframe');
                        iframe.style.display = 'none';
                        document.body.appendChild(iframe);
                        // Function to print with Base64-encoded images
                        function printWithBase64Images() {
                          var printWindow = iframe.contentWindow;
                          printWindow.document.open();
                          printWindow.document.write('<html><head><title>Bot Response</title>');
                          printWindow.document.write('<style>');
                          // Include styles from classes
                          printWindow.document.write(
                            '.pos-receipt { font-family: Arial, sans-serif; width: auto; margin: 0 auto; padding: 20px; background-color: #fff; margin-top: 5px !important; font-size: 14px; animation: 1s ease-out 0s 1 slideInFromAI forwards; }');
                          printWindow.document.write('.receipt-header { text-align: center; font-size: 14px; }');
                          printWindow.document.write('.receipt-header.rtl { text-align: right; }');
                          printWindow.document.write('.receipt-footer { text-align: left; font-size: 12px; }');
                          printWindow.document.write('.receipt-footer p { margin: 5px 0; }');
                          printWindow.document.write('.receipt-footer hr { border: none; border-top: 1px solid #ccc; margin: 5px 0; }');
                          printWindow.document.write('.pos-table { width: 100%; border-collapse: collapse; }');
                          printWindow.document.write('.pos-th, .pos-td { padding: 5px; border-bottom: 1px solid #ddd; text-align: left; }');
                          printWindow.document.write('.pos-th { background-color: #f2f2f2; }');
                          printWindow.document.write('</style>');
                          printWindow.document.write('</head><body>');
                          printWindow.document.write('<div class="pos-receipt">');
                          printWindow.document.write(messageText); // Insert the message content
                          // Loop through each image element and encode it as Base64
                          messageImages.forEach(function(image) {
                            var canvas = document.createElement('canvas');
                            var context = canvas.getContext('2d');
                            canvas.width = image.width;
                            canvas.height = image.height;
                            context.drawImage(image, 0, 0, image.width, image.height);
                            var base64URL = canvas.toDataURL('image/png'); // Convert image to Base64
                            printWindow.document.write('<br>'); // Add line break for better separation
                            printWindow.document.write('<img src="' + base64URL + '" alt="Image">'); // Insert the image
                          });
                          printWindow.document.write('</div>');
                          printWindow.document.write('<script>window.print();<\/script>');
                          printWindow.document.write('</body></html>');
                          printWindow.document.close();
                        }
                        // Print with Base64-encoded images
                        printWithBase64Images();
                      }

                      function copyResponse(buttonElement) {
                        var messageDiv = buttonElement.parentElement.nextElementSibling;
                        // Create a range object to select the text inside the div
                        var range = document.createRange();
                        range.selectNode(messageDiv);
                        // Select the text
                        window.getSelection().removeAllRanges(); // Clear any previous selections
                        window.getSelection().addRange(range);
                        // Copy the selected text
                        try {
                          document.execCommand('copy');
                          // Show tooltip
                          var tooltip = document.createElement('span');
                          tooltip.textContent = 'Response copied to clipboard';
                          tooltip.className = 'tooltip';
                          buttonElement.parentElement.appendChild(tooltip);
                          // Hide tooltip after 2 seconds
                          setTimeout(function() {
                            buttonElement.parentElement.removeChild(tooltip);
                          }, 2000);
                        } catch (err) {
                          console.error('Error copying text: ', err);
                        }
                        // Clear the selection
                        window.getSelection().removeAllRanges();
                      }
                    </script>
                  </td>
                </tr>
                <tr>
                  <td>
                    <script>
                      // Define global variables
                      let recognition;
                      let isRecognizing = false;
                      let btnVoice; // Declare btnVoice globally
                      let recognitionTimer; // Timer for stopping recognition after a period of time
                      function initializeRecognition() {
                        if ('webkitSpeechRecognition' in window || 'SpeechRecognition' in window) {
                          recognition = new(window.SpeechRecognition || window.webkitSpeechRecognition)();
                          recognition.continuous = true; // Allow continuous listening
                          recognition.interimResults = false;
                          recognition.lang = 'ar-EG'; // Set recognition language to Arabic (Egypt)
                          recognition.onstart = function() {
                            console.log('Recognition started');
                            isRecognizing = true;
                            updateVoiceButton(); // Update button text
                          };
                          recognition.onend = function() {
                            console.log('Recognition ended');
                            isRecognizing = false;
                            updateVoiceButton(); // Update button text
                          };
                          recognition.onresult = function(event) {
                            console.log('Recognition result received');
                            let txtUserInput = document.getElementById('ctl00_PageContent_txtUserInput'); // Get txtUserInput element
                            txtUserInput.value = event.results[0][0].transcript;
                            let btnSend = document.getElementById('ctl00_PageContent_btnSend'); // Get btnSend element
                            if (btnSend) {
                              btnSend.click(); // Automatically click the send button after voice input is converted to text
                            } else {
                              console.error('btnSend is not defined');
                            }
                          };
                          recognition.onerror = function(event) {
                            console.error('Recognition error:', event.error);
                            isRecognizing = false;
                            updateVoiceButton(); // Update button text
                          };
                        } else {
                          alert('Your browser does not support speech recognition. Please try a different browser.');
                        }
                      }

                      function startRecognition() {
                        if (!isRecognizing && recognition) {
                          console.log('Starting recognition');
                          recognition.start();
                          // Clear any existing timeout
                          clearTimeout(recognitionTimer);
                        } else {
                          console.log('Cannot start recognition. Is recognizing:', isRecognizing);
                        }
                      }

                      function stopRecognition() {
                        if (isRecognizing && recognition) {
                          console.log('Stopping recognition');
                          recognition.stop();
                        } else {
                          console.log('Cannot stop recognition. Is recognizing:', isRecognizing);
                        }
                      }

                      function toggleRecognition() {
                        console.log('Toggling recognition. Is recognizing:', isRecognizing);
                        if (isRecognizing) {
                          stopRecognition();
                        } else {
                          startRecognition();
                        }
                      }

                      function updateVoiceButton() {
                        // Get the btnVoice element
                        let btnVoice = document.getElementById('ctl00_PageContent_btnVoice');
                        // Check if btnVoice exists and isRecognizing is defined
                        if (btnVoice !== null && typeof isRecognizing !== 'undefined') {
                          // Update the button text based on the recognition state
                          if (isRecognizing) {
                            btnVoice.value = 'Stop Voice';
                          } else {
                            btnVoice.value = 'Start Voice';
                          }
                          console.log('Button text updated to:', btnVoice.value);
                        }
                      }

                      function handleEnter(event, txtUserInput) {
                        if (event.keyCode === 13) {
                          event.preventDefault();
                          let btnSend = document.getElementById('ctl00_PageContent_btnSend'); // Get btnSend element
                          if (btnSend) {
                            btnSend.click();
                          } else {
                            console.error('btnSend is not defined');
                          }
                        }
                      }
                      document.addEventListener('DOMContentLoaded', function() {
                        initializeRecognition();
                        btnVoice = document.getElementById('btnVoice'); // Get btnVoice element
                        let txtUserInput = document.getElementById('txtUserInput');
                        if (btnVoice) {
                          btnVoice.addEventListener('click', function(event) {
                            event.preventDefault();
                            toggleRecognition();
                            updateUpdatePanel(); // Call updateUpdatePanel after toggling recognition
                          });
                        }
                        if (txtUserInput) {
                          txtUserInput.addEventListener('keydown', function(event) {
                            handleEnter(event, txtUserInput);
                          });
                        }
                      });
                    </script>
                  </td>
                </tr>
                <tr>
                  <td>
                    <script>
                      let currentAudio = null;
                      let queue = [];

                      function TextToSpeech(s, apiKey, modelId, voiceId, speedId) {
                        ShowSpinner();
                        var oHttp = new XMLHttpRequest();
                        oHttp.open("POST", "https://api.openai.com/v1/audio/speech");
                        oHttp.setRequestHeader("Accept", "audio/mpeg");
                        oHttp.setRequestHeader("Content-Type", "application/json");
                        oHttp.setRequestHeader("Authorization", "Bearer " + apiKey);
                        oHttp.onload = function() {
                          if (oHttp.readyState === 4) {
                            HideSpinner();
                            var oBlob = new Blob([this.response], {
                              "type": "audio/mpeg"
                            });
                            var audioURL = window.URL.createObjectURL(oBlob);
                            var audio = new Audio();
                            audio.src = audioURL;
                            audio.onended = function() {
                              if (currentAudio) {
                                currentAudio = null;
                              }
                              if (queue.length > 0) {
                                var nextText = queue.shift();
                                startSpeaking(nextText.text, nextText.apiKey, nextText.modelId, nextText.voiceId, nextText.speedId);
                              }
                            };
                            if (currentAudio) {
                              currentAudio.pause();
                              currentAudio = null;
                            } else {
                              currentAudio = audio;
                              audio.play();
                            }
                          }
                        };
                        var data = {
                          model: modelId,
                          input: s,
                          voice: voiceId,
                          speed: speedId
                        };
                        oHttp.responseType = "arraybuffer";
                        oHttp.send(JSON.stringify(data));
                      }

                      function autoSpeak(textToSpeak, apiKey, modelId, voiceId, speedId) {
                        if (textToSpeak && apiKey) {
                          TextToSpeech(textToSpeak, apiKey, modelId, voiceId, speedId);
                        } else {
                          alert('Text to speak or API key is missing.');
                        }
                      }

                      function ShowSpinner() {
                        var o = document.getElementById('spinnerContainer');
                        if (o) return;
                        var style = document.getElementById('SpinnerStyle');
                        if (style == null) {
                          var style = document.createElement("style");
                          style.id = "SpinnerStyle";
                          style.textContent = ".spinner-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999;}" +
                            ".spinner {border: 4px solid rgba(0, 0, 0, 0.1); border-left: 4px solid #3498db; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite;}" +
                            "@keyframes spin {0% {transform: rotate(0deg);} 100% {transform: rotate(360deg);}}";
                          document.head.appendChild(style);
                        }
                        var c = document.createElement('div');
                        c.id = 'spinnerContainer';
                        c.classList.add('spinner-container');
                        var s = document.createElement('div');
                        s.classList.add('spinner');
                        c.appendChild(s);
                        document.body.appendChild(c);
                      }

                      function HideSpinner() {
                        var o = document.getElementById('spinnerContainer');
                        if (o) {
                          document.body.removeChild(o);
                        }
                      }

                      function startSpeaking(textToSpeak, apiKey, modelId, voiceId, speedId) {
                        // Check if speech synthesis is currently speaking
                        if (window.speechSynthesis.speaking) {
                          // Stop speech synthesis
                          window.speechSynthesis.cancel();
                        }
                        // Check if audio is currently playing
                        if (currentAudio) {
                          // Pause the current audio
                          currentAudio.pause();
                          currentAudio = null;
                        }
                        // Start speaking the new text
                        autoSpeak(textToSpeak, apiKey, modelId, voiceId, speedId);
                      }

                      function toggleSpeakButton() {
                        var speakButton = document.getElementById('btnSpeak');
                        if (speakButton) {
                          if (currentAudio) {
                            speakButton.value = "Stop";
                          } else {
                            speakButton.value = "Speak";
                          }
                        }
                      }

                      function triggerSpeakButtonClick() {
                        var speakButton = document.getElementById('btnSpeak');
                        if (speakButton) {
                          speakButton.click();
                        }
                      }
                      //window.onload = function() {
                      //    toggleSpeakButton();
                      //    triggerSpeakButtonClick();
                      //};
                      function speakResponse(element) {
                        var textToSpeak = element.getAttribute('data-text');
                        var apiKey = element.getAttribute('data-api-key');
                        var modelId = element.getAttribute('data-model-id');
                        var voiceId = element.getAttribute('data-voice-id');
                        var speedId = element.getAttribute('data-speed-id');
                        autoSpeak(textToSpeak, apiKey, modelId, voiceId, speedId);
                      }

                      function stopAndSpeak() {
                        var isSpeaking = window.speechSynthesis.speaking;
                        if (isSpeaking || currentAudio) {
                          // Stop speech synthesis or audio playback
                          if (isSpeaking) {
                            alert('Speaking');
                            window.speechSynthesis.cancel();
                          }
                          if (currentAudio) {
                            alert('still Speaking');
                            currentAudio.pause();
                            currentAudio = null;
                          }
                          // Trigger the click event of the "Speak" button
                          var speakButton = document.getElementById('btnSpeak');
                          if (speakButton) {
                            alert('will Speaking');
                            speakButton.click();
                          }
                        }
                      }
                    </script>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div id="detailPopup" class="detailRolloverPopup" onmouseout="detailRolloverPopupClose();" onmouseover="clearTimeout(gPopupTimer);"></div>
          <div class="QDialog" id="dialog" style="display:none;">
            <iframe id="QuickPopupIframe" style="width:100%;height:100%;border:none"></iframe>
          </div>
          <div id="ctl00_PageContent_ValidationSummary1" style="color:Red;display:none;">
          </div>
        </td>
      </tr>
    </tbody>
  </table>
  <script type="text/javascript">
    //<![CDATA[
    var Page_ValidationSummaries = new Array(document.getElementById("ctl00_PageContent_ValidationSummary1"));
    //]]>
  </script>
  <script type="text/javascript">
    //<![CDATA[
    var ctl00_PageContent_ValidationSummary1 = document.all ? document.all["ctl00_PageContent_ValidationSummary1"] : document.getElementById("ctl00_PageContent_ValidationSummary1");
    ctl00_PageContent_ValidationSummary1.headertext = "Please correct the following errors:";
    ctl00_PageContent_ValidationSummary1.showmessagebox = "True";
    ctl00_PageContent_ValidationSummary1.showsummary = "False";
    //]]>
  </script>
  <script language="javascript" type="text/javascript">
    var ctrl = "";

    function pageLoadedHandler1(sender, args) {
      setTimeout("setTimeoutFocus()", 1000);
    }

    function setTimeoutFocus() {
      setFocus(ctrl);
    }
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoadedHandler1);
  </script>
  <script type="text/javascript">
    //<![CDATA[
    openPopupPage('QPageSize');
    (function() {
      var fn = function() {
        $get("ctl00_scriptManager1_HiddenField").value = '';
        Sys.Application.remove_init(fn);
      };
      Sys.Application.add_init(fn);
    })();
    (function(id) {
      var e = document.getElementById(id);
      if (e) {
        e.dispose = function() {
          Array.remove(Page_ValidationSummaries, document.getElementById(id));
        }
        e = null;
      }
    })('ctl00_PageContent_ValidationSummary1');
    //]]>
  </script>
</form>

Text Content

Pharos University AI Assistant


Welcome to Pharos University's AI Assistant!
We're excited to have you! Use our virtual assistant for any help or info you
need. Our AI is here to assist you at every step. Let's begin!
مرحبًا بكم في مساعد الذكاء الاصطناعي بجامعة فاروس!
نحن سعداء بوجودكم! استخدموا مساعدنا الافتراضي لأي مساعدة أو معلومات تحتاجونها.
الذكاء الاصطناعي هنا لمساعدتكم في كل خطوة. لنبدأ!

Thinking.... Please Wait