$(document).ready(function() {
    
		$('#facebook_click').toggle(function() {
			$('#facebook_box').css('margin-left','0px');
}, function() {
  $('#facebook_box').css('margin-left','-292px');
});

		
		});


function lupa(Ob, Li) {
		if (Li==1) {
			Ob.src="images/lupa_z.gif";
			}
		if (Li==0) {
			Ob.src="images/lupa.gif";
			}
}

function search(){
		document.form.action.value="true";
		document.form.submit();
}

function click(link){
window.location.href= link;
}

/*










function ustaw_aktywuj(id,nazwa){
	
 if(confirm('Czy napewno chcesz aktywować konto użytkownika: ' + nazwa + '?'))
	 {
		document.form_edytuj.id_aktywuj.value=""+id;
		document.form_edytuj.submit();
	}
}


function ustaw_deaktywuj(id,nazwa){
	
 if(confirm('Czy napewno chcesz deaktywować konto użytkownika: '+ nazwa + '?'))
	 {
		document.form_edytuj.id_deaktywuj.value=""+id;
		document.form_edytuj.submit();
	}
}



function usun_stacje(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć stację: '  + nazwa + '?'))
	 {
		document.edytor_form.id_usun.value=""+id;
		document.edytor_form.submit();
	}
}

function usun_kgrupa(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć grupę: '  + nazwa + '?'))
	 {
		document.form_grupy.id_usun.value=""+id;
		document.form_grupy.submit();
	}
}

function usun_grupa(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć grupę: '  + nazwa + '?'))
	 {
		document.grupy_form.id_usun.value=""+id;
		document.grupy_form.submit();
	}
}

function usun_grupa_linki(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć grupę: '  + nazwa + '?'))
	 {
		document.grupy_form_linki.id_usun.value=""+id;
		document.grupy_form_linki.submit();
	}
}

function usun_box(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć box: '  + nazwa + '?'))
	 {
		document.boxy_form.id_usun.value=""+id;
		document.boxy_form.submit();
	}
}

function usun_grupa(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć grupę: '  + nazwa + '?'))
	 {
		document.form_grupy.id_usun.value=""+id;
		document.form_grupy.submit();
	}
}

function usun_dzial(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć dział: '  + nazwa + '?'))
	 {
		document.dzialy_form.id_usun.value=""+id;
		document.dzialy_form.submit();
	}
}

function usun_link(id,icon,name){

 if(confirm('Czy napewno chcesz usunąć link: '  + name + '?'))
	 {
		document.linki_form.id_usun.value=""+id;
		document.linki_form.icon.value=""+icon;
		document.linki_form.submit();
	}
}

function usun_dokument(id,identity){

 if(confirm('Czy napewno chcesz usunąć plik: '  + identity + '?'))
	 {
		document.dokument_form.id_usun.value=""+id;
		document.dokument_form.identity.value=""+identity;
		document.dokument_form.submit();
	}
}



function usun_strone(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć stronę: '  + nazwa + '?'))
	 {
		document.strony_form.id_usun.value=""+id;
		document.strony_form.submit();
	}
}


function usun_ceche(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć cechę: '  + nazwa + '?'))
	 {
		document.cechy_form.id_usun.value=""+id;
		document.cechy_form.submit();
	}
}

function usun_artykul(id,nazwa, identity){

 if(confirm('Czy napewno chcesz usunąć wiadomość: '  + nazwa + '?'))
	 {
		document.artykul_form.id_usun.value=""+id;
		document.artykul_form.identity.value=""+identity;
		document.artykul_form.submit();
	}
}

function usun_harm(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć harmonogram: ' + nazwa + '?'))
	 {
		document.harm_form.del_id_harm.value=""+id;
		document.harm_form.del_idstacji.value=""+id;
		document.harm_form.del_harm.value=1;
		document.harm_form.submit();
	}

}

function ustaw_usun(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć konto użytkownika: ' + nazwa + '?'))
	 {
		document.form_edytuj.id_usun.value=""+id;
		document.form_edytuj.submit();
	}
}


function ustaw_dodaj(){
	document.form.id_dodaj.value="true";
	document.form.submit();
}

function dodaj_grupa(){
	document.form_grupy.id_dodaj.value="true";
	document.form_grupy.submit();
}


function wyslij_zdjecie(){
	document.wiadomosc_form.picture.value="true";
	document.wiadomosc_form.submit();
}

function dzial_dodaj(){
	document.dzialy_form.id_dodaj.value="true";
	document.dzialy_form.submit();
}

function grupa_dodaj(){
	document.grupy_form.id_dodaj.value="true";
	document.grupy_form.submit();
}

function grupa_dodaj_linki(){
	document.grupy_form_linki.id_dodaj.value="true";
	document.grupy_form_linki.submit();
}


function dodaj_wiad_box(id){
	document.wiad_kolejnosc_form.article_id.value=""+id;
	document.wiad_kolejnosc_form.submit();
}

function dodaj_doc_group(id){
	document.grupy_kolejnosc_form.document_id.value=""+id;
	document.grupy_kolejnosc_form.submit();
}

function dodaj_link_group(id){
	document.linki_kolejnosc_form.link_id.value=""+id;
	document.linki_kolejnosc_form.submit();
}


function dokument_dodaj(){
	document.dokument_form.id_dodaj.value="true";
	document.dokument_form.submit();
}

function link_dodaj(){
	document.linki_form.id_dodaj.value="true";
	document.linki_form.submit();
}


function artykul_dodaj(){
	document.artykul_form.id_dodaj.value="true";
	document.artykul_form.submit();
}

function cechy_dodaj(){
	document.cechy_form.id_dodaj.value="true";
	document.cechy_form.submit();
}

function strona_dodaj(){
	document.strony_form.id_dodaj.value="true";
	document.strony_form.submit();
}

function box_dodaj(){
	document.boxy_form.id_dodaj.value="true";
	document.boxy_form.submit();
}


function ustaw_usun_rs(id,nazwa){

 if(confirm('Czy napewno chcesz usunąć role: ' + nazwa + '?'))
	 {
		document.form.id_usun.value=""+id;
		document.form.submit();
	}
}

function ustaw_zmien_rs(id_r,id,nazwa){
 if(confirm('Czy napewno chcesz zmienić ilość dostępnych stron dla roli: ' + nazwa + '?'))
	 {
		document.form.id_zmien.value=""+id;
		document.form.id_zmien_r.value=""+id_r;
		document.form.submit();
	}
}

function ustaw_zmien_up(id_ul,id_ur,nazwa,id){
	
 if(confirm('Czy napewno chcesz zmienić uprawnienia dla użytkownika: ' + nazwa + '?'))
	 {
		document.form.id_zmien_ul.value=""+id_ul;
		document.form.id_zmien_ur.value=""+id_ur;
		document.form.id.value=""+id;
		document.form.submit();
	}
}

function edytuj_strona(){
		document.boxy_kolejnosc_form.edytuj.value="true";
		document.boxy_kolejnosc_form.submit();
}


function edytuj_dzial_kolejnosc(){
		document.dzial_kolejnosc_form.edytuj.value="true";
		document.dzial_kolejnosc_form.submit();
}

function edytuj_grupy_kolejnosc(){
		document.grupy_kolejnosc_form.edytuj.value="true";
		document.grupy_kolejnosc_form.submit();
}

function linki_grupy_kolejnosc(){
		document.linki_kolejnosc_form.edytuj.value="true";
		document.linki_kolejnosc_form.submit();
}

function edytuj_wiadomosc(){
		document.wiad_kolejnosc_form.edytuj.value="true";
		document.wiad_kolejnosc_form.submit();
}

function szukaj_wiadomosc(){
		document.wiad_kolejnosc_form.search.value="true";
		document.wiad_kolejnosc_form.submit();
}

function szukaj_link(){
		document.linki_kolejnosc_form.search.value="true";
		document.linki_kolejnosc_form.submit();
}

function szukaj_doc(){
		document.grupy_kolejnosc_form.search.value="true";
		document.grupy_kolejnosc_form.submit();
}


//funkcje do harmonogramu stacji

function podmiana(Ob, Li) {
		if (Li==1) {
			Ob.src="images/dol_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/dol.jpg";
			}
}

function podmiana1(Ob, Li) {
		if (Li==1) {
			Ob.src="images/cz_gor_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/cz_gor.jpg";
			}
}

function podmiana2(Ob, Li) {
		if (Li==1) {
			Ob.src="images/cz_dol_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/cz_dol.jpg";
			}
}

function podmiana3(Ob, Li) {
		if (Li==1) {
			Ob.src="images/iks_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/iks.jpg";
			}
}

function podmiana4(Ob, Li) {
		if (Li==1) {
			Ob.src="images/plus_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/plus.jpg";
			}
}
	
function repaint(val){

	
	
	for (i=0; i<val; i++){
	x=document.getElementById(""+i+"num");
	if(x){
		document.getElementById(""+i+"num").style.background='#f6f3ed';
		document.getElementById(""+i+"icao").style.background='#F6F3ED';
		document.getElementById(""+i+"nazwa").style.background='#F6F3ED';
		document.getElementById(""+i+"godz_r").style.background='#F6F3ED';
		document.getElementById(""+i+"czest_r").style.background='#F6F3ED';
		document.getElementById(""+i+"godz_w").style.background='#F6F3ED';
		document.getElementById(""+i+"czest_w").style.background='#F6F3ED';
		document.getElementById(""+i+"dyz_m").style.background='#F6F3ED';
		document.getElementById(""+i+"uwagi").style.background='#F6F3ED';
		document.getElementById(""+i+"podst").style.background='#F6F3ED';
		document.getElementById(""+i+"status").style.background='#F6F3ED';
		document.getElementById(""+i+"pomiar").style.background='#F6F3ED';
		}
	}

}

		
function edit(Obj){
		
		var tmp=Obj.getAttribute('id');
		var str=tmp.match(/^\d{1,}/);
		var tmpnum=str+"num";
		var tmpicao=str+"icao";
		var tmpnazwa=str+"nazwa";
		var tmpgodz_r=str+"godz_r";
		var tmpczest_r=str+"czest_r";
		var tmpgodz_w=str+"godz_w";
		var tmpczest_w=str+"czest_w";
		var tmpdyz_m=str+"dyz_m";
		var tmpuwagi=str+"uwagi";
		var tmppodst=str+"podst";
		var tmpedit=str+"edit";
		var tmpdel=str+"del";
		var tmpstatus=str+"status";
		var tmppomiar=str+"pomiar";
		var tmpidharmonogram=str+"idharmonogram";
		var tmpidstacji=str+"idstacji";


		document.getElementById('edycja').style.visibility='visible';
		document.getElementById('addst').style.visibility='hidden';
		document.getElementById('wyslane').value=1;
		document.getElementById('_add').value=0;
		
		document.getElementById('num').value=document.getElementById(""+tmpnum).innerHTML;
		document.getElementById('icao').value=document.getElementById(""+tmpicao).innerHTML;
		document.getElementById('uname').value=document.getElementById(""+tmpnazwa).innerHTML;
		document.getElementById('godz_r').value=document.getElementById(""+tmpgodz_r).innerHTML;
		document.getElementById('czest_r').value=document.getElementById(""+tmpczest_r).innerHTML;
		document.getElementById('godz_w').value=document.getElementById(""+tmpgodz_w).innerHTML;
		document.getElementById('czest_w').value=document.getElementById(""+tmpczest_w).innerHTML;
		document.getElementById('dyz_m').value=document.getElementById(""+tmpdyz_m).innerHTML;
		document.getElementById('uwagi').value=document.getElementById(""+tmpuwagi).innerHTML;
		document.getElementById('podstawa').value=document.getElementById(""+tmppodst).innerHTML;
		document.getElementById('idharmonogram').value=document.getElementById(""+tmpidharmonogram).value;
		document.getElementById('idstacji').value=document.getElementById(""+tmpidstacji).value;
		
		//document.getElementById('status').value=document.getElementById(""+tmpstatus).innerHTML;
		
		selected_val = document.getElementById(""+tmpstatus).innerHTML;
		str1=selected_val;
		str = str1.replace(/^\s+|\s+$/g, ''); 
		selected_val=str;
		//alert("p"+selected_val+"k");	
		
		if (selected_val == 'PO') {
		//alert(selected_val);	
		option0 = new Option('PO','PO',true);
		option1 = new Option("PC","PC");
		option2 = new Option("NP","NP");
		document.getElementById('status').options[0] = option0;
		document.getElementById('status').options[1] = option1;
		document.getElementById('status').options[2] = option2;
	
		
		
		//document.getElementById('status').options[document.getElementById('status').selectedIndex].text=document.getElementById(""+tmpstatus).innerHTML;
		//document.getElementById('status').options[document.getElementById('status').selectedIndex].value=document.getElementById(""+tmpstatus).innerHTML;
			
		}
		
		if (selected_val == 'PC') {
		//alert(selected_val);	
		option0 = new Option("PC","PC",true);
		option1 = new Option("PO","PO");
		option2 = new Option("NP","NP");
		
		document.getElementById('status').options[0] = option0;
		document.getElementById('status').options[1] = option1;
		document.getElementById('status').options[2] = option2;
		
		}
		
		if (selected_val=="NP") {
		//alert(selected_val);	
		option0 = new Option("NP","NP",true);
		option1 = new Option("PO","PO");
		option2 = new Option("PC","PC");
		
		document.getElementById('status').options[0] = option0;
		document.getElementById('status').options[1] = option1;
		document.getElementById('status').options[2] = option2;
		
		}
		
		if(selected_val=="") {
		//alert(selected_val);	
		option0 = new Option("NP","NP",true);
		option1 = new Option("PO","PO");
		option2 = new Option("PC","PC");
		
		document.getElementById('status').options[0] = option0;
		document.getElementById('status').options[1] = option1;
		document.getElementById('status').options[2] = option2;
		}
		
		
		selected_pomiar = document.getElementById(""+tmppomiar).innerHTML;
		st1=selected_pomiar;
		st = st1.replace(/^\s+|\s+$/g, ''); 
		selected_pomiar=st;
		//alert("p"+selected_val+"k");	
		
		if (selected_pomiar == 'CYW') {
		//alert(selected_val);	
		option0 = new Option('CYW','CYW',true);
		option1 = new Option("WOJ","WOJ");
		
		document.getElementById('pomiar').options[0] = option0;
		document.getElementById('pomiar').options[1] = option1;
		}
		
		if (selected_pomiar== 'WOJ') {
		//alert(selected_val);	
		option0 = new Option('WOJ','WOJ',true);
		option1 = new Option("CYW","CYW");
		
		document.getElementById('pomiar').options[0] = option0;
		document.getElementById('pomiar').options[1] = option1;
		}
		
		if (selected_pomiar== "") {
		//alert(selected_val);	
		option0 = new Option('WOJ','WOJ',true);
		option1 = new Option("CYW","CYW");
		
		document.getElementById('pomiar').options[0] = option0;
		document.getElementById('pomiar').options[1] = option1;
		}
		
		document.getElementById(""+tmpnum).style.background='#d5c8a6';
		document.getElementById(""+tmpicao).style.background='#d5c8a6';
		document.getElementById(""+tmpnazwa).style.background='#d5c8a6';
		document.getElementById(""+tmpgodz_r).style.background='#d5c8a6';
		document.getElementById(""+tmpczest_r).style.background='#d5c8a6';
		document.getElementById(""+tmpgodz_w).style.background='#d5c8a6';
		document.getElementById(""+tmpczest_w).style.background='#d5c8a6';
		document.getElementById(""+tmpdyz_m).style.background='#d5c8a6';
		document.getElementById(""+tmpuwagi).style.background='#d5c8a6';
		document.getElementById(""+tmppodst).style.background='#d5c8a6';
		document.getElementById(""+tmpstatus).style.background='#d5c8a6';
		document.getElementById(""+tmppomiar).style.background='#d5c8a6';
}

function hidden_st(){
document.getElementById('edycja').style.visibility='hidden';
document.getElementById('addst').style.visibility='hidden';


}

function confirm_del_harm(Obj) {
 var tmp=Obj.getAttribute('id');
 var str=tmp.match(/^\d{1,}/);
 var tmpicao=str+"icao";
 var tmpidharmonogram=str+"idharmonogram";
 var tmpidstacji=str+"idstacji";
 
	if(confirm('Czy napewno chcesz usunąć harmonogram dla stacji: ' + document.getElementById(""+tmpicao).innerHTML + '?'))
	 {
		document.getElementById('del_harm').value=1;
		document.getElementById('del_id_harm').value=document.getElementById(""+tmpidharmonogram).value;
		document.getElementById('del_idstacji').value=document.getElementById(""+tmpidstacji).value;
		document.harm_form.submit();
	}
}
	
	

function load(){
document.getElementById('_add').value=0;
document.getElementById('wyslane').value=0;
document.harm_form.del_harm.value=0;

}


function find_station() {
document.getElementById('findhid').value=1;
document.harm_form.submit();
}
//koniec funkcji do harmonogramu stacji



function weryfikacja_wiadomosc(){
komunikat_puste_pole='';
if(document.getElementById('e_title').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - tytuł';}
if(document.getElementById('e_long').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - nazwa długa';}
if(document.getElementById('e_editor').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - redaktor';}

if(komunikat_puste_pole!=''){
   komunikat_puste_pole = 'Należy uzupełnić obowiązkowe pola:' + komunikat_puste_pole;
   alert(komunikat_puste_pole);
   exit;
   }
	 
document.wiadomosc_form.action.value='edit';
document.wiadomosc_form.submit();


}

function weryfikacja_object(){
komunikat_puste_pole='';
if(document.getElementById('name').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - nazwa';}
if(document.getElementById('description').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - opis';}

if(komunikat_puste_pole!=''){
   komunikat_puste_pole = 'Należy uzupełnić obowiązkowe pola:' + komunikat_puste_pole;
   alert(komunikat_puste_pole);
   exit;
   }
	 
document.object_form.action.value='edit';
document.object_form.submit();


}


function weryfikacja_dokument(){
komunikat_puste_pole='';
if(document.getElementById('e_name_pl').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - nazwa (PL)';}
if(document.getElementById('e_desc_pl').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - opis (PL)';}


if(komunikat_puste_pole!=''){
   komunikat_puste_pole = 'Należy uzupełnić obowiązkowe pola:' + komunikat_puste_pole;
   alert(komunikat_puste_pole);
   exit;
   }
	 
document.plik_form.action.value='edit';
document.plik_form.submit();


}

function weryfikacja_link(){
komunikat_puste_pole='';
if(document.getElementById('e_name_pl').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - nazwa (PL)';}
if(document.getElementById('e_desc_pl').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - opis (PL)';}
if(document.getElementById('e_url').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - url';}


if(komunikat_puste_pole!=''){
   komunikat_puste_pole = 'Należy uzupełnić obowiązkowe pola:' + komunikat_puste_pole;
   alert(komunikat_puste_pole);
   exit;
   }
	 
document.link_form.action.value='edit';
document.link_form.submit();


}

function weryfikacja_harm()
{
komunikat_puste_pole='';
if(document.getElementById("uname").value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - nazwa';}
if(document.getElementById("num").value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - numer stacji';}


if(komunikat_puste_pole!=''){
   komunikat_puste_pole = 'Należy uzupełnić obowiązkowe pola:' + komunikat_puste_pole;
   alert(komunikat_puste_pole);
   exit;
   }
	 
	 Komunikat_niepoprawny_icao='';
if(document.getElementById('icao').value!=''){
    var dobryICAO=/^([A-Za-z]){4}$/;
    if (!dobryICAO.test(document.getElementById('icao').value)){
        Komunikat_niepoprawny_icao = 'Niepoprawny kod ICAO \r(poprawny kod = 4 duże litery np: EPWA)';
    }
  }
	if(Komunikat_niepoprawny_icao!=''){
   alert(Komunikat_niepoprawny_icao);
   exit;
   }
	 
	 Komunikat_niepoprawny_num='';
if(document.getElementById('num').value!=''){
    var dobryNUM=/^([0-9]){5}$/;
    if (!dobryNUM.test(document.getElementById('num').value)){
        Komunikat_niepoprawny_num = 'Niepoprawny numer \r( poprawny numer = 5 cyfr np: 12375 )';       
    }
  }
if(Komunikat_niepoprawny_num!=''){
   alert(Komunikat_niepoprawny_num);
   exit;
   }
	 
	 

document.edytor_form.submit();


}


function weryfikacja()
{
//obowiazkowe pola

komunikat_puste_pole='';
if(document.getElementById("nazwa").value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - nazwa';}
if(document.getElementById('prio').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - priorytet';}
if(document.getElementById('kodicao').value=='' && document.getElementById('wmo').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - ICAO lub numer WMO';}
if(document.getElementById('dst').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - długość geograficzna - stopnie';}
if(document.getElementById('dm').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - długość geograficzna - minuty';}
if(document.getElementById('ds').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - długość geograficzna - sekundy';}
if(document.getElementById('szst').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - szerokość geograficzna - stopnie';}
if(document.getElementById('szm').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - szerokość geograficzna - minuty';}
if(document.getElementById('szs').value==''){komunikat_puste_pole=komunikat_puste_pole +'\r   - szerokość geograficzna - sekundy';}
if(komunikat_puste_pole!=''){
   komunikat_puste_pole = 'Należy uzupełnić obowiązkowe pola:' + komunikat_puste_pole;
   alert(komunikat_puste_pole);
   exit;
   }


Komunikat_niepoprawny_icao='';
if(document.getElementById('kodicao').value!=''){
    var dobryICAO=/^([A-Za-z]){4}$/;
    if (!dobryICAO.test(document.getElementById('kodicao').value)){
        Komunikat_niepoprawny_icao = 'Niepoprawny kod ICAO \r(poprawny kod = 4 duże litery np: EPWA)';
    }
  }

if(Komunikat_niepoprawny_icao!=''){
   alert(Komunikat_niepoprawny_icao);
   exit;
   }


Komunikat_niepoprawny_wmo='';
if(document.getElementById('wmo').value!=''){
    var dobryWMO=/^([0-9]){5}$/;
    if (!dobryWMO.test(document.getElementById('wmo').value)){
        Komunikat_niepoprawny_wmo = 'Niepoprawny numer WMO \r( poprawny numer = 5 cyfr np: 12375 )';       
    }
  }
if(Komunikat_niepoprawny_wmo!=''){
   alert(Komunikat_niepoprawny_wmo);
   exit;
   }

Komunikat_niepoprawny_wys_npm='';
if(isNaN(document.getElementById('wys').value)){
   Komunikat_niepoprawny_wys_npm='wprowadz poprawnie wysokość npm';}
if(Komunikat_niepoprawny_wys_npm!=''){
   alert(Komunikat_niepoprawny_wys_npm);
   exit;
   }


//szer geograficzna

Komunikat_niepoprawny_szer_st='';
if(document.getElementById('szst').value!=''){
    var dobrySt=/^([0-9]){1,2}$/i;
    if (!dobrySt.test(document.getElementById('szst').value)){
        Komunikat_niepoprawny_szer_st = 'Niepoprawnie podane stopnie szerokości geograficznej (poprawne wartości:0-90)';
    }else{
		if (document.getElementById('szst').value>90) {
            Komunikat_niepoprawny_szer_st = 'Niepoprawnie podane stopnie szerokości geograficznej (poprawne wartości:0-90)';
		}
	}	 
  }
if(Komunikat_niepoprawny_szer_st!=''){
   alert(Komunikat_niepoprawny_szer_st);
   exit;
   }

Komunikat_niepoprawny_szer_mm='';
if(document.getElementById('szm').value!=''){
    var dobrySt=/^([0-9]){1,2}$/i;
    if (!dobrySt.test(document.getElementById('szm').value)){
        Komunikat_niepoprawny_szer_mm = 'Niepoprawnie podane minuty szerokości geograficznej (poprawne wartości:0-59)';
    }else{
		if (document.getElementById('szm').value>59) {
            Komunikat_niepoprawny_szer_mm = 'Niepoprawnie podane minuty szerokości geograficznej (poprawne wartości:0-59)';
		}
	}
  }
if(Komunikat_niepoprawny_szer_mm!=''){
   alert(Komunikat_niepoprawny_szer_mm);
   exit;
   }

Komunikat_niepoprawny_szer_ss='';
if(document.getElementById('szs').value!=''){
    var dobrySt=/^([0-9]){1,2}$/i;
    if (!dobrySt.test(document.getElementById('szs').value)){
        Komunikat_niepoprawny_szer_ss = 'Niepoprawnie podane sekundy szerokości geograficznej (poprawne wartości:0-59)';
    }else{
		if (document.getElementById('szs').value>59) {
            Komunikat_niepoprawny_szer_ss = 'Niepoprawnie podane sekundy szerokości geograficznej (poprawne wartości:0-59)';
		}
	}
  }
if(Komunikat_niepoprawny_szer_ss!=''){
   alert(Komunikat_niepoprawny_szer_ss);
   exit;
   }


//dlugosc geograficzna

Komunikat_niepoprawny_dlg_st='';
if(document.getElementById('dst').value!=''){
    var dobrySt=/^([0-9]){1,3}$/i;
    if (!dobrySt.test(document.getElementById('dst').value)){
        Komunikat_niepoprawny_dlg_st = 'Niepoprawnie podane stopnie długości geograficznej (poprawne wartości:0-180)';
    }else{
		if (document.getElementById('dst').value>180) {
            Komunikat_niepoprawny_dlg_st = 'Niepoprawnie podane stopnie długości geograficznej (poprawne wartości:0-180)';
		}
	}
  }
if(Komunikat_niepoprawny_dlg_st!=''){
   alert(Komunikat_niepoprawny_dlg_st);
   exit;
   }

Komunikat_niepoprawny_dlg_mm='';
if(document.getElementById('dm').value!=''){
    var dobrySt=/^([0-9]){1,3}$/i;
    if (!dobrySt.test(document.getElementById('dm').value)){
        Komunikat_niepoprawny_dlg_mm = 'Niepoprawnie podane minuty długości geograficznej (poprawne wartości:0-59)';
    }else{
		if (document.getElementById('dm').value>59) {
            Komunikat_niepoprawny_dlg_mm = 'Niepoprawnie podane minuty długości geograficznej (poprawne wartości:0-59)';
		}
	}
  }
if(Komunikat_niepoprawny_dlg_mm!=''){
   alert(Komunikat_niepoprawny_dlg_mm);
   exit;
   }

  Komunikat_niepoprawny_dlg_ss='';
if(document.getElementById('ds').value!=''){
    var dobrySt=/^([0-9]){1,3}$/i;
    if (!dobrySt.test(document.getElementById('ds').value)){
        Komunikat_niepoprawny_szer_st = 'Niepoprawnie podane sekundy długości geograficznej (poprawne wartości:0-59)';
    }else{
		if (document.getElementById('ds').value>59) {
            Komunikat_niepoprawny_dlg_ss = 'Niepoprawnie podane sekundy długości geograficznej (poprawne wartości:0-59)';
		}
	}
  }
if(Komunikat_niepoprawny_dlg_ss!=''){
   alert(Komunikat_niepoprawny_dlg_ss);
   exit;
   }

Komunikat_niepoprawny_priorytet='';
if(document.getElementById('prio').value!=''){
    var dobrypriorytet2=/^([0-9]){2}$/i;
    var dobrypriorytet1=/^([1-9]){1}$/i;
    if (!dobrypriorytet2.test(document.getElementById('prio').value)){
       if (!dobrypriorytet1.test(document.getElementById('prio').value)){
        Komunikat_niepoprawny_szer_st = 'Niepoprawna wartość priorytetu  (poprawne wartości:1-99)';
       }        
    }
  }
if(Komunikat_niepoprawny_szer_st!=''){
   alert(Komunikat_niepoprawny_szer_st);
   exit;
   }

document.edytor_form.submit();
}

function szczegoly_cechy(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=3&nr=9&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=679, height=600');
}

function szczegoly_wiadomosc(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=4&nr=5&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=100, left=180, width=799, height=610');
}

function podglad_dokument(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=5&nr=7&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=316, height=220');
}

function podglad_link(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=6&nr=4&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=496, height=408');
}

function podglad_obiekty(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=2&nr=6&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=533, height=224');
}

function podglad_grupy(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=2&nr=8&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=533, height=130');
}

function szczegoly(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=3&nr=4&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, status=yes, top=150, left=150, width=616, height=430');
}

function boxy_kolejnosc(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=4&nr=6&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=691, height=430');
}

function dzialy_kolejnosc(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=5&nr=4&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=691, height=430');
}

function grupy_kolejnosc(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=5&nr=6&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=694, height=430');
}

function linki_kolejnosc(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=6&nr=3&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=694, height=430');
}

function wiad_kolejnosc(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=4&nr=7&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no, status=yes, top=150, left=150, width=697, height=430');
}

function szczegoly_harm(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=3&nr=6&id=' + ID , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, status=yes, top=100, left=150, width=766, height=580');
}

function nowy_harm(ID,uprawnienia){
 // window.location.href= 'stacja.php?tryb=N' 
 window.open('index.php?page=3&nr=7' , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, status=yes, top=100, left=150, width=516, height=580');
}

function nowa_stacja(ID,uprawnienia){
 document.edytor_form.action.value='add';
document.edytor_form.submit();
 window.open('index.php?page=3&nr=5'  , 'EDYCJA'+ ID, 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, status=yes, top=150, left=150, width=416, height=425');
}

function drukuj_edytor(link){
 window.open('index.php?page=3&nr=10' + link , 'EDYCJA', 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, status=yes, top=150, left=150, width800, height=800');
}

function drukuj_harm(link){
 window.open('index.php?page=3&nr=11' + link , 'EDYCJA', 'toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, status=yes, top=150, left=150, width800, height=800');
}



function iks(Ob, Li) {
		if (Li==1) {
			Ob.src="images/iks_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/iks.jpg";
			}
}

function lupa(Ob, Li) {
		if (Li==1) {
			Ob.src="images/lup_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/lup.jpg";
			}
}

function google(Ob, Li) {
		if (Li==1) {
			Ob.src="images/cz_google_z.jpg";
			}
		if (Li==0) {
			Ob.src="images/cz_google.jpg";
			}
}

function st_up(link){
window.location.href= link;
}

function st_down(link1){
window.location.href= link1;
}

function usun_stacje_cech(link2){
window.location.href= link2;	
}

function usun_box_strony(link3){
window.location.href= link3;	
}

function box_up(link4){
window.location.href= link4;	
}

function group_up(link){
window.location.href= link;	
}

function group_down(link){
window.location.href= link;	
}

function box_down(link5){
window.location.href= link5;	
}

function usun_wiad_box(link6){
window.location.href= link6;	
}

function wiad_up(link7){
window.location.href= link7;	
}

function wiad_down(link8){
window.location.href= link8;	
}


function usun_link_group(link8){
window.location.href= link8;	
}

function odswiez_stacje(id){
var sciezka = "index.php?page=3&nr=9&id=" +id  +"&id_kraju=" + document.cechy_form.id_kraju.value;
window.location.href= sciezka;
}


function subm(id){
document.cechy_form.id.value=""+id;
document.cechy_form.submit();
}

function odswiez_harmonogram(){
window.opener.document.getElementById('harm_form').submit();
}
function odswiez_a_linki(){
window.opener.document.getElementById('linki_form').submit();
}

function odswiez_object(){
window.opener.document.getElementById('form').submit();
}

function odswiez_groups(){
window.opener.document.getElementById('form_grupy').submit();
}

function odswiez_edytor(){
window.opener.document.getElementById('edytor_form').submit();
}
function odswiez_cechy(){
window.opener.document.getElementById('cechy_form').submit();
}

function odswiez_a_strony(){
window.opener.document.getElementById('strony_form').submit();
}

function odswiez_a_grupylinki(){
window.opener.document.getElementById('grupy_form_linki').submit();
}

function odswiez_a_dokumenty(){
window.opener.document.getElementById('dokument_form').submit();
}

function odswiez_a_boxy(){
window.opener.document.getElementById('boxy_form').submit();
}

function odswiez_a_wiadomosci(){
window.opener.document.getElementById('artykul_form').submit();
}

function odswiez_a_dzialy(){
window.opener.document.getElementById('dzialy_form').submit();
}

function odswiez_a_grupy(){
window.opener.document.getElementById('grupy_form').submit();
}

function doc_up(link){
window.location.href= link;
}

function doc_down(link){
window.location.href= link;
}

function usun_doc_group(link){
window.location.href= link;
}
*/
