function makePopup(url, width, height, overflow)
{
  //if (width > 640) { width = 640; }
  //if (height > 480) { height = 480; }

  if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow))
  {
    overflow = 'both';
  }

  var win = window.open(url, '',
      'width=' + width + ',height=' + height
      + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no')
      + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no')
      + ',status=yes,toolbar=no,menubar=no,location=no'
  );

  return win;
}

function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
};
function attachEventListener(target, eventType, functionRef, capture)
{
  if (typeof target.addEventListener != "undefined")
  {
    target.addEventListener(eventType, functionRef, capture);
  }
  else if (typeof target.attachEvent != "undefined")
  {
    var functionString = eventType + functionRef;
    target["e" + functionString] = functionRef;
    
    target[functionString] = function(event)
    {
      if(typeof event == "undefined"){event = window.event}; target["e" + functionString](event);
    };
    
    target.attachEvent("on" + eventType, target[functionString]);
  }
  else
  {
    eventType = "on" + eventType;

    if (typeof target[eventType] == "function")
    {
      var oldListener = target[eventType];

      target[eventType] = function()
      {
        oldListener();

        return functionRef();
      }
    }
    else
    {
      target[eventType] = functionRef;
    }
  }

  return true;
}

function detachEventListener(target, eventType, functionRef, capture)
{
  if (typeof target.removeEventListener != "undefined")
  {
    target.removeEventListener(eventType, functionRef, capture)
  }
  else if (typeof target.detachEvent != "undefined")
  {
    var functionString = eventType + functionRef;

    target.detachEvent("on" + eventType, target[functionString]);

    target["e" + functionString] = null;
    target[functionString] = null;
  }
  else
  {
    target["on" + eventType] = null;
  }

  return true;
}


function getElementsByAttribute(attribute, attributeValue)
{
  var elementArray = new Array();
  var matchedArray = new Array();

  if (document.all)
  {
    elementArray = document.all;
  }
  else
  {
    elementArray = document.getElementsByTagName("*");
  }

  for (var i = 0; i < elementArray.length; i++)
  {
    if (attribute == "class")
    {
      var pattern = new RegExp("(^| )" + attributeValue + "( |$)");

      if (elementArray[i].className.match(pattern))
      {
        matchedArray[matchedArray.length] = elementArray[i];
      }
    }
    else if (attribute == "for")
    {
      if (elementArray[i].getAttribute("htmlFor") || elementArray[i].getAttribute("for"))
      {
        if (elementArray[i].htmlFor == attributeValue)
        {
          matchedArray[matchedArray.length] = elementArray[i];
        }
      }
    }
    else if (elementArray[i].getAttribute(attribute) == attributeValue)
    {
      matchedArray[matchedArray.length] = elementArray[i];
    }
  }

  return matchedArray;
}

var email='hugh@webPoynor.com';
var phone='(850) 492-3703';

var jb_lhs = "jimbryan3ph";
var jb_inb = "earthlink";
var jb_rhs = "net";

var hp_lhs = "HughPoynor";
var hp_inb = "yahoo";
var hp_rhs = "com";

function print_the_link( lhs, inb, rhs ){
   document.write("<a href=\"mailto");
   document.write(":" + lhs + "@");
   document.write(inb + "." + rhs + "?subject=Jim Bryan for Congress" + "\">" + lhs + "@" + inb + "." + rhs + "<\/a>");
}

function disclaimerNotice(){
	document.write("<div class='disclaimerdiv'>");
	borderAreaBegin('WG','100%', 'center', 'padding:2px;' );
	document.write("<div class='disclaimerNotice'>");
	document.write("<div>Authorized and paid for by James E. “Jim” Bryan,<br />8321 Stokes Rd, Laurel Hill, Okaloosa County, Florida 32567.</div>"); 
	borderAreaEnd('WG');
	document.write("</div>");
}
function siteFooter(){
	/* ---------------------------------
	document.write("Site developed by Web Poynor&nbsp;&nbsp;"+phone+"&nbsp;&nbsp;");
	document.write("<a href='&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#117;&#103;&#104;&#64;&#119;&#101;&#98;&#112;&#111;&#121;&#110;&#111;&#114;&#46;&#99;&#111;&#109;'>"+email+"</a>");	
	----------------------------------- */
	document.write("<div class='siteFoot'>"); 
	document.write("Site developed by volunteers Lee Poynor and Hugh Poynor of <a href='http://www.webpoynor.com' target='_blank'>WebPoynor.com</a> and William M. Sloan.<br />For technical support contact us at " );
	print_the_link( hp_lhs, hp_inb, hp_rhs );
	if( navigator.userAgent.indexOf("Safari")== -1	)document.write(".<div>Updated "+prettyDate()+"</div>");
	document.write("</div><br clear='all'/>");
}
function rowShades(t){
    for (var i=1; i < t.rows.length; i++){
    t.rows[i].bgColor= ((i % 2) == 0?"rgb(252,252,223)":"rgb(255,255,255)")}
}
function updated(){
	if( navigator.userAgent.indexOf("Safari")== -1	)document.write("<div class='updated'>Updated "+prettyDate()+"</div>");
}
function prettyDate(){
    var a=new Date(document.lastModified);
    lm_year=a.getFullYear();
    lm_month=a.getMonth()+1;
    lm_day=a.getDate();
    m = new Array(12);
    m[0]='January';m[1]='February';m[2]='March';m[3]='April'
    m[4]='May';m[5]='June';m[6]='July';m[7]='August'
    m[8]='September';m[9]='October';m[10]='November';m[11]='December'
    return m[lm_month-1]+' '+lm_day+', '+lm_year;
    /* -------------------
	navigator.appName+navigator.appCodeName+navigator.userAgent; //
	Netscape MozillaMozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16		Netscape MozillaMozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21
	Microsoft Internet Explorer MozillaMozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2)
	---------------------- */
}
function top(){
	document.write("<span class='dnp'><img onclick='window.scroll(0,0)' onmouseover='wiggle(this)' onmouseout='unWiggle(this)' src='images/top-s.gif' alt=' go to the top  ' width='35' height='12' border='0' /></span>")
}
function wiggle(obj){
	obj.style.position = 'relative'
	obj.style.top = '-1px'
	obj.style.left = '-1px'
}
function unWiggle(obj){
	obj.style.position = 'relative'
	obj.style.top = '0px'
	obj.style.left = '0px'
}
function wiggle_pp(obj){ /*  paypal img wiggle  */
	obj.style.position = 'relative'
	obj.style.top = '-1px'
	obj.style.left = '-1px'
}
function unWiggle_pp(obj){/*  paypal img wiggle  */
	obj.style.position = 'relative'
	obj.style.top = '0px'
	obj.style.left = '-10px'
}
function mid(string, loc, many){
	    var l = string.length
	    if(l<=0 || loc<0|| many<=0) return string;
	    return string.substr(loc,many)
}
function len(obj){
		return obj.length
}
function trim(str){
    var x="", y="";
    for (var i=0; i<str.length; i++){
    	y=str.substring(i,i+1);
    	if( y!=" " && y!="\n" && y!="\t" ){x = x + y}
	}
    return x
}
function rtrim(str){
	var x=""
	for (var i=str.length-1; i >-1; i--){
		var x = str.charAt(i)
		//alert(i+"="+x)
		if( x!=" " && x!="\n" && x!="\t" ) return str.substr(0,i+1)
	}
	return ""
}
function ltrim(str){
    for (var i = 0; i < str.length; i++){
		var x = str.charAt(i)
		//alert(i+"="+x)
		if( x!=" " && x!="\n" && x!="\t" ) return str.substr(i)
    }
return ""
}
function right(string, many){
    var l = string.length
    if(l<=0 || many<=0) return string;
    return string.substr(l-many)
}
function left(string, many){
    var l = string.length
    if(l<=0 || many<=0) return string;
    return string.substr(0,many)
}
function minimum(a,b){
		if(a<b){return a}else{return b}
}
function maximum(a,b){
		if(a<b){return b}else{return a}
}
