// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - ( event listener ) - - - - - - - -
// by Scott Andrew - http://scottandrew.com
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function addEvent(obj, evType, fn)
	{
	if (obj.addEventListener)
		{
		obj.addEventListener(evType, fn, false); 
		return true;
		}
	else if (obj.attachEvent)
		{
		var r = obj.attachEvent('on'+evType, fn);
		return r;
		}
	else
		{
		return false;
		}
	}


// event listeners eventually to replace the one above
function addEventToObject(obj, evt, func)
	{
	var oldhandler = obj[evt];
	if (typeof obj[evt] != 'function')
		{
		obj[evt] = func;
		}
	else
		{
		obj[evt] = function()
			{
			oldhandler();
			func();
			}
		}
	}





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - ( add in citation and title info for blockquotes ) - - - - - - - -
// http://v2.1976design.com/blog/archive/2003/11/10/updates/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function extractBlockquoteCitations()
	{
	var newdiv;
	var newlink;
	var cite;
	var title;
	var quotes;
	var i;
	
	quotes = document.getElementsByTagName('blockquote');
	for (i = 0; i < quotes.length; i++)
		{
		cite = quotes[i].getAttribute('cite');
		title = quotes[i].getAttribute('title');
		if ((cite) && (cite != ''))
			{
			if ( (cite.match('http://', 'i')) || (cite.match('ftp://', 'i')) || (cite.match('person://', 'i')) )
				{
				newlink = document.createElement('a');
				newlink.setAttribute('href', cite);
				newlink.setAttribute('title', ('Go to ' + cite));
				title = quotes[i].getAttribute('title');
				if ((title) && (title != ''))
					{
					newlink.appendChild(document.createTextNode(title));
					}
				else
					{
					newlink.appendChild(document.createTextNode('Quote source'));
					}
				newdiv = document.createElement('div');
				newdiv.className = 'source';
				newdiv.appendChild(document.createTextNode('\u2014 '));
				newdiv.appendChild(newlink);
				quotes[i].appendChild(newdiv);
				}
			else
				{
				newdiv = document.createElement('div');
				newdiv.className = 'source';
				newdiv.appendChild(document.createTextNode('\u2014 ' + cite));
				quotes[i].appendChild(newdiv);
				}
			}
		
		else if ((title) && (title != ''))
			{
			newdiv = document.createElement('div');
			newdiv.className = 'source';
			newdiv.appendChild(document.createTextNode('\u2014 ' + title));
			quotes[i].appendChild(newdiv);
			}
		quotes[i].removeAttribute('title');
		}
	}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - ( highlight comments using url anchors ) - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// find appropriate text in the URL anchor string
var thisURL = ''+document.location;
var hashPos = thisURL.indexOf('#');
if (hashPos >= 0)
	{
	var anchorTxt = thisURL.substring(hashPos+1, thisURL.length);
	// set regex to find comment anchor
	var cmntTxt = /cmnt([0-9]+)/.test(anchorTxt)
	var runFade = (anchorTxt == 'cmnt-holder' || cmntTxt == true) ? 1 : 0;
	}

function fade(i)
	{
	if ((i > 0) && (runFade == 1))
		{
		document.getElementById(anchorTxt).className = 'fade' + i;
		i--;
		setTimeout('fade('+ i +')', 150);
		}
	else if (i == 0)
		{
		Comments.select(null, document.getElementById(anchorTxt));
		}
	}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 




// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - ( smooth scrolling between internal links ) - - - - - - - - - - - 
// http://www.sitepoint.com/article/scroll-smoothly-javascript
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// set vars
var ss_INTERVAL;
var ss_STEPS = 15;

function ss_fixAllLinks()
	{
	// grab all the links
	var allLinks = document.getElementsByTagName('a');
	
	// loop through all the links
	for (var i=0; i<allLinks.length; i++)
		{
		var lnk = allLinks[i];
		
		// check to see if there's a hash, and if the current url completely matches the one in the link
		if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) || ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search))
			{
			addEvent(lnk, 'click', smoothScroll);
			}
		}
	}

function smoothScroll(e)
	{
	var target;
	// checks with event model to use
	if (window.event)
		{
		// ie
		target = window.event.srcElement;
		}
	else if (e)
		{
		// other
		target = e.target;
		}
	else return;
	
	// strip off the hash
	var anchor = target.hash.substr(1);
	// grab all the anchors on the page
	var destinationLink = document.getElementById(anchor);
	// if none found, exit
	if (!destinationLink) return true;
	
	// find position of destination link
	var destx = destinationLink.offsetLeft; 
	var desty = destinationLink.offsetTop;
	var thisNode = destinationLink;
	// loop up through offsetParent until we hit the document body, as IE requires
	while (thisNode.offsetParent && (thisNode.offsetParent != document.body))
		{
		thisNode = thisNode.offsetParent;
		destx += thisNode.offsetLeft;
		desty += thisNode.offsetTop;
		}
	
	// clear the interval timer (why here?)
	clearInterval(ss_INTERVAL);
	
	// get current y-position
	var cypos = ss_getCurrentYPos();
	
	// calculate the step sizes
	var ss_stepsize = parseInt((desty-cypos)/ss_STEPS);
	
	// run the scroll
	ss_INTERVAL = setInterval('ss_scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
	
	// stop the browser handling the event as normal and opening the link
	// kills the bubble
	if (window.event)
		{
		window.event.cancelBubble = true;
		window.event.returnValue = false;
		}
	if (e && e.preventDefault && e.stopPropagation)
		{
		// hmmm, safari gets inside here, but then fails to stop the event, and so a 'jump' rather than a 'scroll' takes place. I can't figure it out...
		e.preventDefault();
		e.stopPropagation();
		}
	return true;
	}

function ss_scrollWindow(scramount, dest, anchor)
	{
	var wascypos = ss_getCurrentYPos();
	var isAbove = (wascypos < dest);
	window.scrollTo(0,wascypos + scramount);
	var iscypos = ss_getCurrentYPos();
	var isAboveNow = (iscypos < dest);
	// if finished cancel timer and jump anchor so url is correct
	if ((isAbove != isAboveNow) || (wascypos == iscypos))
		{
		window.scrollTo(0,dest);
		clearInterval(ss_INTERVAL);
		location.hash = anchor;
		}
	}

function ss_getCurrentYPos()
	{
	// ie5 and ie5.5
	if (document.body && document.body.scrollTop)
	return document.body.scrollTop;
	// ie6
	if (document.documentElement && document.documentElement.scrollTop)
	return document.documentElement.scrollTop;
	// netscape etc
	if (window.pageYOffset)
	return window.pageYOffset;
	return 0;
	}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - ( weather info sliding panels ) - - - - - - - - - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function primeSlide()
	{
	// set the class name of the containing div to hide appropriate html elements
	document.getElementById('weather-conditions').className = 'hide';
	
	// create html elements using js
	var make = createHTML();
	
	// set panel vars (just for neatness' sake)
	var infoPanel = document.getElementById('weatherinfo');
	var infoTrigger = document.getElementById('weatherinfo-trigger');
	var infoHide = document.getElementById('weatherinfo-hideme');
	var dorsetPanel = document.getElementById('dorset');
	var dorsetTrigger = document.getElementById('dorset-trigger');
	var dorsetHide = document.getElementById('dorset-hideme');
	var dorsetBack = document.getElementById('dorset-back');
	var sanfranPanel = document.getElementById('sanfrancisco');
	var sanfranTrigger = document.getElementById('sanfrancisco-trigger');
	var sanfranHide = document.getElementById('sanfrancisco-hideme');
	var sanfranBack = document.getElementById('sanfrancisco-back');
	
	// add in the panel state variables
	infoPanel.state = 'up';
	dorsetPanel.state = 'up';
	sanfranPanel.state = 'up';
	
	// set event listeners
	addEvent(infoTrigger, 'click', function(e){clearScreen(infoPanel)});
	addEvent(infoHide, 'click', function(e){clearScreen(infoPanel)});
	addEvent(dorsetTrigger, 'click', function(e){clearScreen(dorsetPanel)});
	addEvent(dorsetHide, 'click', function(e){clearScreen(dorsetPanel)});
	addEvent(dorsetBack, 'click', function(e){clearScreen(infoPanel)});
	addEvent(sanfranTrigger, 'click', function(e){clearScreen(sanfranPanel)});
	addEvent(sanfranHide, 'click', function(e){clearScreen(sanfranPanel)});
	addEvent(sanfranBack, 'click', function(e){clearScreen(infoPanel)});
	}

function clearScreen(thisPanel)
	{
	// set panel vars
	var infoPanel = document.getElementById('weatherinfo');
	var dorsetPanel = document.getElementById('dorset');
	var sanfranPanel = document.getElementById('sanfrancisco');
	// loop through and close any open windows that aren't this panel
	var panels = new Array(infoPanel, dorsetPanel, sanfranPanel);
	for (var i=0; i<panels.length; i++)
		{
		if (((panels[i].state == 'down') || (panels[i].state == 'downing')) && (panels[i] != thisPanel))
			{
			setSlide(panels[i]);
			}
		}
	// run for this panel
	setSlide(thisPanel);
	}

function setSlide(thisPanel)
	{
	// grab the height (this is a number such as -500)
	thisPanel.height = thisPanel.offsetHeight;
	var numframes;
	
	// if this panel is fully up
	if (thisPanel.state == 'up')
		{	
		// re-style the panel so it's only just out of site
		thisPanel.style.top = "-"+thisPanel.height+"px";
		
		// set number of frames the animation will take
		numFrames = 12;
		}
	else
		{
		// calculate the number of frames the animation will take
		// (bearing in mind it could be halfway through an up or down movement)
		var finPos = thisPanel.height;
		var nowPos = thisPanel.style.top;
		nowPos = nowPos.substring(0, (nowPos.length - 2));
		var toGo = (finPos - nowPos);
		numFrames = Math.round((12 / thisPanel.height) * toGo);
		numFrames = (numFrames == 0) ? 1 : numFrames;
		}
	
	// set y start position
	var yStart = thisPanel.offsetTop;
	var yEnd;
	// set y end position
	switch (thisPanel.state)
		{
		case 'up':
			thisPanel.state = 'downing';
			yEnd = 0;
			break;
		case 'downing':
			thisPanel.state = 'uping';
			yEnd = 0;
			break;
		case 'down':
			thisPanel.state = 'uping';
			yEnd = "-"+thisPanel.height;
			break;
		case 'uping':
			thisPanel.state = 'downing';
			yEnd = "-"+thisPanel.height;
			break;
		}
	
	// set current frame number
	frameNum = 0;
	// calculate y distance to be moved each frame
	var yDist = (yEnd - yStart)/(numFrames - 1);
	
	// run the sliding function
	runSlide(thisPanel, yStart, yDist, frameNum, numFrames);
	}

function runSlide(thisPanel, yStart, yDist, frameNum, numFrames)
	{
	// if the animation still has frames left to run
	if (frameNum < numFrames)
		{
		thisPanel.style.top = (yStart + yDist*frameNum) + "px";
		frameNum++;
		return setTimeout(function(){runSlide(thisPanel, yStart, yDist, frameNum, numFrames)}, 8);
		}
	// if the animation is complete
	else
		{
		// if it was moving down
		if (thisPanel.state == 'downing')
			{
			// set to all the way down
			thisPanel.state = 'down';
			}
		else
			{
			thisPanel.state = 'up';
			thisPanel.style.top = "-5000px";
			}
		}
	return true;
	}

function createHTML()
	{
	// create weather info trigger elements
	var infoTrigger = document.createElement('div');
	infoTrigger.id = 'weatherinfo-trigger';
	infoTrigger.setAttribute('title', 'View extra information on the weather banner');
	document.body.appendChild(infoTrigger);
	
	// create weather info elements
	var infoPanel = document.createElement('div');
	infoPanel.id = 'weatherinfo';
	infoPanel.innerHTML = '<div class="border"><h3>Panorama information</h3><p>The image displayed above is a 1600 pixel-wide panoramic view from the top of my parents&#8217; house in Dorset, England. The system uses an XML weather feed from their local airbase to provide an up-to-the-minute graphical representation of the current weather, moon, and daylight conditions at their house. It\'s pretty cool, really.</p><p>You can <a href="/blog/colophon/#the-pano" title="View the panorama section in the colophon">read more about the panorama</a>, and how it was created, in the <a href="/blog/colophon/" title="View the colophon">Colophon</a>; or you can select an option from below and view detailed weather information for Dorset, or for San Francisco (where I currently live).</p><ul><li id="dorset-trigger" title="View the latest weather conditions at this location">View live weather information for Leigh, Dorset, UK.</li><li id="sanfrancisco-trigger" title="View the latest weather conditions at this location">View live weather information for San Francisco, California, USA.</li></ul><div id="weatherinfo-hideme" title="&#8593; Hide this panel">&#8593; Hide this panel</div></div>';
	document.getElementById('right').appendChild(infoPanel);
	
	// create dorset elements
	var dorsetPanel = document.getElementById('dorset');
	var dorsetHide = document.createElement('div');
	dorsetHide.id = 'dorset-hideme';
	dorsetHide.appendChild(document.createTextNode('\u2191 Hide this panel'));
	dorsetPanel.getElementsByTagName('div')[0].appendChild(dorsetHide);
	var dorsetBack = document.createElement('div');
	dorsetBack.id = 'dorset-back';
	dorsetBack.appendChild(document.createTextNode('\u2190 Go back to the info panel'));
	dorsetPanel.getElementsByTagName('div')[0].appendChild(dorsetBack);
	
	// create san francisco elements
	var sanfranPanel = document.getElementById('sanfrancisco');
	var sanfranHide = document.createElement('div');
	sanfranHide.id = 'sanfrancisco-hideme';
	sanfranHide.appendChild(document.createTextNode('\u2191 Hide this panel'));
	sanfranPanel.getElementsByTagName('div')[0].appendChild(sanfranHide);
	var sanfranBack = document.createElement('div');
	sanfranBack.id = 'sanfrancisco-back';	
	sanfranBack.appendChild(document.createTextNode('\u2190 Go back to the info panel'));
	sanfranPanel.getElementsByTagName('div')[0].appendChild(sanfranBack);
	return;
	}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 







// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - ( sliding weather panorama ) - - - - - - - - - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// set initial global variables
var hsMovedBefore = 0;
var hsBgXOffset = 0; // equal to the amount of the image sitting offscreen
var hsPrevWindowWidth = window.innerWidth;
var hsT;

function hsPrep()
	{
	// create buttons
	hsCreateButtons();

	// set ids
	var headerDiv = document.getElementById('header');
	var buttonLeft = document.getElementById('buttonLeft');
	var buttonRight = document.getElementById('buttonRight');

	// set event listeners on #header
	addEventToObject(headerDiv, 'onmouseover', function() {hsButtonDisplay('show')});
	addEventToObject(headerDiv, 'onmouseout', function() {hsButtonDisplay('hide')});
	addEventToObject(headerDiv, 'onmouseout', function() {hsLookStop()}); // fix for FF PC

	// set event listeners on #buttonLeft
	addEventToObject(buttonLeft, 'onmouseover', function() {hsLookGo('left')});
	addEventToObject(buttonLeft, 'onmouseout', function() {hsLookStop()});
	
	// set event listeners on #buttonRight
	addEventToObject(buttonRight, 'onmouseover', function() {hsLookGo('right')});
	addEventToObject(buttonRight, 'onmouseout', function() {hsLookStop()});

	// set event listeners on window
	addEventToObject(window, 'onresize', function() {hsWindowResize()});
	}

// create the scroll buttons
function hsCreateButtons()
	{
	// create the two buttons
	var newLeftDiv = document.createElement('div');
	newLeftDiv.setAttribute('id', 'buttonLeft');
	var newRightDiv = document.createElement('div');
	newRightDiv.setAttribute('id', 'buttonRight');

	// append the two buttons
	document.getElementById('header').appendChild(newLeftDiv);
	document.getElementById('header').appendChild(newRightDiv);
	
	// style the left button
	document.getElementById('buttonLeft').style.backgroundImage = 'url(/blog/commonpics/button-left.png)';
	document.getElementById('buttonLeft').style.backgroundPosition = '0px 49px';
	document.getElementById('buttonLeft').style.cursor = 'default';
	document.getElementById('buttonLeft').style.display = 'none';
	document.getElementById('buttonLeft').style.height = '49px';
	document.getElementById('buttonLeft').style.left = '20px';
	document.getElementById('buttonLeft').style.position = 'absolute';
	document.getElementById('buttonLeft').style.top = '61px';
	document.getElementById('buttonLeft').style.width = '91px';
	
	// style the right button
	document.getElementById('buttonRight').style.backgroundImage = 'url(/blog/commonpics/button-right.png)';
	document.getElementById('buttonRight').style.backgroundPosition = '0px 49px';
	document.getElementById('buttonRight').style.cursor = 'default';
	document.getElementById('buttonRight').style.display = 'none';
	document.getElementById('buttonRight').style.height = '49px';
	document.getElementById('buttonRight').style.position = 'absolute';
	document.getElementById('buttonRight').style.right = '20px';
	document.getElementById('buttonRight').style.top = '61px';
	document.getElementById('buttonRight').style.width = '91px';
	}


// starts background-repositioning
function hsLookGo(direction)
	{
	// set headerLink
	var ahrefs = document.getElementById('header').getElementsByTagName('a');
	var headerLink = ahrefs[0];

	// if JS has not moved the background-image before (this will only happen once after page load)
	if (hsMovedBefore == 0)
		{
		var xOffSet = (1600 - window.innerWidth);
		headerLink.style.backgroundPosition = "-"+xOffSet+"px 0px";
		hsBgXOffset = xOffSet;
		hsMovedBefore = 1;
		}

	// if we're asking to look to the right
	if (direction == 'right')
		{
		// is there enough picture to allow a look to the right?
		if ((window.innerWidth + (hsBgXOffset +15)) < (1600))
			{
			document.getElementById('buttonRight').style.backgroundPosition = '0px 0px';
			hsBgXOffset += 15;
			headerLink.style.backgroundPosition = "-"+hsBgXOffset+"px 0px";
			}
		else
			{
			document.getElementById('buttonRight').style.display = 'none';
			document.getElementById('buttonRight').style.cursor = 'pointer';
			return true;
			}
		}
	// if we're asking to look to the left
	else if (direction == 'left')
		{
		// is there enough picture to allow a look to the left?
		if (hsBgXOffset > 15)
			{
			document.getElementById('buttonLeft').style.backgroundPosition = '0px 0px';
			hsBgXOffset -= 15;
			headerLink.style.backgroundPosition = "-"+hsBgXOffset+"px 0px";

			// we only have to run this once here for use right at the very start because after that the onmouseout event listeners for the buttons run it
			hsButtonDisplay('show');
			}
		else
			{
			document.getElementById('buttonLeft').style.display = 'none';
			document.getElementById('buttonLeft').style.cursor = 'pointer';
			return true;
			}
		}

	// wait a bit then run the function again
	hsT = setTimeout(function(){hsLookGo(direction)}, 60);
	return true;
	}

// stops background-repositioning
function hsLookStop()
	{
	clearTimeout(hsT);
	document.getElementById('buttonLeft').style.backgroundPosition = '0px 49px';
	document.getElementById('buttonRight').style.backgroundPosition = '0px 49px';
	}


// show and hide the scroll buttons
function hsButtonDisplay(action)
	{
	// only show buttons if the window isn't too wide
	if (window.innerWidth < 1600)
		{
		// hide
		if (action == 'hide')
			{
			// hide buttons
			document.getElementById('buttonLeft').style.display = 'none';
			document.getElementById('buttonRight').style.display = 'none';
			}
		// show
		else if (action == 'show')
			{
			// if js has moved the background-image before
			if (hsMovedBefore == 1)
				{
				// is there enough picture to allow a look to the left?
				if (hsBgXOffset > 15)
					{	
					document.getElementById('buttonLeft').style.display = 'block';
					}
				// is there enough picture to allow a look to the right?
				if (window.innerWidth + hsBgXOffset + 15 < 1600)
					{
					document.getElementById('buttonRight').style.display = 'block';
					}
				}
			
			// if js has not moved the background-image before
			else if (hsMovedBefore == 0)
				{
				// is there anough picture to allow a look to the left?
				if ((1600 - window.innerWidth) > 15)
					{	
					document.getElementById('buttonLeft').style.display = 'block';
					}
				}
			}
		}
	else
		{
		// hide buttons
		document.getElementById('buttonLeft').style.display = 'none';
		document.getElementById('buttonRight').style.display = 'none';
		}
	}


// reposition the background image when the window has been resized
function hsWindowResize()
	{
	// set vars
	var ahrefs;
	var headerLink;

	// if the js has already moved the background-image we run this, otherwise we leave it positioned as it originally is using "top right"
	if (hsMovedBefore == 1)
		{
		// if the window is wider than the width of the background-image
		if ((window.innerWidth > 1600) || (hsPrevWindowWidth > 1600))
			{
			ahrefs = document.getElementById('header').getElementsByTagName('a');
			headerLink = ahrefs[0];
			headerLink.style.backgroundPosition = "top right";
			hsBgXOffset = (1600 - window.innerWidth);
			hsPrevWindowWidth = window.innerWidth;
			}
		// else if the window is narrower than the width of the background-image
		else
			{
			// the resized window got narrower
			if (hsPrevWindowWidth > window.innerWidth)
				{
				ahrefs = document.getElementById('header').getElementsByTagName('a');
				headerLink = ahrefs[0];
				hsBgXOffset += (hsPrevWindowWidth - window.innerWidth);
				headerLink.style.backgroundPosition = "-"+hsBgXOffset+"px 0px";
				hsPrevWindowWidth = window.innerWidth;
				}
			// the resized window got wider
			else if (hsPrevWindowWidth < window.innerWidth)
				{
				ahrefs = document.getElementById('header').getElementsByTagName('a');
				headerLink = ahrefs[0];
				hsBgXOffset -= (window.innerWidth - hsPrevWindowWidth);
				headerLink.style.backgroundPosition = "-"+hsBgXOffset+"px 0px";
				hsPrevWindowWidth = window.innerWidth;
				}
			}
		}
	}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



// run all the onload scripts
function runScripts()
	{
//	fade(12);
//	primeSlide();
//	extractBlockquoteCitations();
	//ss_fixAllLinks();
	runLSPrep();
//	hsPrep();
	}
window.onload = runScripts;