// ************************************ // AdminWEB Functions // ************************************ function fnStandardWindowOpen(u, w, h) { var windowWidth = w; var windowHeight = h; if (document.all) { var xOffset = (screen.width / 2) - (windowWidth / 2); var yOffset = (screen.height / 2) - (windowHeight / 2); } else if (document.layers) { var xOffset = (window.outerWidth / 2) - (windowWidth / 2); var yOffset = (window.outerHeight / 2) - (windowHeight / 2); } var thiswindow = window.open(u,'windowname','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+windowWidth+',height='+windowHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); thiswindow.focus(); return false; } function fnSelectEditPage() { var page; page = document.AdminWEBMain.SelectEditPage.options[document.AdminWEBMain.SelectEditPage.selectedIndex].text; if (page == "-- select page --") { alert("Please select a page for content edit!"); } else { document.AdminWEBMain.SelectedPage.value = page; document.all.EditorIframe.src = "ContentEditor.aspx?Mode=get&Page=" + page; } } function fnSaveEditPage() { var page; page = parent.document.all.AdminWEBMain.SelectedPage.value; document.ContentEditor.action = "ContentEditor.aspx?Mode=save&Page=" + page; document.ContentEditor.submit(); } function fnConfirmAction(mode) { var message; switch(mode) { case "delete": message = "Are you sure you sure you want to delete this item?"; break; case "edit": message = "Are you sure you want to edit this item?"; break; case "savetrooper": message = "Are you sure you want to save your trooper data?"; break; case "canceledit": message = "Are you sure you want to cancel this edit?"; break; case "savetrooper_roster": message = "Are you sure you want to save this trooper data?\n\nTroop Majors and Admin:\nThis will save the data for the Trooper listed in the Roster Selector (next to YOU ARE CURRENTLY EDITING). If NO RECORD SELECTED appears there, you will be saving your own data."; break; case "canceledit_roster": message = "Are you sure you want to cancel this edit?\n\nTroop Majors and Admin:\nThis will reset the currently selected data to your own."; break; } if(confirm(message)) {} else { return false; } } function fnConfirmMessage(message) { if(confirm(message)) {} else { return false; } } var RosterStatus = ""; function fnDisplayRosterDetail(id) { if (RosterStatus != "") { if (RosterStatus != id) { document.getElementById('RosterDetail_' + RosterStatus).style.display="none"; document.getElementById('IMG_RosterDetail_' + RosterStatus).src="images/TreeImages/plus.gif"; } } if (document.getElementById('RosterDetail_' + id).style.display == "block") { document.getElementById('RosterDetail_' + id).style.display="none"; document.getElementById('IMG_RosterDetail_' + id).src="images/TreeImages/plus.gif"; } else { document.getElementById('RosterDetail_' + id).style.display="block"; document.getElementById('IMG_RosterDetail_' + id).src="images/TreeImages/minus.gif"; } RosterStatus = id; } function fnUploadAlert() { // using 4 since a letter + minimum path, or UNC would need at least 4 (probably 6-7) // for a valid path/filename if (document.ContentEditor.filUpload.value.length < 4) { alert("Please select a file for upload."); return false; } } // ************************************ // Global Site Functions // ************************************ function fnModalPopup(filename) { var strReturn = window.showModalDialog('ModalDialog.aspx',null,'status:no;dialogWidth:385px;dialogHeight:150px;dialogHide:true;help:no;scroll:no'); if (strReturn == null) { alert("ERROR - No return value!"); } else { window.location.href = "ModalPopup.aspx?mode=" + strReturn + "&filename=" + filename; } } function fnOpenCalendar(objname) { window.open('../System/CalendarPopup.aspx?textbox=TextBox' + objname,'cal','width=250,height=225,left=270,top=180'); } function fnOpenHelpWindow(helpcode) { var windowWidth = 410; var windowHeight = 300; if (document.all) { var xOffset = (screen.width / 2) - (windowWidth / 2); var yOffset = (screen.height / 2) - (windowHeight / 2); } else if (document.layers) { var xOffset = (window.outerWidth / 2) - (windowWidth / 2); var yOffset = (window.outerHeight / 2) - (windowHeight / 2); } window.open("../system/Help.aspx?helpcode=" + helpcode,"helpwindow",'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+windowWidth+',height='+windowHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); } function fnOpenMessageWindow(s) { var windowWidth = 565; var windowHeight = 275; if (document.all) { var xOffset = (screen.width / 2) - (windowWidth / 2); var yOffset = (screen.height / 2) - (windowHeight / 2); } else if (document.layers) { var xOffset = (window.outerWidth / 2) - (windowWidth / 2); var yOffset = (window.outerHeight / 2) - (windowHeight / 2); } window.open("ApplyOnlineMessage.aspx?s=" + s,"messagewindow",'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+windowWidth+',height='+windowHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); } function fnOpenMessageReplyWindow(id) { var windowWidth = 565; var windowHeight = 275; if (document.all) { var xOffset = (screen.width / 2) - (windowWidth / 2); var yOffset = (screen.height / 2) - (windowHeight / 2); } else if (document.layers) { var xOffset = (window.outerWidth / 2) - (windowWidth / 2); var yOffset = (window.outerHeight / 2) - (windowHeight / 2); } window.open("ApplyOnlineMessage.aspx?reply=" + id,"messagewindow",'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+windowWidth+',height='+windowHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); } function fnSetCheck(o) { var sImage = document.formCheckAddItems.elements[o.name].src; if (sImage == "../graphics/checkmark_on.gif") { document.formCheckAddItems.elements[o.name].src = "../graphics/checkmark_off.gif"; setCookie(document.formCheckAddItems.elements[o.name].name,"off"); } else { document.formCheckAddItems.elements[o.name].src= "../graphics/checkmark_on.gif"; setCookie(document.formCheckAddItems.elements[o.name].name,"on"); } } function fnConfirmRedirect(mode, id, returnpage, returnquerystring) { var message; // Set the confirm dialog text switch(mode) { case "togglepm": message = "Are you sure you want to change the status of this message? (You can change it back if needed)."; break; case "editdoc": message = "Are you sure you want to edit the selected document?"; break; case "editfol": message = "Are you sure you want to edit the selected folder?"; break; } if (confirm(message)) { window.location = returnpage + ".aspx?mode=" + mode + "&id=" + id + "&returnquerystring=" + escape(returnquerystring); } } function fnConfirmDelete(id, returnpage, returnquerystring) { if (confirm("Are you sure you want to DELETE this item?")) { window.location = returnpage + ".aspx?mode=del&id=" + id + "&returnquerystring=" + escape(returnquerystring); } } function fnWatchFlag(mode, id, returnpage, returnquerystring) { var message; if (mode == "docadd") { message = "Flag item to be watched for changes and updates?"; } else if (mode == "docrem") { message = "Remove item from Document Watch?"; } if (confirm(message)) { window.location = returnpage + ".aspx?mode=" + mode + "&id=" + id + "&returnquerystring=" + escape(returnquerystring); } } function fnGetMedia(id) { window.open("../news/MediaHandler.aspx?id=" + id,"mediawindow",'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=720,height=600'); } function fnGetContentObject(id) { window.open("MediaHandler.aspx?id=" + id,"mediawindow",'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=720,height=540'); return false; } function fnExpandNewsItem(id) { if (document.all) { if (eval('document.all.NewsHeader_' + id + '.innerHTML') == "[ - ]") { eval('document.all.NewsItem_' + id + '.style.display="none"'); eval('document.all.NewsHeader_' + id + '.innerHTML="[ + ]"'); } else { eval('document.all.NewsItem_' + id + '.style.display="block"'); eval('document.all.NewsHeader_' + id + '.innerHTML="[ - ]"'); } } else if (document.layers) { alert("NETSCAPE BROWSER"); } } function fnOpenAll() { alert("open all"); } function fnCloseAll() { alert("close all"); } function fnToggleFolder(id) { if (eval('document.all.Folder_' + id + '.style.display') == "block") { eval('document.all.Folder_' + id + '.style.display = "none"'); eval('document.all.Tab_' + id + '.innerHTML = " [...closed...]"'); } else { eval('document.all.Folder_' + id + '.style.display = "block"'); eval('document.all.Tab_' + id + '.innerHTML = ""'); } } function fnExpandFolder(id) { if (document.all) { if (eval('document.all.FolderHeader_' + id + '.innerHTML') == "[ - ]") { eval('document.all.FolderItem_' + id + '.style.display="none"'); eval('document.all.FolderHeader_' + id + '.innerHTML="[ + ]"'); } else { eval('document.all.FolderItem_' + id + '.style.display="block"'); eval('document.all.FolderHeader_' + id + '.innerHTML="[ - ]"'); } } else if (document.layers) { alert("NETSCAPE BROWSER"); } } function fnGetDocument(doc) { var windowWidth = 300; var windowHeight = 100; if (document.all) { var xOffset = (screen.width / 2) - (windowWidth / 2); var yOffset = (screen.height / 2) - (windowHeight / 2); } else if (document.layers) { var xOffset = (window.outerWidth / 2) - (windowWidth / 2); var yOffset = (window.outerHeight / 2) - (windowHeight / 2); } window.open("DownloadHandler.aspx?mode=get&id=" + doc,"downloadwindow",'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+windowWidth+',height='+windowHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); } function fnListMover() { //alert(document.getElementById('TrooperDocuments').selecteditem.value); //var selected = document.TrooperDocuments.ListBoxTrooper.options[document.TrooperDocuments.ListBoxTrooper.selectedIndex].value; //document.TrooperDocuments.ListBoxUsers.options[document.TrooperDocuments.ListBoxUsers.selectedIndex].value); } function fnToggleBG(o, b, c) { o.style.color = c; o.style.background = b; } function fnRefreshParentWindow() { parent.location.reload(); } // ************************************ //*************************************** //Query string handler //*************************************** QueryString.keys = new Array(); QueryString.values = new Array(); QueryString_Parse(); function QueryString(key) { var value = null; for (var i=0;i= 0) { var argname = pairs[i].substring(0,pos); var value = pairs[i].substring(pos+1); QueryString.keys[QueryString.keys.length] = argname; QueryString.values[QueryString.values.length] = value; } } } //*************************************** // name - name of the cookie // value - value of the cookie // [expires] - expiration date of the cookie (defaults to end of current session) // [path] - path for which the cookie is valid (defaults to path of calling document) // [domain] - domain for which the cookie is valid (defaults to domain of calling document) // [secure] - Boolean value indicating if the cookie transmission requires a secure transmission // * an argument defaults when it is assigned null as a placeholder // * a null placeholder is not required for trailing omitted arguments function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie; } // name - name of the desired cookie // * return string containing value of specified cookie or null if cookie does not exist function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else begin += 2; var end = document.cookie.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin + prefix.length, end)); } // name - name of the cookie // [path] - path of the cookie (must be same as path used to create cookie) // [domain] - domain of the cookie (must be same as domain used to create cookie) // * path and domain default if assigned null or omitted if no explicit argument proceeds function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // date - any instance of the Date object // * hand all instances of the Date object to this function for "repairs" function fixDate(date) { var base = new Date(0); var skew = base.getTime(); if (skew > 0) date.setTime(date.getTime() - skew); } var i_pre = "/"; var i_over = "/images/header/roll/section.jpg"; var i_out = "/images/header/section.jpg"; home_over = new Image(); home_over.src = i_pre + "home" + i_over; home_out = new Image(); home_out.src = i_pre + "home" + i_out; info_over = new Image(); info_over.src = i_pre + "info" + i_over; info_out = new Image(); info_out.src = i_pre + "info" + i_out; join_over = new Image(); join_over.src = i_pre + "join" + i_over; join_out = new Image(); join_out.src = i_pre + "join" + i_out; find_over = new Image(); find_over.src = i_pre + "find" + i_over; find_out = new Image(); find_out.src = i_pre + "find" + i_out; news_over = new Image(); news_over.src = i_pre + "news" + i_over; news_out = new Image(); news_out.src = i_pre + "news" + i_out; troopers_over = new Image(); troopers_over.src = i_pre + "troopers" + i_over; troopers_out = new Image(); troopers_out.src = i_pre + "troopers" + i_out; function fnHeaderRollOut() { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('msie') != -1) { var iTrim = i_pre.length; var section = document.location.pathname; section = section.substring(iTrim, section.length) section = section.substring(0, section.indexOf("/")); section = section.toLowerCase(); document.all.ImageSectionHeader.src = eval(section + "_out.src"); } } function fnHeaderRollOver(section) { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('msie') != -1) { section = section.toLowerCase(); document.all.ImageSectionHeader.src = eval(section + "_over.src"); } } function fnOpenTrooperWindow() { var trooperwindow = window.open('https://www.i-trooper.com/system/TLogin.aspx','thistrooperwindow','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=880,height=660,left=270,top=180'); } function CreateMenu(iFromTop) { //Menu object creation oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname oCMenu.frames = 0 //Menu properties oCMenu.pxBetween=0 oCMenu.fromLeft=5 oCMenu.fromTop=iFromTop oCMenu.rows=1 oCMenu.menuPlacement="center" oCMenu.offlineRoot="" oCMenu.onlineRoot="" oCMenu.resizeCheck=1 oCMenu.wait=1000 oCMenu.fillImg="cm_fill.gif" oCMenu.zIndex=2000 //Background bar properties oCMenu.useBar=1 oCMenu.barWidth="100%" oCMenu.barHeight=21 oCMenu.barClass="clBar" oCMenu.barX=0 oCMenu.barY=iFromTop oCMenu.barBorderX=0 oCMenu.barBorderY=0 oCMenu.barBorderClass="" //Level properties - ALL properties have to be specified in level 0 oCMenu.level[0]=new cm_makeLevel() //Add this for each new level oCMenu.level[0].width=130 oCMenu.level[0].height=18 oCMenu.level[0].regClass="clLevel0" oCMenu.level[0].overClass="clLevel0over" oCMenu.level[0].borderX=1 oCMenu.level[0].borderY=1 oCMenu.level[0].borderClass="clLevel0border" oCMenu.level[0].offsetX=0 oCMenu.level[0].offsetY=0 oCMenu.level[0].rows=0 oCMenu.level[0].arrow=0 oCMenu.level[0].arrowWidth=0 oCMenu.level[0].arrowHeight=0 oCMenu.level[0].align="bottom" //EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number) oCMenu.level[1].width=175 oCMenu.level[1].height=22 oCMenu.level[1].regClass="clLevel1" oCMenu.level[1].overClass="clLevel1over" oCMenu.level[1].borderX=1 oCMenu.level[1].borderY=1 oCMenu.level[1].align="right" oCMenu.level[1].offsetX=-(oCMenu.level[0].width-2)/2+20 oCMenu.level[1].offsetY=0 oCMenu.level[1].borderClass="clLevel1border" oCMenu.level[1].arrow="../includes/images/menu_arrow_yellow.gif" oCMenu.level[1].arrowWidth=10 oCMenu.level[1].arrowHeight=10 //EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this oCMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number) oCMenu.level[2].width=150 oCMenu.level[2].height=20 oCMenu.level[2].offsetX=0 oCMenu.level[2].offsetY=0 oCMenu.level[2].regClass="clLevel2" oCMenu.level[2].overClass="clLevel2over" oCMenu.level[2].borderClass="clLevel2border" /****************************************** Menu item creation: myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) *************************************/ oCMenu.makeMenu('top0','',' Home','../home/Home.aspx','','','','','','','','','','','','fnHeaderRollOver("home")','fnHeaderRollOut()') oCMenu.makeMenu('top1','',' FHPA Information','','','','','','','','','','','','','fnHeaderRollOver("info")','fnHeaderRollOut()') oCMenu.makeMenu('sub11','top1','About the FHP Auxiliary','../info/About.aspx') oCMenu.makeMenu('sub12','top1','FAQs','../info/FAQs.aspx') oCMenu.makeMenu('sub13','top1','Training','../info/training.aspx') oCMenu.makeMenu('top2','',' Join the FHPA','','','','','','','','','','','','','fnHeaderRollOver("join")','fnHeaderRollOut()') oCMenu.makeMenu('sub21','top2','How to Join','../join/HowToJoin.aspx') oCMenu.makeMenu('sub22','top2','Application Request','../join/ContactMap.aspx?mode=recapp') oCMenu.makeMenu('sub23','top2','Apply Online','../join/ApplyOnline.aspx') oCMenu.makeMenu('top3','',' Find Your FHPA','','','','','','','','','','','','','fnHeaderRollOver("find")','fnHeaderRollOut()') oCMenu.makeMenu('sub31','top3','Locate by Map','') oCMenu.makeMenu('sub311','sub31','Station Locations by Map','../join/ContactMap.aspx?mode=statloc') oCMenu.makeMenu('sub312','sub31','Meeting Locations by Map','../join/ContactMap.aspx?mode=meetloc') oCMenu.makeMenu('sub32','top3','Show All Locations','') oCMenu.makeMenu('sub321','sub32','Station Locations Show All','../find/StationLocations.aspx') oCMenu.makeMenu('sub322','sub32','Meeting Locations Show All','../find/MeetingLocations.aspx') oCMenu.makeMenu('top4','',' News and Events','','','','','','','','','','','','','fnHeaderRollOver("news")','fnHeaderRollOut()') oCMenu.makeMenu('sub41','top4','Media Library','../news/MediaLibrary.aspx') oCMenu.makeMenu('sub42','top4','News','../news/News.aspx') oCMenu.makeMenu('sub43','top4','Calendar','../news/Calendar.aspx') oCMenu.makeMenu('sub44','top4','Events','../news/Events.aspx') oCMenu.makeMenu('top5','',' Trooper Access','','','','','','','','','','','','fnOpenTrooperWindow()','fnHeaderRollOver("news")','fnHeaderRollOut()') //Leave this line - it constructs the menu oCMenu.construct() }