Event.observe(window, 'load', function() {
  if ($('faqIndex')) {
    var count = 1;
    var tab = $$('#page h2');
    tab.each(function(e) {
      e.id='q'+count++;
      var header = document.createElement("div");
      var link = document.createElement("a");
      link.href = "#"+e.id;
      link.innerHTML = e.innerHTML;
      header.appendChild(link);
      $('faqIndex').appendChild(header);
    });
  }
});

function setCookie (name, val) {
  document.cookie = name+"="+val;
}

function checkKey(e, k) {
  if(window.event) { // IE 
    if (e.keyCode == 13) search(k);
  } else if(e.which) { // Netscape/Firefox/Opera
    if (e.which == 13) search(k);
  }
}

function step(niv) {
	if(niv == 1) {
		Kwo.go("/sys/visitor.signin");
	} else {
		for(i=2; i<=5; i++) {
			$('screenStep'+i).hide();
		}
		switch(niv) {
			case 2:
			case 3:
			case 4:
			case 5:			
				$('screenStep'+niv).show();
			break;
		}
	}
}

function displayContentBookee(b, p, n) {
	var id = 'boxContent_' + b;
	var idDiv = 'boxContentDiv_' + b;
	var idDown = 'listeDown_' + b;
	var idUp = 'listeUp_' + b;
	var spans = $$('.sep_'+b);
	if (p == 2) {
		spans.each(function(span){
			span.innerHTML = '<br>';
		});
		$(idDiv).setStyle({ height: '100%' });
		$(idDown).hide();
		$(idUp).show();
	} else if(p == 1) {
		spans.each(function(span){
			span.innerHTML = ' - ';
		});
		$(idDiv).setStyle({ height: '100px' });			
		$(idUp).hide();
		$(idDown).show();
	}
	$('box'+b).show();
	$('pic-'+n+'_max').hide();
	$('pic-'+n+'_min').show();
}
