/*This first block is a way to munge my e-mail address so that it can't be conveniently harvested by spammbots*/

var v1 = "la";
var v2 = "rr";
var v3 = "y@lg";
var v4 = "pip";
var v5 = "er.n";
var v6 = "et";

var me= v1 + v2 + v3 + v4 + v5 + v6;
var mail = "mailto:";


/*Find the size of the document space so one can adjust the style sheet to accommodate it*/
function docWidth()
{
	if (window.innerWidth > 0)
		return window.innerWidth;
	else if (document.documentElement.clientWidth > 0)
		return document.documentElement.clientWidth;
	else if (document.body.clientWidth > 0)
		return document.body.clientWidth;
	else
		return 400;
}

function docHeight()
{
	if (window.innerWidth > 0)
		return window.innerHeight;
	else if (document.documentElement.clientHeight > 0)
		return document.documentElement.clientHeight;
	else if (document.body.clientHeight > 0)
		return document.body.clientHeight;
	else
		return 500;
}

function browserName()
{
	return navigator.appName;
}


//Change style sheet for window size

function setStyleSize()
{
	var i, sheet;
	var width = docWidth();
	var style = "";
	
	//we know it's a 3-column sheet if it has a center_content div -- I just made up that standard
	var threeCol = document.getElementById("center_content");
	
	if (width <800)
	{
		threeCol==null ? style = "small" : style="small3";
	} 
	else if ((width>=800) && (width<1000))
	{
		threeCol==null ? style = "medium" : style = "medium3";	
	}
	else
	{
		threeCol==null ? style = "large" : style="large3";
	}

//these were for debugging
	var disabledSheet = new Array();	
	var sheetList = new Array();	
	var allSheets = "";
	
//	for (i=0; (sheet=document.getElementsByTagName("link")[i]); i++)

	var allSheets = document.getElementsByTagName("link");
//alert ("We have " + allSheets.length + " link tags");

//pick all alternative style sheets that affect layout, but not visual effects
//
	for (i=0; (sheet=document.getElementsByTagName("link")[i]); i++)
	{
		if ((sheet.getAttribute("rel").indexOf("style") != -1) && 
			(sheet.getAttribute("title")) && (sheet.getAttribute("title").indexOf("vis") == -1))
		{
			sheetList[i] =  sheet.getAttribute("title"); 
			allSheets += sheetList[i] + "\n";
			
			sheet.disabled = true;
			disabledSheet[i] = sheet.getAttribute("title");
			if(sheet.getAttribute("title") == style)
			{
				sheet.disabled = false;
				var disabledList = "";
			}
		}
	}
	
	//this was a debugging aid I've decided to leave for the moment
/*for (i = 0; i<disabledSheet.length; i++)
	{
		disabledList += disabledSheet[i] + "\n";
	}
alert("we enabled " + style + "\n\nAnd we disabled: \n " + disabledList  + "\n\ntotal sheets processed: " + sheetList.length + "\n\ntheir names: \n" + allSheets);
*/

}
