var nuD = new Date();
var y1y = parseInt(nuD.getFullYear()) - 1; // 1 year less than current year

function insertyears(sel, beg, end)
// sel: (-1=last | ####=value year | #=option) is selected
// beg: start w/ (null=1998 | ####=start year | true=current year | false=previous year)
// end: end w/ (null=last year +5 | true=next year | #=plus years from current year)
{	var max = 5;
	var yNy = y1y + max;
	var opts = null;
	var i, y = y1y, c = 0;

	if (beg == null) {
		y = 1998; // Year that uReach Started
	} else if (beg != null && beg == true) {
		y = y1y + 1;	// start w/ current year
//		max--;
	} else if (beg != null && beg >= 1998 && beg < 3000) {
		y = beg;
	} //else (beg==false) is the basic defualts already
	
	if (end != null && end < 1998) { // extend # years
		yNy = y1y+1 + end;
	} else if (end != null && end == true) { // end next year
		yNy = y1y + 2;
	}
	
	if (y < 1998)
		y = y1y+1;
	else if (y > 3000)	
		y = y1y+1;
		
	if (yNy < y1y || yNy > 3000)
		yNy = y1y+2;
	
	max = yNy - y;
	
	for (i = y; i <= yNy; i++, c++) {
	  opts += "<OPTION VALUE="+i;	  
	  if (sel != null && (i == sel || c == sel || (c == max && sel == -1)))
		opts +=" SELECTED>"+i;
	  else
		opts +=">"+i;
	  opts += "</OPTION>";
	}

	document.write(opts);
}

function insertcopy(align, loc)
// align: ('left', 'center', 'right') defaults to 'left' if missing [align]
// loc: (true:write copy, false:return copy, null:nothing)
{	var name = "uReach&nbsp;Technologies,&nbsp;Inc.";
	var href = "http://www.ureachtech.com/";
	
	if (loc==null) return '';
	var date = "1998-"+(y1y+1); // to current year
	align = (align ? align : "left");
	var copy = "<TABLE ALIGN="+ align +" style='border:0px;'>";
	
	copy += "<TR><TD style='border:0px;'><SPAN class='Sm'>&nbsp;Copyright &copy; "+ date +" &nbsp;";
	//copy += "<a href='"+ href +"' target='_blank' style='display:inline; background-color:transparent; color:#000000; font-size:10px; font-weight:normal;' onMouseOver='this.style.backgroundColor=\"transparent\"; this.style.display=\"inline\"; this.style.textDecoration=\"underline\";' onMouseOut='this.style.textDecoration=\"none\";'>";
	copy += name;
	copy += "</a>";
	copy += " &nbsp;All&nbsp;Rights&nbsp;Reserved.</SPAN></TD></TR></TABLE>";

	if (loc) document.write(copy);
	else return(copy);
}