// JavaScript Document


function filename() //gets filename of current webpage
{	
	// Get filename and remove directories and extension 
	var page_loc = self.location.href;		// store current http address in var page_loc
	var a = page_loc.lastIndexOf('/') + 1;	// store index of last occurance of / in page_loc in var a
	var b = page_loc.lastIndexOf('.');		//store index last . before extension
	var c = page_loc.substring(a, b);		// store substring with range of (a, b]
	
	// Get new filename and see if an 'under-score' character is contained in it.
	
	
	return c;
}

function files_titles(filename)
{
	if (filenames == 'default' || filename == 'index')
	{
		title = 'home'; 	
	}
	else 
	{
		if (filename.indexOf('_') > 0)
		{
			var temp = new Array();	
			temp = filename.split('_');
			for (i = 0; i <= temp.length-1; ++i)
			title = temp[i];
		}
		
		
	}
	return title;
}

