function isPositive(n) { return (n > 0);}
function createRequestObject() { FORM_DATA = new Object(); separator = ','; query = '' + this.location; query = query.substring((query.indexOf('?')) + 1); if (query.length < 1) { return false;}
keypairs = new Object(); numKP = 1; while (query.indexOf('&') > -1) { keypairs[numKP] = query.substring(0,query.indexOf('&')); query = query.substring((query.indexOf('&')) + 1); numKP++;}
keypairs[numKP] = query; for (i in keypairs) { keyName = keypairs[i].substring(0,keypairs[i].indexOf('=')); keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1); while (keyValue.indexOf('+') > -1) { keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1);}
keyValue = unescape(keyValue); if (FORM_DATA[keyName]) { FORM_DATA[keyName] = FORM_DATA[keyName] + separator + keyValue;} else { FORM_DATA[keyName] = keyValue;}
}
return FORM_DATA;}
FORM_DATA = createRequestObject(); function windowWidth() { var myWidth = 0; if( typeof( window.innerWidth ) == 'number' ) { myWidth = window.outerWidth;} else if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { myWidth = document.documentElement.clientWidth;} else if( document.body && ( document.body.clientWidth) ) { myWidth = document.body.clientWidth;}
return myWidth;}
function windowHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { myHeight = window.outerHeight;} else if( document.documentElement &&
( document.documentElement.clientHeight ) ) { myHeight = document.documentElement.clientHeight;} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { myHeight = document.body.clientHeight;}
return myHeight;}
function windowInnerHeight() { var browserName = navigator.appName; if (browserName != 'Netscape')
iH = document.body.clientHeight; else
iH = window.innerHeight; return iH;}
function windowInnerWidth() { var browserName = navigator.appName; if (browserName != 'Netscape')
iW = document.body.clientWidth; else
iW = window.innerWidth; return iW;}
function borderVertical() { hB=parseInt(FORM_DATA['height']) + parseInt(windowHeight()) - parseInt(windowInnerHeight()); return hB;}
function borderHorizontal() { vB=parseInt(FORM_DATA['width']) + parseInt(windowWidth()) - parseInt(windowInnerWidth()); return vB;}
function resizePictureWindow() { var browserName = navigator.appName; if (browserName == 'Netscape')
window.resizeTo(borderHorizontal(),borderVertical()); else { window.resizeTo(FORM_DATA['width'],FORM_DATA['height']); h=parseInt(FORM_DATA['height']) + parseInt(FORM_DATA['height']) - parseInt(windowHeight()); w=parseInt(FORM_DATA['width']) + parseInt(FORM_DATA['width']) - parseInt(windowWidth()); if (parseInt(FORM_DATA['height']) - parseInt(windowHeight()) > 0)
window.resizeTo(w,h);}
}
function toggle( targetId ){ if (document.getElementById){ target = document.getElementById( targetId ); if (target.style.display == "none"){ target.style.display = "";} else { target.style.display = "none";}
}
}
function cleanText (str) { while (str.indexOf(String.fromCharCode(8221)) >= 0)
str=str.replace(String.fromCharCode(8221),"\""); while (str.indexOf(String.fromCharCode(8220)) >= 0)
str=str.replace(String.fromCharCode(8220),"\""); while (str.indexOf(String.fromCharCode(8216)) >= 0)
str=str.replace(String.fromCharCode(8216),"'"); while (str.indexOf(String.fromCharCode(8217)) >= 0)
str=str.replace(String.fromCharCode(8217),"'"); while (str.indexOf(String.fromCharCode(8211)) >= 0)
str=str.replace(String.fromCharCode(8211),"&#150;"); while (str.indexOf(String.fromCharCode(8212)) >= 0)
str=str.replace(String.fromCharCode(8212),"&#151;"); while (str.indexOf(String.fromCharCode(8230)) >= 0)
str=str.replace(String.fromCharCode(8230),"..."); return str;}
function selectLink (linkTarget) { for (i=0; i<document.links.length; i++)
if(document.links[i].name)
if(document.links[i].name == linkTarget)
document.links[i].focus();}
function implode( delim, arr ) { var str =""; for ( var i = 0; i < arr.length; i++ ) { str += arr[i]; if ( (i+1) < arr.length ) str += delim;}
return str;}
function isdefined(ckVar)
{ var DEFINED_V=true; function handleError() { DEFINED_V=false; return true;}
var oldOnError=window.onerror; window.onerror=handleError; try { eval(ckVar);}catch (e)
{ DEFINED_V=false;}
window.onerror=oldOnError; return DEFINED_V;}
function listappend ( list, newValue, delimiter )
{ if (listappend.arguments.length < 3)
delimiter=","; if (list.length > 0)
list += delimiter; list += newValue; return list;}
function listgetat ( list, position, delimiter )
{ if (listgetat.arguments.length < 3)
delimiter=","; listarr = list.split(delimiter); return listarr [ position - 1 ];}
function listlength ( list, delimiter )
{ if (listlength.arguments.length < 2)
delimiter=","; listarr = list.split(delimiter); return listarr.length;}
function listsetat ( list, position, value, delimiter )
{ if (listsetat.arguments.length < 4)
delimiter=","; listarr = list.split(delimiter); listarr[position - 1] = value; newlist = implode (delimiter, listarr); return newlist;}
function submitForm (formObx) { formValidated=1; for (u=0; u < formObx.elements.length; u++) { testBlur=""+formObx.elements[u].onblur; if (testBlur.indexOf("checkTextBox") > 0)
if (!checkTextBox(formObx.elements[u].value)) { formValidated=0; formObx.elements[u].focus(); break;}
if (testBlur.indexOf("checkSoc") > 0)
if (!checkSoc(formObx.elements[formObx.elements[u].name])) { formValidated=0; formObx.elements[u].focus(); break;}
if (testBlur.indexOf("checkPhone") > 0)
if (!checkPhone(formObx.elements[formObx.elements[u].name])) { formValidated=0; formObx.elements[u].focus(); break;}
if (testBlur.indexOf("checkEmail") > 0)
if (!checkEmail(formObx.elements[u].value)) { formValidated=0; formObx.elements[u].focus(); break;}
if (testBlur.indexOf("checkMultipleChoice") > 0)
if (!checkMultipleChoice(formObx.elements[formObx.elements[u].name])) { formValidated=0; formObx.elements[u].focus(); break;}
if (testBlur.indexOf("checkCheckBox") > 0)
if (!checkMultipleChoice(formObx.elements[formObx.elements[u].name])) { formValidated=0; formObx.elements[u].focus(); break;}
if (testBlur.indexOf("checkSelect") > 0)
if (!checkSelect(formObx.elements[u])) { formValidated=0; formObx.elements[u].focus(); break;}
}
if (formValidated)
formObx.submit(); else
alert("Please Complete all required fields");}
function hideSelects (formObj) { for (y=0; y < formObj.elements.length; y++)
if (formObj.elements[y].type.indexOf("select") >= 0)
formObj.elements[y].style.visibility='hidden';}
function showSelects (formObj) { for (y=0; y < formObj.elements.length; y++)
if (formObj.elements[y].type.indexOf("select") >= 0)
formObj.elements[y].style.visibility='visible';}
function checkForm (formObj)
{ for (y=0; y < formObj.elements.length; y++) { if (typeof(formObj.elements[y].onblur) == 'function') { formObj.elements[y].focus(); formObj.elements[y].blur();}
}
formObj.elements[0].focus();}
function checkTextBox (s) { if (s.length > 0)
return true
else{ return false;}
}
function checkSoc (check) { isDone = isSSN(stripCharsNotInBag(check.value,'0123456789')); return isDone;}
function checkPhone (check) { isDone = isUSPhoneNumber(stripCharsNotInBag(check.value,'0123456789')); return isDone;}
function checkEmail(str) { var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){ return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false
}
if (str.indexOf(at,(lat+1))!=-1){ return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false
}
if (str.indexOf(dot,(lat+2))==-1){ return false
}
if (str.indexOf(" ")!=-1){ return false
}
return true
}
function checkPassword (pass1, pass2) { if (pass1.length < 5)
return false; if (pass1==pass2)
return true; else
return false;}
function checkCheckBox (check) { if (check.checked)
return true; else
return false;}
function checkMultipleChoice (check) { var isDone=false; for (x=0; x < check.length; x++)
if (check[x].checked)
isDone=true; return isDone;}
function checkSelect (check) { var isDone=false; if (check.options.selectedIndex >= 0)
isDone=true; return isDone;}
function openWin (loc,width,height,left,top) { msg=window.open(loc,"msg","height="+height+",width="+width+",left="+left+",top="+top+",statusbar=1"); msg.topmargin = 0; msg.leftmargin = 0; msg.marginwidth = 0; msg.marginheight = 0; msg.window.focus();}
function openWinSimple (loc) { msg=window.open(loc,"msg","statusbar=0"); msg.topmargin = 0; msg.leftmargin = 0; msg.marginwidth = 0; msg.marginheight = 0; msg.window.focus();}
function tocItem (name) { this.on = new Image(); this.on.src = relroot+"/images/" + name + "_over.gif"
this.off = new Image(); this.off.src = relroot+"/images/" + name + ".gif"
}
function sideDot () { this.red = new Image(); this.red.src = relroot+"/images/dot_red.gif"
this.green = new Image(); this.green.src = relroot+"/images/dot_green.gif"
this.orange = new Image(); this.orange.src = relroot+"/images/dot_orange.gif"
}

function form_done (imgName)
{ if (document.images)
document[imgName].src = dot.green.src;}
function form_inprogress (imgName)
{ if (document.images)
document[imgName].src = dot.orange.src;}
function form_undone (imgName)
{ if (document.images)
document[imgName].src = dot.red.src;}
if (document.images != null) { dot = new sideDot();}
var browserName = navigator.appName; var browserVersion = parseInt(navigator.appVersion); var browser; function checkAll(field)
{ if ('' + field.length != 'undefined')
for (i = 0; i < field.length; i++)
field[i].checked = true; else
field.checked = true;}
function getCheckBoxes(field) { fields=""; if ('' + field.length != 'undefined') { for (i = 0; i < field.length; i++)
if (field[i].checked)
fields = listappend(fields,field[i].value);}
else
fields = field.value; return fields;}
function uncheckAll(field)
{ if ('' + field.length != 'undefined')
for (i = 0; i < field.length; i++)
field[i].checked = false; else
field.checked=false;}
