function makeSelection(obj, msgWindowURL) {
/*
 ** opens a new window with url passed in selected option value
 ** select object
*/
	if (obj!=null) {
		if (obj.options[obj.selectedIndex].value!="") { 
			if (openExtLinkWindow(obj.options[obj.selectedIndex].value, msgWindowURL)){
				// Origional code that will open in a new window
				//window.open(obj.options[obj.selectedIndex].value,'');
				window.location = obj.options[obj.selectedIndex].value;
				
			} 
		}
		obj.selectedIndex=0;
	}
}

function openExtLinkWindow(href, msgWindowURL) {
/** 
 *href patterns that don't require "splash" page and should be open
 *in a new window right away:
**/
	patterns = new Array("www.otsegocounty.com", "otsegocounty.com",
    "../", "./", "mailto:", "#", " " );
	
	re_pttrn = "www.otsegocounty.com";

	var ind = 0;
	var res = -1;
	var sstr = href;
	var str1 = msgWindowURL+"?EXTURL="+href;
	var winOpt = "height=350,width=545,status=yes,toolbar=no,menubar=no,location=no";
	var i = href.indexOf("http://");


	if ( i >= 0) { sstr = href.substr(7); }

	for (ind=0;ind<patterns.length;ind++) {
		res = sstr.indexOf(patterns[ind]);
		//alert("pattern ["+patterns[ind]+"] found? res ["+res+"]");
		if ( res >= 0) { 
			str1 = href;
			if ( ind==0 ) { str1 = href.replace(patterns[ind], re_pttrn); }
			break; 
		}
	}
	//alert('winOpt:  '+winOpt);
	//alert('res :  '+res);
	if ( res >=0 ) { /*wobj = window.open(str1);*/ return true;} 
	else { wObj = window.open(str1,'',winOpt); return false;}
}

function getURLParameter() {

  queryVar = this.location.href;
  var inq = queryVar.indexOf('?');
  queryVar = queryVar.substring(inq + 1);

  if (inq > 0) { _query_string = queryVar; }

  var text1 = "&";
  var strLength = queryVar.length, txtLength = text1.length;

  var i = queryVar.indexOf(text1);

  while (i+txtLength < strLength) {
    if (i > 0) {
      qrysplit(queryVar.substring(0,i),"=");
    }
    else {
      qrysplit(queryVar,"=");
    }
    queryVar = queryVar.substring(i+txtLength,strLength);
    var i = queryVar.indexOf(text1);
    if (i < 1) {
      i = strLength + 1;
    }
  }

  qrysplit(queryVar,"=");
}

function qrysplit(string,text) {
    name = string.substring(0,string.indexOf(text));
    value = string.substring(string.indexOf(text) + 1);
    eval("query_" + name + " = value;");
}

/* added by DTW, Fig Leaf Software, 20051205 to affect all links within documents */
function setLinkClickEvent() {
	for (var i = 0; i < document.links.length; i++) {
		document.links[i].onclick = callOpenExtLinkWindow;
	}
}

function callOpenExtLinkWindow() {
	var warningURL = 'http://www.otsegocounty.com/depts/clk/splashpage.html';
	return openExtLinkWindow(this.href, warningURL);
	
}
/* end added section */



