
function getNewWindowLinks(){$("a.non-html, a.off-site").click(function(e){var event;if(!e){event=window.event;}else{event=e;}if(event.shiftKey||event.altKey||event.ctrlKey||event.metaKey){return true;}else{var newWindow=window.open(this.getAttribute('href'),'','width=780, height=500, scrollbars=yes, resizable=yes, toolbar=yes, location=yes, directories=no, menubar=yes, copyhistory=no');if(newWindow){try{if(newWindow.focus()){newWindow.focus();}}catch(err){return false;}return false;}return true;}});}function createColumnarLists(){$("ul.columnar li:odd").addClass("column1");$("ul.columnar li:even").addClass("column2");$.each($("ul.columnar li"),function(){if($(this).text()==""){$(this).addClass("none");}});$("ul.columnar + *").addClass("end");}function getNavDesc(){var strCurrentNavDesc;strCurrentNavDesc=$("ul#nav_primary a.hotstate").attr("title");$("div#nav_description").text(strCurrentNavDesc);}function createCaptions(){var titleimages=$("div#content img[title]");var titleimage;var theTitle;for(var i=0;i<titleimages.length;i++){titleimage=titleimages[i];$(titleimage).wrap("<div class='photo'></div>");$(titleimage).after("<span class='caption'></span>");theTitle=$(titleimage).attr("title");$(titleimage).next("span").text(theTitle);$(titleimage).attr("title","");}}function adjustNavigation(){var totalWidth=$("div#main").width();$("ul#nav_primary").css("display","inline");var navWidth=$("ul#nav_primary").width();var navNumber=$("ul#nav_primary li").length;var baseSearchWidth=$("div#search").width();var searchPaddingLeft=$("div#search").css("padding-left");var searchPaddingRight=$("div#search").css("padding-right");var buttonWidth=$("div#search .submit, div#search .sf_searchSubmit").width();var buttonWhitespace=37;var searchPadding=parseFloat(searchPaddingLeft,10)+parseFloat(searchPaddingRight,10);var maxNavWidth=totalWidth-baseSearchWidth;var maxNavImageWidths=maxNavWidth-navNumber;if($("div#search").css("position")=="absolute"||$("div#search").css("display")=="none"){return false;}if(navWidth>maxNavWidth){var theQS=window.location.search.substring(1);if(theQS.indexOf("cmspagemode")!=-1){alert("The navigation images used are too large. Please reduce the total width to "+maxNavImageWidths+" pixels or less.");}return false;}var searchWidth=totalWidth-navWidth-searchPadding;var inputWidth=searchWidth-buttonWidth-buttonWhitespace;if(navWidth>0&&navWidth!=""&&navWidth!=null){$("div#search").width(searchWidth);$("div#search input, div#search .sf_searchText").width(inputWidth);}}function adjustPromos(){var theQS=window.location.search.substring(1);if(theQS.indexOf("cmspagemode")==-1&&$(".promo .shelf").length>=1){var objPromo1=$("div#promo-1 .body");var objPromo2=$("div#promo-2 .body");var objPromo3=$("div#promo-3 .body");var objPromo4=$("div#promo-4 .body");var height1=objPromo1.height();var height2=objPromo2.height();var height3=objPromo3.height();var height4=objPromo4.height();var tallest;if(height1>height2){tallest=height1;}else{tallest=height2;}tallest=tallest+"px";objPromo1.css("height",tallest);objPromo2.css("height",tallest);if(height3>height4){tallest=height3;}else{tallest=height4;}tallest=tallest+"px";objPromo3.css("height",tallest);objPromo4.css("height",tallest);if($("div#promo-4 h1 span").text().length==0){$("div#promo-4").addClass("empty");$("div#promo-3").addClass("full-width");}}}function initModularFeatures(){var objParent=$("#features_modular");var theQS=window.location.search.substring(1);if(theQS.indexOf("cmspagemode")==-1&&objParent.length==1){var strTheme=objParent.attr("class");objParent.addClass("active2");$(".feature_modular:odd").addClass("odd");$(".feature_modular.odd").after("<div class='end'></div>");switch(strTheme){case"grid_2x2_50":var intFeature=0;var objFeatureContent=new Array();var aryFeatureHeight=new Array();var intTallest;$.each($("div.feature_modular"),function(){intFeature++;objFeatureContent[intFeature]=$(this).find("div.content");if($(this).children("div.rotate").length>0){var intTallestRotate=0;var intTempHeight;var intRotateCount=0;var strCountClass;$.each($("div.rotate"),function(){intRotateCount++;strCountId="rotate-"+intRotateCount;$(this).attr("id",strCountId);intTempHeight=$(this).children("div.content").height();if(intTempHeight>intTallestRotate){intTallestRotate=intTempHeight;}});aryFeatureHeight[intFeature]=intTallestRotate;}else{aryFeatureHeight[intFeature]=objFeatureContent[intFeature].height();}if(intFeature%2==false){if(aryFeatureHeight[intFeature-1]>aryFeatureHeight[intFeature]){intTallest=aryFeatureHeight[intFeature-1];}else{intTallest=aryFeatureHeight[intFeature];}objFeatureContent[intFeature-1].height(intTallest);objFeatureContent[intFeature].height(intTallest);}});objParent.append("<div class='end'></div>");function contentRotator(content){content.fadeOut("fast",function(content){return function(){$("div.rotate").fadeOut("fast");content.fadeIn("fast",function(){if($(this).attr("id")==$("div.rotate:last").attr("id")){setTimeout(function(){contentRotator($("div.rotate:first"));},6000);}else{setTimeout(function(){contentRotator($(content.next()));},6000);}});};}(content));}contentRotator($("div.rotate:first"));break;default:}}}function addClasses(){$("a[href^=http://],a[href^=https://],a[target=_blank]").addClass("off-site");$("a[href$=.pdf],a[href$=.jpg],a[href$=.gif],a[href$=.png],a[href$=.sflb],a[href$=doc],a[href$=docx],a[href$=xls],a[href$=xlsx],a[href$=txt]").addClass("non-html");$("a[href$=.jpg],a[href$=.gif],a[href$=.png]").addClass("image");$("a[href$=.avi],a[href$=.wma],a[href$=.mov],a[href$=.f4v]").addClass("video");$("a[href$=pdf]").addClass("pdf");$("a[href$=doc],a[href$=docx]").addClass("ms-word");$("a[href$=xls],a[href$=xlsx]").addClass("ms-excel");$("a[href$=txt]").addClass("text");var currentDomain=window.location.host;currentDomain=currentDomain.toLowerCase();var currentDomainSelector="a[href*="+currentDomain+"]";var additionalDomainSelectors;switch(currentDomain){case"test.columbiagasohio.nisource.net":case"www.columbiagasohio.com":additionalDomainSelectors=", a[href*=help.columbiagasohio.com]";break;case"test.columbiagasmd.nisource.net":case"www.columbiagasmd.com":additionalDomainSelectors=", a[href*=help.columbiagasmd.com]";break;case"test.columbiagasky.nisource.net":case"www.columbiagasky.com":additionalDomainSelectors=", a[href*=help.columbiagasky.com]";break;case"test.columbiagasva.nisource.net":case"www.columbiagasva.com":additionalDomainSelectors=", a[href*=help.columbiagasva.com]";break;case"test.columbiagasma.nisource.net":case"www.columbiagasma.com":additionalDomainSelectors=", a[href*=help.columbiagasma.com]";break;case"test.columbiagaspa.nisource.net":case"www.columbiagaspa.com":additionalDomainSelectors=", a[href*=help.columbiagaspa.com]";break;case"test.nipsco.nisource.net":case"www.nipsco.com":additionalDomainSelectors=", a[href*=help.nipsco.com]";break;case"www.nisource.com":case"nisource.com":case"test.nisource.nisource.net":additionalDomainSelectors=", a[href*=ir.nisource.com]";break;default:additionalDomainSelectors="";}currentDomainSelector=currentDomainSelector+additionalDomainSelectors;$(currentDomainSelector).removeClass("off-site");}function initVideos(){var intCount=1;var strId;var strOverlay;$.each($("a.video"),function(){$(this).addClass("player");$(this).not(".generic").addClass("streaming");strId="video"+intCount;intCount++;strContent=$(this).html();$(this).html("Loading video...");strTrigger="<span class='video' rel='#"+strId+"'>"+strContent+"</span>";$(this).before(strTrigger);strOverlay="<span class='video_overlay' id='"+strId+"'></span>";$(this).wrap(strOverlay);});}function initOverlays(){$(".simple_overlay, .apple_overlay").css("display","none");$("span.video[rel]").overlay({effect:'apple',mask:'gray',onLoad:function(content){this.getOverlay().find("a.player").flowplayer(0).load();},onClose:function(content){$f().unload();}});$(".overlay_trigger[rel]").overlay({mask:"gray",fixed:"true"});var triggers=$(".modalInput").overlay({mask:{color:"#ebecff",loadSpeed:200,opacity:0.9},closeOnClick:false});var buttons=$("#yesno button").click(function(e){var yes=buttons.index(this)===0;triggers.eq(0).html("You clicked "+(yes?"yes":"no"));});$("#prompt form").submit(function(e){triggers.eq(1).overlay().close();var input=$("input",this).val();triggers.eq(1).html(input);return e.preventDefault();});$("div#main").addClass("close");$("a.CommunityOverlay[rel]").overlay({mask:'gray',effect:'apple',onBeforeLoad:function(){var wrap=this.getOverlay().find(".contentWrap");wrap.load(this.getTrigger().attr("href"));$('#main').css("position","static");$('.aside').css("position","static");},onLoad:function(){$('#content .callout').css("position","static");},onClose:function(){$('#content .callout').css("position","relative");}});}function initFlowplayer(){var strLicenceKey;var strDomain=window.location.host;strDomain=strDomain.toLowerCase();strDomain=strDomain.replace("www.","");switch(strDomain){case"baystategas.com":case"columbiagasma.com":strLicenceKey="#@fe540f70fc36f289ee5";break;case"columbiagas.com":strLicenceKey="#@0ab6a1979d162ab0e8a";break;case"columbiagasky.com":strLicenceKey="#@b980a68e00e4ecf3e9d";break;case"columbiagasohio.com":strLicenceKey="#@b1e39903d0a929781ad";break;case"columbiagaspa.com":strLicenceKey="#@ac5b80cf290ac4bbbf9";break;case"columbiagasva.com":strLicenceKey="#@e13065a3eafd4b4f031";break;case"ngtsvideo.com":strLicenceKey="#@2783d4293de4fde44cc";break;case"nipsco.com":strLicenceKey="#@3206144881cbaa0bef2";break;case"nisource.com":strLicenceKey="#@3206144881cbaa0bef2";break;case"nisource.jobs":strLicenceKey="#@20952b33eb565ca5b4f";break;case"careers.nisource.com":strLicenceKey="#@5d334257de4f0847925";break;case"nisource.net":strLicenceKey="#@1fa1400cecf6846f59d";break;case"columbiagasmd.com":strLicenceKey="#@8930baacdc7fa6f425d";break;case"ngts.com":strLicenceKey="#@d933620fd883fb544c7";break;default:strLicenceKey="";}$("a.player.generic").flowplayer("http://www.columbiagas.com/flash/flowplayer.commercial-3.2.3.swf",{key:strLicenceKey,canvas:{backgroundGradient:'none',backgroundColor:'#000000'},clip:{scaling:"fit"}});$("a.player.streaming").flowplayer("http://www.columbiagas.com/flash/flowplayer.commercial-3.2.3.swf",{key:strLicenceKey,plugins:{rtmp:{url:"http://www.columbiagas.com/flash/flowplayer.rtmp-3.2.2.swf",netConnectionUrl:'rtmp://s3sslqsx1uc6h1.cloudfront.net/cfx/st'}},canvas:{backgroundGradient:'none',backgroundColor:'#000000'},clip:{provider:"rtmp",scaling:"fit"}});}function initTabs(){$("div.panes > div").css("display","none");var strTabLink;var blnHistory;var intPreSelectedTab;if($("ul.tabs").length>1){intPreSelectedTab=0;blnHistory=false;}else{blnHistory=true;var strPreSelectedTab=location.hash;if(strPreSelectedTab=="#"){strPreSelectedTab=""}strTabLink=$(this).find("a").attr("href");$.each($("ul.tabs a"),function(){if(strTabLink==strPreSelectedTab){intPreSelectedTab=$(this).index();}});}$("ul.tabs").tabs("> div.pane",{initialIndex:intPreSelectedTab,history:blnHistory});}function clearMePrevious(){var clearMePrevious='';$.each($('.clearMeFocus'),function(){$(this).attr('title',$(this).val());$(this).addClass("inactive");});$('.clearMeFocus').focus(function(){if($(this).val()==$(this).attr('title')){clearMePrevious=$(this).val();$(this).val('');}$(this).removeClass("inactive");});$('.clearMeFocus').blur(function(){if($(this).val()==''){$(this).val(clearMePrevious);$(this).addClass("inactive");}});}function checkForCmsMode(){var theQS=window.location.search.substring(1);if(theQS.indexOf("cmspagemode")!=-1){$("head").append("<link rel='stylesheet' type='text/css' media='all' href='http://www.columbiagas.com/css/cms.css' />");}}function calculateCost(){var intOtherAnnualUsage=0;var intOtherAnnualCost=0;var intGasAnnualUsage=0;var intGasAnnualCost=0;var intProjectedSavings=0;var strOilType;$("td.input input").val("");$("td.input input").bind("keyup",function(){if($(this).val()=="."){$(this).val("0.");}intOtherAnnualUsage=$("td.input input:visible:eq(0)").val();intOtherAnnualPer=$("td.input input:visible:eq(1)").val();intOtherAnnualCost=intOtherAnnualUsage*intOtherAnnualPer;intOtherAnnualCost=intOtherAnnualCost.toFixed(2);intGasAnnualUsage=intOtherAnnualUsage;intGasAnnualPer=parseFloat($("td.gas-cost:visible span.output:visible").html());intGasAnnualCost=intGasAnnualUsage*intGasAnnualPer;intGasAnnualCost=intGasAnnualCost.toFixed(2);intProjectedSavings=intOtherAnnualCost-intGasAnnualCost;intProjectedSavings=intProjectedSavings.toFixed(2);intReplacementCost=$("td.input input:visible:eq(2)").val();intPayback=intReplacementCost/intProjectedSavings;intPayback=intPayback.toFixed(1);if(isNaN(intOtherAnnualUsage)||isNaN(intOtherAnnualPer)||isNaN(intReplacementCost)){alert("Please enter numeric values only.");$(this).val("");}else{$("td.other-annual-cost:visible span.output").html(intOtherAnnualCost);}if(!isNaN(intGasAnnualUsage)){$("td.gas-usage:visible span.output").html(intGasAnnualUsage);}$("td.gas-annual-cost:visible span.output").html(intGasAnnualCost);if(!isNaN(intProjectedSavings)){$("span.projected-savings:visible").html("$"+intProjectedSavings);}if(intReplacementCost>0){$("td.payback:visible span.output").html(intPayback);}});}$(document).ready(function(){$(".req-js").removeClass();addClasses();checkForCmsMode();getNavDesc();getNewWindowLinks();createCaptions();initVideos();initOverlays();initFlowplayer();initTabs();clearMePrevious();if(!$("table").is(".tableExcludeAltStyle")){$("tr:odd").addClass("alt");}$("input.first").focus();$("div#footer li:first-child").addClass("first");});$(window).load(function(){adjustNavigation();adjustPromos();initModularFeatures();});
