<!--
function autotab(fromField,toField)
{
	if ( fromField.value.length==fromField.getAttribute( "maxlength" ) )
	{
		toField.focus();
	}
}


function ValidatePhone(p1,p2,p3)
{
	var phone3 = /^[\d]{3}$/;
	var phone4 = /^[\d]{4}$/;
	var isvalid = true;
	if(p1 != "" || p2 != "" || p3 != "")
	{
		if(!phone3.test(p1) || !phone3.test(p2) || !phone4.test(p3))
			isvalid =false;
	}
	return isvalid;
}

function CVPhone(sender, args)
{
	args.IsValid = ValidatePhone(document.Form1.txtPhone1.value,document.Form1.txtPhone2.value,document.Form1.txtPhone3.value);
}

// Amir - New added from Fredricton Project
function PrinterFriendly() {
  if (document.getElementById != null) {
    var obj = document.getElementById('printArea');
    
    if (obj != null) {
      var innerContent = obj.innerHTML;
      var content = "";
      
      innerContent = innerContent.replace(/(href=[.]*[^\s|^>]+)/gi, '');
      innerContent = innerContent.replace(/(onclick=[.]*[^\s|^>]+)/gi, '');
      
      content = "<html>\n<head><title>Communitech</title>" +
                  "<LINK href='/style/style.css' type=text/css rel=stylesheet></head>" +
                  "\n<body><table cellpadding='8' cellspacing='0' border='0' width='95%' bgcolor='#ffffff' align=center>" +
                  "<tr><td align=center><a href=\"javascript:window.print()\" style='z-index:1000'>Print this page</a></td></tr>" +
                  "<tr><td align='center'>" + innerContent + "</td></tr>" +
				  "<tr><td align=center><a href=\"javascript:window.print()\" style='z-index:1000'>Print this page</a></td></tr></table>" +
				"</body></head></html>";

      var printWindow = window.open("", "Print", "width=580,height=580,scrollbars=yes");
      
      printWindow.document.open();
      printWindow.document.write(content);
      printWindow.location.reload();
    }
  }
  else {
	alert("You're browser is not capable of performing this operation!");
  }
}
/* - Old One
function PrinterFriendly()
{
	var obj = document.getElementById('printArea');
	
	if (obj != null)
	{
		var content = "<html>\n<head><title>Northumberland</title>";
		content += "<LINK href='/style/style.css' type=text/css rel=stylesheet>";
		content += "</head>\n<body>" + obj.innerHTML + "<br/><div align=center><a href=\"javascript:window.print()\">Print</a></dvi>";
		content += "</body></html>";

		var printWindow = window.open("", "Print", "width=650,height=500,resizable=yes,scrollbars=yes");
		printWindow.document.open();
		printWindow.document.write(content);
		printWindow.location.reload();
		printWindow.focus();
	}
}
*/

function PrinterFriendlyResult()
{
	var obj = document.getElementById('printArea');
	
	if (obj != null)
	{
		var content = "<html>\n<head><title>Northumberland</title>";
		content += "<LINK href='/style/style.css' type=text/css rel=stylesheet>";
		content += "</head>\n<body><table border=0 width=98% align=center style=\"margin-top:-20px\"  >\n";
		content += "<tr><td>"
		content += "<IMG height=114 src=\"/images/logo.gif\" width=241>\n";
		content += obj.innerHTML + "<br><br>";
		content += "<table border=0 width=100% cellpadding=0 cellspacing=0><tr><td class=\"headingprint\">Northumberland County Economic Development</td><td aligh=right class=\"headingprint\">2005 Real Estate Database</td></tr></table>\n";
		content += "<div align=center><br><a href=\"javascript:window.print()\">Print</a></dvi>";
		content += "</td></tr>\n";
		
		content += "<br><br></body></html>";

		var printWindow = window.open("", "Print", "width=750,height=650,resizable=yes,scrollbars=yes,top=0,left=50");
		printWindow.document.open();
		printWindow.document.write(content);
		printWindow.location.reload();
		printWindow.focus();
	}
}
	
function GotoSearch()
{
	window.location.href = "/search/index.aspx?strSearch=" + document.getElementById("searchfield").value;
}

				
//-->

