
function popup(url,name,width,height,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

function copyField(from, to) {
  document.getElementById(to).value = document.getElementById(from).value;
}

function set(input) {

  input.value = '';
}

function leave(input) {

  input.value = (input.value == '') ? input.defaultValue : input.value;
}
function changeImage(img, img_src) {

  img.src = img_src;
}

var old_table = '';
var is_opened  = 'none';

function toggle( table ) {

    table_obj = document.getElementById(table);
    is_opened = table_obj.style.display;

	if (table != 'page_01')
	{
		document.getElementById('page_01').style.display = 'none';
	}	

    if (old_table != '' && is_opened == 'none') {
        old_table_obj = document.getElementById(old_table);
        old_table_obj.style.display = 'none';		
    }

    if (old_table != table || is_opened == 'none') {

        table_obj.style.display = 'block';
    }

    old_table = table;
}

function bold(id, count) {
	for (i = 1; i <= count; i++) {
		document.getElementById('a0'+i).style.fontWeight = 'normal';		
	}
	document.getElementById(id).style.fontWeight = 'bold';
}

function line_over(id) {
    class_plus = '';
    if (line_over.arguments[1] != 'undefined') {
        class_plus = ' extra_cell';
    }

    if (typeof(id) == 'object') {
    	id.className = 'row_over'+class_plus;
    } else {
    	document.getElementById('row_'+id).className = 'row_over'+class_plus;
    }
}

function line_out(id) {

    class_plus = '';
    if (line_out.arguments[1] != 'undefined') {
        class_plus = 'extra_cell';
    }

    if (typeof(id) == 'object') {
    	id.className = 'row_out'+class_plus;
    } else {
    	document.getElementById('row_'+id).className = 'row_out'+class_plus;
    }

}


