var showInfo = false;
var	blurb = "";
$(document).ready(function(){
$("p:first").addClass("first");
$("span.ee").mouseover(function(e){
	$(this).fadeTo('fast',0.8).fadeTo('fast',1);
	$(this).attr("title","Could there be some kind of hidden feature being hinted at here? Try clicking around some more ...");
});

$("#aboutThisElement").addClass("aboutThisElement");
$("#aboutThisElement").hide();
	$('*').dblclick(function(){
		blurb = "";
		$('*').removeClass("showElement");
		showInfo = true;
		$("#aboutThisElement").fadeIn('fast').fadeTo(10,0.95);
		var tag = this.tagName.toLowerCase();
		blurb = "<p>You double-clicked on a <strong><code>" + tag +"</code></strong> element!</p><p><a href='http://reference.sitepoint.com/html/" + this.tagName.toLowerCase() + "'>You can find out more about the <strong><code>" + tag +"</code></strong> element at SitePoint's <em>online</em> HTML reference &raquo;</a></p>";
		blurb+="<ul>";
		if (this.getAttribute("href")) {
			blurb+="<li><code>href</code> = " + this.getAttribute("href") + "</li>";
			}
		if (this.lang.length>0) {
			blurb+="<li><code>lang</code> = " + this.lang + "</li>";
			}
		if (this.id.length>0) {
			blurb+="<li><code>id</code> = " + this.id + "</li>";
			}
		if (this.className.length>0) {
			blurb+="<li><code>class</code> = " + this.className + "</li>";
			}
		if (this.title.length>0) {
			blurb+="<li><code>title</code> = " + this.title + "</li>";
			}
		blurb+="</ul>";

		$(this).addClass("showElement");
		$("#aboutThisElementBlurb").html(blurb);
		
		return false;
	});
	$(document).mousemove(function(event){
		// Calculate pageX/Y if missing and clientX/Y available
		if (!showInfo)
			{
			$("#aboutThisElement").attr("style","top:" + (event.pageY + 40) + "px;left:" + (event.pageX + 40) + "px;display:none;");
			}
	});
	$(document).click(function(e){
		showInfo = false;
		$('*').removeClass("showElement");
		$("#aboutThisElement").fadeOut('fast');
	});
});

function showSkipLinks() {
var skipBgColor= "#004386";
var skipTextColor = "#ed8f00";
// Amend/tweak these to your satisfaction	
var textIndent = "20px";
var skipNavHeight = "auto";
var skipFontSize = "medium";
var viewportwidth="100%";
var sk_a = document.getElementsByTagName("a");
for (i=0; i<sk_a.length; i++)
 {
	if (sk_a[i].className=="skip-link")
		{
		sk_a[i].onfocus=function(e){
			this.style.width=viewportwidth;
			this.style.padding="10px 0";
			this.style.fontSize = skipFontSize;
			this.style.height = skipNavHeight;
			this.style.textIndent = textIndent;
			this.style.backgroundColor = skipBgColor;
			this.style.color = skipTextColor;
			}
		sk_a[i].onblur=function(e){
			this.style.width="0";
			this.style.padding="0";
			this.style.fontSize="0px";
			this.style.height="0";
			this.style.textIndent="-30000px";
			this.style.backgroundColor="transparent";
			this.style.backgroundImage="none";
			}
		}
	}
}
function init()
{
//place calls to all functions that you want to run after page load here
showSkipLinks();
}
window.onload=init;
