//** AnyLink CSS Menu v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm
//** January 19', 2009: Script Creation date

var anylinkcssmenu={

menusmap: {},
effects: {delayhide: 200, shadow:{enabled:true, opacity:0.3, depth: [5, 5]}, fade:{enabled:true, duration:500}}, //customize menu effects

dimensions: {},

getoffset:function(what, offsettype){
	return (what.offsetParent)? what[offsettype]+this.getoffset(what.offsetParent, offsettype) : what[offsettype]
},

getoffsetof:function(el){
	el._offsets={left:this.getoffset(el, "offsetLeft"), top:this.getoffset(el, "offsetTop"), h: el.offsetHeight}
},

getdimensions:function(menu){
	this.dimensions={anchorw:menu.anchorobj.offsetWidth, anchorh:menu.anchorobj.offsetHeight,
		docwidth:(window.innerWidth ||this.standardbody.clientWidth)-20,
		docheight:(window.innerHeight ||this.standardbody.clientHeight)-15,
		docscrollx:window.pageXOffset || this.standardbody.scrollLeft,
		docscrolly:window.pageYOffset || this.standardbody.scrollTop
	}
	if (!this.dimensions.dropmenuw){
		this.dimensions.dropmenuw=menu.dropmenu.offsetWidth
		this.dimensions.dropmenuh=menu.dropmenu.offsetHeight
	}
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

setopacity:function(el, value){
	el.style.opacity=value
	if (typeof el.style.opacity!="string"){ //if it's not a string (ie: number instead), it means property not supported
		el.style.MozOpacity=value
		if (el.filters){
			el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+ value*100 +")"
		}
	}
},

showmenu:function(menuid){
	var menu=anylinkcssmenu.menusmap[menuid]
	clearTimeout(menu.hidetimer)
	this.getoffsetof(menu.anchorobj)
	this.getdimensions(menu)
	var posx=menu.anchorobj._offsets.left + (menu.orientation=="lr"? this.dimensions.anchorw : 0) //base x pos
	var posy=menu.anchorobj._offsets.top+this.dimensions.anchorh - (menu.orientation=="lr"? this.dimensions.anchorh : 0)//base y pos
	if (posx+this.dimensions.dropmenuw+this.effects.shadow.depth[0]>this.dimensions.docscrollx+this.dimensions.docwidth){ //drop left instead?
		posx=posx-this.dimensions.dropmenuw + (menu.orientation=="lr"? -this.dimensions.anchorw : this.dimensions.anchorw)
	}
	if (posy+this.dimensions.dropmenuh>this.dimensions.docscrolly+this.dimensions.docheight){  //drop up instead?
		posy=Math.max(posy-this.dimensions.dropmenuh - (menu.orientation=="lr"? -this.dimensions.anchorh : this.dimensions.anchorh), this.dimensions.docscrolly) //position above anchor or window's top edge
	}
	if (this.effects.fade.enabled){
		this.setopacity(menu.dropmenu, 0) //set opacity to 0 so menu appears hidden initially
		if (this.effects.shadow.enabled)
			this.setopacity(menu.shadow, 0) //set opacity to 0 so shadow appears hidden initially
	}
	menu.dropmenu.setcss({left:posx+'px', top:posy+'px', visibility:'visible'})
	if (this.effects.shadow.enabled)
		menu.shadow.setcss({left:posx+anylinkcssmenu.effects.shadow.depth[0]+'px', top:posy+anylinkcssmenu.effects.shadow.depth[1]+'px', visibility:'visible'})
	if (this.effects.fade.enabled){
		clearInterval(menu.animatetimer)
		menu.curanimatedegree=0
		menu.starttime=new Date().getTime() //get time just before animation is run
		menu.animatetimer=setInterval(function(){anylinkcssmenu.revealmenu(menuid)}, 20)
	}
},

revealmenu:function(menuid){
	var menu=anylinkcssmenu.menusmap[menuid]
	var elapsed=new Date().getTime()-menu.starttime //get time animation has run
	if (elapsed<this.effects.fade.duration){
		this.setopacity(menu.dropmenu, menu.curanimatedegree)
		if (this.effects.shadow.enabled)
			this.setopacity(menu.shadow, menu.curanimatedegree*this.effects.shadow.opacity)
	}
	else{
		clearInterval(menu.animatetimer)
		this.setopacity(menu.dropmenu, 1)
		menu.dropmenu.style.filter=""
	}
	menu.curanimatedegree=(1-Math.cos((elapsed/this.effects.fade.duration)*Math.PI)) / 2
},

setcss:function(param){
	for (prop in param){
		this.style[prop]=param[prop]
	}
},

hidemenu:function(menuid){
	var menu=anylinkcssmenu.menusmap[menuid]
	clearInterval(menu.animatetimer)
	menu.dropmenu.setcss({visibility:'hidden', left:0, top:0})
	menu.shadow.setcss({visibility:'hidden', left:0, top:0})
},

getElementsByClass:function(targetclass){
	if (document.querySelectorAll)
		return document.querySelectorAll("."+targetclass)
	else{
		var classnameRE=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "i") //regular expression to screen for classname
		var pieces=[]
		var alltags=document.all? document.all : document.getElementsByTagName("*")
		for (var i=0; i<alltags.length; i++){
			if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1)
				pieces[pieces.length]=alltags[i]
		}
		return pieces
	}
},

addEvent:function(targetarr, functionref, tasktype){
	if (targetarr.length>0){
		var target=targetarr.shift()
		if (target.addEventListener)
			target.addEventListener(tasktype, functionref, false)
		else if (target.attachEvent)
			target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)})
		this.addEvent(targetarr, functionref, tasktype)
	}
},

setupmenu:function(targetclass, anchorobj, pos){
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	var relattr=anchorobj.getAttribute("rel")
	var dropmenuid=relattr.replace(/\[(\w+)\]/, '')
	var menu=this.menusmap[targetclass+pos]={
		id: targetclass+pos,
		anchorobj: anchorobj,	
		dropmenu: document.getElementById(dropmenuid),
		revealtype: (relattr.length!=dropmenuid.length && RegExp.$1=="click")? "click" : "mouseover",
		orientation: anchorobj.getAttribute("rev")=="lr"? "lr" : "ud",
		shadow: document.createElement("div")
	}
	menu.anchorobj._internalID=targetclass+pos
	menu.anchorobj._isanchor=true
	menu.dropmenu._internalID=targetclass+pos
	menu.shadow._internalID=targetclass+pos
	menu.shadow.className="anylinkshadow"
	document.body.appendChild(menu.dropmenu) //move drop down div to end of page
	document.body.appendChild(menu.shadow)
	menu.dropmenu.setcss=this.setcss
	menu.shadow.setcss=this.setcss
	menu.shadow.setcss({width: menu.dropmenu.offsetWidth+"px", height:menu.dropmenu.offsetHeight+"px"})
	this.setopacity(menu.shadow, this.effects.shadow.opacity)
	this.addEvent([menu.anchorobj, menu.dropmenu, menu.shadow], function(e){ //MOUSEOVER event for anchor, dropmenu, shadow
		var menu=anylinkcssmenu.menusmap[this._internalID]
		if (this._isanchor && menu.revealtype=="mouseover" && !anylinkcssmenu.isContained(this, e)){ //event for anchor
			anylinkcssmenu.showmenu(menu.id)
		}
		else if (typeof this._isanchor=="undefined"){ //event for drop down menu and shadow
			clearTimeout(menu.hidetimer)
		}
	}, "mouseover")
	this.addEvent([menu.anchorobj, menu.dropmenu, menu.shadow], function(e){ //MOUSEOUT event for anchor, dropmenu, shadow
		if (!anylinkcssmenu.isContained(this, e)){
			var menu=anylinkcssmenu.menusmap[this._internalID]
			menu.hidetimer=setTimeout(function(){anylinkcssmenu.hidemenu(menu.id)}, anylinkcssmenu.effects.delayhide)
		}
	}, "mouseout")
	this.addEvent([menu.anchorobj, menu.dropmenu], function(e){ //CLICK event for anchor, dropmenu
		var menu=anylinkcssmenu.menusmap[this._internalID]
		if ( this._isanchor && menu.revealtype=="click"){
			if (menu.dropmenu.style.visibility=="visible")
				anylinkcssmenu.hidemenu(menu.id)
			else
				anylinkcssmenu.showmenu(menu.id)
			if (e.preventDefault)
				e.preventDefault()
			return false
		}
		else
			menu.hidetimer=setTimeout(function(){anylinkcssmenu.hidemenu(menu.id)}, anylinkcssmenu.effects.delayhide)
	}, "click")
},

init:function(targetclass){
	var anchors=this.getElementsByClass(targetclass)
	for (var i=0; i<anchors.length; i++){
		this.setupmenu(targetclass, anchors[i], i)
	}
}

}
function checkFields() {
   missinginfo ="__________________\n" + "Please Select State \n" + "__________________";
   alert(missinginfo);
   return true;
}
// ==========================
function Set_Cookie( name, value, expires, path, domain, secure ) {
  var today = new Date();
  today.setTime( today.getTime() );
  if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; }
  var expires_date = new Date( today.getTime() + (expires) );
  document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" );
}
// ==========================
function writeValueToField(FieldID,TheValue) {
   if (document.getElementById && document.getElementById(FieldID)) {
   	document.getElementById(FieldID).value = TheValue;
   } else if (document.all && document.all(FieldID)) {
        document.all(FieldID).value = TheValue;
   }
}
// ==========================
function textCounter(field, countfield, maxlimit) {
   if (field.value.length > maxlimit) { // if too long...trim it!
	alert('Text Limit is '+maxlimit+' characters!');
      	field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter
   } else {
	countfield.value = maxlimit - field.value.length;
   }
}
// ==========================
function ChangeFontSize(id, size) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).style.fontSize = size + "px";
   } else if (document.all && document.all(id)) {
       document.all(id).style.fontSize = size + "px";
   }
}
function ChangeFontColor(id, clmode) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).style.color = clmode;
   } else if (document.all && document.all(id)) {
       document.all(id).style.color = clmode;
   }
}
// ==========================
function ChangeBGColor(id, clmode) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).style.bgColor = clmode;
   } else if (document.all && document.all[id]) {
       document.all[id].style.bgColor = clmode;
   }
}
// ==========================
function ChangeObgClass(id, clmode) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).className = clmode;
   } else if (document.all && document.all[id]) {
       document.all[id].className = clmode;
   }
}
// ==========================
function showHTMLObg(id) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).style.display = 'block';
   } else if (document.all && document.all(id)) {
       document.all(id).style.display = 'block';
   }
} 
function hideHTMLObg(id) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).style.display = 'none';
   } else if (document.all && document.all(id)) {
       document.all(id).style.display = 'none';
   }
}
function EmptyFormObg(id) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).value = '';
   } else if (document.all && document.all(id)) {
       document.all(id).value = '';
   }
} 
function disableFormObg(id) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).disabled = true;
   } else if (document.all && document.all(id)) {
       document.all(id).disabled = true;
   }
}
function enableFormObg(id) {
   if (document.getElementById && document.getElementById(id)) {
       document.getElementById(id).disabled = false;
   } else if (document.all && document.all(id)) {
       document.all(id).disabled = false;
   }
}
function checkUncheckFormObg(id,mode) {
   if ( mode == 1 ) {
       if (document.getElementById && document.getElementById(id)) {
          document.getElementById(id).checked = true;
       } else if (document.all && document.all(id)) {
          document.all(id).checked = true;
       }
   } else {
       if (document.getElementById && document.getElementById(id)) {
          document.getElementById(id).checked = false;
       } else if (document.all && document.all(id)) {
          document.all(id).checked = false;
       }
   }
}
function enableEng(Fld) {
      var NoneChecked = false;
      if (document.getElementById) {
            NoneChecked = document.getElementById('messageTypeNone'+Fld).checked;
      } else if (document.all) {
            NoneChecked = document.all['messageTypeNone'+Fld].checked;
      }
      if ( NoneChecked == true ) {
         if (document.getElementById) {
             document.getElementById('messageTypeNone'+Fld).checked = false;
             document.getElementById('messageTypeBlock'+Fld).checked = false;
             document.getElementById('messageTypeScript'+Fld).checked = true;
         } else if (document.all) {
             document.all['messageTypeNone'+Fld].checked = false;
             document.all['messageTypeBlock'+Fld].checked = false;
             document.all['messageTypeScript'+Fld].checked = true;
         }
      }
}
// ==========================
function ReloadTextDivNew(MsgId) {
   if (document.getElementById) {
      var NewText = document.getElementById(MsgId).value;
      var DivElement1 = document.getElementById("TextDisplay1");
      var DivElement2 = document.getElementById("TextDisplay2");
   } else if (document.all) {
      var NewText = document.all[MsgId].value;
      var DivElement1 = document.all['TextDisplay1'];
      var DivElement2 = document.all['TextDisplay2'];
   } else {
      return;
   }
   // =========
   var NewTxtCh = NewText.replace(/\n/g, '');
   if ( NewTxtCh != '' ) {
      var NoneChecked = false;
      if (document.getElementById) {
            NoneChecked = document.getElementById('messageTypeNone').checked;
      } else if (document.all) {
            NoneChecked = document.all['messageTypeNone'].checked;
      }
      if ( NoneChecked == true ) {
         if (document.getElementById) {
	     document.getElementById('messageTypeNone').checked = false;
	     document.getElementById('messageTypeBlock').checked = false;
	     document.getElementById('messageTypeScript').checked = true;
	 } else if (document.all) {
	     document.all['messageTypeNone'].checked = false;
	     document.all['messageTypeBlock'].checked = false;
	     document.all['messageTypeScript'].checked = true;
	 }
         hideHTMLObg('TextDisplay1');
         showHTMLObg('TextDisplay2');
         hideHTMLObg('ChFont');
         showHTMLObg('ChFontS');
      }
   }
   // =========
   NewText = NewText.replace(/\n/g, '<br />');
   DivElement1.innerHTML = NewText;
   DivElement2.innerHTML = NewText;
}
function writeTxtToDiv(text,id)
{
	if (document.getElementById) {
		var x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	} else if (document.all) {
		x = document.all[id];
		x.innerHTML = text;
	}
	return;
}
// ==========================
function checkBrowser(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
        return this
}
bw=new checkBrowser()
function show(div,nest){
        obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
        obj.visibility='visible'
}
function popimage(title,imagesrc,width,height){
  var winleft = (screen.width - width) / 2;
  var wintop = (screen.height - height) / 2;
  var look='width='+width+',height='+height+',top='+wintop+', left='+winleft+',resizable,scrollbars';
  popwin=window.open("","",look)
  popwin.document.open()
  popwin.document.write('<html><head><title>'+title+'<\/title><\/head>\n');
  popwin.document.write('<body style="margin: 0px;">\n');
  popwin.document.write('<TABLE align=center border="0" cellspacing="0" cellpadding="1" vspace="0" hspace="0">\n');
  popwin.document.write('<tr><td valign="top" align=center bgcolor="#FFFFFF"><img src="'+imagesrc+'" border=0><\/td><\/tr>\n');
  popwin.document.write('<tr><td valign="top" align=center><br>');
  popwin.document.write('<FORM><INPUT type="Button" VALUE="Close Window" onClick="self.close()"><\/FORM>\n');
  popwin.document.write('<\/td><\/tr>\n');
  popwin.document.write('<\/table>\n');
  popwin.document.write('<\/body><\/html>')
  popwin.document.close()
}

function popimage2(title,imagesrc,width,height,url){
  var winleft = (screen.width - width) / 2;
  var wintop = (screen.height - height) / 2;
  var look='width='+width+',height='+height+',top='+wintop+', left='+winleft+',resizable,scrollbars';
  popwin=window.open("","",look)
  popwin.document.open()
  popwin.document.write('<html><head><title>'+title+'<\/title><\/head>\n');
  popwin.document.write('<body style="margin: 0px;">\n');
  popwin.document.write('<FORM>\n');

  popwin.document.write('<TABLE align=center border="0" cellspacing="0" cellpadding="1">\n');
  if (title != "wait"){
     popwin.document.write('<tr><td valign="top">');
     popwin.document.write('<INPUT type="image" src="'+url+'/images/close.gif" style="border: none;" onClick="self.close()">\n');
     popwin.document.write('<\/td><\/tr>\n');
  }
  popwin.document.write('<tr><td valign="top" align=center bgcolor="#FFFFFF"><a href="javascript:window.close();"><img src="'+imagesrc+'" border=0><\/a><\/td><\/tr>\n');
  popwin.document.write('<\/table>\n');

  popwin.document.write('<\/FORM>\n');
  popwin.document.write('<\/body><\/html>')
  popwin.document.close()
}
//** Tab Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
//   -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
//   -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
//   -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
//   -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container 
////NO NEED TO EDIT BELOW////////////////////////
function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
	this.enabletabpersistence=true
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}

ddtabcontent.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

ddtabcontent.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}

ddtabcontent.prototype={

	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
		this.cancelautorun() //stop auto cycling of tabs (if running)
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="") //if a valid tab is found based on function parameter
			this.expandtab(tabref) //expand this tab
	},

	setpersist:function(bool){ //PUBLIC function to toggle persistence feature
			this.enabletabpersistence=bool
	},

	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
		this.selectedClassTarget=objstr || "link"
	},

	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},

	expandtab:function(tabref){
		var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		this.expandsubcontent(subcontentid)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
	},

	expandsubcontent:function(subcontentid){
		for (var i=0; i<this.subcontentids.length; i++){
			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
		}
	},


	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
		}
	},

	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
		var currentTabIndex=this.automode_currentTabIndex //index within this.hottabspositions to begin
		var hottabspositions=this.hottabspositions //Array containing position numbers of "hot" tabs (those with a "rel" attr)
		this.expandtab(this.tabs[hottabspositions[currentTabIndex]])
		this.automode_currentTabIndex=(currentTabIndex<hottabspositions.length-1)? currentTabIndex+1 : 0 //increment currentTabIndex
	},

	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},

	init:function(automodeperiod){
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
		var persisterror=true //Bool variable to check whether persisted tab position is valid (can become invalid if user has modified tab structure)
		this.automodeperiod=automodeperiod || 0
		for (var i=0; i<this.tabs.length; i++){
			this.tabs[i].tabposition=i //remember position of tab relative to its peers
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
				this.tabs[i].onclick=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
					return false
				}
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (this.enabletabpersistence && parseInt(persistedtab)==i || !this.enabletabpersistence && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					this.expandtab(this.tabs[i]) //expand current tab if it's the persisted tab, or if persist=off, carries the "selected" CSS class
					persisterror=false //Persisted tab (if applicable) was found, so set "persisterror" to false
					//If currently selected tab's index(i) is greater than 0, this means its not the 1st tab, so set the tab to begin in automode to 1st tab:
					this.automode_currentTabIndex=(i>0)? 0 : 1
				}
			}
		} //END for loop
		if (persisterror) //if an error has occured while trying to retrieve persisted tab (based on its position within its peers)
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.automode_currentTabIndex=this.automode_currentTabIndex || 0
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	} //END int() function

} //END Prototype assignment

function EngrMsgPreview(MsgFormName,MsgviewFile,MsgviewTarget,MsgsubmitFile,FieldID,TheValue) {
    if (document.getElementById) {
        document.getElementById(FieldID).value = TheValue;
    } else if (document.all) {
        document.all(FieldID).value = TheValue;
    }
    MsgFormName.action = MsgviewFile;
    MsgFormName.target = MsgviewTarget;
    MsgFormName.submit();
    MsgFormName.action = MsgsubmitFile;
    MsgFormName.target = '_self';
}
