????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.133.113.227 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/apps/school/www_old_temp/js/ |
Upload File : |
function s_setHeaderTable(idDivTable, title, subTitle, isBtnHomeRequired, isBtnPlayAgainReqd) { s_setHeaderTable2(idDivTable, title, subTitle, isBtnHomeRequired, isBtnPlayAgainReqd, false) } function s_setHeaderTable2(idDivTable, title, subTitle, isBtnHomeRequired, isBtnPlayAgainReqd, isZoomCheckboxReqd) { var table = ""; var deviceType = s_getDeviceType(); var headerStyle = 's_style_buttons_header_footer'; var sizePercentage = s_getSizePercentageAsPerDeviceHeightWidth(); var sizeMultiplyValue = 40; var fontSize = sizeMultiplyValue * sizePercentage; var fontSizeTitle = fontSize * 0.35;//0.4 var fontSizeButtonText = fontSizeTitle; var buttonHeight = fontSize * 1.0; var borderRadius = fontSize; var fontSizeSubTitle = fontSizeTitle * 0.8; fontSizeTitle = fontSizeTitle + 'px'; fontSizeSubTitle = fontSizeSubTitle + 'px'; fontSizeButtonText = fontSizeButtonText + 'px'; buttonHeight = buttonHeight + 'px'; borderRadius = borderRadius + 'px'; var headerHeight = s_dataTableHeight * 8 / 100.0; table += ' <table id="s_style_tblMainiPadHeader" border="0" width="100%" height="' + headerHeight + '" cellspacing="0">'; table += ' <tr>'; if (isBtnHomeRequired) { table += ' <td width="20%" onClick="btnHome_click()" style="padding-left: 5px">'; table += ' <input type="button" class="' + headerStyle + '" value="Home" style="width: 100%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto">'; } else { table += ' <td width="20%" style="padding-left: 5px">'; } table += ' </td>'; table += ' <td width="*" align="center">'; table += ' <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">'; table += ' <tr height="50%">'; table += ' <td width="100%" align="center" style="font-size:' + fontSizeTitle + '"><b>' + title + '</b></td>'; table += ' </tr>'; if (subTitle !== '') { table += ' <tr height="50%">'; if (isZoomCheckboxReqd) { table += ' <td width="100%">'; table += ' <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">'; table += ' <tr height="100%">'; table += ' <td width="75%" align="center" style="font-size:' + fontSizeSubTitle + '">' + subTitle + '</td>'; table += ' <td width="*" align="left" color="red" style="font-size:' + fontSizeSubTitle + '">' + 'Zoom ' + '<input type="checkbox" id="s_id_checkBoxZoom" value="" style="min-height: 10px; min-width: 10px" onClick="btnChkZoom_click()"></td>'; table += ' </tr>'; table += ' </table>'; table += ' </td>'; } else { table += ' <td width="75%" align="center" style="font-size:' + fontSizeSubTitle + '">' + subTitle + '</td>'; } table += ' </tr>'; } table += ' </table>'; table += ' </td>'; if (isBtnPlayAgainReqd) { table += ' <td width="20%" onClick="s_btnPlayAgain_click()" align="right" style="padding-right: 5px">'; table += ' <input type="button" class="' + headerStyle + '" value="Play Again" style="width: 100%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '">'; } else { table += ' <td width="20%" align="right" style="padding-right:2%">'; var resString = subTitle.substr(subTitle.length - 10, subTitle.length); if ((subTitle != 'Levels') && (resString != 'Categories')) { if ((s_currentDeviceType == s_DeviceTypeWindowsPhone) || (s_currentDeviceType == s_DeviceTypeWindowsInternetExplorer)) { var imageHeight = 1.2 * fontSize; var imageWidth = 1.2 * fontSize; table += ' <img src="../../../readingImage.jpg" width="' + imageWidth + '" height="' + imageHeight + '" draggable="false" onClick="s_btnPlayAgain_click()"/>'; } else { table += ' <img src="../../../readingImage.jpg" width="50%" alt="" draggable="false" onClick="s_btnPlayAgain_click()"/>'; } } } table += ' </td>'; table += ' </tr>'; table += ' </table>'; document.getElementById(idDivTable).innerHTML = table; } function btnChkZoom_click() { var eZoomCheckBox = document.getElementById('s_id_checkBoxZoom'); eZoomCheckBox.parentElement.style.color = eZoomCheckBox.checked ? 'orange' : 'white'; if (s_currentDeviceType == s_DeviceTypeAndroidDeviceApp) { eZoomCheckBox.parentElement.style.fontWeight = eZoomCheckBox.checked ? 'bold' : '' } } function s_setFooterTableEmpty(idDivTable, isCategoriesPage) { var table = ''; var footerHeight = s_dataTableHeight * 8 / 100.0; table += ' <table id="s_style_tblMainiPadFooter" border="0" width="100%" height="' + footerHeight + '" cellspacing="0">'; table += ' <tr>'; var imageHeight = 80 * s_dataTableHeight / 1024; var imageWidth = 200 * s_dataTableWidth / 768; if (isCategoriesPage) { if (s_currentDeviceType == s_DeviceTypeWindowsInternetExplorer) { table += ' <td align="center"><img src="../../poweredByAstacus.png" width="' + imageWidth + '" height="' + imageHeight + '"/></td>'; } else { table += ' <td align="center"><img src="../../poweredByAstacus.png" width="35%"/></td>'; } } else//Levels page { if (s_currentDeviceType == s_DeviceTypeWindowsInternetExplorer) { table += ' <td align="center"><img src="poweredByAstacus.png" width="' + imageWidth + '" height="' + imageHeight + '"/></td>'; } else { table += ' <td align="center"><img src="poweredByAstacus.png" width="35%"/></td>'; } } table += ' </tr>'; table += ' </table>'; document.getElementById(idDivTable).innerHTML = table; } function s_setFooterTable(idDivTable, isbtnFirstRequired, isBtnPreviousRequired, isBtnValidateRequired, isBtnNextRequired, isbtnLastRequired)//Aug16 { var table = ''; var deviceType = s_getDeviceType(); var footerStyle = 's_style_buttons_header_footer'; var buttonStyle_disabled = s_currentDeviceOS == s_deviceOS_iOS ? 's_style_buttons_header_footer' : 's_style_buttons_header_footer_disabled';//Aug16 var sizePercentage = s_getSizePercentageAsPerDeviceHeightWidth(); var sizeMultiplyValue = 40; var fontSize = sizeMultiplyValue * sizePercentage; var fontSizeButtonText = fontSize * 0.4; var buttonHeight = fontSize * 1.0; var borderRadius = fontSize; fontSizeButtonText = fontSizeButtonText + 'px'; buttonHeight = buttonHeight + 'px'; borderRadius = borderRadius + 'px'; var footerHeight = s_dataTableHeight * 8 / 100.0; table += ' <table id="s_style_tblMainiPadFooter" border="0" width="100%" height="' + footerHeight + '" cellspacing="0">'; table += ' <tr>'; if (isbtnFirstRequired) { table += ' <td width="15%" onClick="s_btnFirstLesson_click()" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + footerStyle + '" value="<<" style="width:100%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto">'; } else { table += ' <td width="15%" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + buttonStyle_disabled + '" value="<<" style="width:100%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto" disabled>'; } table += ' </td>'; if (isBtnPreviousRequired) { table += ' <td width="15%" onClick="btnPrevious_click()" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + footerStyle + '" value="<" style="width:75%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto">'; } else { table += ' <td width="15%" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + buttonStyle_disabled + '" value="<" style="width:75%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto" disabled>'; } table += ' </td>'; if (isBtnValidateRequired) { table += ' <td width="*" onClick="btnValidate_click()" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + footerStyle + '" value="Validate" style="width: 50%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto">'; } else { table += ' <td width="*" style="text-align:center; vertical-align:middle">'; } table += ' </td>'; if (isBtnNextRequired) { table += ' <td width="15%" onClick="btnNext_click()" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + footerStyle + '" value=">" style="width:75%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto">'; } else { table += ' <td width="15%" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + buttonStyle_disabled + '" value=">" style="width:75%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto" disabled>'; } table += ' </td>'; if (isbtnLastRequired == true) { table += ' <td width="15%" onClick="s_btnLastLesson_click()" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + footerStyle + '" value=">>" style="width:100%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto">'; } else { table += ' <td width="15%" style="text-align:center; vertical-align:middle">'; table += ' <input type="button" class="' + buttonStyle_disabled + '" value=">>" style="width:100%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto" disabled>'; } table += ' </td>'; table += ' </tr>'; table += ' </table>'; document.getElementById(idDivTable).innerHTML = table; } function s_btnHomeLevels_click() { window.location = '../../levels.html'; } function s_btnHomeCategories_click(levelNameWithoutSpace) { window.location = '../' + levelNameWithoutSpace + 'Categories.html'; } function s_btnFirstLesson_click() { window.location = s_currentLevel + s_currentCategory + 'Lesson01.html'; } function s_btnLastLesson_click() { window.location = s_currentLevel + s_currentCategory + s_currentCategoryLastLesson; } function s_btnPlayAgain_click() { window.location.reload(); } function s_getPageParametersArray() { var urlEncoded = document.URL; var urlDecoded = decodeURI(urlEncoded); var indexOfQuestionMark = urlDecoded.indexOf("?"); var parametersAll = urlDecoded.substring(indexOfQuestionMark + 1); var parametersArray = parametersAll.split("&"); return (parametersArray); } function s_setTextAndBackgroundColorToGreen(id_text, id_box_destination, text_prefix, text_suffix) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var elementBox = document.getElementById(id_box_destination); var innerHtml = '<u>' + text_prefix + text + '</u>' + text_suffix; elementBox.innerHTML = innerHtml; elementBox.style.backgroundColor = s_colorGreen; elementBox.style.color = 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorToGreenByTrimmingText(id_text, id_box_destination) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var elementBox = document.getElementById(id_box_destination); var innerHtml = '<u>' + text + '</u>'; elementBox.innerHTML = innerHtml; elementBox.style.backgroundColor = s_colorGreen; elementBox.style.color = 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorAndIsMovedTrue(id_text, id_box_destination) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var splitText = text.toLowerCase().split(' '); var elementBox = document.getElementById(id_box_destination); elementBox.innerHTML = text; elementBox.style.backgroundColor = splitText[0]; elementBox.style.color = ((splitText[0] == 'white') || (splitText[0] == 'yellow')) ? 'black' : 'white'; elementBox.style.border = (splitText[0] == 'white') ? '2px solid black' : 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorAndIsMovedTrueNew(id_text, id_box_destination) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var splitText = text.toLowerCase().split(' '); var elementBox = document.getElementById(id_box_destination); elementBox.innerHTML = text; elementBox.style.backgroundColor = (splitText[0] == 'brown') ? 'rgba(139, 69, 19, 1)' : splitText[0]; elementBox.style.color = ((splitText[0] == 'white') || (splitText[0] == 'yellow')) ? 'black' : 'white'; elementBox.style.border = (splitText[0] == 'white') ? '2px solid black' : 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorToGreenAndIsMovedTrue(id_text, id_box_destination) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var elementBox = document.getElementById(id_box_destination); elementBox.innerHTML = '<u>' + text + '</u>'; elementBox.style.backgroundColor = s_colorGreen; elementBox.style.color = 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorToGreenAndIsMovedTrueAndIsFilledTrue(id_text, id_box_destination) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var elementBox = document.getElementById(id_box_destination); elementBox.innerHTML = '<u>' + text + '</u>'; elementBox.style.backgroundColor = s_colorGreen; elementBox.style.color = 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementBox.isFilled = true;//23-Aug-2014 elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorToGreenAndIsMovedTrueAndReplaceText(id_text, id_box_destination) { var millID = document.getElementById(id_box_destination); var millText = millID.innerText.trim(); millText = millText.substring(0, millText.length - 7); var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); text =text.concat(millText); var elementBox = document.getElementById(id_box_destination); elementBox.innerHTML = '<u>' + text + '</u>'; elementBox.style.backgroundColor = s_colorGreen; elementBox.style.color = 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_setTextAndBackgroundColorByTrimmingText(id_text, id_box_destination) { var elementText = document.getElementById(id_text); var text = elementText.innerText.trim(); var splitText = text.toLowerCase().split(' '); var elementBox = document.getElementById(id_box_destination); elementBox.innerHTML = text; elementBox.style.backgroundColor = splitText[0]; elementBox.style.color = ((splitText[0] == 'white') || (splitText[0] == 'yellow')) ? 'black' : 'white'; elementBox.style.border = (splitText[0] == 'white') ? '2px solid black' : 'white'; elementBox.style.fontFamily = 'Arial Rounded MT Bold'; elementText.style.display = 'none';//For browser IE elementText.hidden = true; elementText.isMoved = true; } function s_dragDropImage(id_draggable_image, id_box_destination, id_img_source) { var elementDraggableImage = document.getElementById(id_draggable_image); var elementBox = document.getElementById(id_box_destination); var elementImageSource = document.getElementById(id_img_source); var insertImage = '<img src="' + elementImageSource.src + '" width="' + elementImageSource.width + '" height="' + elementImageSource.height + '"/>'; elementBox.innerHTML = insertImage; elementBox.style.backgroundColor = s_colorGreen; elementDraggableImage.style.display = 'none';//For browser IE elementDraggableImage.hidden = true; } function s_dragDropImageAndIsMovedTrue(id_draggable_image, id_box_destination, id_img_source) { var elementDraggableImage = document.getElementById(id_draggable_image); var elementBox = document.getElementById(id_box_destination); var elementImageSource = document.getElementById(id_img_source); var insertImage = '<img src="' + elementImageSource.src + '" width="' + elementImageSource.width + '" height="' + elementImageSource.height + '"/>'; elementBox.innerHTML = insertImage; elementBox.style.backgroundColor = s_colorGreen; elementDraggableImage.style.display = 'none';//For browser IE elementDraggableImage.hidden = true; elementDraggableImage.isMoved = true; } function s_hideClapsImage() { var imageDivEelement = document.getElementById('s_id_div_message'); imageDivEelement.hidden = true; imageDivEelement.style.display = 'none';//For browser IE s_stopSoundClaps(); } function s_playSoundClaps()//original { var pInnerHtml = ""; pInnerHtml += ' <audio id="id_claps_sound" autoplay="autoplay" loop="loop" controls="controls" style="position: absolute; visibility: hidden">'; pInnerHtml += ' <source src="../../../res/sounds/claps-sound.mp3" type="audio/mpeg">'; pInnerHtml += ' </audio>'; document.getElementById('id_playAudio').innerHTML = pInnerHtml; } function s_stopSoundClaps() { var eSound = document.getElementById('id_claps_sound') if (eSound != null) { eSound.pause(); if ((s_currentDeviceType == s_DeviceTypeWindowsPhone) || (s_currentDeviceType == s_DeviceTypeWindowsInternetExplorer)) { eSound.currentTime.toFixed(0); } else { eSound.currentTime = 0; } } } function s_is_all_infos_filled_show_claps_animationWithIsFilled(boxIdsArray) { if (s_isAllInfosFilled(boxIdsArray)) { s_show_claps_animation(); } } function s_isAllInfosFilled(boxIdsArray) { for (index=0; index<boxIdsArray.length; index++) { var element = document.getElementById(boxIdsArray[index]); if (element.isFilled == false) { return (false); } } return (true); } function s_setFilledAsFalseToArray(ids_arrayBoxes) { for (index = 0; index < ids_arrayBoxes.length; index++) { var id_element = ids_arrayBoxes[index]; var eElement = document.getElementById(id_element); eElement.isFilled = false; } } //To rectify a problem in Android device. function s_show_claps_animation_for_initial() { var innerHtml = ''; var clapsImageSize = s_dataTableWidth / 2.0; innerHtml += ' <div id="id_div">'; innerHtml += ' <table width="' + s_dataTableWidth + '" height="' + s_dataTableHeight + '" border="1" cellspacing="0" cellpadding="0" >'; innerHtml += ' <tr>'; innerHtml += ' <td align="center" style="text-align:center; vertical-align:middle">'; innerHtml += ' <input type="image" id="id_image" src="img/claps.gif" width="' + clapsImageSize + '" height="' + clapsImageSize + '" onclick="s_hideClapsImage()" alt="Claps">'; innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>'; innerHtml += ' </div>'; var eDiv = document.getElementById('s_id_div_message'); eDiv.innerHTML = innerHtml; eDiv.hidden = false; eDiv.style.display = 'block';//For browser IE eDiv.style.visibility = "visible"; var eDiv = document.getElementById('id_image'); eDiv.setAttribute("unselectable", "on"); eDiv.className = 's_style_unselectable s_style_animation_show_success'; } function s_show_claps_animation() { var clapsImageSize = s_dataTableWidth / 2.0; var deviceType = s_getDeviceType(); var buttonStyle = 's_style_buttons_header_footer'; var left = ((deviceType == s_DeviceTypeMacSafari)|| (deviceType == s_DeviceTypeWindowsChrome)) ? '16px' : '4px'; var innerHtml = ''; innerHtml += ' <div style="position: absolute; text-align:center; z-index: 99; -webkit-overflow-scrolling: touch; overflow-y: scroll; right: 0; bottom: 0; left: ' + left + '; top: 8px" >';//for resized window innerHtml += ' <table border="0" align="center" cellspacing="0" cellpadding="0" width="' + s_dataTableWidth + '" height="' + s_dataTableHeight + '" style="background-color: rgba(0, 0, 0, 0)">'; innerHtml += ' <tr height="100%">';//tr1 innerHtml += ' <td align="center" valign="center">'; innerHtml += '<img id="id_image" src="../../../img/claps.gif" width="' + clapsImageSize + '" height="' + clapsImageSize + '" onclick="s_hideClapsImage()" alt="Claps">'; innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>'; innerHtml += ' </div>'; innerHtml += ' <span id="id_playAudio"></span>'; var eDiv = document.getElementById('s_id_div_message'); eDiv.innerHTML = innerHtml; eDiv.hidden = false; eDiv.style.display = 'block';//For browser IE eDiv.style.visibility = "visible"; var eDiv = document.getElementById('id_image'); eDiv.setAttribute("unselectable", "on"); eDiv.className = 's_style_unselectable s_style_animation_show_success'; s_playSoundClaps(); } function s_show_message_info(title, message, messageOption) { var deviceType = s_getDeviceType(); var buttonStyle = 's_style_buttons_header_footer'; var messageBoxWidth = s_dataTableWidth * 0.65; var messageBoxHeight = messageBoxWidth * 0.7; var sizePercentageAsDevice = s_getSizePercentageAsPerDeviceHeightWidth(); var actualSize = 24; var textSize = actualSize * sizePercentageAsDevice; var fontSizeButtonText = textSize; var buttonHeight = textSize * 1.8; var borderRadius = buttonHeight / 2.0; var tdButtonHeight = buttonHeight * 1.2; var buttonWidthPercent = (messageOption == MessageOption.OKCancel) ? 70 : 35; fontSizeButtonText = fontSizeButtonText + 'px'; buttonHeight = buttonHeight + 'px'; borderRadius = borderRadius + 'px'; tdButtonHeight = tdButtonHeight + 'px'; var left = ((deviceType == s_DeviceTypeMacSafari)|| (deviceType == s_DeviceTypeWindowsChrome)) ? '16px' : '4px'; var innerHtml = ''; innerHtml += ' <div style="position: absolute; text-align:center; z-index: 99; -webkit-overflow-scrolling: touch; overflow-y: scroll; right: 0; bottom: 0; left: ' + left + '; top: 8px" >';//for resized window//19Aug2015 innerHtml += ' <table border="0" cellspacing="0" cellpadding="0" align="center" width="' + s_dataTableWidth + '" height="' + s_dataTableHeight + '" style="background-color:rgba(0, 0, 0, 0)">';//table1 // White transparent background is required for IE to avoid other buttons click. innerHtml += ' <tr>'; innerHtml += ' <td align="center" style="border:none;">'; innerHtml += ' <table width="' + messageBoxWidth + '" height="' + messageBoxHeight + '" border="0" cellspacing="0" cellpadding="0">';//table2 innerHtml += ' <tr>'; innerHtml += ' <td id="s_style_messagebox_background" align="center">'; innerHtml += ' <table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" style="border:none">';//table3 innerHtml += ' <tr height="' + messageBoxHeight / 3.8 + '">';//tr1 innerHtml += ' <td align="center" style="border:none; font-size:' + textSize + 'px">'; innerHtml += ' <span>' + title + '</span>'; innerHtml += ' </td">'; innerHtml += ' </tr>'; innerHtml += ' <tr height="' + messageBoxHeight / 2.4 + '">';//tr2 innerHtml += ' <td align="center" style="border-left:none;border-right:none;">'; innerHtml += ' <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="5" style="border:none">';//table5 innerHtml += ' <tr>'; innerHtml += ' <td align="center" style="border:none; font-size:' + textSize + 'px">'; innerHtml += ' ' + message + ''; innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>';//table5 innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' <tr height="' + messageBoxHeight / 3.8 + '">';//tr3 if (deviceType == s_DeviceTypeAndroidDeviceApp) { innerHtml += ' <td align="center" style="border-bottom:none;border-left:none;border-right:none; padding:5px">'; } else { innerHtml += ' <td align="center" style="border:none; padding:5px">'; } innerHtml += ' <table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" style="border:none">';//table6 innerHtml += ' <tr>'; innerHtml += ' <td width="50%" align="center" style="border:none">'; innerHtml += ' <input type="button" class="' + buttonStyle + '" value="OK" onClick="hide_message_info()" style="width:' + buttonWidthPercent + '%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto; color:blue">'; innerHtml += ' </td>'; if (messageOption == MessageOption.OKCancel) { innerHtml += ' <td width="50%" align="center" style="border:none">'; innerHtml += ' <input type="button" class="' + buttonStyle + '" value="Cancel" onClick="cancel_message_info()" style="width:' + buttonWidthPercent + '%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto; color:blue">'; innerHtml += ' </td>'; } innerHtml += ' </tr>'; innerHtml += ' </table>';//table6 innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>';//table3 innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>';//table2 innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>';//table1 innerHtml += ' </div>'; var eDiv = document.getElementById('s_id_div_message'); eDiv.innerHTML = innerHtml; eDiv.setAttribute("unselectable", "on"); eDiv.className = 's_style_unselectable'; var eTd = document.getElementById('id_tblMainiPadBody'); var eTdRectangle = eTd.getBoundingClientRect(); eDiv.style.left = eTdRectangle.left + 'px'; eDiv.style.top = eTdRectangle.top + 'px'; } function show_message_info() { var eDiv = document.getElementById('s_id_div_message'); eDiv.hidden = false; eDiv.style.display = 'block';//For browser IE } function hide_message_info() { var eDiv = document.getElementById('s_id_div_message'); eDiv.hidden = true; eDiv.style.display = 'none';//For browser IE } function cancel_message_info() { hide_message_info(); } function s_setEmptyDropBoxForImageInfo(ids_array_boxes) { for (var idIndex = 0; idIndex < ids_array_boxes.length; idIndex++) { var eTdBox = document.getElementById(ids_array_boxes[idIndex]); eTdBox.style.backgroundColor = '#FFDB99';//Light orange eTdBox.style.color = 'white'; eTdBox.style.textAlign = 'center'; eTdBox.style.verticalAlign = 'middle'; eTdBox.innerHTML = 'Drag here'; } } function s_init_dropping_spans(ids_spans) { for (var idIndex = 0; idIndex < ids_spans.length; idIndex++) { var eSpan = document.getElementById(ids_spans[idIndex]); eSpan.isMoved = false; } } function s_init_dropBox_tds_with_drag_here(ids_boxes) { for (var idIndex = 0; idIndex < ids_boxes.length; idIndex++) { var eTdBox = document.getElementById(ids_boxes[idIndex]); eTdBox.style.backgroundColor = '#FFDB99';//Light orange eTdBox.style.color = 'white'; eTdBox.style.textAlign = 'center'; eTdBox.style.verticalAlign = 'middle'; eTdBox.innerHTML = 'Drag here'; eTdBox.isFilled = false; eTdBox.customBackgroundcolor = '#FFDB99';//Light orange } } function s_init_dropBox_tds_withOUT_drag_here(ids_boxes) { for (var idIndex = 0; idIndex < ids_boxes.length; idIndex++) { var eTdBox = document.getElementById(ids_boxes[idIndex]); eTdBox.isFilled = false; eTdBox.customBackgroundcolor = 'white'; } } function s_setImageSource(id_image, imagesPath, imageName) { var eImage = document.getElementById(id_image); eImage.src = imagesPath + imageName; } function s_createProjectPaths() { } function s_downloadProjectFiles() { } function s_removeEndPathOrFile(path) { return (path.substring(0, path.lastIndexOf('/'))); } function s_getSubTitle(level, catNo, lessonNo) { //Un-commented on 21-Apr-2021 var totalLessons = s_get_totalLessons(level, catNo); if (s_isDebug) { return ("Level " + level.name + " [Debug - Cat " + catNo.name + " : Lesson " + lessonNo + "/" + totalLessons + "]"); } else { return ("Level " + level.name + " [" + catNo.name + " - " + lessonNo + " of " + totalLessons + "]"); } //Commented on 21-Apr-2021 //return ("OBE - A Level - English - Lesson No : " + lessonNo); } function s_setFilledAsFalseToArray(ids_arrayBoxes) { for (index = 0; index < ids_arrayBoxes.length; index++) { var id_element = ids_arrayBoxes[index]; var eElement = document.getElementById(id_element); eElement.isFilled = false; } } function s_hideAllExceptFirstElement(id_prefix, nIds_total) { for (var id_no = 1; id_no <= nIds_total; id_no++) { var idOfElement = id_prefix + id_no; var eElement = document.getElementById(idOfElement); eElement.isMoved = false; eElement.hidden = (id_no == 1) ? false : true; eElement.style.display = (id_no == 1) ? 'block' : 'none'; } } function s_hideAllExceptFirstElement2(id_startsFrom , id_prefix, nIds_total)//oct29 { for (var id_no = id_startsFrom; id_no <= nIds_total; id_no++) { var idOfElement = id_prefix + id_no; var eElement = document.getElementById(idOfElement); eElement.isMoved = false; eElement.hidden = (id_no == 1) ? false : true; eElement.style.display = (id_no == 1) ? 'block' : 'none'; } } function s_unHideNextElementNew(id_prefix, nIds_total) { for (var id_no = 1; id_no <= nIds_total; id_no++) { var idOfElement = id_prefix + id_no; var eElement = document.getElementById(idOfElement); if (eElement != null && eElement.isMoved == false) { eElement.hidden = false; eElement.style.display = 'block'; eElement.setAttribute("draggable", "true"); return; } } } function s_unHideNextElementNew1(id_startsFrom, id_prefix, nIds_total)//oct29 { for (var id_no = id_startsFrom; id_no <= nIds_total; id_no++) { var idOfElement = id_prefix + id_no; var eElement = document.getElementById(idOfElement); if (eElement != null && eElement.isMoved == false) { eElement.hidden = false; eElement.style.display = 'block'; eElement.setAttribute("draggable", "true"); return; } } } function s_unHideNextElementNew2(id_spanPrefix, id_tdPrefix, nIds_total) { for (var id_no = 1; id_no <= nIds_total; id_no++) { var id_span = id_spanPrefix + id_no; var eSpan = document.getElementById(id_span); var id_td = id_tdPrefix + id_no; var eTd = document.getElementById(id_td); if (eSpan != null && eSpan.isMoved == false) { eSpan.hidden = false; eSpan.style.display = 'block'; eTd.setAttribute("draggable", "true"); return; } } } function s_hide_canvas_circle_makeBackgroundWhite(id_canvas) { var eCanvas = document.getElementById(id_canvas); if (eCanvas.style.display == 'block') eCanvas.style.display = 'none'; if (eCanvas.parentElement.parentElement.style.backgroundColor != 'white') { eCanvas.parentElement.parentElement.style.backgroundColor = 'white'; } } function s_hide_canvas_circle(id_canvas) { var eCanvas = document.getElementById(id_canvas); if (eCanvas.style.display == 'block') eCanvas.style.display = 'none'; } function s_svg_setEllipseLightGreenTransparentIfisValidatedIsFalse(eEllipse) { if (eEllipse.isValidated == false) { eEllipse.style.stroke = 'rgba(0, 250, 0, 1)'; eEllipse.style.fill = 'rgba(0, 250, 0, 0.4)';//LightGreen } } function s_svg_setEllipseFillRedTransparentIfisValidatedIsFalse(eEllipse) { if (eEllipse.isValidated == false) { eEllipse.style.stroke = 'rgba(250, 0, 0, 0.6)'; eEllipse.style.fill = 'rgba(250, 0, 0, 0.4)';//LightRed } } function s_svg_setEllipseFillBlackTransparentIfisValidatedIsFalse(eEllipse) { if (eEllipse.isValidated == false) { eEllipse.style.stroke = 'rgba(0, 0, 0, 0.6)'; eEllipse.style.fill = 'rgba(0, 0, 0, 0.4)';//LightBlack } } function s_svg_setEllipseBorderRedIfisValidatedIsFalse(eEllipse) { if (eEllipse.isValidated == false) { eEllipse.style.stroke = 'rgba(255, 0, 0, 0)';//Red } } function s_svg_setEllipseBorderBlackIfisValidatedIsFalse(eEllipse) { if (eEllipse.isValidated == false) { eEllipse.style.stroke = 'rgba(0, 0, 0, 0)';//Black } } function s_svg_setSvgWidthHeightAndPositionFromTd(id_td, id_eSvg) { var eTd = document.getElementById(id_td); var eTdRectangle = eTd.getBoundingClientRect(); var eSvg = document.getElementById(id_eSvg); eSvg.style.width = eTdRectangle.width + 'px'; eSvg.style.height = eTdRectangle.height + 'px'; eSvg.style.left = eTdRectangle.left + 'px'; eSvg.style.top = eTdRectangle.top + 'px'; eSvg.style.visibility = "visible"; if (s_isDebug) { eSvg.style.backgroundColor = 'rgba(0, 200, 0, 0.2)'; } } function s_svg_setEllipseStyle(id_ellipse) { var eEllipse = document.getElementById(id_ellipse); eEllipse.style.stroke = 'transparent'; eEllipse.style.fill = 'transparent'; eEllipse.style.strokeWidth = '1px'; eEllipse.onclick = function(){ellipse_click(id_ellipse)}; eEllipse.isValidated = false; eEllipse.circleColor = CircleColorSvg.None; if (s_isDebug) { eEllipse.style.stroke = 'rgba(250, 0, 0, 0.5)'; } } function s_svg_setRectangleStyle(id_rectangle) { var eRectangle = document.getElementById(id_rectangle); eRectangle.style.stroke = 'transparent'; eRectangle.style.fill = 'transparent'; eRectangle.style.strokeWidth = '1px'; eRectangle.onclick = function(){rectangle_click(id_rectangle)}; eRectangle.isValidated = false; eRectangle.circleColor = CircleColorSvg.None; eRectangle.isSelected = false; if (s_isDebug) { eRectangle.style.stroke = 'rgba(250, 0, 0, 0.5)'; } } function s_svg_setEllipseStyle_stroke_width_zero(id_ellipse) { var eEllipse = document.getElementById(id_ellipse); eEllipse.style.stroke = 'transparent'; eEllipse.style.fill = 'transparent'; eEllipse.style.strokeWidth = '0px'; eEllipse.onclick = function(){ellipse_click(id_ellipse)}; eEllipse.isValidated = false; eEllipse.circleColor = CircleColorSvg.None; if (s_isDebug) { eEllipse.style.stroke = 'rgba(250, 0, 0, 0.5)'; } } function s_svg_clearMultiEllipsesUsingIdsArray(ellipseIdsArray) { for (var indexEllipse = 0; indexEllipse < ellipseIdsArray.length; indexEllipse++) { var id_ellipse = ellipseIdsArray[indexEllipse]; s_svg_clearEllipse(id_ellipse); } } function s_svg_clearEllipse(id_ellipse) { var eEllipse = document.getElementById(id_ellipse); eEllipse.style.fill = 'transparent'; eEllipse.style.stroke = 'transparent'; eEllipse.circleColor = CircleColorSvg.None; eEllipse.isValidated = false; } function s_svg_validateEllipsesForValidationReqd(ellipseIdsArrayValidationReqd, circleColor) { var nCorrectEllipses = 0; for (var indexEllipse = 0; indexEllipse < ellipseIdsArrayValidationReqd.length; indexEllipse++) { var id_ellipse = ellipseIdsArrayValidationReqd[indexEllipse]; var eEllipse = document.getElementById(id_ellipse); if (eEllipse.circleColor != CircleColorSvg.None) { if (eEllipse.circleColor == circleColor) { s_svg_setEllipseLightGreenTransparentIfisValidatedIsFalse(eEllipse); nCorrectEllipses++; } else { s_svg_setEllipseFillRedTransparentIfisValidatedIsFalse(eEllipse); } } eEllipse.isValidated = true; } return (nCorrectEllipses); } function s_svg_validateEllipsesForValidationNotReqdForMulti(ellipseIdsArrayValidationNotReqd) { for (var indexEllipse = 0; indexEllipse < ellipseIdsArrayValidationNotReqd.length; indexEllipse++) { var id_ellipse = ellipseIdsArrayValidationNotReqd[indexEllipse]; s_svg_validateEllipseForValidationNotReqdForSingle(id_ellipse); } } function s_svg_validateEllipseForValidationNotReqdForSingle(id_ellipse) { var eEllipse = document.getElementById(id_ellipse); if (eEllipse.circleColor != CircleColorSvg.None) { s_svg_setEllipseFillRedTransparentIfisValidatedIsFalse(eEllipse); } eEllipse.isValidated = true; } function s_svg_showHideEllipsesMultipleFor1Td(id_ellipse, allGroupsIdsArrayArray) { var eEllipse = document.getElementById(id_ellipse); if (eEllipse.circleColor == CircleColorSvg.None) { for (var indexGroup = 0; indexGroup < allGroupsIdsArrayArray.length; indexGroup++) { var groupIdsArray = allGroupsIdsArrayArray[indexGroup]; for (var indexEllipse = 0; indexEllipse < groupIdsArray.length; indexEllipse++) { var id_ellipse = groupIdsArray[indexEllipse]; if (eEllipse.id == id_ellipse) { for (var indexEllipseInner = 0; indexEllipseInner < groupIdsArray.length; indexEllipseInner++) { if (indexEllipse != indexEllipseInner) { s_svg_clearEllipse(groupIdsArray[indexEllipseInner]); } } s_svg_showEllipse(eEllipse); return; } } } } else { s_svg_showEllipse(eEllipse); } } function s_svg_showEllipse(eEllipse) { eEllipse.style.stroke = 'blue'; eEllipse.style.fill = 'Transparent'; eEllipse.circleColor = CircleColorSvg.Blue; eEllipse.isValidated = false; } function s_svg_showRectangleWithFillColor(id_rectangle, fillColor) { var eRectangle = document.getElementById(id_rectangle); eRectangle.style.stroke = 'blue'; eRectangle.style.fill = fillColor; eRectangle.circleColor = CircleColorSvg.Blue; eRectangle.isValidated = false; } function s_svg_showRectangleWithFillTransaperent(id_rectangle) { var eRectangle = document.getElementById(id_rectangle); eRectangle.style.stroke = 'green'; eRectangle.style.fill = 'Transparent'; eRectangle.circleColor = CircleColorSvg.Blue; eRectangle.isValidated = false; } function s_svg_validateEllipses(allEllipseIdsArray, correctEllipseIdsArray) { var nCorrectEllipses = 0; for (var indexEllipse = 0; indexEllipse < allEllipseIdsArray.length; indexEllipse++) { var id_ellipse = allEllipseIdsArray[indexEllipse]; var eEllipse = document.getElementById(id_ellipse); if (eEllipse.circleColor == CircleColorSvg.Blue)//Circled { if (correctEllipseIdsArray.indexOf(id_ellipse) != -1) { s_svg_setEllipseLightGreenTransparentIfisValidatedIsFalse(eEllipse) nCorrectEllipses++; } else { s_svg_setEllipseFillRedTransparentIfisValidatedIsFalse(eEllipse) } } eEllipse.isValidated = true; } return (nCorrectEllipses); } function s_canvas_showHideCirclesOfCorrespondingGroup(idCanvas, allGroupsIdsArrayInArray) { var eCanvas = document.getElementById(idCanvas); if (eCanvas.isCircled == false) { for (var indexGroup = 0; indexGroup < allGroupsIdsArrayInArray.length; indexGroup++) { var groupIdsArray = allGroupsIdsArrayInArray[indexGroup]; for (var indexCanvas = 0; indexCanvas < groupIdsArray.length; indexCanvas++) { var id_canvas = groupIdsArray[indexCanvas]; if (eCanvas.id == id_canvas) { for (var indexCanvasInner = 0; indexCanvasInner < groupIdsArray.length; indexCanvasInner++) { if (indexCanvas != indexCanvasInner) { s_canvas_clearCircle(groupIdsArray[indexCanvasInner]); } } s_canvas_showCanvas_border_blue(eCanvas); return; } } } } else { s_canvas_clearCircle(idCanvas); } } function s_canvas_showHideCircles(idCanvas, allGroupsIdsArrayInArray) { var eCanvas = document.getElementById(idCanvas); if (eCanvas.isCircled == false) { for (var indexGroup = 0; indexGroup < allGroupsIdsArrayInArray.length; indexGroup++) { var groupIdsArray = allGroupsIdsArrayInArray[indexGroup]; for (var indexCanvas = 0; indexCanvas < groupIdsArray.length; indexCanvas++) { var id_canvas = groupIdsArray[indexCanvas]; if (eCanvas.id == id_canvas) { s_canvas_showCanvas_border_blue(eCanvas); return; } } } } else { s_canvas_clearCircle(idCanvas); } } function s_canvas_clearCircle(idCanvas) { var eCanvas = document.getElementById(idCanvas); var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); eCanvas.style.display = 'none'; eCanvas.isValidated = false; eCanvas.isCircled = false; } function s_canvas_showCanvas(eCanvas) { var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); eCanvasContext.strokeStyle = 'blue'; eCanvasContext.stroke(); eCanvas.style.display = 'block'; eCanvas.isValidated = false; eCanvas.isCircled = true; } function s_canvas_showCanvas2(eCanvas) { var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); eCanvas.style.display = 'block'; eCanvas.isValidated = false; eCanvas.isCircled = true; } function s_canvas_showCanvas_border_blue(eCanvas) { var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); eCanvasContext.strokeStyle = 'blue'; eCanvasContext.stroke(); eCanvas.style.display = 'block'; eCanvas.isValidated = false; eCanvas.isCircled = true; } function s_canvas_showCanvas_border_black(eCanvas) { var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); eCanvasContext.strokeStyle = 'black'; eCanvasContext.stroke(); eCanvas.style.display = 'block'; eCanvas.isValidated = false; eCanvas.isCircled = true; } function s_canvas_validateCanvases(allGroupsIdsArrayInArray, correctCanvasIdsArray) { var nCorrectCanvases = 0; for (var indexGroup = 0; indexGroup < allGroupsIdsArrayInArray.length; indexGroup++) { var groupIdsArray = allGroupsIdsArrayInArray[indexGroup]; for (var indexCanvas = 0; indexCanvas < groupIdsArray.length; indexCanvas++) { var id_canvas = groupIdsArray[indexCanvas]; var eCanvas = document.getElementById(id_canvas); if (eCanvas.isCircled) { if (correctCanvasIdsArray.indexOf(id_canvas) != -1) { s_canvas_setCanvasCircleLightGreenTransparentIfisValidatedIsFalse(eCanvas); nCorrectCanvases++; } else { s_canvas_setCanvasCircleLightRedTransparentIfisValidatedIsFalse(eCanvas); s_isSelectedWrong = true; } } eCanvas.isValidated = true; } } return (nCorrectCanvases); } function s_canvas_validateCanvases_withoutGroups(allCanvasIdsArray, correctCanvasIdsArray) { var nCorrectCanvases = 0; var nWrongCanvases = 0; var validatedCanvasesArray = null; for (var index = 0; index < allCanvasIdsArray.length; index++) { var id_canvas = allCanvasIdsArray[index]; var eCanvas = document.getElementById(id_canvas); if (eCanvas.isCircled) { if (correctCanvasIdsArray.indexOf(id_canvas) != -1) { s_canvas_setCanvasCircleLightGreenTransparentIfisValidatedIsFalse(eCanvas); nCorrectCanvases++; } else { s_canvas_setCanvasCircleLightRedTransparentIfisValidatedIsFalse(eCanvas); s_isSelectedWrong = true; nWrongCanvases++; } } eCanvas.isValidated = true; } validatedCanvasesArray = [nCorrectCanvases, nWrongCanvases]; return (validatedCanvasesArray); } function s_canvas_setCanvasCircleLightGreenTransparentIfisValidatedIsFalse(eCanvas) { var eCanvasContext = eCanvas.getContext('2d'); if (eCanvas.isValidated == false) { eCanvasContext.strokeStyle = 'green'; eCanvasContext.stroke(); eCanvasContext.fillStyle = 'rgba(0, 250, 0, 0.4)';//Light green eCanvasContext.fill(); eCanvas.isValidated = true; } } function s_canvas_setCanvasCircleLightRedTransparentIfisValidatedIsFalse(eCanvas) { var eCanvasContext = eCanvas.getContext('2d'); if (eCanvas.isValidated == false) { eCanvasContext.strokeStyle = 'red'; eCanvasContext.stroke(); eCanvasContext.fillStyle = 'rgba(250, 0, 0, 0.4)';//Light red eCanvasContext.fill(); eCanvas.isValidated = true; } } function s_canvas_drawCircle(id_canvas, id_td) { s_canvas_drawCircleWithRadiusPercentageOfTd(id_canvas, id_td, 80); } function s_canvas_drawCircleWithRadiusPercentageOfTd(id_canvas, id_td, radiousPercentageOfTd) { var eTd = document.getElementById(id_td); var eTdRectangle = eTd.getBoundingClientRect(); var eCanvas = document.getElementById(id_canvas); eCanvas.style.left = eTdRectangle.left + 'px'; eCanvas.style.top = eTdRectangle.top + 'px'; eCanvas.textAlign = 'center'; eCanvas.width = eTdRectangle.width; eCanvas.height = eTdRectangle.height; var minWidthOrHeight = eTdRectangle.width < eTdRectangle.height ? eTdRectangle.width : eTdRectangle.height; var radious = (minWidthOrHeight * radiousPercentageOfTd / 100.0) / 2.0; var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.beginPath(); eCanvasContext.arc(eCanvas.width/2, eCanvas.height/2, radious, 0, 2*Math.PI); eCanvasContext.strokeStyle = 'blue'; eCanvasContext.lineWidth = 2; eCanvasContext.stroke(); eCanvas.isValidated = false; eCanvas.isCircled = false; eCanvas.circleColor = CircleColorCanvas.None; } function s_show_hideCirclesWithReqdColorForMultiUsingColors(idCanvas, color1, color2) { var eCanvas = document.getElementById(idCanvas); eCanvas.style.display = 'block'; var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); var color1Circle = s_getCanvasCircleColorUsingColor(color1); var color2Circle = s_getCanvasCircleColorUsingColor(color2); if (eCanvas.circleColor == CircleColorCanvas.None) { eCanvasContext.strokeStyle = color1; eCanvasContext.stroke(); eCanvas.circleColor = color1Circle; eCanvas.isCircled = true; } else if (eCanvas.circleColor == color1Circle) { eCanvasContext.strokeStyle = color2; eCanvasContext.stroke(); eCanvas.circleColor = color2Circle; eCanvas.isCircled = true; } else if (eCanvas.circleColor == color2Circle) { s_canvas_clearCircle(idCanvas); eCanvas.circleColor = CircleColorCanvas.None; eCanvas.isCircled = false; } eCanvas.isValidated = false; } function s_show_hideCirclesWithReqdColorForMulti(idCanvas) { var eCanvas = document.getElementById(idCanvas); var eCanvasContext = eCanvas.getContext('2d'); eCanvasContext.clearRect(0, 0, eCanvas.width, eCanvas.height); if (eCanvas.circleColor == CircleColorCanvas.None) { eCanvasContext.strokeStyle = 'blue'; eCanvasContext.stroke(); eCanvas.style.display = 'block'; eCanvas.circleColor = CircleColorCanvas.Blue; eCanvas.isCircled = true; } else if (eCanvas.circleColor == CircleColorCanvas.Blue) { s_canvas_clearCircle(idCanvas); eCanvas.circleColor = CircleColorCanvas.None; eCanvas.isCircled = false; } eCanvas.isValidated = false; } function s_getCanvasCircleColorUsingColor(color) { if (color == 'green') { return (CircleColorCanvas.Green); } else if (color == 'red') { return (CircleColorCanvas.Red); } else if (color == 'blue') { return (CircleColorCanvas.Blue); } else if (color == 'black') { return (CircleColorCanvas.Black); } return (CircleColorCanvas.Blue); } function s_canvas_getNoOfNotCircledCanvases(canvasIdsArrayValidationNotReqd) { var nCircleNotReqdCanvases = 0; for (var indexCanvas = 0; indexCanvas < canvasIdsArrayValidationNotReqd.length; indexCanvas++) { var id_canvas = canvasIdsArrayValidationNotReqd[indexCanvas]; var eCanvas = document.getElementById(id_canvas); if (eCanvas.circleColor == CircleColorCanvas.None) { nCircleNotReqdCanvases++; } } return (nCircleNotReqdCanvases); } function s_canvas_validateCanvasesForValidationReqd(canvasIdsArrayValidationReqd, circleColor) { var nCorrectCanvases = 0; for (var indexCanvas = 0; indexCanvas < canvasIdsArrayValidationReqd.length; indexCanvas++) { var id_canvas = canvasIdsArrayValidationReqd[indexCanvas]; var eCanvas = document.getElementById(id_canvas); if (eCanvas.circleColor != CircleColorCanvas.None) { if (eCanvas.circleColor == circleColor) { s_canvas_setCanvasCircleLightGreenTransparentIfisValidatedIsFalse(eCanvas) nCorrectCanvases++; } else { s_canvas_setCanvasCircleLightRedTransparentIfisValidatedIsFalse(eCanvas) } } eCanvas.isValidated = true; } return (nCorrectCanvases); } function s_canvas_validateCanvasesForValidationNotReqdForMulti(canvasIdsArrayValidationNotReqd) { for (var indexCanvas = 0; indexCanvas < canvasIdsArrayValidationNotReqd.length; indexCanvas++) { var id_canvas = canvasIdsArrayValidationNotReqd[indexCanvas]; s_canvas_validateCanvasForValidationNotReqdForSingle(id_canvas); } } function s_canvas_validateCanvasForValidationNotReqdForSingle(id_canvas) { var eCanvas = document.getElementById(id_canvas); var eCanvasContext = eCanvas.getContext('2d'); if (eCanvas.circleColor == CircleColorCanvas.None) { eCanvasContext.fillStyle = 'transparent'; eCanvasContext.fill(); eCanvasContext.strokeStyle = 'transparent'; eCanvasContext.stroke(); eCanvas.circleColor = CircleColorCanvas.None; } else { s_canvas_setCanvasCircleLightRedTransparentIfisValidatedIsFalse(eCanvas) } eCanvas.isValidated = true; } function s_getSizePercentageAsPerDeviceHeightWidth() { var sizePercentage = (s_dataTableWidth + s_dataTableHeight) / (768*0.75 + 1024*0.75); return (sizePercentage); } //Above all are Copied from initial on 30 Jul 2014 function s_adjust_fontSize_for_ids_webOS(ids_array, sizePercentage) { //if (s_currentDeviceOS == s_DeviceOS_WebOS) if (s_currentDeviceOS == s_deviceOS_Mac) { s_adjust_fontSize_for_ids_all(ids_array, sizePercentage) } } function s_adjust_fontSize_for_ids_iPhone(ids_array, sizePercentage) { if ((s_currentDeviceOS == s_deviceOS_iOS) && (s_currentDeviceType == s_DeviceTypeiOSiPhoneAllSizes)) { s_adjust_fontSize_for_ids_all(ids_array, sizePercentage) } } function s_adjust_fontSize_for_ids_iPad(ids_array, sizePercentage) { if ((s_currentDeviceOS == s_deviceOS_iOS) && (s_currentDeviceType == s_deviceTypeiOSiPad)) { s_adjust_fontSize_for_ids_all(ids_array, sizePercentage) } } function s_adjust_fontSize_for_ids_android(ids_array, sizePercentage) { if (s_currentDeviceOS == s_deviceOS_Android) { s_adjust_fontSize_for_ids_all(ids_array, sizePercentage) } } function s_adjust_fontSize_for_ids_all_devices(ids_array, sizePercentage) { var sizePercentageAsDevice = s_getSizePercentageAsPerDeviceHeightWidth(); var actualSize = 24; var size = actualSize * sizePercentageAsDevice * (sizePercentage / 100.0); for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.fontSize = size + 'px'; } } function s_set_border_left_thickness_5px_for_ids_android(ids_array) { if (s_currentDeviceOS == s_deviceOS_Android) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderLeft = '5px'; } } } function s_set_border_right_thickness_5px_for_ids_android(ids_array) { if (s_currentDeviceOS == s_deviceOS_Android) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderRight = '5px'; } } } function s_set_border_top_thickness_5px_for_ids_android(ids_array) { if (s_currentDeviceOS == s_deviceOS_Android) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderTop = '5px'; } } } function s_set_border_bottom_thickness_5px_for_ids_android(ids_array) { if (s_currentDeviceOS == s_deviceOS_Android) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderBottom = '5px'; } } } function s_set_border_none_for_ids_iOS(ids_array) { if (s_currentDeviceOS == s_deviceOS_iOS) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.border = 'none'; } } } function s_set_border_top_none_for_ids_iOS(ids_array) { if (s_currentDeviceOS == s_deviceOS_iOS) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderTop = 'none'; } } } function s_set_border_bottom_none_for_ids_iOS(ids_array) { if (s_currentDeviceOS == s_deviceOS_iOS) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderBottom = 'none'; } } } function s_set_border_left_none_for_ids_iOS(ids_array) { if (s_currentDeviceOS == s_deviceOS_iOS) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderLeft = 'none'; } } } function s_set_border_right_none_for_ids_iOS(ids_array) { if (s_currentDeviceOS == s_deviceOS_iOS) { for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; var element = document.getElementById(id_element); element.style.borderRight = 'none'; } } } function s_allowDrop_web(ev) { ev.preventDefault(); } function s_dragStart(event) { s_currentDropingId = event.currentTarget.id; //alert("s_dragStart"); //if (s_currentDeviceOS == s_DeviceOS_WebOS) if (s_currentDeviceOS == s_deviceOS_Mac) { var eDragging = document.getElementById(s_currentDropingId); var divisor = 3.0; var text = eDragging.innerText; if (text != text.trim()) { divisor = 6.0; } var nChars = text.length; var computedFontSize = window.getComputedStyle(eDragging).fontSize; computedFontSize = computedFontSize.replace('px', ''); var width = nChars * computedFontSize; var height = computedFontSize; event.dataTransfer.setDragImage(event.target,width/divisor, height * 0.75); } return true; } function s_dragStartNew(event) { s_currentDropingId = event.currentTarget.firstElementChild.id; var eElement = document.getElementById(s_currentDropingId); //alert(s_currentDropingId); s_moving_left = eElement.style.left; s_moving_top = eElement.style.top; } function s_set_all_draggble_to_false_except_first_element(id_prefix, nIds_total) { for (var id_no = 1; id_no <= nIds_total; id_no++) { var idOfElement = id_prefix + id_no; var eElement = document.getElementById(idOfElement); if (id_no > 1) { eElement.setAttribute("draggable", "false"); } } } function s_set_all_draggble_to_false_except_first_element2(id_startsFrom, id_prefix, nIds_total) { for (var id_no = id_startsFrom; id_no <= nIds_total; id_no++) { var idOfElement = id_prefix + id_no; var eElement = document.getElementById(idOfElement); if (id_no > 1) { eElement.setAttribute("draggable", "false"); } } } function s_resetCurrentDroppingPosition(id_dropBox) { var eElement = document.getElementById(s_currentDropingId); eElement.style.left = s_moving_left; eElement.style.top = s_moving_top; s_un_highlight(id_dropBox); } function s_resetCurrentDroppingPosition2(id_dropBox) { var eElement = document.getElementById(s_currentDropingId); eElement.style.left = s_moving_left; eElement.style.top = s_moving_top; s_un_highlight2(id_dropBox); } function s_isMovingElementIdInTheArraySetIsFilledTrue(id_box, ids_array) { var eBox = document.getElementById(id_box); if (eBox.isFilled) { return (false); } if (s_is_currentDropingIdHidden())//for iOS { return (false); } for (var index = 0; index < ids_array.length; index++) { var id_element = ids_array[index]; if (s_currentDropingId == id_element) { eBox.isFilled = true; return (true); } } return (false); } function s_setCategoryFontSize(id_category) { var sizePercentage = s_getSizePercentageAsPerDeviceHeightWidth(); var sizeMultiplyValue = 25; var fontSize = sizeMultiplyValue * sizePercentage; fontSize = fontSize + 'px'; var eCategoryText = document.getElementById(id_category); eCategoryText.style.fontSize = fontSize; eCategoryText.style.color = 'blue'; } function s_getScrolledXY() { var pScrolledXY = new ScrolledXY(); if (typeof (window.pageYOffset) == 'number') { // Netscape pScrolledXY.x = window.pageXOffset; pScrolledXY.y = window.pageYOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { // DOM pScrolledXY.x = document.body.scrollLeft; pScrolledXY.y = document.body.scrollTop; } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { // IE6 standards compliant mode pScrolledXY.x = document.documentElement.scrollLeft; pScrolledXY.y = document.documentElement.scrollTop; } return (pScrolledXY); } function s_highlight(id_element) { if (s_is_currentDropingIdHidden()) { return; } var eElement = document.getElementById(id_element); if (eElement.isFilled == false) { if (eElement.nodeName == 'CANVAS') { var eContext = eElement.getContext("2d"); eContext.fillStyle = '#81BEF7';//Light blue eContext.fill(); } else { eElement.style.background = '#81BEF7';//Light blue } } } function s_is_currentDropingIdHidden() { if (s_currentDropingId != '') { var eSpan = document.getElementById(s_currentDropingId); return (eSpan.hidden); } return (false); } function s_un_highlight_web(id_element) { var id_element = event.target.id; s_un_highlight(id_element); } function s_un_highlight(id_element) { var eElement = document.getElementById(id_element); if (eElement.isFilled == false) { if (eElement.nodeName == 'CANVAS') { s_canvas_clearCircle(id_element); s_canvas_showCanvas_border_black(eElement); var eContext = eElement.getContext("2d"); eContext.strokeStyle = 'black'; eContext.stroke(); eContext.fillStyle = '#F2F2F2';//Light gray eContext.fill(); } else { eElement.style.background = eElement.customBackgroundcolor; } } } function s_un_highlight2(id_element) { var eElement = document.getElementById(id_element); if (eElement.isFilled == false) { if (eElement.nodeName == 'CANVAS') { s_canvas_clearCircle(id_element); s_canvas_showCanvas2(eElement); var eContext = eElement.getContext("2d"); } else { eElement.style.background = eElement.customBackgroundcolor; } } } function s_set_currentDropingId_draggbleToFalse() { var eElement = document.getElementById(s_currentDropingId); if (eElement.parentElement != null) { eElement.parentElement.setAttribute("draggable", "false"); } } function s_border_collapse_for_tables_except_android_and_IE(id_tables_array) { if ((s_currentDeviceOS != s_deviceOS_Android) && (s_currentDeviceType != s_DeviceTypeWindowsInternetExplorer)) { for (var idIndex = 0; idIndex < id_tables_array.length; idIndex++) { var eTable = document.getElementById(id_tables_array[idIndex]); eTable.style.borderCollapse = 'collapse'; } } } function s_border_collapse_for_tables_except_android(id_tables_array) { if (s_currentDeviceOS != s_deviceOS_Android) { for (var idIndex = 0; idIndex < id_tables_array.length; idIndex++) { var eTable = document.getElementById(id_tables_array[idIndex]); eTable.style.borderCollapse = 'collapse'; } } } function s_border_collapse_for_tables_for_all(id_tables_array) { for (var idIndex = 0; idIndex < id_tables_array.length; idIndex++) { var eTable = document.getElementById(id_tables_array[idIndex]); eTable.style.borderCollapse = 'collapse'; } } function s_increase_thickness_for_td_border_left(id_tds_array) { s_increase_thickness_for_td_border(id_tds_array, 1); } function s_increase_thickness_for_td_border_right(id_tds_array) { s_increase_thickness_for_td_border(id_tds_array, 2); } function s_increase_thickness_for_td_border_top(id_tds_array) { s_increase_thickness_for_td_border(id_tds_array, 3); } function s_increase_thickness_for_td_border_bottom(id_tds_array) { s_increase_thickness_for_td_border(id_tds_array, 4); } function s_increase_thickness_for_td_border(id_tds_array, side_no) { for (var idIndex = 0; idIndex < id_tds_array.length; idIndex++) { var eTd = document.getElementById(id_tds_array[idIndex]); if (s_currentDeviceOS == s_deviceOS_Android) { if (side_no == 1)//Left { eTd.style.borderLeft = '2px solid'; } else if (side_no == 2)//Right { eTd.style.borderRight = '2px solid'; } else if (side_no == 3)//Top { eTd.style.borderTop = '2px solid'; } else if (side_no == 4)//Bottom { eTd.style.borderBottom = '2px solid'; } } } } function s_set_border_none_for_td_left_except_android(id_tds_array) { s_set_border_none_for_td(id_tds_array, 1); } function s_set_border_none_for_td_right_except_android(id_tds_array) { s_set_border_none_for_td(id_tds_array, 2); } function s_set_border_none_for_td_top_except_android(id_tds_array) { s_set_border_none_for_td(id_tds_array, 3); } function s_set_border_none_for_td_bottom_except_android(id_tds_array) { s_set_border_none_for_td(id_tds_array, 4); } function s_set_border_none_for_td(id_tds_array, side_no) { for (var idIndex = 0; idIndex < id_tds_array.length; idIndex++) { var eTd = document.getElementById(id_tds_array[idIndex]); if (s_currentDeviceOS != s_deviceOS_Android) { if (side_no == 1)//Left { eTd.style.borderLeft = '0px'; } else if (side_no == 2)//Right { eTd.style.borderRight = '0px'; } else if (side_no == 3)//Top { eTd.style.borderTop = '0px'; } else if (side_no == 4)//Bottom { eTd.style.borderBottom = '0px'; } } } } function s_set_border_none_for_table_except_android(id_tds_array) { for (var idIndex = 0; idIndex < id_tds_array.length; idIndex++) { var eTd = document.getElementById(id_tds_array[idIndex]); if (s_currentDeviceOS != s_deviceOS_Android) { eTd.style.border = 'none'; } } } function s_getAngleInRadians(fromPoint, toPoint) { var originPoint = new Point(toPoint.x - fromPoint.x, toPoint.y - fromPoint.y); var angleInRadians = Math.atan2(originPoint.y, originPoint.x); return (angleInRadians); } function s_getDistance(point1, point2) { var distance = Math.sqrt(((point2.y - point1.y) * (point2.y - point1.y)) + ((point2.x - point1.x) * (point2.x - point1.x))); return (distance); } function s_getMidPoint(fromPoint, toPoint) { var returnPoint = new Point(); returnPoint.x = (fromPoint.x + toPoint.x) / 2.0; returnPoint.y = (fromPoint.y + toPoint.y) / 2.0; return (returnPoint); } function s_getPoint(fromPoint, angleInRadians, distance) { var returnPoint = new Point(); returnPoint.x = fromPoint.x + distance * Math.cos(angleInRadians); returnPoint.y = fromPoint.y + distance * Math.sin(angleInRadians); return (returnPoint); } function s_draw_underline(id_td) { var eTd = document.getElementById(id_td); var text = eTd.innerText; eTd.style.color = 'black'; eTd.style.backgroundColor = 'transparent'; eTd.isUnderlined = false; eTd.isValidated = false; eTd.underlineColor = UnderlineColorTd.None; } function s_showHideUnderlineOfCorrespondingGroup(id_td, allGroupsIdsArrayInArray) { var eTd = document.getElementById(id_td); if (eTd.isUnderlined == false) { for (var indexGroup = 0; indexGroup < allGroupsIdsArrayInArray.length; indexGroup++) { var groupIdsArray = allGroupsIdsArrayInArray[indexGroup]; for (var indexTd = 0; indexTd < groupIdsArray.length; indexTd++) { var idTd = groupIdsArray[indexTd]; if (eTd.id == idTd) { for (var indexTdInner = 0; indexTdInner < groupIdsArray.length; indexTdInner++) { if (indexTd != indexTdInner) { s_clear_underline(groupIdsArray[indexTdInner]); } } s_show_underline(eTd); return; } } } } else { s_clear_underline(id_td); } } function s_clear_underline(id_td) { var eTd = document.getElementById(id_td); var text = eTd.innerText; eTd.innerHTML = text; eTd.style.backgroundColor = s_colorWhite; eTd.style.color = s_colorBlack; eTd.isUnderlined = false; eTd.isValidated = false; } function s_show_underline(eTd) { var text = eTd.innerText; eTd.innerHTML = '<u style="color:blue">' + text + '</u>'; eTd.style.backgroundColor = s_colorWhite; eTd.style.color = s_colorBlack; eTd.isUnderlined = true; eTd.isValidated = false; } function s_validate_tds(allGroupsIdsArrayInArray, correctTdIdsArray) { var nCorrectTds = 0; for (var indexGroup = 0; indexGroup < allGroupsIdsArrayInArray.length; indexGroup++) { var groupIdsArray = allGroupsIdsArrayInArray[indexGroup]; for (var indexTd = 0; indexTd < groupIdsArray.length; indexTd++) { var id_td = groupIdsArray[indexTd]; var eTd = document.getElementById(id_td); if (eTd.isUnderlined) { if (correctTdIdsArray.indexOf(id_td) != -1) { s_set_td_backgroundLightGreenTransparentIfisValidatedIsFalse(eTd); nCorrectTds++; } else { s_set_td_backgroundLightRedTransparentIfisValidatedIsFalse(eTd); s_isSelectedWrong = true; } } eTd.isValidated = true; } } return (nCorrectTds); } function s_set_td_backgroundLightGreenTransparentIfisValidatedIsFalse(eTd) { if (eTd.isValidated == false) { eTd.style.backgroundColor = s_colorLightGreen; eTd.style.color = 'white'; eTd.isValidated = true; } } function s_set_td_backgroundLightRedTransparentIfisValidatedIsFalse(eTd) { if (eTd.isValidated == false) { eTd.style.backgroundColor = s_colorRed; eTd.style.color = 'white'; eTd.isValidated = true; } } function s_show_hideUnderlineWithReqdColorForMultiUsingColors(id_td, color1, color2) { var eTd = document.getElementById(id_td); var text = eTd.innerText; var color1Underline = s_getUnderlineColorUsingColor(color1); var color2Underline = s_getUnderlineColorUsingColor(color2); if (eTd.underlineColor == UnderlineColorTd.None) { eTd.innerHTML = '<u style="color:' + color1 + '">' + text + '</u>'; eTd.style.backgroundColor = s_colorWhite; eTd.underlineColor = color1Underline; eTd.isUnderlined = true; } else if (eTd.underlineColor == color1Underline) { eTd.innerHTML = '<u style="color:' + color2 + '">' + text + '</u>'; eTd.style.backgroundColor = s_colorWhite; eTd.underlineColor = color2Underline; eTd.isUnderlined = true; } else if (eTd.underlineColor == color2Underline) { eTd.innerHTML = '<span style="color:black">' + text + '</span>'; eTd.style.backgroundColor = s_colorWhite; eTd.underlineColor = UnderlineColorTd.None; eTd.isUnderlined = false; } eTd.isValidated = false; } function s_getUnderlineColorUsingColor(color) { if (color == 'blue') { return (UnderlineColorTd.Blue); } else if (color == '#800000')//Brown { return (UnderlineColorTd.Brown); } else if (color == 'green') { return (UnderlineColorTd.Green); } return (UnderlineColorTd.Blue); } function s_td_getNoOfNotUnderlinedTds(tdIdsArrayValidationNotReqd) { var nUnderlineNotReqdTds = 0; for (var indexTd = 0; indexTd < tdIdsArrayValidationNotReqd.length; indexTd++) { var id_td = tdIdsArrayValidationNotReqd[indexTd]; var eTd = document.getElementById(id_td); if (eTd.isUnderlined) { nUnderlineNotReqdTds++; } } return (nUnderlineNotReqdTds); } function s_td_validateTdsForValidationNotReqdForMulti(tdIdsArrayValidationNotReqd) { for (var indexTd = 0; indexTd < tdIdsArrayValidationNotReqd.length; indexTd++) { var id_td = tdIdsArrayValidationNotReqd[indexTd]; s_td_validateTdForValidationNotReqdForSingle(id_td); } } function s_td_validateTdForValidationNotReqdForSingle(id_td) { var eTd = document.getElementById(id_td); if (eTd.underlineColor == UnderlineColorTd.None) { eTd.style.backgroundColor = s_colorWhite; eTd.style.color = s_colorBlack; eTd.underlineColor == UnderlineColorTd.None; } else { s_set_td_backgroundLightRedTransparentIfisValidatedIsFalse(eTd); s_isSelectedWrong = true; } eTd.isValidated = true; } function s_Td_validateTdsForValidationReqd(tdIdsArrayValidationReqd, underlineColor) { var nCorrectTds = 0; for (var indexTd = 0; indexTd < tdIdsArrayValidationReqd.length; indexTd++) { var id_td = tdIdsArrayValidationReqd[indexTd]; var eTd = document.getElementById(id_td); if (eTd.underlineColor != UnderlineColorTd.None) { if (eTd.underlineColor == underlineColor) { s_set_td_backgroundLightGreenTransparentIfisValidatedIsFalse(eTd); nCorrectTds++; } else { s_set_td_backgroundLightRedTransparentIfisValidatedIsFalse(eTd); s_isSelectedWrong = true; } } eTd.isValidated = true; } return (nCorrectTds); } function s_setHelpButtonsStyle(id_btn) { var deviceType = s_getDeviceType(); var buttonStyle = 's_style_buttons_header_footer'; var sizePercentageAsDevice = s_getSizePercentageAsPerDeviceHeightWidth(); var actualSize = 15; var textSize = actualSize * sizePercentageAsDevice; var fontSizeButtonText = textSize; var buttonHeight = textSize * 1.8; var borderRadius = buttonHeight / 2.0; var tdButtonHeight = buttonHeight * 1.2; var buttonWidthPercent = 50; fontSizeButtonText = fontSizeButtonText + 'px'; buttonHeight = buttonHeight + 'px'; borderRadius = borderRadius + 'px'; tdButtonHeight = tdButtonHeight + 'px'; var button = document.getElementById(id_btn); button.style.fontSize = fontSizeButtonText; button.style.borderRadius = borderRadius; button.style.width = buttonWidthPercent + '%'; button.style.height = buttonHeight + '%'; } function s_help_click(pathHtmlOrImage) { var deviceType = s_getDeviceType(); var buttonStyle = 's_style_buttons_header_footer'; var sizePercentageAsDevice = s_getSizePercentageAsPerDeviceHeightWidth(); var actualSize = 24; var textSize = actualSize * sizePercentageAsDevice; var fontSizeButtonText = textSize; var buttonHeight = textSize * 1.8; var borderRadius = buttonHeight / 2.0; var tdButtonHeight = buttonHeight * 1.2; var buttonWidthPercent = 20; fontSizeButtonText = fontSizeButtonText + 'px'; buttonHeight = buttonHeight + 'px'; borderRadius = borderRadius + 'px'; tdButtonHeight = tdButtonHeight + 'px'; var left = ((deviceType == s_DeviceTypeMacSafari)|| (deviceType == s_DeviceTypeWindowsChrome)) ? '16px' : '4px'; var innerHtml = ''; innerHtml += ' <div style="position: absolute; text-align:center; z-index: 99; -webkit-overflow-scrolling: touch; overflow-y: scroll; right: 0; bottom: 0; left: ' + left + '; top: 8px" >';//for resized window innerHtml += ' <table border="0" align="center" cellspacing="0" cellpadding="0" width="' + s_dataTableWidth + '" height="' + s_dataTableHeight + '" style="background-color: rgba(255, 255, 255, 0.5)">';//table1 if (s_currentDeviceOS == s_deviceOS_iOS) { innerHtml += ' <tr height="8%">';//tr2 innerHtml += ' <td align="center">'; innerHtml += ' <input type="button" class="' + buttonStyle + '" value="OK" onClick="hide_message_info()" style="width:' + buttonWidthPercent + '%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto; color:blue">'; innerHtml += ' </td>'; innerHtml += ' </tr>';//tr2 end } innerHtml += ' <tr height="*">';//tr1 innerHtml += ' <td align="center" valign="bottom">'; innerHtml += ' <iframe src="' + pathHtmlOrImage + '" align="center">'; innerHtml += ' </iframe>'; innerHtml += ' </td>'; innerHtml += ' </tr>';//tr1 end innerHtml += ' <tr height="8%">';//tr2 innerHtml += ' <td align="center">'; innerHtml += ' <input type="button" class="' + buttonStyle + '" value="OK" onClick="hide_message_info()" style="width:' + buttonWidthPercent + '%; height:' + buttonHeight + '; font-size:' + fontSizeButtonText + '; border-radius:' + borderRadius + '; text-align:middle; text-height:auto; color:blue">'; innerHtml += ' </td>'; innerHtml += ' </tr>';//tr2 end innerHtml += ' <tr height="8%">';//tr3 innerHtml += ' <td align="center">'; innerHtml += ' '; innerHtml += ' </td>'; innerHtml += ' </tr>';//tr3 end innerHtml += ' </table>'; innerHtml += ' </div>'; var eDiv = document.getElementById('s_id_div_message'); eDiv.innerHTML = innerHtml; eDiv.setAttribute("unselectable", "on"); eDiv.className = 's_style_unselectable'; eDiv.hidden = false; eDiv.style.display = 'block';//For browser IE } function s_isDoubleClicked(id_element) { var result = false; var now = +(new Date()); if (((now - s_timeForDoubleClick) < 500) && (s_elementIdForDoubleClick == id_element)) { result = true; } s_timeForDoubleClick = now; s_elementIdForDoubleClick = id_element; return (result); } function s_showImageBiggerDefault() { s_showImageBigger('60%'); } function s_showImageBigger(sizePercent) { s_showImageBiggerWithImage_sizePercent(event.target.id, sizePercent); } function s_showImageBiggerWithImage_sizePercent(id_image, sizePercent) { var element = document.getElementById(id_image); var pathFile_image = element.src; s_showImageBiggerWithImageWithPath_sizePercent(pathFile_image, sizePercent); } //sizePercent should be <= 70 is good for view function s_showImageBiggerWithImageWithPath_sizePercent(pathFile_image, sizePercent) { var deviceType = s_getDeviceType(); var buttonStyle = 's_style_buttons_header_footer'; var sizePercentageAsDevice = s_getSizePercentageAsPerDeviceHeightWidth(); var actualSize = 24; var textSize = actualSize * sizePercentageAsDevice; var fontSizeButtonText = textSize; var buttonHeight = textSize * 1.8; var borderRadius = buttonHeight / 2.0; var tdButtonHeight = buttonHeight * 1.2; var buttonWidthPercent = 20; fontSizeButtonText = fontSizeButtonText + 'px'; buttonHeight = buttonHeight + 'px'; borderRadius = borderRadius + 'px'; tdButtonHeight = tdButtonHeight + 'px'; var left = ((deviceType == s_DeviceTypeMacSafari)|| (deviceType == s_DeviceTypeWindowsChrome)) ? '16px' : '4px'; var innerHtml = ''; innerHtml += ' <div style="position: absolute; text-align:center; z-index: 99; -webkit-overflow-scrolling: touch; overflow-y: scroll; right: 0; bottom: 0; left: ' + left + '; top: 8px" >';//for resized window innerHtml += ' <table border="0" align="center" cellspacing="0" cellpadding="0" width="' + s_dataTableWidth + '" height="' + s_dataTableHeight + '" style="background-color: rgba(0, 0, 0, 0.5)">'; innerHtml += ' <tr height="100%">';//tr1 innerHtml += ' <td align="center" valign="center">'; innerHtml += '<img id="id_img_ugTable" src="' + pathFile_image + '" width="' + sizePercent + '" height="auto" alt="" onClick="hide_message_info()" draggable="false" IEsizePercent="0.85"/>'; innerHtml += ' </td>'; innerHtml += ' </tr>'; innerHtml += ' </table>'; innerHtml += ' </div>'; var eDiv = document.getElementById('s_id_div_message'); eDiv.innerHTML = innerHtml; eDiv.setAttribute("unselectable", "on"); eDiv.className = 's_style_unselectable'; eDiv.hidden = false; eDiv.style.display = 'block';//For browser IE } function s_setImageSizesForWindowsOS(id_array_images, widthMultiplier, heightMultiplier) { if ((s_currentDeviceType == s_DeviceTypeWindowsPhone) || (s_currentDeviceType == s_DeviceTypeWindowsInternetExplorer)) { for (index=0; index<id_array_images.length; index++) { var eImage = document.getElementById(id_array_images[index]); eImage.width = s_dataTableWidth * widthMultiplier; eImage.height = s_dataTableHeight * heightMultiplier; } } } function s_setTablesHeightsForIE() { if ((s_currentDeviceType == s_DeviceTypeWindowsPhone) || (s_currentDeviceType == s_DeviceTypeWindowsInternetExplorer)) { var eMainTable = document.getElementById('id_tblMainiPadBody'); var heightMainTable = eMainTable.style.height; var middlesTableRow = eMainTable.rows[1]; var middleRowHeight = middlesTableRow.height; if ((middleRowHeight == "") || (middleRowHeight == "*")) { middleRowHeight = middlesTableRow.getAttribute("hieghtForIE"); } var col = middlesTableRow.cells[0]; if (col != null) { var table = col.firstElementChild; if (table != null) { middleRowHeight = middleRowHeight.replace("%", "") / 100.0; var tableHeightToSet = heightMainTable.replace("px", "") * middleRowHeight; s_setInnerTablesHeightsForIE(table, tableHeightToSet); } } } } function s_setInnerTablesHeightsForIE(table, tableHeightToSet) { if (table.rows == null) { return; } table.style.height = tableHeightToSet + 'px'; var nRows = table.rows.length; for (var i = 0; i < nRows; i++) { var row = table.rows[i]; if (row != null) { var heightRow = row.height; if (heightRow == "")//For height="*" getting empty in IE { var hieghtForIE = row.getAttribute("hieghtForIE"); if ((hieghtForIE != null) && (hieghtForIE != "")) { heightRow = hieghtForIE; } else { heightRow = (100.0 / nRows) + "%"; } } var heightValueRow = tableHeightToSet * (heightRow.replace("%", "") / 100.0); var nColumns = row.cells.length; for (var j = 0; j < nColumns; j++) { var col = row.cells[j]; if (col != null) { var firstElement = col.firstElementChild; if (firstElement != null) { if (firstElement.localName == "table") { s_setInnerTablesHeightsForIE(firstElement, heightValueRow); } else if (firstElement.localName == "img") { s_setImageHeightForIE(firstElement); } else if (firstElement.localName == "span") { var spanFirstElement = firstElement.firstElementChild; if ((spanFirstElement != null) && (spanFirstElement.localName == "img")) { s_setImageHeightForIE(spanFirstElement); } } } } } } } } function s_setImageHeightForIE(imgElement) { var IEsizePercent = imgElement.getAttribute("IESizePercent"); if ((IEsizePercent == null) || (IEsizePercent == "")) { return; } var width = imgElement.style.width.replace("px", ""); var height = imgElement.style.height.replace("px", ""); if (width == "" && height == "") { width = imgElement.width; height = imgElement.height; if ((width != "") && (width > 10))//getting width=1 for some cases { imgElement.style.width = (width * IEsizePercent) + 'px'; //imgElement.style.height = 'auto'; } else if ((height != "") && (height > 10))//getting height=1 for some cases { imgElement.style.height = (height * IEsizePercent) + 'px'; //imgElement.style.width = 'auto'; } } } function s_validate_setBGcolors(ids_textBoxes_array) { var isAllTextboxesAreCorrect = true; for (indexTextbox = 0; indexTextbox < ids_textBoxes_array.length; indexTextbox++) { var id_textBox = ids_textBoxes_array[indexTextbox]; var eTextBox = document.getElementById(id_textBox); var enteredValue = eTextBox.value.toUpperCase(); var correctValue = eTextBox.getAttribute('correctValue'); if (enteredValue == correctValue) { eTextBox.style.backgroundColor = s_colorLightGreen; } else { eTextBox.style.backgroundColor = s_colorRed; isAllTextboxesAreCorrect = false; } } return (isAllTextboxesAreCorrect); } function s_isZoomChecked() { var eZoomCheckBox = document.getElementById('s_id_checkBoxZoom'); return (eZoomCheckBox.checked); }