	function setTabs()  {
		var qs = new Querystring()
		var v1 = qs.get("Section")
		var allTags=document.getElementsByTagName('tab*'), i=0, e;
		while(e=allTags[i++]) {
			if(e.id){
			
				var pre = ''
				var tab = ''
				var pos = ''
				var pre = e.id.substring(0,3)
				var tab = e.id.substring(3,7)
				var pos = e.id.substring(7,10)
				
				if (pre=='tab') {
					
					if (pos=='Opn') { document.getElementById(e.id).className="tabInActiveOpen"; }
					if (pos=='Beg') { document.getElementById(e.id).className="tabInActiveToInActive"; }
					if (pos=='Mid') { document.getElementById(e.id).className="tabInActiveMiddle"; }
					if (pos=='Cls') { document.getElementById(e.id).className="tabInActiveToClose"; }

				}
					
			}
		}
			allTags=document.getElementsByTagName('*'), i=0, e;
			var beg = 10
			while(e=allTags[i++]) {
			if(e.id){
			
				var pre = ''
				var tab = ''
				var pos = ''
				var pre = e.id.substring(0,3)
				var tab = e.id.substring(3,7)
				var pos = e.id.substring(7,10)

				
				if (tab==v1 || beg<2) {
					if (pos=='Opn') {
						newImage = "url(assets/tabActiveOpen.gif)";
						document.getElementById(e.id).style.backgroundImage=newImage;
						beg = 1	
					}
					else if (pos=='Beg') { 
						if (beg==1) { 
							newImage = "url(assets/tabActiveToInActive.gif)"; 
							document.getElementById(e.id).style.backgroundImage=newImage;
							beg = 2 
						} 
						else if (beg>1) { 
							beg = 1 
							newImage = "url(assets/tabInActiveToActive.gif)"; 
							document.getElementById(e.id).style.backgroundImage=newImage;
						}
					}
					else if (pos=='Mid') { 
						newImage = "url(assets/tabActiveMiddle.gif)"; 
						document.getElementById(e.id).style.backgroundImage=newImage;
					}
					else if (pos=='Cls') { 
						newImage = "url(assets/tabActiveToClose.gif)"; 
						beg = 2
						document.getElementById(e.id).style.backgroundImage=newImage;
					}
					else {
						
					}
					
				}
					
			}
		}
	}


function toggleCheck(that)  {
	var cat = that.name.substring(4,99)
	var checked = that.checked
	var allTags=document.getElementsByTagName('*'), i=0, e;
	while(e=allTags[i++]) {

		if(e.id) {
			var sub = ''
			var pos = 0
			sub = e.id.substring(0,3)
			pos = InStr(e.id,'_')
			if (pos==0) 
				{ 
					var1 = e.id
					var1 = var1.replace('_' + cat + '_','')
					if (var1.length!=e.id.length)
						{ 
							if (checked==true) {
								e.checked=true
							}
							else {
								e.checked=false
							}
						}
				}
		}
	}
}

function InStr(strSearch, charSearchFor)
	/*
	InStr(strSearch, charSearchFor) : Returns the first location a substring (SearchForStr)
							was found in the string str.  (If the character is not
							found, -1 is returned.)
	                           
	Requires use of:
		Mid function
		Len function
	*/
	{
		for (i=0; i < Len(strSearch); i++)
		{
			if (charSearchFor == Mid(strSearch, i, 1))
			{
				return i;
			}
		}
		return -1;
	}
	
function Mid(str, start, len)
        /***
                IN: str - the string we are LEFTing
                    start - our string's starting position (0 based!!)
                    len - how many characters from start we want to get

                RETVAL: The substring from start to start+len
        ***/
        {
                // Make sure start and len are within proper bounds
                if (start < 0 || len < 0) return "";

                var iEnd, iLen = String(str).length;
                if (start + len > iLen)
                        iEnd = iLen;
                else
                        iEnd = start + len;

                return String(str).substring(start,iEnd);
        }
	function Len(str)
        {  return String(str).length;  }
	
function Left(str, n)
        /***
                IN: str - the string we are LEFTing
                    n - the number of characters we want to return

                RETVAL: n characters from the left side of the string
        ***/
        {
                if (n <= 0)     // Invalid bound, return blank string
                        return "";
                else if (n > String(str).length)   // Invalid bound, return
                        return str;                // entire string
                else // Valid bound, return appropriate substring
                        return String(str).substring(0,n);
        }


function FormatDateTime(datetime, FormatType)
/*
	 FomatType takes the following values
		1 - General Date = Friday, October 30, 1998
		2 - Typical Date = 10/30/98
		3 - Standard Time = 6:31 PM
		4 - Military Time = 18:31
*/
{
	var strDate = new String(datetime);

	if (strDate.toUpperCase() == "NOW") {
		var myDate = new Date();
		strDate = String(myDate);
	} else {
		var myDate = new Date(datetime);
		strDate = String(myDate);
}
}
function selectAll(int){
    void(d=document);
    void(el=d.getElementsByTagName('INPUT'));
    for(i=0;i<el.length;i++)
        void(el[i].checked=int) 
}
            
function setFocus(elem,myid) 
	{
	elem.id = myid
	}		

