function openHelp(url) {
	window.open(url,'help','width=350,height=400,scrollbars=yes,resizable=yes,screenx=400,screeny=100,top=100,left=400');
}

function openPrint(url) {
	window.open('/ecalc_citizens/print.asp','help','width=650,height=450,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,screenx=200,screeny=100,top=100,left=200');
}

function openChange() {
	window.open('/ecalc_citizens/change.asp','help','width=650,height=450,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,screenx=200,screeny=100,top=100,left=200');
}

document.onkeydown = mykeyhandler;

//handle key pressed actions
function mykeyhandler() {
	//F5 keycode set to return
	if (window.event && window.event.keyCode == 116) {
    	window.event.keyCode = 10;
  	}
	//Return disabled
    if (window.event && window.event.keyCode == 10) {
        // try to cancel the backspace
        window.event.cancelBubble = true;
        window.event.returnValue = false;
        return false;
    }
}

//handle right click
function right(e) {
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
		alert("These features have been disabled");
		return false;
	}
	return true;
}


document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

//set's first form item to focus
var qstr, hid;
qstr = new String(window.location);
if( (qstr.indexOf('question12') > -1) || (qstr.indexOf('question30') > -1) )	{
	
} else {
 if( qstr.indexOf('question') > -1 )	{
	if( (qstr.indexOf('2') > -1) && (document.forms[0].elements[0].name == 'direction') ) { //&& (document.forms[0].elements[0].name == '')
		//document.forms[0].elements[0].focus();
	} else {
		hid = new String(document.forms[0].elements[1].type);
	
		if( (qstr.indexOf('8') > -1) && hid == 'hidden' ) {
			document.forms[0].elements[2].focus();
		} else {
			document.forms[0].elements[1].focus();
		}
	}
 }
}
	
//IE only function that submits the form when the help tab is clicked on
function subForm(q,help,d_view){
	if(d_view)
		document.forms['form2'].action = "question"+q+".asp?help="+help+"&d_view="+d_view;
	else
		document.forms['form2'].action = "question"+q+".asp?help="+help;
		
	document.forms['form2'].method = "POST";
	document.forms['form2'].submit();
	
}