
// **************** DataLibrary  ***************** //
// ------------------------  COMMON METHODS -------------------//
		
 
  function exit() {
        if (confirm("Are you sure you want to exit the 508 Universe site?")) 
        	window.location = "exit.asp";
    }

  function leaveSite(url) {
      if (confirm("You will now leave the 508 Awareness site.\nSelect OK to leave or Cancel to return to the site.")) location.href = url
  }
  function leaveSite2(url) {
      if (confirm("You will now leave the 508 Awareness site.\nSelect OK to leave or Cancel to return to the site.")) {
      	window.close();
      	opener.location.href = url
      }
  }

 // Returns true if browser is MSIE 5+ or any other browser.

	function isSupportedBrowser() {
		var supportedBrowser 	= true;
		var browserName 	= getBrowserName();
		var browserVersion 	= navigator.appVersion;
	 
	  if (browserName.indexOf("MSIE") != -1) {
		index1 = browserName.indexOf("MSIE");
		index2 = browserName.indexOf(";", index1);
		browserVersion = browserName.substring(index1 + 5, index2);  

		  if (browserVersion < "5") {
			supportedBrowser = false;
		  }
		  else
			supportedBrowser = true;
	  }	
	  else
		supportedBrowser = true;
	 
	  return supportedBrowser;
	}
	function printPageAlert() {
		alert('To print this list, position the cursor on the list and click the right-hand mouse button. Click "Print" on the menu that appears, and then click the "OK" button in the Print window.');
	}

 // Returns the user's browser name.

	function getBrowserName() {
		return navigator.userAgent;
	}
	
	function goToCourseListing(pNum) {
		parent.Content.location = "Content.htm?courseID=" +  pNum;
	}
	
	// used in Blank.html
	function newWindow(file,window) {
		msgWindow=open(file,window,"resizable,width=450,height=400,scrollbars,dependent");
		//if (msgWindow.opener == null) 
		//	msgWindow.opener = self;
	}
	function open8x6(file,window) {
		msgWindow=open(file,window,"resizable,width=790,height=550,menubar=yes");
		//if (msgWindow.opener == null) 
		//	msgWindow.opener = self;
	   }
	function showExample(file,window) {
		msgWindow=open(file,window,"resizable,width=700,height=500,scrollbars");
		//if (msgWindow.opener == null) 
		//	msgWindow.opener = self;
	}

	function goToCourseDownloads(pType,pNum) {
		parent.Content.location = "Downloads.htm?courseID=" +  pNum + "&type=" + pType;
	}

	function getCourseName(pNum) {
		var i;
		for (i=0; i<=ArrayCourseName.length; i++) { 
			if ( i == pNum )
				return ArrayCourseName[pNum][0];
		}
		return 0;
	}

	function getCourseABR(pNum) {
		var i;
		for (i=0; i<=ArrayCourseName.length; i++) { 
			if ( i == pNum )
				return ArrayCourseName[pNum][1];
		}
		return 0;
	}
	
	function getFileType (pStr) {
		if (pStr.search(/Word/) != -1)  {
			directory = "word"
		}
		else if (pStr.search(/Excel/) != -1) {
			directory = "excel"
		}
		else if (pStr.search(/PowerPoint/) != -1)  {
			directory = "ppt"	
		}
		else {
			directory = "html"	
		}	
		return directory;
	}
		
	function getIconType(pStr,pi) {
		if (pStr.search(/Word/) != -1)  {
			icon		= "icon_Word"
		}
		else if (pStr.search(/Excel/) != -1) {
			icon		= "icon_XLS"
		}
		else if (pStr.search(/PowerPoint/) != -1)  {
			icon		= "icon_ppt"
		}
		else if (pStr.search(/PDF/) != -1)  {
			icon		= "icon_pdf"
		}
		else {
			if (pi % 2 == 1)
				icon = 'Star1';
			else
				icon = 'Star2';
		}	
		return icon;
	}	
	function MM_openBrWindow(theURL) {
		window.open(theURL,'1','scrollbars=yes,resizable=yes,width=700,height=500');
	}
	var windowHandle = '';

	function myOpen(url,name,attributes) {
	    windowHandle = window.open(url,name,"scrollbars=yes,resizable,width=500,height=500");
	}

	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_findObj(n, d) { //v3.0
		var p,i,x;
		if(!d)
			d=document;
		if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=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);
				return x;
		}
	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_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 MM_preloadImages2() { //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_preloadImages2.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_swapImgRestore2() { //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_findObj2(n, d) { //v3.0
		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_findObj2(n,d.layers[i].document);
				return x;
		}
	function MM_swapImage2() { //v3.0
		var i,j=0,x,a=MM_swapImage2.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj2(a[i]))!=null){
			document.MM_sr[j++]=x;
		if(!x.oSrc)
			x.oSrc=x.src;
			x.src=a[i+2];
		}
	}
//	-------------------- END: COMMON METHODS -----------------//




// **************** DataLibrary  ***************** //





	var aw01 	= new Array()
	var aw02 	= new Array()
		
// Function relating to Course pages
	var tmp;

	function getLocation () {
		var here = "'" + window.location + "'"	//parent.Content.
		var position = ( here.indexOf('.html') - 7 );
		tmp = here.substring(position,position+7);
		
	}

	function previous(pArray) {
		var newLoc;
		getLocation ()

		for (i=0;i<eval(pArray +".length");i++) {
		if (tmp == eval(pArray + "[" + i + "]")) {
			newLoc = eval(pArray + "[" + (i-1) + "]")
		}
	}
		if(typeof newLoc == "undefined")
			newLoc = eval(pArray + "[" + 0 + "]")

	window.location = newLoc + ".html";
	}

	function next(pArray) {
		var newLoc;
		getLocation ()

		for (i=0;i<eval(pArray +".length");i++) {
		if (tmp == eval(pArray + "[" + i + "]")) {
			newLoc = eval(pArray + "[" + (i+1) + "]")
		}
	}
		if(typeof newLoc == "undefined")  {
			var courseID = tmp.substring(0,2);
			courseID = courseID.toUpperCase();
			//var arrlength = eval(pArray +".length")-1
			newLoc = "Lessons" //eval(pArray + "[" + arrlength + "]")
			window.location = newLoc + ".html?courseID=" + courseID;			
		}
		else
			window.location = newLoc + ".html";
	}
	
	function getPageNo(pArray) {
		var pageNo= '';
		getLocation ()

		for (i=0;i<eval(pArray +".length");i++) {
			if (tmp == eval(pArray + "[" + i + "]")) {
			    pageNo = i+1;
			    break;
			}
		}
		return pageNo;
	}

	function getCourseName (courseID) {
		for (i=0;i<ArrayCourseName.length;i++) {
			if (courseID == ArrayCourseName[i][1]) {
			    pageNo = ArrayCourseName[i][0];
			    break;
			}
		}
		return pageNo;
	}

 	function getLength(pArray) {
 		return eval(pArray +".length")
 	}
 	
   function AW01 () {
      	aw01[0]		= new Array("aw01005")	
      	aw01[1]		= new Array("aw01010")
      	aw01[2]		= new Array("aw01015")
      	aw01[3]		= new Array("aw01020")
      	aw01[4]		= new Array("aw01025")
      	aw01[5]		= new Array("aw01026")
      	aw01[6]		= new Array("aw01030")
      	aw01[7]		= new Array("aw01031")
      	aw01[8]		= new Array("aw01035")
      	aw01[9] 	= new Array("aw01040")
      	aw01[10]	= new Array("aw01045")
      	aw01[11]	= new Array("aw01050")
      	aw01[12]	= new Array("aw01051")
      	aw01[13]	= new Array("aw01055")
      	aw01[14]	= new Array("aw01090")
      	aw01[15]	= new Array("aw01091")
      	aw01[16]	= new Array("aw01095")
      	aw01[17]	= new Array("aw01100")
      	aw01[18]	= new Array("aw01102")
      	aw01[19]	= new Array("aw01105")
      	aw01[20]	= new Array("aw01110")
      	aw01[21]	= new Array("aw01120")
      	aw01[22]	= new Array("aw01125")
      	aw01[23]	= new Array("aw01130")
      	aw01[24]	= new Array("aw01115")
   }

   function AW02 () {
   	aw02[0]		= new Array("aw02005")		//  22005
   //	aw02[1]		= new Array("aw02006")
   	aw02[1]		= new Array("aw02010")
   	aw02[2]		= new Array("aw02011")
   	aw02[3]		= new Array("aw02015")
   	aw02[4]		= new Array("aw02020")
   	aw02[5]		= new Array("aw02025")
   	aw02[6]		= new Array("aw02026")
   	aw02[7]		= new Array("aw02030")
   	aw02[8]		= new Array("aw02045")
   	aw02[9]		= new Array("aw02050")
   	aw02[10]	= new Array("aw02070")
   	aw02[11]	= new Array("aw02075")
   	aw02[12]	= new Array("aw02080")
   	aw02[13]	= new Array("aw02090")
   	aw02[14]	= new Array("aw02095")
   	aw02[15]	= new Array("aw02085")
   }

// ------------------------------------------------------- //    
    var co03 	= new Array() 
 
    function CO03 () {
    	co03[0]		= new Array("co03005")
    	co03[1]		= new Array("co03010")
    	co03[2]		= new Array("co03015")
    	co03[3]		= new Array("co03020")
    	co03[4]		= new Array("co03025")  	
    	co03[5]		= new Array("co03030")
    	co03[6]		= new Array("co03035")
    	co03[7]		= new Array("co03045")
    	co03[8]		= new Array("co03050")
    	co03[9]		= new Array("co03055")
    	co03[10]	= new Array("co03065")
    	co03[11]	= new Array("co03070")
    	co03[12]	= new Array("co03060")
    }
// ------------------------------------------------------- //    
    var te01 	= new Array() 
 
    function TE01 () {
    	te01[0]		= new Array("te01")
    	te01[1]		= new Array("te02")
    	te01[2]		= new Array("te03")
    	te01[3]		= new Array("te04")
    	te01[4]		= new Array("te05")  	
    	te01[5]		= new Array("te06")
    	te01[6]		= new Array("te07")
    	te01[7]		= new Array("te08")
    	te01[8]		= new Array("te09")
    	te01[9]		= new Array("te10")
    	te01[10]	= new Array("te11")
    	te01[11]	= new Array("te12")
    	te01[12]	= new Array("te13")
    	te01[13]	= new Array("te14")
    	te01[14]	= new Array("te15")
    	te01[15]	= new Array("te16")
    	te01[16]	= new Array("te17")
    	te01[17]	= new Array("te18")
    	te01[18]	= new Array("te19")
    	te01[19]	= new Array("te20")
    }
	var rf01	= new Array()
		function RF01 () {
		rf01[0]	= new Array("references")
		}