-.shadetabs{
-padding: 3px 0;
-margin-left: 0;
-margin-top: 1px;
-margin-bottom: 0;
-font: bold 12px Verdana;
-list-style-type: none;
-text-align: left; /*set to left, center, or right to align the menu as desired*/
-}
-
-.shadetabs li{
-display: inline;
-margin: 0;
-}
-
-.shadetabs li a{
-text-decoration: none;
-padding: 3px 7px;
-margin-right: 3px;
-border: 1px solid #778;
-color: #2d2b2b;
-background: white url(shade.gif) top left repeat-x;
-}
-
-.shadetabs li a:visited{
-color: #2d2b2b;
-}
-
-.shadetabs li a:hover{
-text-decoration: underline;
-color: #2d2b2b;
-}
-
-.shadetabs li.selected{
-position: relative;
-top: 1px;
-}
-
-.shadetabs li.selected a{ /*selected main tab style */
-background-image: url(shadeactive.gif);
-border-bottom-color: white;
-}
-
-.shadetabs li.selected a:hover{ /*selected main tab style */
-text-decoration: none;
-}
-
-.tabcontentstyle{ /*style of tab content oontainer*/
-border: 1px solid gray;
-width: 90%;
-margin-bottom: 1em;
-padding: 10px;
-}
-
-.tabcontent{
-display:none;
-}
-
-@media print {
-.tabcontent {
-display:block!important;
-}
+/* ######### CSS for Shade Tabs. Remove if not using ######### */\r
+\r
+.shadetabs{\r
+padding: 3px 0;\r
+margin-left: 0;\r
+margin-top: 1px;\r
+margin-bottom: 0;\r
+font: bold 12px Verdana;\r
+list-style-type: none;\r
+text-align: left; /*set to left, center, or right to align the menu as desired*/\r
+}\r
+\r
+.shadetabs li{\r
+display: inline;\r
+margin: 0;\r
+}\r
+\r
+.shadetabs li a{\r
+text-decoration: none;\r
+position: relative;\r
+z-index: 1;\r
+padding: 3px 7px;\r
+margin-right: 3px;\r
+border: 1px solid #778;\r
+color: #2d2b2b;\r
+background: white url(../image/shade.gif) top left repeat-x;\r
+}\r
+\r
+.shadetabs li a:visited{\r
+color: #2d2b2b;\r
+}\r
+\r
+.shadetabs li a:hover{\r
+text-decoration: underline;\r
+color: #2d2b2b;\r
+}\r
+\r
+.shadetabs li a.selected{ /*selected main tab style */\r
+position: relative;\r
+top: 1px;\r
+}\r
+\r
+.shadetabs li a.selected{ /*selected main tab style */\r
+background-image: url(../image/shadeactive.gif);\r
+border-bottom-color: white;\r
+}\r
+\r
+.shadetabs li a.selected:hover{ /*selected main tab style */\r
+text-decoration: none;\r
+}\r
+\r
+.tabcontent{\r
+display:none;\r
+}\r
+\r
+@media print {\r
+.tabcontent {\r
+display:block !important;\r
+}\r
+}\r
+\r
+/* ######### CSS for Inverted Modern Bricks II Tabs. Remove if not using ######### */\r
+\r
+.modernbricksmenu2{\r
+padding: 0;\r
+width: 362px;\r
+border-top: 5px solid #D25A0B; /*Brown color theme*/ \r
+background: transparent;\r
+voice-family: "\"}\"";\r
+voice-family: inherit;\r
+}\r
+\r
+.modernbricksmenu2 ul{\r
+margin:0;\r
+margin-left: 10px; /*margin between first menu item and left browser edge*/\r
+padding: 0;\r
+list-style: none;\r
+}\r
+\r
+.modernbricksmenu2 li{\r
+display: inline;\r
+margin: 0 2px 0 0;\r
+padding: 0;\r
+text-transform:uppercase;\r
+}\r
+\r
+.modernbricksmenu2 a{\r
+float: left;\r
+display: block;\r
+font: bold 11px Arial;\r
+color: white;\r
+text-decoration: none;\r
+margin: 0 1px 0 0; /*Margin between each menu item*/\r
+padding: 5px 10px;\r
+background-color: black; /*Brown color theme*/ \r
+border-top: 1px solid white;\r
+}\r
+\r
+.modernbricksmenu2 a:hover{\r
+background-color: #D25A0B; /*Brown color theme*/ \r
+color: white;\r
+}\r
+\r
+.modernbricksmenu2 a.selected{ /*currently selected tab*/\r
+background-color: #D25A0B; /*Brown color theme*/ \r
+color: white;\r
+border-color: #D25A0B; /*Brown color theme*/ \r
+}\r
+\r
+.tabcontent{\r
+display:none;\r
+}\r
+\r
+@media print {\r
+.tabcontent {\r
+display:block !important;\r
+}\r
+}\r
+\r
+/* ######### CSS for Indented CSS Tabs. Remove if not using ######### */\r
+\r
+\r
+.indentmenu{\r
+font: bold 13px Arial;\r
+width: 100%; /*leave this value as is in most cases*/\r
+}\r
+\r
+.indentmenu ul{\r
+margin: 0;\r
+padding: 0;\r
+float: left;\r
+/* width: 80%; width of menu*/\r
+border-top: 1px solid navy; /*navy border*/\r
+background: black url(../image/indentbg.gif) center center repeat-x;\r
+}\r
+\r
+.indentmenu ul li{\r
+display: inline;\r
+}\r
+\r
+.indentmenu ul li a{\r
+float: left;\r
+color: white; /*text color*/\r
+padding: 5px 11px;\r
+text-decoration: none;\r
+border-right: 1px solid navy; /*navy divider between menu items*/\r
+}\r
+\r
+.indentmenu ul li a:visited{\r
+color: white;\r
+}\r
+\r
+.indentmenu ul li a.selected{\r
+color: white !important;\r
+padding-top: 6px; /*shift text down 1px*/\r
+padding-bottom: 4px;\r
+background: black url(../image/indentbg2.gif) center center repeat-x;\r
+}\r
+\r
+\r
+.tabcontentstyle{ /*style of tab content oontainer*/\r
+border: 1px solid gray;\r
+width: 95%;\r
+margin-bottom: 1em;\r
+padding: 10px;\r
+}\r
+\r
+.tabcontent{\r
+display:none;\r
+}\r
+\r
+@media print {\r
+.tabcontent {\r
+display:block !important;\r
+}\r
}
\ No newline at end of file
-//** Tab Content script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)\r
-//** Last updated: June 29th, 06\r
-\r
-var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered?\r
+//** Tab Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)\r
+//** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:\r
+// -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected\r
+// -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted\r
+// -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)\r
+// -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container\r
+//** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically\r
+//** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) \r
\r
////NO NEED TO EDIT BELOW////////////////////////\r
-var tabcontentIDs=new Object()\r
-\r
-function expandcontent(linkobj){\r
-var ulid=linkobj.parentNode.parentNode.id //id of UL element\r
-var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents\r
-for (var i=0; i<ullist.length; i++){\r
-ullist[i].className="" //deselect all tabs\r
-if (typeof tabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)\r
-document.getElementById(tabcontentIDs[ulid][i]).style.display="none" //hide all tab contents\r
-}\r
-linkobj.parentNode.className="selected" //highlight currently clicked on tab\r
-document.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab content\r
-saveselectedtabcontentid(ulid, linkobj.getAttribute("rel"))\r
-}\r
\r
-function savetabcontentids(ulid, relattribute){// save ids of tab content divs\r
-if (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yet\r
-tabcontentIDs[ulid]=new Array()\r
-tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute\r
+function ddtabcontent(tabinterfaceid){\r
+ this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container\r
+ this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container\r
+ this.enabletabpersistence=true\r
+ this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container\r
+ this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array\r
+ this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)\r
+ this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)\r
+ this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")\r
}\r
\r
-function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie\r
-if (enabletabpersistence==1) //if persistence feature turned on\r
-setCookie(ulid, selectedtabid)\r
+ddtabcontent.getCookie=function(Name){ \r
+ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair\r
+ if (document.cookie.match(re)) //if cookie found\r
+ return document.cookie.match(re)[0].split("=")[1] //return its value\r
+ return ""\r
}\r
\r
-function getullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab content\r
-var ullist=document.getElementById(ulid).getElementsByTagName("li")\r
-for (var i=0; i<ullist.length; i++){\r
-if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){\r
-return ullist[i].getElementsByTagName("a")[0]\r
-break\r
-}\r
-}\r
+ddtabcontent.setCookie=function(name, value){\r
+ document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)\r
}\r
\r
-function initializetabcontent(){\r
-for (var i=0; i<arguments.length; i++){ //loop through passed UL ids\r
-if (enabletabpersistence==0 && getCookie(arguments[i])!="") //clean up cookie if persist=off\r
-setCookie(arguments[i], "")\r
-var clickedontab=getCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if any\r
-var ulobj=document.getElementById(arguments[i])\r
-var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL\r
-for (var x=0; x<ulist.length; x++){ //loop through each LI element\r
-var ulistlink=ulist[x].getElementsByTagName("a")[0]\r
-if (ulistlink.getAttribute("rel")){\r
-savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runs\r
-ulistlink.onclick=function(){\r
-expandcontent(this)\r
-return false\r
-}\r
-if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by default\r
-expandcontent(ulistlink) //auto load currenly selected tab content\r
-}\r
-} //end inner for loop\r
-if (clickedontab!=""){ //if a tab has been previously clicked on per the cookie value\r
-var culistlink=getullistlinkbyId(arguments[i], clickedontab)\r
-if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute value\r
-expandcontent(culistlink) //auto load currenly selected tab content\r
-else //else if no match found between tabcontent id and rel attribute value (cookie mis-association)\r
-expandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead\r
-}\r
-} //end outer for loop\r
-}\r
+ddtabcontent.prototype={\r
\r
+ expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers\r
+ this.cancelautorun() //stop auto cycling of tabs (if running)\r
+ var tabref=""\r
+ try{\r
+ if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr\r
+ tabref=document.getElementById(tabid_or_position)\r
+ else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr\r
+ tabref=this.tabs[tabid_or_position]\r
+ }\r
+ catch(err){alert("Invalid Tab ID or position entered!")}\r
+ if (tabref!="") //if a valid tab is found based on function parameter\r
+ this.expandtab(tabref) //expand this tab\r
+ },\r
\r
-function getCookie(Name){ \r
-var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair\r
-if (document.cookie.match(re)) //if cookie found\r
-return document.cookie.match(re)[0].split("=")[1] //return its value\r
-return ""\r
-}\r
+ cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )\r
+ if (dir=="next"){\r
+ var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0\r
+ }\r
+ else if (dir=="prev"){\r
+ var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1\r
+ }\r
+ if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function\r
+ this.cancelautorun() //stop auto cycling of tabs (if running)\r
+ this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])\r
+ },\r
+\r
+ setpersist:function(bool){ //PUBLIC function to toggle persistence feature\r
+ this.enabletabpersistence=bool\r
+ },\r
+\r
+ setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")\r
+ this.selectedClassTarget=objstr || "link"\r
+ },\r
+\r
+ getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to\r
+ return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref\r
+ },\r
+\r
+ urlparamselect:function(tabinterfaceid){\r
+ var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL\r
+ return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index\r
+ },\r
+\r
+ expandtab:function(tabref){\r
+ var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand\r
+ //Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through\r
+ var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""\r
+ this.expandsubcontent(subcontentid)\r
+ this.expandrevcontent(associatedrevids)\r
+ for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"\r
+ this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""\r
+ }\r
+ if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers\r
+ ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)\r
+ this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array\r
+ },\r
+\r
+ expandsubcontent:function(subcontentid){\r
+ for (var i=0; i<this.subcontentids.length; i++){\r
+ var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)\r
+ subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value\r
+ }\r
+ },\r
+\r
+ expandrevcontent:function(associatedrevids){\r
+ var allrevids=this.revcontentids\r
+ for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface\r
+ //if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it\r
+ document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"\r
+ }\r
+ },\r
+\r
+ setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)\r
+ for (var i=0; i<this.hottabspositions.length; i++){\r
+ if (tabposition==this.hottabspositions[i]){\r
+ this.currentTabIndex=i\r
+ break\r
+ }\r
+ }\r
+ },\r
+\r
+ autorun:function(){ //function to auto cycle through and select tabs based on a set interval\r
+ this.cycleit('next', true)\r
+ },\r
+\r
+ cancelautorun:function(){\r
+ if (typeof this.autoruntimer!="undefined")\r
+ clearInterval(this.autoruntimer)\r
+ },\r
+\r
+ init:function(automodeperiod){\r
+ var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)\r
+ var selectedtab=-1 //Currently selected tab index (-1 meaning none)\r
+ var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index\r
+ this.automodeperiod=automodeperiod || 0\r
+ for (var i=0; i<this.tabs.length; i++){\r
+ this.tabs[i].tabposition=i //remember position of tab relative to its peers\r
+ if (this.tabs[i].getAttribute("rel")){\r
+ var tabinstance=this\r
+ this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers\r
+ this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)\r
+ this.tabs[i].onclick=function(){\r
+ tabinstance.expandtab(this)\r
+ tabinstance.cancelautorun() //stop auto cycling of tabs (if running)\r
+ return false\r
+ }\r
+ if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element\r
+ this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))\r
+ }\r
+ if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){\r
+ selectedtab=i //Selected tab index, if found\r
+ }\r
+ }\r
+ } //END for loop\r
+ if (selectedtab!=-1) //if a valid default selected tab index is found\r
+ this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)\r
+ else //if no valid default selected index found\r
+ this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr\r
+ if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){\r
+ this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)\r
+ }\r
+ } //END int() function\r
\r
-function setCookie(name, value){\r
-document.cookie = name+"="+value //cookie value is domain wide (path=/)\r
-}
\ No newline at end of file
+} //END Prototype assignment
\ No newline at end of file