/*  All JavaScript code below is copyright 2003-2004 by Kevin Meixner (KMIT Solutions)  
 *  (email: kmit@rogers.com) except where otherwise noted. This code may 
 *  not be reproduced or distributed without written consent of 
 *  Kevin Meixner.
 * 
 * These scripts used by Marlene George with permission from Kevin Meixner
 */

function removeNoScriptMessage()
{
	// Remove "JavaScript is not supported by your browser" message:

	var node = document.getElementById("noScriptMessage");
	node.parentNode.removeChild(node);

	return;
}

function displayLastRevised()
{
	modified = new Date(document.lastModified);
	theYear = modified.getFullYear();
	theDayOfMonth = modified.getDate();
	switch (modified.getMonth())
	{
		case 0: theMonth = "Jan";
			break;
		case 1: theMonth = "Feb";
			break;
		case 2: theMonth = "Mar";
			break;
		case 3: theMonth = "Apr";
			break;
		case 4: theMonth = "May";
			break;
		case 5: theMonth = "Jun";
			break;
		case 6: theMonth = "Jul";
			break;
		case 7: theMonth = "Aug";
			break;
		case 8: theMonth = "Sep";
			break;
		case 9: theMonth = "Oct";
			break;
		case 10: theMonth = "Nov";
			break;
		case 11: theMonth = "Dec";
			break;	
	}
	
	outString = theDayOfMonth + "-" + theMonth + "-" + theYear;

	document.write(outString);
	
	return;
}


function includeHTMLfile(fileName)
{
	try
	{
		// Try Microsoft method of creating XML DOM object (Microsoft.XMLHTTP ActiveXObject):

		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("GET", fileName, false);
		xmlHttp.send();		
	}
	catch(e)
	{
		// Execute this if Microsoft method of creating XML DOM object (Microsoft.XMLHTTP ActiveXObject) failed:
	
		try
		{
			// Try Netscape method of creating XML DOM object (XMLHttpRequest() Object):

			xmlHttp = new XMLHttpRequest();
			xmlHttp.open("GET", fileName, false);
			xmlHttp.send(null);
		}
		catch(e)
		{
			// Execute this if Netscape method of creating XML DOM object (XMLHttpRequest() Object) failed:

			alert("Your browser does not support the javaScript on our site. Please upgrade to the latest version of MSIE (http://www.microsoft.com/windows/ie/default.asp) or Netscape (http://channels.netscape.com/ns/browsers/download.jsp) if you wish to use our site.");

			// exit function since browser does not support Microsoft or Netscape XML DOM
			return;
		}
		
	}
	xmlDoc=xmlHttp.responseText;

	document.write(xmlDoc);
}


function includeOnlyBetweenTags(fileName)
{
	// Clean up improper conversion of : to %3A and / to %2F if applicable:

	while (fileName.indexOf("%3A") != -1)
	{
		fileName = fileName.replace("%3A", ":");
	}
	while (fileName.indexOf("%2F") != -1)
	{
		fileName = fileName.replace("%2F", "/");
	}

	try
	{
		// Try Microsoft method of creating XML DOM object (Microsoft.XMLHTTP ActiveXObject):

		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("GET", fileName, false);
		xmlHttp.send();		
	}
	catch(e)
	{
		// Execute this if Microsoft method of creating XML DOM object (Microsoft.XMLHTTP ActiveXObject) failed:
	
		try
		{
			// Try Netscape method of creating XML DOM object (XMLHttpRequest() Object):

			xmlHttp = new XMLHttpRequest();
			xmlHttp.open("GET", fileName, false);
			xmlHttp.send(null);
		}
		catch(e)
		{
			// Execute this if Netscape method of creating XML DOM object (XMLHttpRequest() Object) failed:

			alert("Your browser does not support the javaScript on our site. Please upgrade to the latest version of MSIE (http://www.microsoft.com/windows/ie/default.asp) or Netscape (http://channels.netscape.com/ns/browsers/download.jsp) if you wish to use our site.");

			// exit function since browser does not support Microsoft or Netscape XML DOM
			return;
		}
		
	}
	xmlDoc=xmlHttp.responseText;
	start = xmlDoc.indexOf("<!--Content Start -->");
	if (start != -1)
	{
		start = start + 21;
	}
	xmlDoc = xmlDoc.substr(start, xmlDoc.length);
	end = xmlDoc.indexOf("<!--Content End -->")
	xmlDoc = xmlDoc.substr(0, end);
	document.write(xmlDoc);
}


function getEnd()
{
	theURL = document.URL;
	if ((start = theURL.indexOf("url=")) == -1)
	{
		return "empty";
	}
	else
	{
		return theURL.substr(start + 4, theURL.length);
	}
}


function viewprinterfriendly()
{
	// Generate invisible HTML form:

	myForm = document.createElement("form");
	myForm.setAttribute("name", "hiddenviewprintform");
	myForm.setAttribute("action", "printerfriendly.html");
	myForm.setAttribute("method", "get");
	myForm.setAttribute("target", "_blank");

	// Generate hidden fields to store HTML code, 
	// domain and path in these fields:

	urlInput = document.createElement("input");
	urlInput.setAttribute("type", "hidden");
	urlInput.setAttribute("name", "url");
	urlInput.setAttribute("value", document.URL );

	// Append hidden fields to invisible HTML form:

	myForm.appendChild(urlInput);

	// Append invisible form to end of <body> section calling page:

	docBody = document.getElementsByTagName("body").item(0);
	docBody.appendChild(myForm);

	// Automatically call the hidden form's submit() method to send data to 
	// printver.asp via "post" method

	myForm.submit();

	return;
}


function stripdomain(strURL)
{
	/*
	 * PURPOSE:
	 *
	 * Will strip off domain and "http://" from URL and return path only.
	 *
	 * INPUT:
	 * 
	 * 	string containing URL
	 *
	 * OUTPUT:
	 * 
	 * 	returns URL minus domain and "http://" as a string, 
         *      eg: /city-hall/mayor/default.asp
	 */

	stripped = strURL;

	if (stripped.indexOf("file:") != -1)
	{
		// Chop off "file:///C:" if necessary (where C is any drive letter)

		stripped = stripped.substr((stripped.lastIndexOf(":") + 1), (stripped.length));
	}

	if (stripped.substr(0,7) == "http://")
	{
		// Chop off "http://" if necessary:

		stripped = stripped.substr(7,stripped.length);
	}

	if (stripped.indexOf("/") != -1)
	{
		// URL contains at least one instance of "/", so first instance will be beginning of path, 
		// Chop off everything before path begins

		stripped = stripped.substr(stripped.indexOf("/"), stripped.length);
	}
	else
	{

		// URL contains no instances of "/" so it is a root path, set to "/":

		stripped="/"; // case of path being root directory of domain
	}

	return stripped;
}


function displayPathLocation()
{
	var locationDirs = new Array(20);
	var locationString = "/kmresume/";

//	theURL = stripdomain(document.URL);
	theURL = stripdomain("file:///C:/portfolio/index.html");

	theURL = theURL.substr(1, theURL.length);
	for(i = 0; (theURL.indexOf("/") != -1) && i < 20; i++)
	{
		locationDirs[i] = theURL.substr(0, (theURL.indexOf("/")));
		theURL = theURL.substr((theURL.indexOf("/") + 1), theURL.length);
//		locationString = locationString + locationDirs[i] + "/";
//		alert(locationString);
//		document.write(" > <a href=\"" + locationString + "\">" + locationDirs[i] + "</a>");

		for(j = 0; j < i+1; j++)
		{
			locationString = locationString + locationDirs[j] +"/";
		}
		if (i > 0)
		{
			document.write(" > ");
		}
		document.write("<a href=\"" + locationString + "\">" + locationDirs[i] + "</a>");
		
	}
}


// The printit() function below will print the current Web page when it is called 
// (from a button, click, etc.)

// This script is written by Eric (Webcrawl@usa.net)
// For full source code, installation instructions,
// 100's more DHTML scripts, and Terms Of
// Use, visit dynamicdrive.com or see "Dynamic Drive - Terms of Use" below this function

function printit()
{  
	if (window.print) 
	{
		window.print();  
	} 
	else
	{
    		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
	}
}

/*
Dynamic Drive- Terms Of Use 
 

Unless indicated otherwise by the credit, all scripts on this site are original scripts 
written by the authors of Dynamic Drive, and are protected by both US and international 
copyright laws. The below lists the terms of use users of Dynamic Drive must agree to 
before using the programs/scripts:

1) Users may use any of the scripts found on Dynamic Drive on both personal and commercial 
web sites, free of charge. However, users may NOT redistribute, sell, or repost for download 
any of the scripts found on Dynamic Drive on any medium (CD-Rom,  website, etc) without the 
expressed written permission of Dynamic Drive. What this basically means is that while you 
may use our scripts on your site, you may not redistribute them (ie: put them on another '
script archive). The only exception are scripts submitted by outside programmers. The 
distribution rights to these scripts belong to both Dynamic Drive (as agreed to by user when 
he/she submitted script to us) AND the authors themselves. Approval from either party is 
required for non standard usage.

2) Users agree not to remove the copyright notices inside each script. What is the copyright 
notice? It appears inside the <script> tag of each script, and looks something like this:


Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com


This notice must not be removed.

3) Users agree not to use scripts found on Dynamic Drive for illegal purposes, or on pages 
containing illegal material.

4) Users agree not to hold Dynamic Drive liable for any damages resulted from proper or improper 
use of any of the scripts found on Dynamic Drive. Use at your own risk.

A link back on the page that contains the script will be very much appreciated, although not 
required.

By using any of the scripts on Dynamic Drive, you understand that you have read and agreed to the 
above usage terms. These terms will be strictly enforced, and violators will face criminal charges. 
Don't say our lawyer didn't warn you!

Copyright © 1998-2001 Dynamic Drive.

*/
