


function showHideConcepts(conceptID, topicID){

		var conceptList;
		var IDcount = 0 // Counter
		conceptList = document.getElementById('p_track_content').getElementsByTagName('tr');
		for (var a=0, i=conceptList.length; a < i; a++) {
			if (conceptList[a].id.indexOf(conceptID) > -1){
				if (conceptList[a].className == 'concept'){conceptList[a].className = 'conceptShow'; document.cookie= conceptList[a].id + '=' + 'conceptShow';}
				else {conceptList[a].className = 'concept';document.cookie= conceptList[a].id + '=' + 'concept';}
			}
		}
		if (document.getElementById(topicID).className == 'topic'){document.getElementById(topicID).className = 'topicShow'; document.cookie= topicID + '=' + 'topicShow';}
		else {document.getElementById(topicID).className = 'topic'; document.cookie= topicID + '=' + 'topic';}

}



function loadState(){
	
	
	
		var bars;
		bars = document.getElementById('p_track_content').getElementsByTagName('tr');
		for (var a=0, i=bars.length; a < i; a++) {
			
			if (bars[a].id){
			if (get_sess_cookie(bars[a].id)){ bars[a].className = get_sess_cookie(bars[a].id);}
			}
			
		}
	
	document.getElementById("ptrack").className="visible";

}



function showHideTopics(targetID, areaID){

		var rowList;
		var IDcount = 0 // Counter
		rowList = document.getElementById('p_track_content').getElementsByTagName('tr');
		for (var a=0, i=rowList.length; a < i; a++) {
			if (rowList[a].id.indexOf(targetID) > -1){
				if (rowList[a].className == 'conceptShow'){rowList[a].className = 'concept'; document.cookie= rowList[a].id + '=' + 'concept';}
				else if (rowList[a].className == 'topic'){rowList[a].className = 'topicHide'; document.cookie= rowList[a].id + '=' + 'topicHide';}
				else if (rowList[a].className == 'topicShow'){rowList[a].className = 'topicHide'; document.cookie= rowList[a].id + '=' + 'topicHide';}
				else if (rowList[a].className == 'topicHide'){rowList[a].className = 'topic'; document.cookie= rowList[a].id + '=' + 'topic';}
			}
		}
		if (document.getElementById(areaID).className == 'areaOfStudy'){document.getElementById(areaID).className = 'areaOfStudyShow'; document.cookie= document.getElementById(areaID).id + '=' + 'areaOfStudyShow';}
		else {document.getElementById(areaID).className = 'areaOfStudy'; document.cookie= document.getElementById(areaID).id + '=' + 'areaOfStudy';}

}


function MM_openBrWindow(theURL,winName,features) { //v2.0
			window.open(theURL,winName,features);
}




//Get cookie routine by Shelley Powers 
function get_sess_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}



var lighthref = null;

function lightWindow_DoneLoading(){
	
		var sGet = window.location.search;
		// Drop the leading "?"
		
		sGet = sGet.substr(1);
    
		// Generate a string array of the name value pairs.
		// Each array element will have the form "mw=310"
		var sNVPairs = sGet.split("&");
    
		// Now, for each name-value pair, we need to extract
		// the name and value.
		for (var i = 0; i < sNVPairs.length; i++){	
			// So, sNVPairs[i] contains the current element...
			// Split it at the equals sign.
			var sNV = sNVPairs[i].split("=");
			if (sNV[0] == 'launch'){ 
			
				if (sNV[1] == 'trial'){
					lighthref = '/jsp/trial_application.jsp';
				}
				else {
					lighthref = '/images/autoplayer.swf?vidpath=/images/videos/' + sNV[1] + '.flv';
				}
					
			myLightWindow.activateWindow({
			href: lighthref, 
			title: '', 
			width:503, 
			height:407});
			
			}
			
		}
	
}


<!--
function MM_preloadImages() { //v3.0
  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_swapImgRestore() { //v3.0
  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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  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 P7_swapClass(){ //v1.4 by PVII
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}

function writePageHrefs(pages, currentPage, href) {
    for ( i = 1 ; i <= pages; i ++ ) {
        if ( i == currentPage )
            document.write( i + " | " );
        else
            document.write("<a href=\"" + href + "&page=" + i + "\">" + i + "</a> | ");
   }
}


function getCookie(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 null
}

function setCookie(name, value, days) {
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

function deleteCookie(name){
setCookie(name, "moot")
}
