function PrintScottWhiteEmail()
{
  document.write("<a href=\"mailto:");
  document.write('m');
  document.write('i');
  document.write('z');
  document.write('o');
  document.write('n');
  document.write('g');
  document.write('@');
  document.write('k');
  document.write('j');
  document.write('.');
  document.write('s');
  document.write('o');
  document.write('-');
  document.write('n');
  document.write('e');
  document.write('t');
  document.write('.');
  document.write('n');
  document.write('e');
  document.write('.');
  document.write('j');
  document.write('p');
  document.write("\">");
  document.write('m');
  document.write('i');
  document.write('z');
  document.write('o');
  document.write('n');
  document.write('g');
  document.write('@');
  document.write('k');
  document.write('j');
  document.write('.');
  document.write('s');
  document.write('o');
  document.write('-');
  document.write('n');
  document.write('e');
  document.write('t');
  document.write('.');
  document.write('n');
  document.write('e');
  document.write('.');
  document.write('j');
  document.write('p');
  document.write("</a>");
}

function JWindow(loc, wid, hei) {
  window.open(loc, "CMACNewWindow" + Math.round(Math.random()*1000), "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=" + wid + ",height=" + hei);
}

function setActiveStyleSheet(title) {
   var i, a;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

function determineCSS(){
  if (screen.width == 800)
  {
    setActiveStyleSheet("800");
  }
}

determineCSS();

var pmVisible = false;
var smVisible = false;

function ClearMentions()
{
  document.getElementById("FIRightMask").style.display = "none";

  if (document.getElementById("PMNumber"))
  {
    document.getElementById("PMNumber").style.display = "inline";

//    document.getElementById("PMExpandPrompt").style.display = "block";
    document.getElementById("PMList").style.display = "none";
    document.getElementById("PMCollapsePrompt").style.display = "none";

    pmVisible = false;
  }
  if (document.getElementById("SMNumber"))
  {
    document.getElementById("SMNumber").style.display = "inline";

//    document.getElementById("SMExpandPrompt").style.display = "block";
    document.getElementById("SMList").style.display = "none";
    document.getElementById("SMCollapsePrompt").style.display = "none";

    smVisible = false;
  }
}

function PeopleMentioned()
{
  if (!pmVisible)
  {
    ClearMentions();

    document.getElementById("PMNumber").style.display = "none";

//    document.getElementById("PMExpandPrompt").style.display = "none";
    document.getElementById("PMList").style.display = "block";
    document.getElementById("PMCollapsePrompt").style.display = "block";

    document.getElementById("FIRightMask").style.display = "block";

    pmVisible = true;
  }
  else
  {
    ClearMentions();
  }
}

function StylesMentioned()
{
  if (!smVisible)
  {
    ClearMentions();

    document.getElementById("SMNumber").style.display = "none";

//    document.getElementById("SMExpandPrompt").style.display = "none";
    document.getElementById("SMList").style.display = "block";
    document.getElementById("SMCollapsePrompt").style.display = "block";

    document.getElementById("FIRightMask").style.display = "block";

    smVisible = true;
  }
  else
  {
    ClearMentions();
  }
}


//Analytics
/*
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3738192-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
*/

//Right mouse click

var message="Copyright 2008 Nick Scrima and the Chinese Martial Arts Center, Inc. All Rights Reserved. Unauthorized use is prohibited.";

function clickIE4(){
	if (event.button==2){
		alert(message);
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}

//Selecting text
function disableselect(e){
	return false
}
function reEnable(){
	return true
}

function loaderFunc()
{

	var preventativeJSPrevented = false;

	if (typeof disablePreventativeJS != "undefined")
	{
		//I detest JavaScript.
		preventativeJSPrevented = true;
	}

	if (preventativeJSPrevented == false)
	{
		if (document.layers){
			document.captureEvents(Event.MOUSEDOWN);
			document.onmousedown=clickNS4;
		}
		else if (document.all&&!document.getElementById){
			document.onmousedown=clickIE4;
		}

//		document.oncontextmenu=new Function("alert(message);return false");
		document.oncontextmenu=new Function("return false");

		//if IE4+
		document.onselectstart = new Function ("return false");

		//if NS6
		if (window.sidebar){
			document.onmousedown = disableselect;
			document.onclick = reEnable;
		}
	}

}

