<!--
var AT ="&#064;";			/* Used by mailsome1 */

/* HTML code = <a href='javascript:mailsome1("name"+AT+"domain.com", null)'>Email Us</a> */
function mailsome1(Addr, Subj)
{	var A;
	var S;
	var AT;
	A="Webmaster@PMIMaine.org";
	S="Mail%20from%20PMI%20Maine%20Website";
	AT="&#064;";
	if (Addr == null ) {Addr=A};
	if (Subj == null ) {Subj=S};
	parent.location.href='mailto:'+Addr+'?subject='+Subj+'';
}

/* <a href='javascript:NewWindow("http://www.abgbrew.com/","myName","","","yes")'>www.abgbrew.com</a>
	if w & h are null, then defaults to 95% of opening window's width and/or height
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
*/
function NewWindow(mypage,myname,w,h,scroll)
{	var win = null;
	var winW = 630, winH = 460, winTop = 0, winLeft = 0;
	if ( scroll == "" || scroll == null )
	{	scroll = "yes";
	}
	if ( w == "" || w == null )
	{	if (parseInt(navigator.appVersion)>3)
		{	if (navigator.appName=="Netscape")
			{	winW = .95*window.innerWidth;
				winH = .95*window.innerHeight;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1)
			{	winW = .95*document.body.offsetWidth;
				winH = .95*document.body.offsetHeight;
			}
		}
	else
		{	winW = w;
			winH = h;
			winTop = 10;
			winLeft = 10;
		}
	}
	settings =
		'height=' + winH + ',width=' + winW + 
		',top=' + winTop + ',left=' + winLeft +
		',scrollbars=' + scroll + 
		',resizable=yes,toolbar=yes,status=yes,menubar=yes,location=yes';
	win = window.open(mypage,myname,settings);
	win.focus();
}


/*
HTML =
<a target='w3' href='pg.html' onclick="return w3.load('pg.html')">my link</a>
Javascript = 
window.onload = function()
{
  w3 = new CWindow(
    'w3',               // name
    200, 200,           // size
    'center', 'center', // position
    0,  // location field
    0,  // menubar       
    0,  // resizable     
    0,  // scrollbars    
    0,  // statusbar     
    0); // toolbar       
}*/

function CWindow(name, w, h, x, y, loc, men, res, scr, sta, too)
{
  var f = '';
  if (w && h) {
    if (typeof(x)=='string') x = (screen.width - w) / 2;
    if (typeof(y)=='string') y = (screen.height - h) / 2;
    if (document.layers) f = 'screenX=' + x + ',screenY=' + y;
    else f = 'left=' + x + ',top=' + y;
    f += ',width=' + w + ',height=' + h + ',';
  }
  f += ('location='+loc+',menubar='+men+',resizable='+res
    +',scrollbars='+scr+',status='+sta+',toolbar='+too);
  this.features = f;
  this.name = name;
  this.wnd = null;
  this.load = function(sUrl) {
    if (this.wnd && !this.wnd.closed) this.wnd.location.href = sUrl;
    else this.wnd = window.open(sUrl, this.name, this.features);
    this.wnd.focus();
    return false;
  }
}

function printWindow()
{	var bV;
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) window.print();
}
//-->

<!-- Begin
/*	Original:  Tom Khoury (twaks@yahoo.com) http://javascript.internet.com */
function placeFocus()
{ if (document.forms.length > 0)
  { var field = document.forms[0];
    for (i = 0; i < field.length; i++)
    { if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) =="s"))
      { document.forms[0].elements[i].focus();
        break;
      }
    }
  }
}

function addEvent(obj, evType, fn)
{	if (obj.addEventListener)
	{	obj.addEventListener(evType, fn, true); 
    	return true; 
	}
	else if (obj.attachEvent)
		{	var r = obj.attachEvent("on"+evType, fn); 
    		return r; 
 		}
 		else
 		{	return false; 
		}
}

addEvent(window, 'load', function()
{var input, textarea; 
 var inputs = document.getElementsByTagName('input'); 
 for (var i = 0; (input = inputs[i]); i++)
 {	addEvent(input, 'focus', oninputfocus); 
	addEvent(input, 'blur', oninputblur); 
 } 
 var textareas = document.getElementsByTagName('textarea'); 
 for (var i = 0; (textarea = textareas[i]); i++)
 {	addEvent(textarea, 'focus', oninputfocus); 
	addEvent(textarea, 'blur', oninputblur); 
 } 
}); 

function oninputfocus(e) { 
 /* Cookie-cutter code to find the source of the event */ 
 if (typeof e == 'undefined') { 
   var e = window.event; 
 } 
 var source; 
 if (typeof e.target != 'undefined') { 
    source = e.target; 
 } else if (typeof e.srcElement != 'undefined') { 
    source = e.srcElement; 
 } else { 
   return; 
 } 
 /* End cookie-cutter code */ 
 source.style.border='1px solid #0175BB'; 
}
 
function oninputblur(e) { 
 /* Cookie-cutter code to find the source of the event */ 
 if (typeof e == 'undefined') { 
   var e = window.event; 
 } 
 var source; 
 if (typeof e.target != 'undefined') { 
    source = e.target; 
 } else if (typeof e.srcElement != 'undefined') { 
    source = e.srcElement; 
 } else { 
   return; 
 } 
 /* End cookie-cutter code */ 
 source.style.border='1px solid #ccc'; 
} 
//-->