//	modified from www.hivelogic.com/safeaddress/	by Dan Benjamin 
//	presented at www.alistapart.com/stories/spam/  
//  to insert email address anywhere in document:
//  <script type="text/javascript">noSpamEmail('link text here')</script> 
function noSpamEmail(txt) {
  var address = '<a href="';
  address += "ma";  address += "il";  address += "to:";
  address += "&#99;&#111;&#110;&#116;&#97;&#99;&#116;&#95;&#48;&#49;";	
  address += "&#64;";
  address += "&#100;&#121;&#110;&#45;&#119;&#101;&#98;&#46;&#99;&#111;&#109;";
  address += '">' + txt + "<\/a>";
  document.write(address);
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//--
window.size = function()
{
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	return {width:w,height:h};
}

window.center = function()
{
	var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};

	var _x = 0;
	var _y = 0;
	var offsetX = 0;
	var offsetY = 0;

	//IE
	if(!window.pageYOffset)
	{
		//strict mode
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		//quirks mode
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	//w3c
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}

	_x = ((this.size().width-hWnd.width)/2)+offsetX;
	_y = ((this.size().height-hWnd.height)/2)+offsetY;

	return{x:_x,y:_y};
}

function showhide(layer_ref) { 
	if (state == 'block') { 
		state = 'none'; 
	} else { 
		state = 'block'; 
	} 
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + layer_ref + ".style.display = state"); 
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[layer_ref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		hza.style.display = state; 
	} 
} 
function shadowAndCenter(target,point, animate){
	var wa = document.getElementById(target);
	var shadow = document.getElementById("shadow");
	wa.style.top = point.y + "px";
	wa.style.left = point.x + "px";
	
	shadow.style.top = (point.y +6) + "px";
	shadow.style.left = (point.x +6) + "px";
	shadow.style.height = wa.clientHeight + "px";
	shadow.style.width = wa.clientWidth + "px";
	
	if(animate == undefined || animate == 1)
	{
	Spry.Effect.AppearFade(target,{ duration: 1000, from: 0, to: 100, finish:function()
		 {
			
			Spry.Effect.AppearFade("shadow",{ duration: 1000, from: 0, to: 30});		  
		 }
	 });
	}
	
}
function closePopup(target)
{
	Spry.Effect.AppearFade("shadow",{ duration: 1000, from: 30, to: 0, finish:function()
		 {
			Spry.Effect.AppearFade(target,{ duration: 1000, from: 100, to: 0});
		 }
		 });
}
function hideHand(target)
{
	target.style.cursor = "default";
}

function showHand(target)
{
	target.style.cursor = "hand";
}
