<!--put js here -->


function HNav() {

// though all variables are here, the only three you'll need to worry about are the first 3,
// HTMLString1, and HTMLString2.
// BaseURL1 and BaseURL2 are explained above. You can change the look of your navigation text by
// modifying HTMLString1. HTMLString2 is the character used as a seperator.

var BaseURL1 = "phd138/"
var BaseURL2 = ""
var IndexFile = "default.asp"

var DocURLRef = document.URL
var DocURL = DocURLRef
var DocURLSplit = ''

var HomeURL = ''
var TextURL = ''
var LinkURL = ''
var LinkURLSpacer = ''
var HTMLString = ''
var HTMLString1 = '<font size="1" face="Verdana, Arial, Helvetica, sans-serif">  '
var HTMLString2 = ' &gt;&gt;'
var HTMLString3 = '</div><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"></div>'

// Check for which URL is used. BaseURL1 is the default.

if (BaseURL1 || BaseURL2 !='') {
	if (DocURL.search(BaseURL1)!= -1){
		DocURL=DocURL.slice(DocURL.indexOf(BaseURL1) + BaseURL1.length)
		HomeURL = DocURLRef.slice(0, DocURLRef.indexOf(BaseURL1) + BaseURL1.length) + 'default.asp'
		}
	if (DocURL.search(BaseURL2)!= -1 && BaseURL2 !='') {
		DocURL=DocURL.slice(DocURL.indexOf(BaseURL2) + BaseURL2.length)
		HomeURL = DocURLRef.slice(0, DocURLRef.indexOf(BaseURL2) + BaseURL2.length) + 'default.asp'
		}
	}



// split you string into an array. Each folder will get it's own array value

DocURLSplit = DocURL.split('/')

// build the relative paths

for (var i=0; i<(DocURLSplit.length-1); i++) {
	LinkURLSpacer+='../'
	}

// build the actual string from right to left (reverse of how you'd read it) using relative links.

for (var i=0; i<(DocURLSplit.length-1); i++) {
	LinkURL = LinkURLSpacer + DocURLSplit[i] + '/'+ IndexFile
	TextURL = DocURLSplit[i].replace(/_/g, " ")

	if(i==(DocURLSplit.length-2)){ // the far right folder is not a link.
	HTMLString += HTMLString2 + TextURL
	LinkURLSpacer = LinkURLSpacer.slice(0,-3)
	}
	else{ // but every other folder is.
	HTMLString += HTMLString2 + '<a href="'+LinkURL+'" class="Fineprint" target="_parent">'+TextURL+'</a>'
	LinkURLSpacer = LinkURLSpacer.slice(0,-3)
	}
	}

// now add the home link and output it to you HTML document.
HTMLString = HTMLString1.concat("Home".link(HomeURL), HTMLString, HTMLString3)
document.writeln(HTMLString)
}




function MM_preloadImages() {
    if (document.images) {
        var imgFiles = MM_preloadImages.arguments;
        if (document.preloadArray == null) {
            document.preloadArray = new Array();
        }
        var i = document.preloadArray.length;
        with (document) {
            for (var j = 0; j < imgFiles.length; j++) {
                if (imgFiles[j].charAt(0) != "#") {
                    document.preloadArray[i] = new Image();
                    document.preloadArray[i++].src = imgFiles[j];
                }
            }
        }
    }
}

function MM_swapImage() {
    var i, j = 0, objStr, obj, swapArray = new Array(), oldArray = document.MM_swapImgData;
    for (i = 0; i < (MM_swapImage.arguments.length - 2); i += 3) {
        objStr = MM_swapImage.arguments[(navigator.appName == "Netscape") ? i : i + 1];
        if ((objStr.indexOf("document.layers[") == 0 && document.layers == null) || (objStr.indexOf("document.all[") == 0 && document.all == null)) {
            objStr = "document" + objStr.substring(objStr.lastIndexOf("."), objStr.length);
        }
        obj = eval(objStr);
        if (obj != null) {
            swapArray[j++] = obj;
            swapArray[j++] = (oldArray == null || oldArray[j - 1] != obj) ? obj.src : oldArray[j];
            obj.src = MM_swapImage.arguments[i + 2];
        }
    }
    document.MM_swapImgData = swapArray;
}

function MM_swapImgRestore() {
    if (document.MM_swapImgData != null) {
        for (var i = 0; i < (document.MM_swapImgData.length - 1); i += 2) {
            document.MM_swapImgData[i].src = document.MM_swapImgData[i + 1];
        }
    }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function CatalogWindowNav()
	{
	
		maxHeight = 700;
		winHeight = screen.height - 150;
		
		if (winHeight > maxHeight){
			winHeight = maxHeight;
		}
		
		//alert ("Screen height is:" + screen.height + "\nWindow Height is: " + winHeight);
		
   		winStats="toolbar=yes,location=yes,directories=no,menubar=no,";
		winStats+="scrollbars=1, resizable=yes,";
			if (navigator.appName.indexOf("Microsoft")>=0) 
			{
				winStats+="left=10,top=0,width=775,height=" + winHeight;
			}
			else
			{
				winStats+="screenX=10,top=0,width=800,height=668";
			}
		catWindow = window.open('http://catalog.phdinc.com','catWindow',winStats);     
		catWindow.focus();
	}	
	
function Litstore() {

		maxHeight = 800;
		maxWidth = 800;
		
		winHeight = screen.height - 100;
		
		if (winHeight > maxHeight){
			winHeight = maxHeight;
		}
		
		winWidth = screen.width - 15;
		
		if (winWidth > maxWidth){
			winWidth = maxWidth;
		}
		
		//alert("Width:" + winWidth + "\nHeight: " + winHeight);
		//alert ("Screen height is:" + screen.height + "\nWindow Height is: " + winHeight);
		
   		winStats="toolbar=no,location=no,directories=no,menubar=no,";
		winStats+="scrollbars=1, resizable=no,";
			//if (navigator.appName.indexOf("Microsoft")>=0) 
			//{
				winStats+="left=0,top=10,width=" + winWidth + ",height=" + winHeight;
			//}
			//else
			//{
			//	winStats+="screenX=10,top=0,width=800,height=668";
			//}
		catWindow = window.open('/litstore/default.asp','litStore',winStats);     
		catWindow.focus();
}	
	
//-- This function shows/hides stuff

function changein(id) 
	{
        if (document.layers) document.layers[id].visibility = "show"
        else if (document.getElementById) document.getElementById(id).style.visibility = "visible"
        else if (document.all && !(document.getElementById)) document.all(id).style.visibility = "visible"
	}

function changeout(id) 
	{
        if (document.layers) document.layers[id].visibility = "hide"
        else if (document.getElementById) document.getElementById(id).style.visibility = "hidden"        
        else if (document.all && !(document.getElementById)) document.all(id).style.visibility = "hidden"
	}

// End the hiding -->

