var Dpath = false;

function declarePath(p) {
  Dpath = p;
}

var show = 0;
function hide(name) {
	x = document.getElementById(name);

	if (x.style.display=='none') {
		x.style.display = 'block';
	}
	else if (x.style.display = 'block') {
		x.style.display = 'none';
	}
}


function col1(name) {alert('col1');
	x = document.getElementById(name);

	x.style.backgroundColor = '#C9BEA6';
	x.style.color = 'white';
}

function col2(name) {alert('col2');
	x = document.getElementById(name);

	x.style.backgroundColor = '#F8F4E8';
	x.style.color = '#BCB29B';
}

function fun2() {alert('fun2');
	x = document.getElementById('styleul');

	if (x.style.display=='block') {
		x.style.display = 'none';
	}
	else if (x.style.display=='none') {
		x.style.display = 'block';
		show = 1;
	}
}

function fun1() {alert('fun1');
	x = document.getElementById('styleul');
	if (x.style.display=='block' && show!=1) {
		x.style.display = 'none';
	}
	show = 0;
}

function color(o) {
	if (o.style.backgroundColor == '')	o.style.backgroundColor = '#CDBD9B';
	else o.style.backgroundColor = '';
}


var menu_on = 0;

function menu2() {alert('menu2');
	x = document.getElementById('pmenu');
	
	if (!x) {return false}

	if (x.style.display=='block') {
		x.style.display = 'none';
	}
	else if (x.style.display=='none') {
		x.style.display = 'block';
		menu_on = 1;
	}
}

function menu1() {alert('menu1');
	x = document.getElementById('pmenu');
	
	if (!x) {return false}
	
	if (x.style.display=='block' && menu_on!=1) {
		x.style.display = 'none';
	}
	menu_on = 0;
}

//------------------------

function select_all(ob) {
  var arr = document.forms.sett.elements;
  ile = arr.length;
  if (ob.hasAttribute("checked")) {
    for(i=0;i<ile;i++) {
      if (arr[i].type=="checkbox") {
        arr[i].removeAttribute("checked");
      }
    }
  }
  else {
    for(i=0;i<ile;i++) {
      if (arr[i].type=="checkbox") {
        arr[i].setAttribute("checked","checked");
      }
    }
  }
}

