// Title: url.js
// Last update: 26 Sep 09

var copyright ="copyright &copy: 2004-2012";

//setup root URL first
var myURL;
var myHost;
var subWeb= "website1";	//terminate at <root><subWeb>

// test for browser type
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);

var ns = (document.layers) ? true : false;
var ie = (document.all) ? true : false;
var ff = document.getElementById? true : false;
var ch = /chrome/.test( navigator.userAgent.toLowerCase() );

// dtermine URL or File prefix
if (window.location.host!="")
	{
	myHost = window.location.host+"/";
	myURL = "/";
	}
else
	{
	pathArray = window.location.pathname.split( '/' );
	myURL = "";
	for ( i = 0; i < pathArray.length-1; i++ ) 
		{
		if (pathArray[i] == "")continue;
		if (pathArray[i] == subWeb )break;
		myURL += pathArray[i];
		myURL += "/";
		}
		myHost = "file:///"+myURL;
		myURL = "file:///"+myURL;
	}
	
// current system date
function myDate()
	{
	str = Date();
	x = str.split(" ",5);
	
	if (ie)
		{
		y = x[0]+" "+x[2]+" "+x[1]+" "+x[4];
		}
	else
		{
		y = x[0]+" "+x[2]+" "+x[1]+" "+x[3];
		}
	return(y);
	}

// last page update 
function lastDate()	
	{
	str = new Date(document.lastModified);
  	str = str.toLocaleString();
  	x = str.split(" ",3);
  	y = x[1].substring(0,3)
  	z = x[0]+" "+y+" "+x[2];
	return(z);		
  	}
  	
