<!--

// form functions

function form_graphcolor(char)
 {
	var hexcolor;

	hexcolor = '#'+getElem('id','func_' + char + '_color', null).value.substring(1,7);
	getElem('id','func_name_' + char, null).style.color = hexcolor;
	getElem('id','func_colorfield_' + char, null).style.background = hexcolor;
 }

function form_emptyvalue(field,cbox)
 {
	if(field.value == '')
		getElem('id',cbox,null).checked = false;
 }

function form_submit() {
	if(getElem('id','output_pwindow',null).checked) {

		var width;
		var height;
		var left;

		width = Math.min(screen.availWidth - 10, Number(getElem('id','plot_size_x',null).value) + 100);
		height = screen.availHeight - 75;

		left = Math.max(5, screen.availWidth - width - 10);

		childwindow = window.open('', 'resultwindow', 'width=' + width + ',height=' + height + ',resizable=yes,location=no,menubar=no,toolbar=no,status=no,left=' + left + ',top=5,scrollbars=yes,dependent=no');

		getElem('id','fedit',null).target = 'resultwindow'

		childwindow.focus();

		return true;
	}
	else {
		getElem('id','fedit',null).target = '_self'
		return true;
	}

}

// switch checkbox status

function switchchecked(id)
 {
 	if(getElem('id',id,null).disabled == false)
    if(getElem('id',id,null).checked == true)
      getElem('id',id,null).checked = false;
    else
      getElem('id',id,null).checked = true;
 }

// open new window

function openchildwin(url,winid)
 {
 	if(!winid)
 	 {
 	 	var now = new Date();
 		winid = "x"+now.getTime();
 	 }

	childwindow = window.open(url, winid, 'width=300,height=450,resizable=yes,location=no,menubar=no,toolbar=no,status=no,left=50,top=50,scrollbars=yes,dependent=yes');
	childwindow.focus();
 }

//-->