//'  xxxx.js
//'*****************************************************************
//'* 08/16/01   Proj-M133   by  Kent Welling
//'* Create script.
//'*****************************************************************

function setFocus(formObj) {
	formObj.focus()
	formObj.select()
}
function setCheckBox(formObj, val) {
	var n = formObj.length
	
	for (var i=0; i < n; i++) {
//	  alert(formObj[i].name + " len=" + n + " val=" + formObj[i].value+".")
	  if (formObj[i].value == val) {
		formObj[i].checked = true
	  }
	}
}
function setTextBox(formObj, val) {
	var n = formObj.length
	
//	  alert(formObj.name + " val=" + formObj.value)
	  formObj.value = val
}


var newWind
var isIE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false

function popup(type) {
  newWindow(type)
  return false
}

function newWindow(type) {
  var output = ""

/*  var out2 = ""
  var f = document.forms['parms'].magcode
  out2 += "#="+f.length+"\n"
  for (var i=0; i < f.length; i++){
	out2 += f[i].value+"="+f[i].selected+"\n"
  }
  alert(out2)
*/


  switch (type) {
	case "privacy":
		if (newWind && !newWind.closed
					&& newWind.name != 'privacy') {
		  newWind.close()
		  newWind = null
		}
		if (! newWind || newWind.closed) {
		  newWind = window.open("", "privacy", "HEIGHT=300,WIDTH=600,SCROLLBARS")
		  if (newWind.opener == null) {
			newWind.opener = window
		  }
		  newWind.moveTo(20,50)
		  newWind.focus()

		  output += '<html><head><title>Kable News Company</title>'
		  output += '<frameset rows="50, *">'
		  output += '<frame name="docHead" src="/privhead.asp"'
		  output += ' scrolling="no" noresize frameborder="0">'
//		  output += '<frame name="docDisplay" src="javascript:parent.opener.wrtDocDisplay()"'
		  output += '<frame name="docDisplay" src="/legal/priv.html"'
		  output += ' scrolling="auto" noresize frameborder="0">'
/*		  output += '<frame name="docButton" src="javascript:parent.opener.wrtDocButton()"'
		  output += ' scrolling="no" noresize frameborder="0">'
***/
		  output += '</frameset>'
		  output += '</head></html>'
		  newWind.document.write(output)
		  newWind.document.close()

		} else {
		  newWind.focus()
		}
		break;

	case "tos":
		if (newWind && !newWind.closed
					&& newWind.name != 'TOS') {
		  newWind.close()
		  newWind = null
		}
		if (! newWind || newWind.closed) {
		  newWind = window.open("", "TOS", "HEIGHT=300,WIDTH=600,SCROLLBARS")
		  if (newWind.opener == null) {
			newWind.opener = window
		  }
		  newWind.moveTo(20,50)
		  newWind.focus()
		  
		  output += '<html><head><title>Kable News Company</title>'
		  output += '<frameset rows="50, *">'
		  output += '<frame name="docHead" src="/toshead.asp"'
		  output += ' scrolling="no" noresize frameborder="0">'
		  output += '<frame name="docDisplay" src="/legal/tos.html"'
		  output += ' scrolling="auto" noresize frameborder="0">'
		  output += '</frameset>'
		  output += '</head></html>'
		  newWind.document.write(output)
		  newWind.document.close()

		} else {
		  newWind.focus()
		}
		break;

	default :
		alert("newWindow(): 'switch' failed, unknown 'type' = " + type)
  }	// end: switch
}	// end: newWindow



