
function numbersonly(e)
{
//var unicode=e.charCode? e.charCode : e.keyCode;
	var unicode=document.all? e.keyCode : e.which;
	if (unicode!=8)
	{
		if (unicode<48||unicode>57) //if not a number
			return false; //disable key press
	}
}

function addbookmark(bookmarkurl, bookmarktitle)
{
	if (document.all)
	{
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}
}

function isNumericKey(e)
{
	var k = document.all ? e.keyCode : e.which;
	return ((k > 47 && k < 58) || k == 8 || k == 0);
}

function extractNumeric(str)
{
	return str.replace(/\D/g,"");
}

function showtextbox(n)
{
	hidetextbox();
	for(var i=0; i < n; i++)
	{
		document.getElementById("dtc"+i).innerHTML='<div id="dependentAge" >Age Child '+(i+1)+'</div><input size="2" name="dependant'+i+'" id="dependant'+i+'" onKeyPress="return numbersonly(event);" maxlength="2">';
	}
	restorevalues(n)
}

function restorevalues(d)
{
	for(var i=0; i<d; i++)
		document.getElementById("dependant"+i).value = hidden[i+18]!=""?hidden[i+18]:"";
}

function hidetextbox()
{
	for(var i=0; i <= 5; i++)
		document.getElementById("dtc"+i).innerHTML='';
}
function popupwindow(URL) 
{
	popupWin = window.open(URL, 'Information', 'menubar=no,location=no,scrollbars,width=640,height=480');
	window.top.name = 'opener';
}

/*
JSTarget function by Roger Johansson, www.456bereastreet.com
*/
var JSTarget = {
init: function(att,val,warning) {
if (document.getElementById && document.createElement && document.appendChild) {
var strAtt = ((typeof att == 'undefined') || (att == null)) ? 'class' : att;
var strVal = ((typeof val == 'undefined') || (val == null)) ? 'non-html' : val;
var strWarning = ((typeof warning == 'undefined') || (warning == null)) ? ' (opens in a new window)' : warning;
var oWarning;
var arrLinks = document.getElementsByTagName('a');
var oLink;
var oRegExp = new RegExp("(^|\\s)" + strVal + "(\\s|$)");
for (var i = 0; i < arrLinks.length; i++) {
oLink = arrLinks[i];
if ((strAtt == 'class') && (oRegExp.test(oLink.className)) || (oRegExp.test(oLink.getAttribute(strAtt)))) {
oWarning = document.createElement("em");
oWarning.appendChild( document.createTextNode(strWarning) );
//oLink.appendChild(oWarning);
oLink.onclick = JSTarget.openWin;
}
oWarning = null;
}
}
},
openWin: function(e) {
var event = (!e) ? window.event : e;
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return true;
else {
var oWin = window.open(this.getAttribute('href'), '_blank');
if (oWin) {
if (oWin.focus) oWin.focus();
return false;
}
oWin = null;
return true;
}
},
/*
addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
*/
addEvent: function(obj, type, fn) {
if (obj.addEventListener)
obj.addEventListener(type, fn, false);
else if (obj.attachEvent) {
obj["e"+type+fn] = fn;
obj[type+fn] = function() {obj["e"+type+fn]( window.event );}
obj.attachEvent("on"+type, obj[type+fn]);
}
}
};
JSTarget.addEvent(window, 'load', function(){JSTarget.init();});