

function submit_bc_st_pobierz()	{
	
	$('#downloadAfile').submit();
}


function SwitchVisibility(warstwa, cell){
  var div = null;
  var div_color = new Array();
  var i=0;

  if (document.getElementById){
    div = document.getElementById(warstwa);
    
    while(document.getElementById(cell+i)!=null){
      div_color[i] = document.getElementById(cell+i);
      i++;
    }
  }
  else if (document.all){
    div = document.all[warstwa];
    div_color = document.all[cell];
  }
  else if (document.layers){
    div = document.layers[warstwa];
    div_color = document.layers[cell];
  }
  if (!div) {	}
  else if (div.style){
    if (div.style.display != 'none'){
      div.style.display = 'none';
      for(var k=0;k<div_color.length;k++){
        div_color[k].className='menujsoff';
      }
    }
    else{
      if (browsertype=="IE") {
        div.style.display = 'block';
      } else {
        div.style.display = 'table-row';
        }
      for(var k=0;k<div_color.length;k++){
        div_color[k].className='menujson';
      }
    }
  } else {
    if (div.visibility == 'hidden'){
      div.visibility = 'show';
    }
    else{
      div.visibility = 'hidden';
    }
  }
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}


// funkcja do ukrywania warstwy
function Hide2(warstwa){

var div = null;

  if (document.getElementById){
    div = document.getElementById(warstwa);
  }
  else if (document.all){
    div = document.all[warstwa];
  }
  else if (document.layers){
    div = document.layers[warstwa];
  }

  if (!div) {	}
  else if (div.style){
    if (div.style.display != 'none'){
      div.style.display = 'none';
    }
  } else {

      div.visibility = 'hidden';
  }
}

// funkcja do pokazywania warstwy
function Show(warstwa){

var div = null;
	var browsertype='';
  if (document.getElementById){
    div = document.getElementById(warstwa);
  }
  else if (document.all){
    div = document.all[warstwa];
  }
  else if (document.layers){
    div = document.layers[warstwa];

  }
  if(!div){
    }
  else if (div.style){
    div.style.display = 'block';
      }
  else {
      div.visibility = 'visible';
    }

}
function menu_show_content(name)
  {
    if (getCookie(name))
      {
        return true;
      }
    else
      {
        return false;
      }
  }
  
function menu_swich_content(name)
  {
    if (menu_show_content(name))
      {
        menu_close_content(name);
      }
    else
      {
        menu_open_content(name);
      }
  }
  
function SwitchVisibilityImproved(warstwa, cell){

	
  var goon = true;
  var field;
  var i=0;
  while (goon) {
    field = document.getElementById(warstwa+'-'+i);
    if (field) {
     
      Hide(warstwa+'-'+i, cell);
      i++;
    } else {
      goon=false;
    }
  }
  if(document.getElementById(warstwa+'-'+cell))
  		Show(warstwa+'-'+cell);
}

function FormSubmit(hidden, action)	{
	
	ChangeInputValueById(hidden, action)
	document.form.submit();
}
	
function ChangeInputValueById(hidden, action)	{
	
	
	var change = document.getElementById(hidden);
	change.value = action;
}

