/* On-the-fly JavaScript adds START */
var addJava_ADDED = [];
var addCSS_ADDED = [];
$(document).ready(function() {
$(document).on('focus', '.empSearch', function() {
addJava('/javascript/empSearch/empSearch.js');
addCSS('/javascript/empSearch/empSearch.css');
});
$(document).on('focus', '.stuSearch', function() {
addJava('/javascript/stuSearch/stuSearch.js');
addCSS('/javascript/empSearch/empSearch.css');
});
$(document).on('focus', '.lookupSearch, .lookupSearch_DD', function() {
addJava('/javascript/lookupSearch/lookupSearch.js');
addCSS('/javascript/empSearch/empSearch.css');
});
});
function addJava (javaURL) {
if (!addJava_ADDED[javaURL]) {
//alert('test: ' + javaURL);
addJava_ADDED[javaURL] = true;
$('head').append('');
}
}
function addCSS (cssURL) {
if (!addCSS_ADDED[cssURL]) {
addCSS_ADDED[cssURL] = true;
$('head').append('');
}
}
/* On-the-fly JavaScript adds END */
jQuery.fn.reverse = [].reverse;
function load_sendIssue() {
$("#floating_helpBoxData").html('
');
$("#floating_helpBoxData").load('/sendIssue_iFrame.php');
}
function menuTabMore () {
var menuHeight = $('#menu_tabs').outerHeight(true);
var testHeight = 25;
if (menuHeight > testHeight) {
$('.moreMenuListUL').html('');
if ($('#moreOption').length == 0){
$('#menu_tabs #navlist').append('
');
$('#relatedToHidden_' + relatedTo + ' .multi_searchOption').clone().appendTo('#'+relatedTo+'TBkey_'+numRelatedToItems);
$('#'+relatedTo+'TBkey_'+numRelatedToItems + ' .multi_searchOption').each(function(index) {
var relatedToVal = $(this).attr('relatedTo');
$(this).val($('#'+relatedToVal).val())
//alert(nameTEMP);
});
$('#relatedDIV_'+relatedTo).css('display', 'none');
$('#relatedDisplay_'+relatedTo).css('display', 'inline');
$('#formonly_TB_'+relatedTo+'_0').change();
}
numRelatedToItems = numRelatedToItems + 1;
while ($('#formonly_TB_' + relatedTo + '_' + numRelatedToItems).length != 0){
numRelatedToItems = numRelatedToItems + 1;
//alert ('NEW'+ numRelatedToItems);
}
$('#relatedToHidden_' + relatedTo + ' .multi_searchOption').attr('TBkey', numRelatedToItems);
$('#relatedToHidden_' + relatedTo + ' .multi_searchOption').each(function(index) {
var nameTEMP = $(this).attr('nameTEMP');
if ($(this).attr('targetid') == $(this).attr('id') ) {
//alert('test: ' + $(this).attr('targetid') + ' : ' + $(this).attr('id'))
$(this).attr('targetid', nameTEMP+'_'+numRelatedToItems);
}
$(this).attr('id', nameTEMP+'_'+numRelatedToItems);
$(this).attr('name', nameTEMP+'_'+numRelatedToItems);
});
$('#relatedToHidden_' + relatedTo + ' .multi_searchOption').clone().appendTo('#relatedTo_'+ relatedTo);
$('#relatedTo_'+ relatedTo).append('
');
});
$(document).on('click', '.runTask', function() {
// $('.runTask').live('click', function runTask(event) {
// alert (event.target.id);
var taskID = $(this).attr('taskID');
if (taskID == undefined) { taskID = $(this).attr('id')+'_RT' }
var taskURL = $(this).attr('taskURL');
var taskTest = $(this).attr('taskTest');
var taskConfirm = $(this).attr('taskConfirm');
if ($('#'+taskID).length == 0){
$('body').append('
');
}
$('#'+taskID).load(taskURL, function() {
if (taskTest == 'Y') {
$('#'+taskID).prepend('');
$('#'+taskID).css('left', '0px');
$('#'+taskID).css('top', '0px');
//alert('test:'+taskURL);
//$('#'+taskID).html('test:'+taskURL);
$('body').blur();
}
});
});
function floatingReportPage(displayInfo) {
var newLeft = $(window).width() - 270;
if ($('#floatingReportPage').length == 0){
$('#defaultDIV').append('
');
$('#floatingReportPage').append('');
$('#floatingReportPage').append('
');
}
$('#floatingReportPageMenu').html(displayInfo);
$('#floatingReportPage').css('left', newLeft+'px');
$('#floatingReportPage').css('position', 'fixed');
}
$(document).on('click', '.floatingTable', function() {
var formonly_tableID = $(this).attr('tableID');
var tableTitle = $(this).attr('tableTitle');
var iframeURL = $(this).attr('iframeURL');
var AddListInfo = $(this).attr('AddListInfo');
var AddListURL = $(this).attr('AddListURL');
$.when( floatingTable(formonly_tableID, tableTitle, iframeURL, AddListInfo) ).done(function() {
//alert('e')AddListURL
//$('#floating_jobApplication_AddList').html('test')
$("#floating_jobApplication_AddList").load(AddListURL);
});
});
function floatingTable(formonly_tableID, tableTitle, iframeURL, AddListInfo) {
is_safari = 'N';
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
//alert('Its Safari');
is_safari = 'Y';
}
if ($('#defaultDIV').length == 0){
$('body').append('
');
}
if(typeof(AddListInfo)==='undefined') AddListInfo = '';
var newWidth = $(window).width();
newWidth = newWidth - 20;
if ($('#'+formonly_tableID).length == 0){
$('#defaultDIV').append('
');
$('#'+formonly_tableID).append('
');
$('#'+formonly_tableID).append('
'+iframeURL+'
');
}
$('#'+formonly_tableID+'_URL').html(iframeURL);
$('#'+formonly_tableID).css('width', newWidth+'px');
moveOfforOnDataBox('defaultDIV',formonly_tableID, 10, 10, 'N');
tableTitle = tableTitle.replace(/ /gi, "*SPACE*");
if (AddListInfo == 'NoAddList') {
var newHeight = $(window).height();
newHeight = newHeight - 40;
$('#'+formonly_tableID+'_table').load('/includes/floatingTable.php?windowHeight=' + newHeight + '&tableTitle=' + tableTitle + '&formonly_tableID=' + formonly_tableID, function() {
iframeURL
newurl = iframeURL.replace(/&/gi, "&");
if (newurl.indexOf('?') == -1) {
newurl = newurl + '?';
} else {
newurl = newurl + '&';
}
newurl = newurl + 'formonly_tableID='+formonly_tableID;
//alert(newurl);
$('#'+formonly_tableID+'_iframe').attr('src', newurl);
$('.MaxLink').attr('href', newurl);
});
$('#'+formonly_tableID).css('top', '10px');
if (is_safari == 'N') {
$('#'+formonly_tableID).css('position', 'fixed');
} else {
newTop = window.pageYOffset;
$('#'+formonly_tableID).css('top', newTop +'px');
}
} else if (AddListInfo == 'MaxAddList') {
var newHeight = $(window).height();
newHeight = newHeight - 0;
$('#'+formonly_tableID+'_table').load('/includes/floatingTable.php?windowHeight=' + newHeight + '&tableTitle=' + tableTitle + '&formonly_tableID=' + formonly_tableID, function() {
iframeURL
newurl = iframeURL.replace(/&/gi, "&");
if (newurl.indexOf('?') == -1) {
newurl = newurl + '?';
} else {
newurl = newurl + '&';
}
newurl = newurl + 'formonly_tableID='+formonly_tableID;
//alert(newurl);
$('#'+formonly_tableID+'_iframe').attr('src', newurl);
$('.MaxLink').attr('href', newurl);
});
} else if (AddListInfo == 'SmallWindow') {
//var newHeight = $(window).height();
var newHeight = window.innerHeight ? window.innerHeight : $(window).height();
var innerWidth = window.innerWidth;
newHeight = newHeight - 400;
$('#'+formonly_tableID+'_table').load('/includes/floatingTable.php?windowHeight=' + newHeight + '&tableTitle=' + tableTitle + '&formonly_tableID=' + formonly_tableID, function() {
iframeURL
newurl = iframeURL.replace(/&/gi, "&");
if (newurl.indexOf('?') == -1) {
newurl = newurl + '?';
} else {
newurl = newurl + '&';
}
newurl = newurl + 'formonly_tableID='+formonly_tableID;
//alert(newurl);
$('#'+formonly_tableID+'_iframe').attr('src', newurl);
$('.MaxLink').attr('href', newurl);
});
if ($('#'+formonly_tableID+'_AddList').length == 0){
$('#defaultDIV').append('
');
}
newWidth = $('#'+formonly_tableID+'_table').width()/3;
$('#'+formonly_tableID).css('width', newWidth+'px');
newHeight = newHeight + 30;
//left distance
var leftDistance = (innerWidth - 700) / 2;
moveOfforOnDataBox('defaultDIV',formonly_tableID+'_AddList', 10, newHeight, 'N');
// Add the AddList box below pop-up where needed.
$('#'+formonly_tableID).css('top', '100px');
$('#'+formonly_tableID).css('left', leftDistance+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID).css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('top', newHeight+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID+'_AddList').css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('display', 'block');
} else if (AddListInfo == 'PLCWindow') {
//var newHeight = $(window).height();
var newHeight = window.innerHeight ? window.innerHeight : $(window).height();
var innerWidth = window.innerWidth;
newHeight = newHeight - 200;
$('#'+formonly_tableID+'_table').load('/includes/floatingTable.php?windowHeight=' + newHeight + '&tableTitle=' + tableTitle + '&formonly_tableID=' + formonly_tableID, function() {
iframeURL
newurl = iframeURL.replace(/&/gi, "&");
if (newurl.indexOf('?') == -1) {
newurl = newurl + '?';
} else {
newurl = newurl + '&';
}
newurl = newurl + 'formonly_tableID='+formonly_tableID;
//alert(newurl);
$('#'+formonly_tableID+'_iframe').attr('src', newurl);
$('.MaxLink').attr('href', newurl);
});
if ($('#'+formonly_tableID+'_AddList').length == 0){
$('#defaultDIV').append('
');
}
newWidth = $('#'+formonly_tableID+'_table').width()/1.5;
$('#'+formonly_tableID).css('width', newWidth+'px');
newHeight = newHeight + 30;
//left distance
var leftDistance = 100;
moveOfforOnDataBox('defaultDIV',formonly_tableID+'_AddList', 10, newHeight, 'N');
// Add the AddList box below pop-up where needed.
$('#'+formonly_tableID).css('top', '100px');
$('#'+formonly_tableID).css('left', leftDistance+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID).css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('top', newHeight+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID+'_AddList').css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('display', 'block');
} else if (AddListInfo == 'PrefectWindow') {
//var newHeight = $(window).height();
var newHeight = window.innerHeight ? window.innerHeight : $(window).height();
var innerWidth = window.innerWidth;
newHeight = newHeight - 150;
$('#'+formonly_tableID+'_table').load('/includes/floatingTable.php?windowHeight=' + newHeight + '&tableTitle=' + tableTitle + '&formonly_tableID=' + formonly_tableID, function() {
iframeURL
newurl = iframeURL.replace(/&/gi, "&");
if (newurl.indexOf('?') == -1) {
newurl = newurl + '?';
} else {
newurl = newurl + '&';
}
newurl = newurl + 'formonly_tableID='+formonly_tableID;
//alert(newurl);
$('#'+formonly_tableID+'_iframe').attr('src', newurl);
$('.MaxLink').attr('href', newurl);
});
if ($('#'+formonly_tableID+'_AddList').length == 0){
$('#defaultDIV').append('
');
}
newWidth = $('#'+formonly_tableID+'_table').width()/1.25;
$('#'+formonly_tableID).css('width', newWidth+'px');
newHeight = newHeight + 30;
//left distance
var leftDistance = 250;
moveOfforOnDataBox('defaultDIV',formonly_tableID+'_AddList', 10, newHeight, 'N');
// Add the AddList box below pop-up where needed.
$('#'+formonly_tableID).css('top', '100px');
$('#'+formonly_tableID).css('left', leftDistance+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID).css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('top', newHeight+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID+'_AddList').css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('display', 'block');
} else {
//var newHeight = $(window).height();
var newHeight = window.innerHeight ? window.innerHeight : $(window).height();
newHeight = newHeight - 100;
$('#'+formonly_tableID+'_table').load('/includes/floatingTable.php?windowHeight=' + newHeight + '&tableTitle=' + tableTitle + '&formonly_tableID=' + formonly_tableID, function() {
iframeURL
newurl = iframeURL.replace(/&/gi, "&");
if (newurl.indexOf('?') == -1) {
newurl = newurl + '?';
} else {
newurl = newurl + '&';
}
newurl = newurl + 'formonly_tableID='+formonly_tableID;
//alert(newurl);
$('#'+formonly_tableID+'_iframe').attr('src', newurl);
$('.MaxLink').attr('href', newurl);
});
if ($('#'+formonly_tableID+'_AddList').length == 0){
$('#defaultDIV').append('
');
}
newWidth = $('#'+formonly_tableID+'_table').width()-2;
$('#'+formonly_tableID+'_AddList').css('width', newWidth+'px');
newHeight = newHeight + 30;
moveOfforOnDataBox('defaultDIV',formonly_tableID+'_AddList', 10, newHeight, 'N');
// Add the AddList box below pop-up where needed.
$('#'+formonly_tableID).css('top', '10px');
if (is_safari == 'N') {
$('#'+formonly_tableID).css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('top', newHeight+'px');
if (is_safari == 'N') {
$('#'+formonly_tableID+'_AddList').css('position', 'fixed');
}
$('#'+formonly_tableID+'_AddList').css('display', 'block');
}
//alert('test#'+formonly_tableID+'_iframeLoading')
//$('#'+formonly_tableID+'_iframeLoading').css('display', 'none');
}
$(document).on('click', '.sectionIDbox', function() {
if ($(this).hasClass("MiniWindow") == false) {
$(this).addClass("MiniWindow");
$(this).attr("MWTitle", "Section ID Search");
$(this).attr("MWwidth", "550");
$(this).attr("MWstyle_main", "padding:10px;");
$(this).attr("MWURL", '/student_achievement/includes/sectionID_search.php');
$(this).attr("MWID", "sectionIDbox");
$(this).click();
}
});
$(document).on('click', '.dataDef', function() {
if ($(this).hasClass("MiniWindow") == false) {
$(this).addClass("MiniWindow");
var fieldID = $(this).attr('fieldID');
$(this).attr("MWTitle", "Data Definition");
$(this).attr("MWwidth", "550");
$(this).attr("MWstyle_main", "padding:10px;");
$(this).attr("MWURL", '/student_achievement/includes/dataDef.php?fieldID='+fieldID);
$(this).attr("MWID", "dataDef");
$(this).click();
}
});
$(document).on('click', '.fakeSelect', MiniWindow);
$(document).on('click', '.MiniWindow', MiniWindow);
function MiniWindow () {
var MWvariables = '';
var MWotherInfo = '';
var originalID = $(this).attr('id');
if ( $(this).is( ".fakeSelect" ) ) {
//alert('yup')
MWvariables = $(this).val();
var FStarget = $(this).attr('FStarget');
var FSotherInfo = $(this).attr('FSotherInfo');
var FSfieldInfo = $(this).attr('FSfieldInfo');
if ($('#'+FStarget).length == 0){
$('body').append('
');
}
if (FStarget != undefined) {
MWvariables = $('#'+FStarget).val();
} else {
FStarget = originalID;
}
if (FSotherInfo == undefined) {
FSotherInfo = '';
}
}
var currZ = $(this).css("z-index");
var MWID = $(this).attr('MWID');
if (MWID == undefined) { MWID = $(this).attr('id')+'_MW' }
var MWTitle = $(this).attr('MWTitle');
var MWURL = $(this).attr('MWURL');
var MWwidth = $(this).attr('MWwidth');
var MWheight = $(this).attr('MWheight');
var MWstyle = $(this).attr('MWstyle');
var MWstyle_main = $(this).attr('MWstyle_main');
var MWmain_style = $(this).attr('MWmain_style');
var MWclass = $(this).attr('MWclass');
var MWiFrame = $(this).attr('MWiFrame');
var MWtableData = $(this).attr('MWtableData');
var MWcurrVal = $(this).val();
var leftOffSet = $(this).attr('leftOffSet');
var topOffSet = $(this).attr('topOffSet');
if (leftOffSet == undefined) { leftOffSet = 0; }
if (topOffSet == undefined) { topOffSet = 0; }
leftOffSet = parseFloat(leftOffSet);
topOffSet = parseFloat(topOffSet);
if (MWheight != undefined) {
MWstyle_main = MWstyle_main + ';max-height:' + MWheight + 'px;overflow-y:auto;'
}
if ($('#'+MWID).length == 0){
$('body').append('
');
$('#'+MWID).append('
');
$('#'+MWID).append('
');
$('#'+MWID+'_main').append('');
$('#'+MWID+'_main').append('
');
}
$('#'+MWID+'_title').html(MWTitle);
if (MWTitle == "NONE") {
$('#'+MWID+'_header').css('display', 'none');
}
var upPointer = $(this).attr('upPointer');
if (upPointer == undefined) {
$('#'+MWID+'_pointer').html('

');
} else {
$('#'+MWID+'_pointer').html(upPointer);
}
var positionID = $(this).attr('positionID');
if (positionID == undefined) {
var position = $(this).offset(); //$(this).position();
var positionIDWidth = $(this).outerWidth();
} else {
var position = $('#'+positionID).offset(); //$('#'+positionID).position();
var positionIDWidth = $('#'+positionID).outerWidth();
}
var newWidth = 250; //$(window).width();
if (MWwidth !== undefined) {
newWidth = parseFloat(MWwidth);
}
var newLeft = position.left + leftOffSet;
var newTop = position.top + $(this).outerHeight(true) + topOffSet;
if (MWwidth == 'auto') {
$('#'+MWID).css('width', 'auto');
} else {
$('#'+MWID).css('width', newWidth+'px');
}
if ($(this).attr('alignRight') == "Y") {
var docwidth = $(document).width();
var newRight = docwidth - (position.left + positionIDWidth + leftOffSet);
//$('#'+MWID).css('width', newWidth+'px');
$('#'+MWID).css('left', 'auto');
$('#'+MWID).css('right', newRight+'px');
$('#'+MWID).css('top', newTop+'px');
var overflow = $('#'+MWID).outerWidth(true) - $('#'+MWID+'_pointer img').outerWidth(true);
$('#'+MWID+'_pointer').css('padding-left', overflow+'px');
} else {
var newRight = newLeft + newWidth;
var docwidth = $(document).width();
$('#'+MWID).css('left', newLeft+'px');
$('#'+MWID).css('top', newTop+'px');
if (newRight > docwidth) {
var overflow = newRight - docwidth + 20;
var overflowFix = newLeft - overflow;
$('#'+MWID).css('left', overflowFix+'px');
$('#'+MWID+'_pointer').css('padding-left', overflow+'px');
}
}
var loaded = $(this).attr('loaded');
if (loaded != 'Y') {
$('#'+MWID+'_data').html('

');
}
var currPageDIV = $(this).attr('currPageDIV');
var currPageDIVmove = $(this).attr('currPageDIVmove');
var MWtextEntry = $(this).attr('MWtextEntry');
var MWlistEntry = $(this).attr('MWlistEntry');
if (MWtextEntry != undefined) {
var nextID = $(this).attr('nextID');
$('#'+MWID+'_data').html('
')
$('#'+$(this).attr('id')+'_DE').focus();
$('#'+$(this).attr('id')+'_DE').select();
} else if (MWlistEntry != undefined) {
var nextID = $(this).attr('nextID');
$('#'+MWID+'_data').html('
'+$('#'+MWlistEntry).html()+'