var ASSET_PATH_HEADER = "/cms/assets/header/"; var ASSET_PATH_FOOTER= "/cms/assets/bottom_frame/"; var compWidth = 725; var singleClickCount = 0; var submitClickCount = 0; // Disable right-click. function checkCtrlIns(field) { if (event.ctrlKey==1 || event.keyCode==45) { return false } else { return true } } function browser() { if (event.button == 2) var message=""; if (navigator.appName == 'Microsoft Internet Explorer') { clickIE() } if (navigator.appName == 'Netscape') { clickNS } else { clickNS } function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") } // Begin Auto Tab var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input,len, e) { var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } // End Auto Tab--> function gn_rollover_preload(){ //preloads middle images for the navigation if (document.images){ var argLength = gn_rollover_preload.arguments.length; for (arg=0; arg < argLength; arg++){ eval(arguments[arg] + "_off = new Image()"); eval(arguments[arg] + "_on = new Image()"); eval(arguments[arg] + "_left = new Image()"); eval(arguments[arg] + "_right = new Image()"); eval(arguments[arg] + "_off.src = '" + ASSET_PATH_HEADER + "button_nav_"+ arguments[arg] + "_off.gif'"); eval(arguments[arg] + "_on.src = '" + ASSET_PATH_HEADER + "button_nav_"+ arguments[arg] + "_on.gif'"); eval(arguments[arg] + "_left.src = '" + ASSET_PATH_HEADER + "button_nav_"+ arguments[arg] + "_left.gif'"); eval(arguments[arg] + "_right.src = '" + ASSET_PATH_HEADER + "button_nav_"+ arguments[arg] + "_right.gif'"); } // Now Preload all "corner" images for faster swapping corner1 = new Image(); corner2 = new Image(); corner2_both = new Image(); corner3 = new Image(); corner3_both = new Image(); corner4 = new Image(); corner4_both = new Image(); corner5 = new Image(); corner1.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner_1.gif'"); corner2.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner_2.gif'"); corner2_both.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner2_both.gif'"); corner3.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner_1.gif'"); corner3_both.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner3_both.gif'"); corner4.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner_1.gif'"); corner4_both.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner4_both.gif'"); corner5.src = eval("'" + ASSET_PATH_HEADER + "button_nav_corner_2.gif'"); } } function isBothCorner(cornerName){ //determines whether a corner needs "both" colors or just one if (cornerName.indexOf("both")>=1) { return ("true"); } else { return ("false"); } } function gn_rollover(imageName, cornerLeft, cornerRight){ // must be used in conjuction with gn_rollover_preload() if (document.images){ document.images[imageName].src = eval(imageName + "_on.src"); if (isBothCorner(cornerLeft) == "false") { document.images[cornerLeft].src = eval(imageName + "_left.src"); } else { document.images[cornerLeft].src = eval(cornerLeft + ".src"); } if (isBothCorner(cornerRight) == "false") { document.images[cornerRight].src = eval(imageName + "_right.src"); } else { document.images[cornerRight].src = eval(cornerRight + ".src"); } } } function gn_restore(imageName, cornerLeft, cornerLeftType, cornerRight, cornerRightType){ // must be used in conjuction with gn_rollover_preload() if (document.images){ eval("document." + imageName + ".src=" + imageName + "_off.src"); if ((cornerLeftType == '1') || (cornerLeftType == '2')) { eval("document." + cornerLeft + ".src ='" + ASSET_PATH_HEADER + "button_nav_corner_" + cornerLeftType +".gif'"); } else { eval("document." + cornerLeft + ".src ='" + ASSET_PATH_HEADER + "button_nav_" + cornerLeftType +".gif'"); } if ((cornerRightType =='1') || (cornerRightType == '2')) { eval("document." + cornerRight + ".src ='" + ASSET_PATH_HEADER + "button_nav_corner_" + cornerRightType +".gif'"); } else { eval("document." + cornerRight + ".src ='" + ASSET_PATH_HEADER + "button_nav_" + cornerRightType +".gif'"); } } } function rollover_preload(){ if (document.images){ //var argLength = rollover_preload.arguments.length; eval(arguments[0]+" = new Image()"); eval(arguments[0]+".src='"+arguments[1]+"'"); eval(arguments[0]+"_off = new Image()"); eval(arguments[0]+"_off.src='"+arguments[1]+"'"); eval(arguments[0]+"_on = new Image()"); eval(arguments[0]+"_on.src='"+arguments[2]+"'"); } } function rollover(imageName){ if (document.images){ eval("document." + imageName + ".src=" + imageName + "_on.src"); } } function restore(imageName){ if (document.images){ eval("document." + imageName + ".src=" + imageName + "_off.src"); } } function submitForm(formName) { //submits the form given a formname eval("document."+formName+".submit()"); } function resetForm(formName) { //resets a form given a formName eval("document."+formName+".reset()"); } function externalWin(path,newWin) { //Creates a new window and centers it //constant definitions var POPUP_WIDTH = 640; var POPUP_HEIGHT = 480; var URL = path; var WINDOW_NAME = newWin; //the center properties var window_width = POPUP_WIDTH; var window_height = POPUP_HEIGHT; var screen_balance_w = ((screen.width)-(window_width))/2; var screen_balance_h = ((screen.height)-(window_height))/2; var set_top = screen_balance_h; var set_left = screen_balance_w; //window open functionality var win = window.open(URL,WINDOW_NAME,'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=' + window_width + ',height=' + window_height + ',top=' + set_top + ',left=' + set_left + ''); if ((document.window != null) && (!win.opener)) { win.opener = document.window; } //set focus to the window (commented out, since it appears to be causing a problem in WinNT IE4.0) // win.focus(); } function MM_swapImgRestore() { var i,x,a=document.MM_sr; for(i=0;a&&i< a.length&&(x=a[i])&&x.oSrc;i++){ x.src=x.oSrc; } } function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p){ d.MM_p=new Array(); } var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i< a.length; i++){ if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; } } } } function MM_findObj(n, d) { var p,i,x; if(!d){ d=document; } if((p=n.indexOf("?"))>0&&parent.frames.length){ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all){ x=d.all[n]; } for (i=0;!x&&i< d.forms.length;i++){ x=d.forms[i][n]; } for(i=0;!x&&d.layers&&i< d.layers.length;i++){ x=MM_findObj(n,d.layers[i].document); } return x; } function MM_swapImage() { var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3){ if ((x=MM_findObj(a[i]))!=null){ document.MM_sr[j++]=x; if(!x.oSrc){ x.oSrc=x.src; } x.src=a[i+2]; } } } function openWin(calendarName){ calendarPage = calendarName+".htm"; window.open(calendarPage, calendarName, "width=314, height=124, status=no, resizable=no"); } function closeWin(){ window.close(); } function popConversion() { window.open('/web/eenablement/manage/view_usage_info/conversion_chart.jsp','Nothing','width=600,height=500,toolbar=0,location=0,menubar=0,resizable=0,titlebar=0,directories=0,status=1,scrollbars=1'); } function popCancelCalendar() { window.open('/web/eenablement/manage/turn_off_service/popCalendar.jsp','Nothing','width=318,height=220,toolbar=0,location=0,menubar=0,resizable=0,titlebar=0,directories=0,status=1,scrollbars=1'); } function addHiddenField(formName, hValue) { eval("document."+formName+".action.value= '"+ hValue + "'"); submitForm(formName); } function submitFormAction (formName, formAction, submitForm, newURL){ // All form submitting functions have been consolidated into this function // Simply pass false as any parameter that is not needed // formName and formAction are REQUIRED! //add double click validation submitClickCount++; if(submitClickCount>1) { return false; } var myForm = (formName != null)?formName:'forms[0]'; var myAction = (formAction != null)?formAction:' '; var doSubmit = (submitForm == true)?true:false; var newPage = (newURL != null && newURL != false)?newURL:false; eval("window.document."+formName+".action.value = '"+formAction+"'"); if(doSubmit){ eval("window.document."+formName+".submit()"); } if(newPage){ document.location.href = ''+newURL; } } // function to submit the form on pressing the enter in textfield function enterFormAction(event,formName, formAction, submitForm, newURL) { NS4 = (document.layers) ? true : false; var code = 0; if (NS4) code = event.which; else code = event.keyCode; if (code==13) submitFormAction(formName, formAction, submitForm, newURL); } // function to submit the form only once // Used in input=image type forms , function being called in onClick submitHandler // Usage onClick = "return checkImageButtonSubmitAction();" function checkImageButtonSubmitAction() { singleClickCount++; if(singleClickCount>1) { return false; } else { return true; } } function order(formName,fieldName){ var orderValue = eval("document." + formName + "." + fieldName + ".value"); if (orderValue == "descending") { eval("document." + formName + "." + fieldName + ".value='ascending'"); } else { eval("document." + formName + "." +fieldName + ".value='descending'"); } } function submitSortingOrderForm (formName, sortByValue) { eval("document." + formName + ".sortBy.value = '" + sortByValue + "';"); eval("document." + formName + ".submit();"); } function popLamp(lamp,name,winName) { var newwin = window.open("", winName,'width=220,height=500,toolbar=0,location=0,menubar=0,resizable=0,titlebar=0,directories=0,status=0,scrollbars=0') newwin.document.open(); newwin.document.write('' + name + '
'); newwin.document.write(''); newwin.document.write('

'+name+'

'); newwin.document.close(); } function popNorthBuilder() { window.open('/web/eenablement/order/services_for_construction/north/pop_builder_north.jsp','Nothing','width=275,height=360,toolbar=0,location=0,menubar=0,resizable=0,titlebar=0,directories=0,status=0,scrollbars=0'); } function updateOrder(action, todo, company, itemIndex) { orderBuilderForm.action.value = action; orderBuilderForm.todo.value = todo; orderBuilderForm.company.value = company; orderBuilderForm.itemIndex.value = itemIndex; orderBuilderForm.submit(); } function flashCheck(){ var haveFlash= "yes"; var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4) { haveFlash= "yes"; } else { haveFlash= "no"; } } function openCalendar(x, activity, ldc) { url='/calendar.do?calHelper.field='+x+'&calHelper.activity='+activity+'&calHelper.ldc='+ldc+'&action=initial'; var win = window.open(url,'_blank','width=250,height=350,top=0,left=0'); win.focus(); return; } function openAchCalendar(x, activity, ldc, statementDueDate) { url='/calendar.do?calHelper.field='+x+'&calHelper.activity='+activity+'&calHelper.ldc='+ldc+'&calHelper.statementDueDate='+statementDueDate+'&action=initial'; var win = window.open(url,'_blank','width=250,height=350,top=0,left=0'); win.focus(); return; } function getTableHeight() { NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false; if(NS6) { //Netscape 6 logic document.writeln(''); } else if (navigator.appName=='Netscape') { // all other Netscape logic document.writeln('
'); } else { // all other browser logic (tested in IE) document.writeln('
'); } } function popup(url,name,toolbar,location,directories,status,menubar,scrollbars,resizable,width,height,top,left) { this[name] = window.open(url,name,"toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+",width="+width+",height="+height+",top="+top+",left="+left+""); window[name].focus(); } /*****************************************************************************/ function popup_a(url) { popup(url,'general','no','no','no','yes','no','no','no',390,276,0,0); } function popup_b(url) { popup(url,'general','no','no','no','yes','no','yes','yes',475,550,0,0); } function popup_c(url) { popup(url,'general','no','no','no','yes','no','yes','yes',800,400,0,0); } function popup_d(url) { popup(url,'general','no','no','no','yes','no','yes','yes',740,800,0,0); } function pastBills() { window.open('/viewPastBills.do', '_blank', 'height=700,innerHeight=700,width=805,innerWidth=805,left=0,top=0,scrollbars=yes,resizable=yes'); return; } function listPastLetters() { window.open('/viewLetterHistory.do', '_blank', 'height=700,innerHeight=700,width=805,innerWidth=805,left=0,top=0,scrollbars=yes,resizable=yes'); return; } /*****************************************************************************/ //toggle function for use with dynamic form display fields; To use, call the function onClick in the form object(s) and set the targetID and toggle, such as onClick="toggle('someName',this.checked); then add a corresponding id and default style to the field that you want to toggle such as, id="someName" style="display:none" function toggle( targetId, toggle) { target = document.getElementById( targetId ); if (toggle) { target.style.display = "inline"; } else { target.style.display = "none"; } } /*****************************************************************************/ //function for holding page state image rollovers function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i