(function ($) {
var Url = ‘http://flowtest.mapsearch360.com’

var templates = {
GeneratingUnits: ‘

Loading...

‘ +

‘ +
‘ +
‘ +
 
From
To
‘ +

‘ +

‘ +

‘ +

‘ +

‘ +
‘ +
‘ +
‘ +
‘ +

‘ +

‘ +

};

$.fn.GeneratingUnits = function (option) {
var defaults = {
onSuccess: function (data) { console.log([200, ‘OK’]); },
onError: function (data) { console.log([500, ‘Error’]); }
};
(function () {
//var po = document.createElement(‘script’);
////po.type = ‘text/javascript’;
//po.async = true;
//po.src = ‘~/js/CompanyProfile/PowerPlantTestPulginJs/jquery-1.8.3.js’;
//var s = document.getElementsByTagName(‘script’)[0];
//s.parentNode.insertBefore(po, s);
var po4 = null;
var s4 = null;

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/eakroko.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/application.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/demonstration.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/nicescroll/jquery.nicescroll.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
// s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/imagesLoaded/jquery.imagesloaded.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/jquery-ui/jquery.ui.core.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
// s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/jquery-ui/jquery.ui.widget.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/jquery-ui/jquery.ui.mouse.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/jquery-ui/jquery.ui.draggable.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/jquery-ui/jquery.ui.resizable.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
// s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/jquery-ui/jquery.ui.sortable.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
// s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/slimscroll/jquery.slimscroll.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
// s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/bootstrap.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
// s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/bootbox/jquery.bootbox.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/dynatree/jquery.dynatree.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/fullcalendar/fullcalendar.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/icheck/jquery.icheck.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/plugins/chosen/chosen.jquery.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertAfter(po4, s4);
s4.parentNode.append(po4)

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/jquery.mCustomScrollbar.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

o4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/jquery.mCustomScrollbar.concat.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/CompanyProfileView.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/CompanyProfileSilverlight.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = energymapitURL + ‘/js/CompanyProfileView.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = energymapitURL + ‘/Scripts/moment.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = ‘https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.5.3/jsgrid.min.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = energymapitURL + ‘/js/bootstrap.min.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/Scripts/jquery-ui.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = ‘https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = ‘http://energymapit.com/Scripts/jquery-1.9.1.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/CompanyProfile/googleMapHelper.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

po4 = null;
s4 = null;
po4 = document.createElement(‘script’);
// po4.type = ‘text/javascript’;
po4.async = true;
po4.src = energymapitURL + ‘/js/CompanyProfile/ContextMenu.js’;
po4.type = “text/javascript”
s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);
s4.parentNode.append(po4)

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = ‘http://maps.googleapis.com/maps/api/js?client=gme-pennwellcorporation&v=3.17&signature=hl4KxdA-647HX7JjUACvDuyf1l0=&v=3&sensor=false&libraries=geometry,places’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = ‘http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = ‘http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

//po4 = null;
//s4 = null;
//po4 = document.createElement(‘script’);
//// po4.type = ‘text/javascript’;
//po4.async = true;
//po4.src = ‘http://geoxml3.googlecode.com/svn/trunk/ProjectedOverlay.js’;
//po4.type = “text/javascript”
//s4 = document.getElementsByTagName(‘script’)[0];
//s4.parentNode.insertBefore(po4, s4);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/dynatree/ui.dynatree.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/chosen/chosen.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/icheck/all.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/Content/Default/icon.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/themes.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/style.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/fullcalendar/fullcalendar.print.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/fullcalendar/fullcalendar.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/jquery-ui/smoothness/jquery.ui.theme.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/plugins/jquery-ui/smoothness/jquery-ui.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po1 = null;
var s1 = null;
po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/bootstrap-responsive.min.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

po1 = document.createElement(‘link’);
po1.async = true;
po1.href = energymapitURL + ‘/css/bootstrap.min.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

//po1 = document.createElement(‘link’); po1.async = true;
//po1.href = ‘http://energymapit.com/css/plugins/jquery-ui/smoothness/jquery-ui.css’
//po1.rel = ‘stylesheet’
//po1.type = “text/css”
//s1 = document.getElementsByTagName(‘link’)[0];
//s1.parentNode.insertBefore(po1, s1);
//po1 = null;
//s1 = null;
//po1 = document.createElement(‘link’); po1.async = true;
//po1.href = energymapitURL + ‘/css/plugins/jquery-ui/smoothness/jquery.ui.theme.css’
//po1.rel = ‘stylesheet’
//po1.type = “text/css”
//s1 = document.getElementsByTagName(‘link’)[0];
//s1.parentNode.insertBefore(po1, s1);
//po1 = null;
//s1 = null;
//po1 = document.createElement(‘link’); po1.async = true;
//po1.href = energymapitURL + ‘/css/style.css’
//po1.rel = ‘stylesheet’
//po1.type = “text/css”
//s1 = document.getElementsByTagName(‘link’)[0];
//s1.parentNode.insertBefore(po1, s1);
//po1 = null;
//s1 = null;
//po1 = document.createElement(‘link’); po1.async = true;
//po1.href = energymapitURL + ‘/css/themes.css’
//po1.rel = ‘stylesheet’
//po1.type = “text/css”
//s1 = document.getElementsByTagName(‘link’)[0];
//s1.parentNode.insertBefore(po1, s1);
var po1 = document.createElement(‘link’); po1.async = true;
po1.href = Url + ‘/Content/Content/PowerPlantsTest/demos.css’;
po1.rel = ‘stylesheet’
po1.type = “text/css”
var s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

var po2 = document.createElement(‘link’); po2.async = true;
po2.href = Url + ‘/Content/Content/PowerPlantsTest/jsgrid.css’;
po2.rel = ‘stylesheet’
po2.type = “text/css”
var s2 = document.getElementsByTagName(‘link’)[0];
s2.parentNode.insertBefore(po2, s2);

var po3 = document.createElement(‘link’);
po3.async = true;
po3.href = Url + ‘/Content/Content/PowerPlantsTest/theme.css’;
po3.rel = ‘stylesheet’
po3.type = “text/css”
var s3 = document.getElementsByTagName(‘link’)[0];
s3.parentNode.insertBefore(po3, s3);

po1 = null;
s1 = null;
po1 = document.createElement(‘link’); po1.async = true;
po1.href = energymapitURL + ‘/css/CompanyProfile/PowerPlants.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

po1 = null;
s1 = null;
po1 = document.createElement(‘link’); po1.async = true;
po1.href = energymapitURL + ‘/css/CompanyProfile/GeneratingUnits.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

po1 = null;
s1 = null;
po1 = document.createElement(‘link’); po1.async = true;
po1.href = energymapitURL + ‘/css/CompanyProfile/GeneratingUnitsTest.css’
po1.rel = ‘stylesheet’
po1.type = “text/css”
s1 = document.getElementsByTagName(‘link’)[0];
s1.parentNode.insertBefore(po1, s1);

})();

var settings = $.extend({}, defaults, option);
var apiurl = AmazonAPiURL + “/api/CompanyProfile/GetGeneratingUnits”
// var apiurl = Url+”/api/PowerPlantAPI/getJsonGeneratingUnitsData”
//$.ajax({
// type: “GET”,
// url: AmazonAPiURL+ “/api/CompanyProfile/GetGeneratingUnits”,
// contentType: “application/json; charset=utf-8”,
// dataType: “json”,
// success: function (response) {
//
// var response = this.responseText;
// response = JSON.parse(response);
// GenUnitTestData = response.data;

// FillGenUnitGrid_Test(GenUnitTestData);
// //$(“#btnApply_TestGenUnit”).on(“click”, function () {
// // Apply_TestGenUnitFilter();
// //})

// //$(“#btnClear_TestGenUnit”).on(“click”, function () {
// // Clear_TestGenUnitFilter();
// //})
// },
// error: function (e) {
//
// },
// failure: function (response) {
//
// }
//});
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var response = this.responseText;
response = JSON.parse(response);
GenUnitTestData = response.data;
var apiurl1 = AmazonAPiURL + “/api/CompanyProfile/GetGeneratingUnits?skip=17000”
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
debugger
var response = this.responseText;
response = JSON.parse(response);
var UnitData = response.data;
GenUnitTestData = GenUnitTestData.concat(UnitData);
FillGenUnitGrid_Test(GenUnitTestData);

}
else {
FillGenUnitGrid_Test(GenUnitTestData);
}
};
xmlHttp.open(“GET”, apiurl1, true);
xmlHttp.send();
$(‘#GUTPageDropdown’).css(‘display’, ‘none’);
$(“.GeneratingUnitsTestpager”).on(“change”, function () {
$(“#GenUnitContent_Test”).jsGrid(“option”, “pageSize”, $(this).val());
// $(“#externalPager .jsgrid-pager”).append(PageDropDown);
$(“#GeneratingUnitsTestpager”).val($(this).val());
});
$(‘#Search_TestGUT’).on(‘keyup’, function (e) {
event.preventDefault();
if (event.keyCode === 13) {
searchGeneartingUnitsData();
}
});
//$(“#btnApply_TestGenUnit”).on(“click”, function () {
// Apply_TestGenUnitFilter();
//});

//$(“#btnClear_TestGenUnit”).on(“click”, function () {
// Clear_TestGenUnitFilter();
//});

}
};
xmlHttp.open(“GET”, apiurl, true);
xmlHttp.send();
Suggestive_GUT_PowerplantResults();
fill_Test_GenUnitStates();
var element = “”;
element = templates.GeneratingUnits;
return this.html(element)

}

})(jQuery);

function searchGeneartingUnitsData() {
try {
var Search_TestGUT = $(‘#Search_TestGUT’).val();
var UnitsData = GenUnitTestData
if (Search_TestGUT) {
UnitsData = GenUnitTestData.filter(function (el) {
if (Search_TestGUT.toLowerCase().indexOf(el.operatingUtility.toLowerCase().trim()) > -1 || Search_TestGUT.toLowerCase().indexOf(el.powerPlant.toLowerCase().trim()) > -1) {
return el;
}
//else if (el.powerPlant != null && el.powerPlant != undefined && ) {
// return el;
//}
});
UnitsData = UnitsData
}
setTimeout(function () { FillGenUnitGrid_Test(UnitsData); }, 500);
} catch (e) {
console.log(ex.message);
}
}
function SearchGUTUtilityandPowerPlant() {
try {
searchGeneartingUnitsData();

} catch (e) {
console.log(e.message);
}
}

function Apply_TestGenUnitFilter() {
var States = $(“#GenUnit_TestStates”).val();
var NERCRegions = $(“#GenUnit_TestRegion”).val();
var PrimeMover = $(“#GenUnit_TestPrimeMovers”).val();
var Status = $(“#GenUnit_TestStatus”).val();
var FuelTypes = $(“#GenUnit_TestFuelTypes”).val();
var OnlineYearFrom = $(‘#txt_TestOnlineYearFrom’).val();
var OnlineYearTo = $(‘#txt_TestOnlineYearTo’).val();
var NamePlateCapFrom = $(‘#txt_TestNamePlateCapFrom’).val();
var NamePlateCapTo = $(‘#txt_TestNamePlateCapTo’).val();
var SummerCapFrom = $(‘#txt_TestSummerCapFrom’).val();
var SummerCapTo = $(‘#txt_TestSummerCapTo’).val();
var Search_TestGUT = $(‘#Search_TestGUT’).val();

//if (States[0] == “ALL” && NERCRegions[0] == “ALL” && Status[0] == “ALL” && FuelTypes[0] == “ALL” && PrimeMover[0] == “ALL”) {
// return;
//}
//else {
Clear_TestGenUnitGrid();
if (GenUnitTestData == undefined || GenUnitTestData == null) {

var apiurl = AmazonAPiURL + “/api/CompanyProfile/GetGeneratingUnits”
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {

var response = this.responseText;
response = JSON.parse(response);
GenUnitTestData = response.data;
Test_ApplyFilter(GenUnitTestData);
}
};
xmlHttp.open(“GET”, apiurl, true);
xmlHttp.send();

//$.ajax({
// type: “GET”,
// url: “/CompanyProfile/GenUnitGridData”,
// contentType: “application/json; charset=utf-8”,
// dataType: “json”,
// success: function (response) {
// GenUnitData = response;

// },
// failure: function (response) {
// }
//});
}
else
Test_ApplyFilter(GenUnitTestData);
//}
}
function Clear_TestGenUnitFilter() {
Clear_TestGenUnitGrid();
Test_SetDefaultValues();
setTimeout(function () { FillGenUnitGrid_Test(GenUnitTestData); }, 500);
}
function Test_SetDefaultValues() {
$(“#GenUnit_TestStates”).val(“ALL”);
$(“#GenUnit_TestRegion”).val(“ALL”);
$(“#GenUnit_TestPrimeMovers”).val(“ALL”);
$(“#GenUnit_TestStatus”).val(“ALL”);
$(“#GenUnit_TestFuelTypes”).val(“ALL”);
$(“#txt_TestOnlineYearFrom”).val(1890);
$(“#txt_TestOnlineYearTo”).val(2030);
$(“#txt_TestNamePlateCapFrom”).val(0);
$(“#txt_TestNamePlateCapTo”).val(99999);
$(“#txt_TestSummerCapFrom”).val(0);
$(“#txt_TestSummerCapTo”).val(99999);
$(‘#Search_TestGUT’).val(“”);
}
function Test_ApplyFilter(GenUnitData) {
var States = $(“#GenUnit_TestStates”).val();
var NERCRegions = $(“#GenUnit_TestRegion”).val();
var PrimeMover = $(“#GenUnit_TestPrimeMovers”).val();
var Status = $(“#GenUnit_TestStatus”).val();
var FuelTypes = $(“#GenUnit_TestFuelTypes”).val();
var OnlineYearFrom = $(‘#txt_TestOnlineYearFrom’).val();
var OnlineYearTo = $(‘#txt_TestOnlineYearTo’).val();
var NamePlateCapFrom = $(‘#txt_TestNamePlateCapFrom’).val();
var NamePlateCapTo = $(‘#txt_TestNamePlateCapTo’).val();
var SummerCapFrom = $(‘#txt_TestSummerCapFrom’).val();
var SummerCapTo = $(‘#txt_TestSummerCapTo’).val();
var Search_TestGUT = $(‘#Search_TestGUT’).val();

var StatesData = GenUnitData.filter(function (el) {
if (States[0] == “ALL”)
return el;
else
if (el.state != null && el.state != undefined && States.indexOf(el.state.trim()) > -1)
return el;
})
var NERCData = StatesData.filter(function (el) {
if (NERCRegions[0] == “ALL”)
return el;
else
if (el.nerc != null && el.nerc != undefined && NERCRegions.indexOf(el.nerc.trim()) > -1)
return el;
})
var PrimeMoverData = NERCData.filter(function (el) {
if (PrimeMover[0] == “ALL”)
return el;
else
if (el.primeMover != null && el.primeMover != undefined && PrimeMover.indexOf(el.primeMover.trim()) > -1)
return el;
})
var StatusData = PrimeMoverData.filter(function (el) {
if (Status[0] == “ALL”)
return el;
else
if (el.status != null && el.status != undefined && Status.indexOf(el.status.trim()) > -1)
return el;
})
var FuelTypesData = StatusData.filter(function (el) {
if (FuelTypes[0] == “ALL”)
return el;
else
if (el.primaryFuel != null && el.primaryFuel != undefined && FuelTypes.indexOf(el.primaryFuel.trim()) > -1)
return el;
})

var OnlineYearData;
if (parseInt(OnlineYearFrom) >= 0 && parseInt(OnlineYearTo) >= 0) {
OnlineYearData = FuelTypesData.filter(function (el) {
return parseInt(el.onlineYear) >= parseInt(OnlineYearFrom) && parseInt(el.onlineYear) <= parseInt(OnlineYearTo) }) } else OnlineYearData = FuelTypesData; var NamePlateCapacityData; if (parseInt(NamePlateCapFrom) >= 0 && parseInt(NamePlateCapTo) >= 0) {
NamePlateCapacityData = OnlineYearData.filter(function (el) {
return parseInt(el.capacity) >= parseInt(NamePlateCapFrom) && parseInt(el.capacity) <= parseInt(NamePlateCapTo) }) } else NamePlateCapacityData = OnlineYearData; var SummerCapacityData; if (parseInt(SummerCapFrom) >= 0 && parseInt(SummerCapTo) >= 0) {
SummerCapacityData = NamePlateCapacityData.filter(function (el) {
return parseInt(el.summerCapacity) >= parseInt(SummerCapFrom) && parseInt(el.summerCapacity) <= parseInt(SummerCapTo) }) } else SummerCapacityData = NamePlateCapacityData; //if (Search_TestGUT) { // var UnitsData = SummerCapacityData.filter(function (el) { // if (Search_TestGUT.toLowerCase().indexOf(el.operatingUtility.toLowerCase().trim()) > -1 || Search_TestGUT.toLowerCase().indexOf(el.powerPlant.toLowerCase().trim()) > -1) {
// return el;
// }
// //else if (el.powerPlant != null && el.powerPlant != undefined && ) {
// // return el;
// //}
// });

// SummerCapacityData = UnitsData
//}
setTimeout(function () { FillGenUnitGrid_Test(SummerCapacityData); }, 500);
}
function Clear_TestGenUnitGrid() {
$(‘#GenUnitContent_Test’).empty();
$(‘#GenUnitContent_Test’).html(“   Loading…

“);
}
function fill_Test_GenUnitStates() {
// var apiurl = AmazonAPiURL+”/api/CompanyProfile/GetPowerState”;
var apiurl = AmazonAPiURL + “/api/CompanyProfile/GetAllGeneratingUnitOptions”;
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {

response = JSON.parse(this.responseText);
if (response.error == “”) {
$(“#GenUnit_TestStates”).html(”);
$(“#GenUnit_TestStates”).append($(‘‘).attr(“value”, “ALL”).html(“ALL”));
$(“#GenUnit_TestStates”).val(“ALL”);
for (i = 0; i < response.sates.length; i++) { var obj = response.sates[i]; $("#GenUnit_TestStates").append($('‘).attr(“value”, obj.stateCode1).html(obj.stateProvince));
}
fill_Test_GenUnitNERCRegion(response);
}
else {
alert(response.error);
}

}
else {
console.log(this.responseText);
}
};
xmlHttp.open(“GET”, apiurl, true);
xmlHttp.send();
}

function fill_Test_GenUnitNERCRegion(Data) {
if (!Data.nerc) {
var apiurl = AmazonAPiURL + “/api/CompanyProfile/GetAllGeneratingUnitOptions”;
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {

response = JSON.parse(this.responseText);
if (response.error == “”) {
$(“#GenUnit_TestRegion”).html(”);
$(“#GenUnit_TestRegion”).append($(‘‘).attr(“value”, “ALL”).html(“ALL”));
$(“#GenUnit_TestRegion”).val(“ALL”);
for (i = 0; i < response.nerc.length; i++) { var obj = response.nerc[i]; $("#GenUnit_TestRegion").append($('‘).attr(“value”, obj.nercregionCode).html(obj.nercregionCode));
}
}
else {
alert(response.error);
}

}
else {
console.log(this.responseText);
}
};
xmlHttp.open(“GET”, apiurl, true);
xmlHttp.send();
}
else {
$(“#GenUnit_TestRegion”).html(”);
$(“#GenUnit_TestRegion”).append($(‘‘).attr(“value”, “ALL”).html(“ALL”));
$(“#GenUnit_TestRegion”).val(“ALL”);
for (i = 0; i < Data.nerc.length; i++) { var obj = Data.nerc[i]; $("#GenUnit_TestRegion").append($('‘).attr(“value”, obj.nercregionCode).html(obj.nercregionCode));
}
}
}
function FillGenUnitGrid_Test(GenUnitTestData) {
try {
$(“#GenUnitsLoader_Test”).show();
$(‘#GenUnitContent_Test’).html(“”);
$(‘#GUTPageDropdown’).css(‘display’, ‘block’);
$(“#GeneratingUnitsTestpager”).val(“25”);
$(“#GenUnitContent_Test”).jsGrid({
height: “auto”,
width: “100%”,
sorting: true,
paging: true,
autoload: true,
pageButtonCount: 5,
selectable: true,
data: GenUnitTestData,
pageSizes: 25,
pagerContainer: “#GenUnitexternalPager”,
pagerFormat: “Pages: {pageIndex}    {first} {prev} {pages} {next} {last}    {pageIndex} of {pageCount} “,
pagePrevText: “Prev”,
pageNextText: “Next”,
pageFirstText: “First”,
pageLastText: “Last”,
pageNavigatorNextText: “…”,
pageNavigatorPrevText: “…”,
fields: [
{ name: “unitID”, visible: false, title: “ID” },
{ name: “powerID”, visible: false, title: ‘PowerID’ },
{
name: “operatingUtility”, title: ‘Operating Utility’, width: ‘16%’
, itemTemplate: function (item, value) {

var _object = value.operatingUtility;
var CompID = value.companyID;
return “” + _object + “

}
},
{
name: “powerPlant”, title: ‘Power Plant’, width: ‘16%’
, itemTemplate: function (item, value) {
var _object = value.powerPlant;
var PowerID = value.powerID;
var CompanyID = value.companyID;
return “” + _object + “
}
},
{ name: “state”, title: ‘State’, width: “7%” },
{ name: “generator”, title: ‘Generator’, width: “7%” },
{ name: “primeMover”, title: ‘Prime Mover’, width: “10%” },
{ name: “status”, title: ‘Status’, width: ‘11%’ },
{
name: “capacity”, title: ‘Capacity
(MW)’, width: ‘7%’
, itemTemplate: function (item, value) {

var Capacity = value.capacity;
if (Capacity != undefined && Capacity != null && Capacity != “”)
return Capacity.toFixed(2);
else
return Capacity;
}
},
{
name: “summerCapacity”, title: ‘Summer Capacity
(MW)’, width: “15%”, itemTemplate: function (item, value) {
var summerCapacity = value.summerCapacity;
if (summerCapacity != undefined && summerCapacity != null && summerCapacity != “”)
return summerCapacity.toFixed(2);
else
return summerCapacity;

}
},
{ name: “onlineYear”, title: ‘Online Year’, width: ‘9%’ },
{ name: “primaryFuel”, title: ‘Primary Fuel’, width: ‘9%’ },

]
});
$(“#GenUnitContent_Test”).jsGrid(“option”, “pageSize”, 25);
$(“#GenUnitsLoader_Test”).hide();
}
catch (err) {
console.log(“GenUnitsGridTest Err : ” + err);
$(“#GenUnitsLoader_Test”).hide();
}
}

function Gen_Test_UnitsPlantOperatorModal(CompanyID) {
$(“#GenUnitsLoader_Test”).show();

var apiurl = AmazonAPiURL + “/api/CompanyProfile/GetPlantOperatorByID?cID=” + CompanyID
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {

var response = this.responseText;

var Data = JSON.parse(response);
Data = JSON.parse(Data);
$(“#modal-GenUnitsbodyPlantOperator_Test”).html(“”);
var TotalCapacity = 0;
var html = ‘

‘ + Data.data.CompanyName + ‘


//$(“#modal-bodyPlantOperator_Test”).append(html);
//html = ”;
var CompType = Data.data.CompanyType;
if (CompType == null || CompType == ‘null’) {
CompType = ”;
}
//html += ‘

Contact Details

‘ +
// ‘

Physical Address 1 :
‘ + Data.data.PhysicalAddress1 + ‘

‘+
// ‘

Physical Address 2 :
‘ + Data.data.PhysicalAddress2 + ‘

‘ +
// ‘

City/State/Zip :
‘ + Data.data.City + ‘,’ + Data.data.State + ‘,’ + Data.data.Zip + ‘

‘ +
// ‘

Country :
‘ + Data.data.Country + ‘

‘ +
// ‘

Company Type:
‘ + CompType + ‘
Parent Company:
‘ + Data.data.ParentCompany + ‘


//$(“#modal-GenUnitsbodyPlantOperator_Test”).html(html);
var htmlAddress2 = ”;
if (Data.data.PhysicalAddress2) {
htmlAddress2 = ‘
‘ + Data.data.PhysicalAddress2
}
html += ‘

Contact Details

‘ +

Address
‘ + Data.data.PhysicalAddress1 + ” + htmlAddress2 + ‘
‘ + Data.data.City + ‘, ‘ + Data.data.State + ‘ ‘ + Data.data.Zip + ‘
‘ + Data.data.Country +
Company Type:
‘ + CompType + ‘
Parent Company:
‘ + Data.data.ParentCompany + ‘


$(“#modal-GenUnitsbodyPlantOperator_Test”).html(html);
html = ”;
html = ‘

Operating Summary

Operating Capacity

‘ +

MWs


if (Data.Capacity.length > 0) {
for (var i = 0; i < Data.Capacity.length; i++) { TotalCapacity = Data.Capacity[i].Value + TotalCapacity; html += '

‘ + Data.Capacity[i].Key + ‘
‘ + Data.Capacity[i].Value + ‘


}
}

html += ‘

Total Capacity:


if (TotalCapacity > 0) {
html += ‘

‘ + TotalCapacity + ‘


} else {
html += ‘


}
html += ‘


$(“#span121″).append(html);
html = ”;

html = ‘
Plant Data

‘;
html += ‘

Power Plant City County State NERC Capacity MWs Planned
Increases MWs
Primary Fuel Sector


$(“#modal-GenUnitsbodyPlantOperator_Test”).append(html);
if (Data.data.Plants.length > 0) {
html = ”;
for (var i = 0; i < Data.data.Plants.length; i++) { var PlannedIncreasesMWs = Data.data.Plants[i].PlannedIncreasesMWs if (PlannedIncreasesMWs == null || PlannedIncreasesMWs == 'null') { PlannedIncreasesMWs = '' } var Sector = Data.data.Plants[i].Sector; var PrimaryFuel = Data.data.Plants[i].PrimaryFuel; if (!Sector) Sector = ''; if (!PrimaryFuel) PrimaryFuel = ''; html += ' ‘ + Data.data.Plants[i].PlantName + ‘ ‘ + Data.data.Plants[i].City + ‘ ‘ + Data.data.Plants[i].County + ‘ ‘ + Data.data.Plants[i].State + ‘ ‘ + Data.data.Plants[i].NERC + ‘ ‘ + Data.data.Plants[i].CapacityMWs + ‘ ‘ + PlannedIncreasesMWs + ‘ ‘ + PrimaryFuel + ‘ ‘ + Sector + ‘

‘;
}
}
$(“#GeneratingGrid_Test_tbody”).html(“”);
$(“#GeneratingGrid_Test_tbody”).html(html);
$(“#GenUnitsLoader_Test”).hide();
$(“#modal-GenUnitsPlantsOperator_Test”).css(‘height’, ‘80%’);
$(“#modal-GenUnitsbodyPlantOperator_Test”).css(‘max-height’, ‘none’);
$(“#modal-GenUnitsPlantsOperator_Test”).on(‘show’, function () {
$(this).addClass(“modalPlantOperator”);
})
//$(“#modal-GenUnitsPlantsOperator_Test”).on(‘shown.bs.modal’, function () {
// resize_Test_GenUnitsPlantOperatorPopup();
//})
$(“#modal-GenUnitsPlantsOperator_Test”).on(‘hidden.bs.modal’, function () {
$(this).removeClass(“modalPlantOperator”);
})
$(“#modal-GenUnitsPlantsOperator_Test”).modal(‘show’);
}
else {
// alert(this.responseText);
console.log(this.responseText);
}
};
xmlHttp.open(“GET”, apiurl, true);
xmlHttp.send();

//$.ajax({
// url: “/CompanyProfile/GetPlantOperatorByID”,
// type: ‘GET’,
// data: { cID: CompanyID },
// contentType: ‘json’,
// success: function (response) {
// $(“#GenUnitsLoader”).hide();
// $(“#modal-GenUnitsPlantsOperator”).css(‘height’, ‘80%’);
// $(“#modal-GenUnitsPlantsOperator”).on(‘show’, function () {
// $(this).addClass(“modalPlantOperator”);
// })
// $(“#modal-GenUnitsPlantsOperator”).on(‘shown.bs.modal’, function () {
// resizeGenUnitsPlantOperatorPopup();
// })
// $(“#modal-GenUnitsPlantsOperator”).on(‘hidden.bs.modal’, function () {
// $(this).removeClass(“modalPlantOperator”);
// })
// $(“#modal-GenUnitsbodyPlantOperator”).html(response);
// $(“#modal-GenUnitsPlantsOperator”).modal(‘show’);
// },
// error: function (errorMsg) {
// $(“#GenUnitsLoader”).hide();
// console.log(errorMsg);
// }
//});
}

function Gen_Test_UnitsPlantModal(PowerID, CompanyID) {
$(“#GenUnitsLoader_Test”).show();
var apiurl = AmazonAPiURL + “/api/CompanyProfile/GetPowerPlantByID?PowerID=” + PowerID + “&CompanyID=” + CompanyID;
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {

var response = this.responseText;
var Data = JSON.parse(response);
Data = JSON.parse(Data);

var OperatingUtility = ”;
var OwnershipType = ”;
var Country = ”;
var City = ”;
var NERC = ”;
var ISO = ”;
var TransFacilityOwner = ”;
if (Data.data.OperatingUtility) {
OperatingUtility = Data.data.OperatingUtility
}
if (Data.data.OwnershipType) {
OwnershipType = Data.data.OwnershipType
}
if (Data.data.Country) {
Country = Data.data.Country
}
if (Data.data.City) { City = Data.data.City; }
if (Data.data.NERC) { NERC = Data.data.NERC }
if (Data.data.ISO) { ISO = Data.data.ISO }
if (Data.data.TransFacilityOwner) { TransFacilityOwner = Data.data.TransFacilityOwner }

var html = ‘

‘ + Data.data.Name + ‘

‘;
html += ‘

‘;
$(“#modal-GenUnitsbodyPowerPlantPopup_Test”).html(html);
html = ”
html = ‘

Operating Utility
‘ + OperatingUtility + ‘

‘ +

Ownership Type:
‘ + OwnershipType + ‘

‘ +

Country
‘ + Country + ‘

‘ +

City/State:
‘ + City + ‘, ‘ + Data.data.State + ‘

‘ +

County:
‘ + Data.data.County + ‘

‘ +

NERC Region:
‘ + NERC + ‘

‘ +

ISO/RTO:
‘ + ISO + ‘

‘ +

Trans Facility Owner:
‘ + TransFacilityOwner + ‘


$(“#Gnspan6_1”).html(“”);
$(“#Gnspan6_1″).append(html);
var HeatRate = Data.data.HeatRate;
var PrimaryFuel = Data.data.PrimaryFuel;
var WaterSource = Data.data.WaterSource;
var RegulatoryStatus = Data.data.RegulatoryStatus;
var Sector = Data.data.Sector;
var CapacityFactor = Data.data.CapacityFactor;
var Capacity = Data.data.Capacity
if (HeatRate == null || HeatRate == ‘null’)
HeatRate = ”;
if (PrimaryFuel == null || PrimaryFuel == ‘null’)
PrimaryFuel = ”;
if (WaterSource == null || WaterSource == ‘null’)
WaterSource = ”;
if (RegulatoryStatus == null || RegulatoryStatus == ‘null’)
RegulatoryStatus = ”;
if (Sector == null || Sector == ‘null’)
Sector = ”;
if (CapacityFactor == null || CapacityFactor == ‘null’)
CapacityFactor = ”;
if (Capacity == null || Capacity == ‘null’)
Capacity = ”;
html = ”;
html = ‘

Capacity (MWs):
‘ + Capacity + ‘

‘ +

Capacity Factor:
‘ + CapacityFactor + ‘

‘ +

Avg. Heat Rate (Btu/kWh):
‘ + HeatRate + ‘

‘ +

Primary Fuel:
‘ + PrimaryFuel + ‘

‘ +

Water Source:
‘ + WaterSource + ‘

‘ +

Regulatory Status:
‘ + RegulatoryStatus + ‘

‘ +

Sector:
‘ + Sector + ‘

‘;
$(“#GNspan6_2”).html(“”);
$(“#GNspan6_2″).append(html);
html = ”;
html = ‘

‘;
$(“#GNspan6_3”).html(“”);
$(“#GNspan6_3″).append(html);
html = ”;
html = ‘
Existing & Planned Unit Data

‘;
$(“#modal-GenUnitsbodyPowerPlantPopup_Test”).append(html);
html = ”;
html = ‘

‘ +

Generator Prime Mover NamePlate
Capacity MWs
Summer
Capabilitiy MWs
Status Online
Year
Primary Fuel Ownership

‘;
$(“#modal-GenUnitsbodyPowerPlantPopup_Test”).append(html);
html = ”;
if (Data.data.PowerUnits.length > 0) {
for (var i = 0; i < Data.data.PowerUnits.length; i++) { var Generator = Data.data.PowerUnits[i].Generator; var PrimeMover = Data.data.PowerUnits[i].PrimeMover; var NamePlateCapacity = Data.data.PowerUnits[i].NamePlateCapacity; var SummerCapabilities = Data.data.PowerUnits[i].SummerCapabilities; var Status = Data.data.PowerUnits[i].Status; var OnlineYear = Data.data.PowerUnits[i].OnlineYear; var PrimaryFuel = Data.data.PowerUnits[i].PrimaryFuel; var Ownership = Data.data.PowerUnits[i].Ownership if (Generator == null || Generator == 'null') Generator = ''; if (PrimeMover == null || PrimeMover == 'null') PrimeMover = ''; if (NamePlateCapacity == null || NamePlateCapacity == 'null') NamePlateCapacity = ''; if (SummerCapabilities == null || SummerCapabilities == 'null') SummerCapabilities = ''; if (Status == null || Status == 'null') Status = ''; if (OnlineYear == null || OnlineYear == 'null') OnlineYear = ''; if (PrimaryFuel == null || PrimaryFuel == 'null') PrimaryFuel = ''; if (Ownership == null || Ownership == 'null') Ownership = ''; html += ' ‘ + Generator + ‘ ‘ + PrimeMover + ‘ ‘ + NamePlateCapacity + ‘ ‘ + SummerCapabilities + ‘ ‘ + Status + ‘ ‘ + OnlineYear +
‘ ‘ + PrimaryFuel + ‘ ‘ + Ownership + ‘

‘;
}
}
$(“#GeneratingUnitsGrid_Test_tbody”).html(“”);
$(“#GeneratingUnitsGrid_Test_tbody”).html(html);

$(“#GenUnitsLoader_Test”).hide();
$(“#modal-GenUnitsPowerPlantPopup_Test”).css(‘height’, ‘80%’);
$(“#modal-GenUnitsPowerPlantPopup_Test”).css(‘max-height’, ‘none’);
$(“#modal-GenUnitsPowerPlantPopup_Test”).on(‘show’, function () {
$(this).addClass(“modalPlantOperator”);
})
$(“#modal-GenUnitsPowerPlantPopup_Test”).on(‘shown.bs.modal’, function () {
debugger
GUnitsTest_map_canvas_initialize_map(Data.data.latitude, Data.data.longitude);
//resize_Test_GenUnitsPowerPlantPopup();
})
$(“#modal-GenUnitsPowerPlantPopup_Test”).on(‘hidden.bs.modal’, function () {
$(“#main”).css(‘margin-left’, ‘0px’);
$(this).removeClass(“modalPlantOperator”);
})
//$(“#modal-bodyPowerPlantPopup_Test”).html(response);
$(“#modal-GenUnitsPowerPlantPopup_Test”).modal(‘show’);
$(“#main”).css(‘margin-left’, ‘0px’);
}
else {
// alert(this.responseText);
console.log(this.responseText);
}
};
xmlHttp.open(“GET”, apiurl, true);
xmlHttp.send();

//$.ajax({
// // url: “/CompanyProfile/GetPowerPlantByID_Test”,
// url: “http://flowtest.mapsearch360.com/api/PowerPlantAPI/GetPowerPlantByID?PowerID=” + PowerID + “&CompanyID=” + CompanyID,
// type: ‘GET’,
// // data: { PowerID: PowerID, CompanyID: CompanyID },
// contentType: ‘json’,
// success: function (response) {
//
// var Data = JSON.parse(response)

// },
// error: function (errorMsg) {
// hideNewsLoading();
// console.log(errorMsg);
// }
//});
}

function resize_Test_GenUnitsPlantOperatorPopup() {
var popupHeight = $(“#modal-GenUnitsPlantsOperator_Test”).height()
if (popupHeight > 0) {
var bodyMaxHeight = popupHeight – 50;
if (bodyMaxHeight < 150) { bodyMaxHeight = 150; } $("#modal-GenUnitsPlantsOperator_Test .modal-body").css('max-height', bodyMaxHeight); var ActualBodyHeight = $("#modal-GenUnitsPlantsOperator_Test").height() if (ActualBodyHeight < bodyMaxHeight) { $("#modal-GenUnitsbodyPlantOperator_Test").css('height', ActualBodyHeight + 50); } } } function resize_Test_GenUnitsPowerPlantPopup() { var popupHeight = $("#modal-GenUnitsPowerPlantPopup_Test").height() if (popupHeight > 0) {
var bodyMaxHeight = popupHeight – 50;
if (bodyMaxHeight < 150) { bodyMaxHeight = 150; } $("#modal-GenUnitsPowerPlantPopup_Test .modal-body").css('max-height', bodyMaxHeight); var ActualBodyHeight = $("#modal-GenUnitsbodyPowerPlantPopup_Test").height() if (ActualBodyHeight < bodyMaxHeight) { $("#modal-GenUnitsPowerPlantPopup_Test").css('height', ActualBodyHeight + 50); } } } function Suggestive_GUT_PowerplantResults() { try { debugger var apiurl = AmazonAPiURL + "/api/CompanyProfile/GetSuggestiveGeneratingUnitsResults"; var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { response = JSON.parse(this.responseText); response = JSON.parse(response); if (response) { autocomplete_Test_GUT(document.getElementById("Search_TestGUT"), response); } } else { // alert(this.responseText); console.log(this.responseText); } }; xmlHttp.open("GET", apiurl, true); xmlHttp.send(); } catch (e) { console.log(e.message); } } function autocomplete_Test_GUT(inp, arr) { /*the autocomplete function takes two arguments, the text field element and an array of possible autocompleted values:*/ var currentFocus; /*execute a function when someone writes in the text field:*/ inp.addEventListener("input", function (e) { var a, b, i, val = this.value; /*close any already open lists of autocompleted values*/ closeAllLists(); if (!val) { return false; } currentFocus = -1; /*create a DIV element that will contain the items (values):*/ a = document.createElement("DIV"); a.setAttribute("id", this.id + "autocomplete-list"); a.setAttribute("class", "autocomplete-items"); /*append the DIV element as a child of the autocomplete container:*/ this.parentNode.appendChild(a); /*for each item in the array...*/ for (i = 0; i < arr.length; i++) { /*check if the item starts with the same letters as the text field value:*/ if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) { /*create a DIV element for each matching element:*/ b = document.createElement("DIV"); /*make the matching letters bold:*/ b.innerHTML = "” + arr[i].substr(0, val.length) + ““;
b.innerHTML += arr[i].substr(val.length);
/*insert a input field that will hold the current array item’s value:*/
b.innerHTML += ““;
/*execute a function when someone clicks on the item value (DIV element):*/
b.addEventListener(“click”, function (e) {
/*insert the value for the autocomplete text field:*/
inp.value = this.getElementsByTagName(“input”)[0].value;
/*close the list of autocompleted values,
(or any other open lists of autocompleted values:*/
closeAllLists();
});
a.appendChild(b);
}
}
});
/*execute a function presses a key on the keyboard:*/
inp.addEventListener(“keydown”, function (e) {
var x = document.getElementById(this.id + “autocomplete-list”);
if (x) x = x.getElementsByTagName(“div”);
if (e.keyCode == 40) {
/*If the arrow DOWN key is pressed,
increase the currentFocus variable:*/
currentFocus++;
/*and and make the current item more visible:*/
addActive(x);
} else if (e.keyCode == 38) { //up
/*If the arrow UP key is pressed,
decrease the currentFocus variable:*/
currentFocus–;
/*and and make the current item more visible:*/
addActive(x);
} else if (e.keyCode == 13) {
/*If the ENTER key is pressed, prevent the form from being submitted,*/
e.preventDefault();
if (currentFocus > -1) {
/*and simulate a click on the “active” item:*/
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
/*a function to classify an item as “active”:*/
if (!x) return false;
/*start by removing the “active” class on all items:*/
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1); /*add class "autocomplete-active":*/ x[currentFocus].classList.add("autocomplete-active"); } function removeActive(x) { /*a function to remove the "active" class from all autocomplete items:*/ for (var i = 0; i < x.length; i++) { x[i].classList.remove("autocomplete-active"); } } function closeAllLists(elmnt) { /*close all autocomplete lists in the document, except the one passed as an argument:*/ var x = document.getElementsByClassName("autocomplete-items"); for (var i = 0; i < x.length; i++) { if (elmnt != x[i] && elmnt != inp) { x[i].parentNode.removeChild(x[i]); } } } /*execute a function when someone clicks in the document:*/ document.addEventListener("click", function (e) { closeAllLists(e.target); }); }