cnfg_url = 'http://www.eksportuj.pl/';

	 function zakladka(strId){

		document.getElementById('usd').className='off';
		document.getElementById('eur').className='off';
		document.getElementById('gbp').className='off';
		document.getElementById('chf').className='off';

		document.getElementById('usd_waluty').style.display='none';
		document.getElementById('eur_waluty').style.display='none';
		document.getElementById('gbp_waluty').style.display='none';
		document.getElementById('chf_waluty').style.display='none';

		document.getElementById(strId).className='on';
		document.getElementById(strId+'_waluty').style.display='block';
    }


	function wers(strId){
		//alert(strId);
		var i=0,wersy=document.getElementById('kursy').getElementsByTagName('tr');

		for (i; i < wersy.length; i++) {
			wersy[i].style.fontWeight='normal';

		}
		document.getElementById(strId).style.fontWeight='bold';

	}

	function wskaznik(strWskaznik){

		document.getElementById('zakladka_waluty_l').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_l.png)';
		document.getElementById('zakladka_waluty_p').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_p.png)';
		document.getElementById('zakladka_waluty_href').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_bg.png)';
		document.getElementById('zakladka_waluty_href').style.color ='#4C70B7';
		document.getElementById('tresc_waluty').style.display ='none';

		document.getElementById('zakladka_forex_l').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_l.png)';
		document.getElementById('zakladka_forex_p').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_p.png)';
		document.getElementById('zakladka_forex_href').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_bg.png)';
		document.getElementById('zakladka_forex_href').style.color ='#4C70B7';
		document.getElementById('tresc_forex').style.display ='none';

		document.getElementById('zakladka_surowce_l').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_l.png)';
		document.getElementById('zakladka_surowce_p').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_p.png)';
		document.getElementById('zakladka_surowce_href').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_c_bg.png)';
		document.getElementById('zakladka_surowce_href').style.color ='#4C70B7';
		document.getElementById('tresc_surowce').style.display ='none';

		document.getElementById('zakladka_'+strWskaznik+'_l').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_j_l.png)';
		document.getElementById('zakladka_'+strWskaznik+'_p').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_j_p.png)';
		document.getElementById('zakladka_'+strWskaznik+'_href').style.background ='url(http://www.eksportuj.pl/pliki/modules/strategie/zak_j_bg.png)';
		document.getElementById('zakladka_'+strWskaznik+'_href').style.color ='#666666';
		document.getElementById('tresc_'+strWskaznik).style.display ='block';
	}

	function podswietl(strRodzic,strDiv){

		var i=0,wersy=document.getElementById(strRodzic).getElementsByTagName('div');

		for (i; i < wersy.length; i++) {
			wersy[i].style.backgroundColor='#ffffff';

		}
		document.getElementById(strDiv).style.backgroundColor='#EEF2F8';
	}

function wykres_mod(strKod,strGdzie){

	advAJAX.post({

	url: "http://www.eksportuj.pl/apps/php/wykres_mod.php",
	parameters: {
		"strKod": strKod
	},
	onLoading: function(obj){
	document.getElementById(strGdzie).innerHTML='<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img style="" src="http://www.eksportuj.pl/pliki/ajax-loader.gif"/><br/><br/>';
	},
	onComplete: function(obj){
	},
	onSuccess: function(obj){
		document.getElementById(strGdzie).innerHTML = obj.responseText;
	},
	onError: function(obj){
	}
	});
}

function wykres(strKod){


	intLicznik = document.getElementById('licz').value;
	//alert(strKod);

	//
	walutaLicznik = intLicznik%3;

	//alert("waluta_"+walutaLicznik);

	nowyLicznik = parseInt(intLicznik)+1;
	//alert(walutaLicznik);
	//alert(nowyLicznik);
	//alert("waluta_"+intLicznik);
	advAJAX.post({

	url: "http://www.eksportuj.pl/apps/php/wykres.php",
	parameters: {
		"strKod": strKod,
		"intLicznik": intLicznik
	},
	onLoading: function(obj){
	document.getElementById("waluta_"+walutaLicznik).innerHTML='<br/><br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img style="" src="http://www.eksportuj.pl/pliki/ajax-loader.gif"/><br/><br/>';
	},
	onComplete: function(obj){
	},
	onSuccess: function(obj){

		document.getElementById("waluta_"+walutaLicznik).innerHTML = obj.responseText;
		document.getElementById('licz').value=nowyLicznik;
	},
	onError: function(obj){
	}
	});
}

function check(){
	var ppts = document.getElementById('newsletterki').getElementsByTagName('input');
    var zazbool=true;
    var i=0;
	var licznik=0;

	for(i; i<ppts.length; i++) {
   		var pptsInput = ppts[i];
		if(pptsInput.checked==zazbool){
			licznik++
		}
	 	//if(pptsInput.type=='checkbox' && pptsInput.id!='all') {
		  //pptsInput.checked=zazbool;
		//}
 	}
	if(licznik==0) return confirm('Czy na pewno nie chcesz otrzymywa� �adnego newslettera?');
}

function newsletter_details(id_newslettera){
	window.open('http://www.eksportuj.pl/apps/php/news_det.php?id='+id_newslettera,'item','width=640, height=600,left=10,top=10');
	//alert(id_newslettera);
}

function setgodz(){
        var czas = new Date();
        var godzina = czas.getHours();
        if(godzina<10){
            godzina='0'+godzina;
        }
        var minuta = czas.getMinutes();
        if(minuta<10){
            minuta='0'+minuta;
        }
        document.getElementById('godzina').innerHTML=unescape('godz. %3Cstrong%3E'+godzina+':'+minuta+'%3C/strong%3E');
    }
/*
function change_bg(id,action){
    if(action=='out'){
        if(zakladki[id][3]=='1'){
            document.getElementById('zak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+zakladki[id][2]+"')";
        }
        else{
            document.getElementById('zak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+zakladki[id][0]+"')";
        }
    }
    else if(action=='over'){
        if(zakladki[id][3]=='1'){
            document.getElementById('zak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+zakladki[id][2]+"')";
        }
        else{
            document.getElementById('zak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+zakladki[id][0]+"')";
        }
    }
}

function change_bg_pz(id,action){
    if(action=='out'){
        if(podzakladki[id][3]=='1'){
            document.getElementById('pzak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+podzakladki[id][2]+"')";
            document.getElementById('pzak'+id).style.color="#000";
        }
        else{
            document.getElementById('pzak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+podzakladki[id][0]+"')";
            document.getElementById('pzak'+id).style.color="#FFF";
        }
    }
    else if(action=='over'){
        if(podzakladki[id][3]=='1'){
            document.getElementById('pzak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+podzakladki[id][0]+"')";
            document.getElementById('pzak'+id).style.color="#FFF";
        }
        else{
            document.getElementById('pzak'+id).style.background="url('http://dev.eksportuj.pl/uploaded/image/cms/ikonki/"+podzakladki[id][2]+"')";
            document.getElementById('pzak'+id).style.color="#000";
        }
	}
}
*/
function pokaz(pokaz){
	document.getElementById(pokaz).style.display="block";
}

function ukryj(ukryj){
	document.getElementById(ukryj).style.display="none";
}

function ajaxArtLogowanie(intId){
	//alert(cnfg_url+"apps/modules/newsletter/test.php?adres="+document.getElementById("logowanie_mail").value+"operacja=dodaj_bw"+"id_art="+intId);

	advAJAX.get({
		url: cnfg_url+"apps/modules/newsletter/newsletterAjax.php",
	    parameters : {
		      "adres" : document.getElementById("logowanie_mail").value,
		      "operacja" : "dodaj_bw",
		      "id_art": intId
		},
		onLoading : function(obj){
			document.getElementById("n_logowanie").innerHTML = '<div style="padding-top: 60px;"><img src="http://www.eksportuj.pl/pliki/baza_wiedzy/ajax-loader_n.gif" >';
			//document.getElementById("n_logowanie").innerHTML = '<div style="padding-top: 40px;"><img src="'+cnfg_url+'"pliki/baza_wiedzy/ajax-loader_n.gif" >';
		},
		onComplete : function(obj) {

		},
		onSuccess : function(obj) {
			if(obj.responseText=='OK'){
			    document.getElementById("n_logowanie").innerHTML = '<div style="padding-top: 10px;">Na podany adres email wysłaliśmy kod potwierdzający<br> odbierz mail i kliknij w link.</div>';
			}
			else if(obj.responseText=='LOG'){
				document.getElementById("n_logowanie").innerHTML = '<div style="padding-top: 60px;">Na Twoją skrzynke e-mail został wysłany link logujący do serwisu.</div>';
				//document.getElementById('art_restricted_again').style.display="block";
			}
			else if(obj.responseText=='BLAD'){
				document.getElementById("n_logowanie").innerHTML = '<div style="padding-top: 60px;">Email nie prawidłowy '+'<a href="javascript: window.location.reload()">spróbuj jeszcze raz</a></div>';
			}
		},
		onError : function(obj) {
			//alert('blad');
			document.getElementById("register_only").innerHTML = "Blad podczas logowania"+'<a href="javascript: window.location.reload()">spróbuj jeszcze raz</a>';;
		}
	});
}

function ajaxNewsletter(co,intId){

	advAJAX.get({
	    url: cnfg_url+"apps/modules/newsletter/newsletterAjax.php",
	    parameters : {
	      "id" : intId,
	      "adres" : document.getElementById("newsletter_"+intId+"_adres").value,
	      "operacja" : co
	    },
	    onLoading : function(obj){
			document.getElementById("newsletter_"+intId+"_L").style.display = "block";
			document.getElementById("newsletter_"+intId+"_S").style.display = "none";
			document.getElementById("newsletter_"+intId+"_E").style.display = "none";
			document.getElementById("newsletter_"+intId+"_W").style.display = "none";
	    },
	    onComplete : function(obj) {
			document.getElementById("newsletter_"+intId+"_L").style.display = "block";
			document.getElementById("newsletter_"+intId+"_S").style.display = "none";
			document.getElementById("newsletter_"+intId+"_E").style.display = "none";
			document.getElementById("newsletter_"+intId+"_W").style.display = "none";
	    },
	    onSuccess : function(obj) {
			document.getElementById("newsletter_"+intId+"_L").style.display = "none";
			document.getElementById("newsletter_"+intId+"_S").style.display = "none";
			document.getElementById("newsletter_"+intId+"_E").style.display = "none";
			document.getElementById("newsletter_"+intId+"_W").style.display = "block";
			if(obj.responseText=='OK'){
			    document.getElementById("newsletter_"+intId+"_W").style.display = "none";
			    document.getElementById("newsletter_"+intId+"_L").style.display = "block";
				document.getElementById("newsl"+intId+"_form").submit();

			}
			else if(obj.responseText=='KASUJ'){
			    document.getElementById("newsletter_"+intId+"_W").style.display = "none";
			    document.getElementById("newsletter_"+intId+"_L").style.display = "block";
			    document.getElementById('newsletter_"+intId+"_ico').value='KASUJ';
			    document.getElementById("newsl"+intId+"_form").submit();
			}
			else{
			    document.getElementById("newsletter_"+intId+"_W").innerHTML = obj.responseText;
			}
	    },
	    onError : function(obj) {
			document.getElementById("newsletter_"+intId+"_L").style.display = "none";
			document.getElementById("newsletter_"+intId+"_S").style.display = "none";
			document.getElementById("newsletter_"+intId+"_E").style.display = "block";
			document.getElementById("newsletter_"+intId+"_W").style.display = "none";
	    }
	});
}

function pokazFormNewsletter(intId){
    document.getElementById("newsletter_"+intId+"_L").style.display = "none";
    document.getElementById("newsletter_"+intId+"_S").style.display = "block";
    document.getElementById("newsletter_"+intId+"_E").style.display = "none";
    document.getElementById("newsletter_"+intId+"_W").style.display = "none";
}

function naj_najjs2(pokaz,intId){
    if(pokaz=='najnowsze'){
        document.getElementById('najnowsze_l'+intId).style.color="#666666";
        document.getElementById('najpopularniejsze_l'+intId).style.color="#4C70B7";
        document.getElementById('najnowsze_l'+intId).style.background="url("+cnfg_url+"pliki/modules/naj-naj/najnowsze_j.gif)";
        document.getElementById('najpopularniejsze_l'+intId).style.background="url("+cnfg_url+"pliki/modules/naj-naj/najpopularniejsze_c.gif)";
   	}
    else{
        document.getElementById('najnowsze_l'+intId).style.color="#4C70B7";
        document.getElementById('najpopularniejsze_l'+intId).style.color="#666666";
        document.getElementById('najnowsze_l'+intId).style.background="url("+cnfg_url+"pliki/modules/naj-naj/najnowsze_c.gif)";
        document.getElementById('najpopularniejsze_l'+intId).style.background="url("+cnfg_url+"pliki/modules/naj-naj/najpopularniejsze_j.gif)";
    }
}

function naj_najjs4(skad,intId,ile_wiadomosci){
    for(i=0;i<=ile_wiadomosci;i++){
        if(skad=='najn'){
            if(document.getElementById('lead1_'+intId+'_'+i)){
                document.getElementById('lead1_'+intId+'_'+i).style.display="none";
                document.getElementById('slead1_'+intId+'_'+i).style.background="url("+cnfg_url+"pliki/modules/naj-naj/rozw.gif) no-repeat";
            }
        }
        else if(skad='najp') {
            if(document.getElementById('lead2_'+intId+'_'+i)){
                document.getElementById('lead2_'+intId+'_'+i).style.display="none";
                document.getElementById('slead2_'+intId+'_'+i).style.background="url("+cnfg_url+"pliki/modules/naj-naj/rozw.gif) no-repeat";
            }
        }
    }
}


function naj_najjs3(zmien,skad,intId,ile_wiadomosci){
    naj_najjs4(skad,intId,ile_wiadomosci);
    if(document.getElementById(zmien).style.display=="block"){
        document.getElementById(zmien).style.display="none";
        document.getElementById("s"+zmien).style.background="url("+cnfg_url+"pliki/modules/naj-naj/rozw.gif) no-repeat";
    }
    else{
        document.getElementById(zmien).style.display="block";
        document.getElementById("s"+zmien).style.background="url("+cnfg_url+"pliki/modules/naj-naj/zwin.gif) no-repeat";
    }
}


function ajaxStrategie(id_zakladki_str,id_zakladki_db,id_modulu,intId,links,links2,ile_wiadomosci){
/*alert(cnfg_url+"apps/modules/strategie/strategieAjax_str.php" + "?id=" + id_zakladki_db + "&id_z=" + id_zakladki_str + "&id_modulu=" + id_modulu+"&ile_wiadomosci"+ile_wiadomosci);*/
	advAJAX.get({

		url: cnfg_url+"apps/modules/strategie/strategieAjax_str.php",

		parameters : {
	      "id" : id_zakladki_db,
	      "id_z" : id_zakladki_str,
	      "id_modulu" : id_modulu,
		  "ile_wiadomosci" : ile_wiadomosci
	    },
	    onLoading : function(obj){
			document.getElementById("strategie_zawartosc"+intId+"_L").style.display = "block";
			document.getElementById("strategie_zawartosc"+intId+"_E").style.display = "none";
			document.getElementById("strategie_zawartosc"+intId+"").style.display = "none";
	   },
	    onComplete : function(obj) {
			document.getElementById("strategie_zawartosc"+intId+"_L").style.display = "block";
			document.getElementById("strategie_zawartosc"+intId+"_E").style.display = "none";
			document.getElementById("strategie_zawartosc"+intId+"").style.display = "none";
	    },
	    onSuccess : function(obj) {
			document.getElementById("strategie_zawartosc"+intId+"_L").style.display = "none";
			document.getElementById("strategie_zawartosc"+intId+"_E").style.display = "none";
			document.getElementById("strategie_zawartosc"+intId+"").style.display = "block";
			document.getElementById("strategie_zawartosc"+intId+"").innerHTML = obj.responseText;
			strategiejs4(id_zakladki_str,intId,links2,links);
	    },
	    onError : function(obj) {
			document.getElementById("strategie_zawartosc"+intId+"_L").style.display = "none";
			document.getElementById("strategie_zawartosc"+intId+"_E").style.display = "block";
			document.getElementById("strategie_zawartosc"+intId+"").style.display = "none";
	    }
	});
}

function strategiejs4(id_zakladki,intId,links,links2){
    for (i=0;i<=links;i++){
        if(i<links2){

            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_href').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_c_bg.png)";
            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_l').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_c_l.png)";
            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_p').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_c_p.png)";
            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_href').style.color="#4C70B7";
        }
        else{

            document.getElementById("strategie_zakladka_"+i+"_"+intId+"_href").style.background="url("+cnfg_url+"pliki/modules/strategie/zak_c_b_bg.png)";
            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_l').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_c_b_l.png)";
            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_p').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_c_b_p.png)";
            document.getElementById('strategie_zakladka_'+i+'_'+intId+'_href').style.color="#4C70B7";
        }
    }

    document.getElementById(id_zakladki+'_href').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_j_bg.png)";

    document.getElementById(id_zakladki+'_l').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_j_l.png)";

    document.getElementById(id_zakladki+'_p').style.background="url("+cnfg_url+"pliki/modules/strategie/zak_j_p.png)";

    document.getElementById(id_zakladki+'_href').style.color="#666666";
}

function strategiejs(intId,ile_wiadomosci){
    for(i=0;i<=ile_wiadomosci;i++){
        if(document.getElementById('strateg_lead_'+intId+'_'+i)){
            document.getElementById('strateg_lead_'+intId+'_'+i).style.display="none";
            document.getElementById('sstrateg_lead_'+intId+'_'+i).style.background="url("+cnfg_url+"pliki/modules/strategie/rozw.gif) no-repeat";

        }
    }
}

function strategiejs3(zmien,intId,ile_wiadomosci){
    strategiejs(intId,ile_wiadomosci);
    if(document.getElementById(zmien).style.display=="block"){
        document.getElementById(zmien).style.display="none";
        document.getElementById("s"+zmien).style.background="url("+cnfg_url+"pliki/modules/strategie/rozw.gif) no-repeat";

    }
    else{
        document.getElementById(zmien).style.display="block";
        document.getElementById("s"+zmien).style.background="url("+cnfg_url+"pliki/modules/strategie/zwin.gif) no-repeat";

    }
}

function szkolenia_short(id,intId){
    for(i=0;i<=9;i++){
            if(document.getElementById('mod_szkol_'+intId+'_'+i)){
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_l').style.background = 'url(../pliki/modules/szkolenia/zak_c_l.png)';
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_p').style.background = 'url(../pliki/modules/szkolenia/zak_c_p.png)';
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_href').style.background = 'url(../pliki/modules/szkolenia/zak_c_bg.png)';
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_href').style.color = '#4C70B7';
                document.getElementById('mod_szkol_'+intId+'_'+i).style.display = 'none';
            }
    }
    if(document.getElementById('mod_szkol_'+intId+'_'+id)){
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_href').style.color = '#666666';
        document.getElementById('mod_szkol_'+intId+'_'+id).style.display = 'block';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_l').style.background = 'url(../pliki/modules/szkolenia/zak_j_l.png)';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_p').style.background = 'url(../pliki/modules/szkolenia/zak_j_p.png)';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_href').style.background = 'url(../pliki/modules/szkolenia/zak_j_bg.png)';
    }
}

function szkolenia(id,intId,links,links2){
    for(i=0;i<=links;i++){

            document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_l').style.background = 'url(../pliki/modules/szkolenia/zak_c_l.png)';
            document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_p').style.background = 'url(../pliki/modules/szkolenia/zak_c_p.png)';
            document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_href').style.background = 'url(../pliki/modules/szkolenia/zak_c_bg.png)';
            document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_href').style.color = '#4C70B7';
            if(document.getElementById('mod_szkol_'+intId+'_'+i)){
                document.getElementById('mod_szkol_'+intId+'}_'+i).style.display = 'none';
            }

    }
    for(i=links;i<=links2;i++){

            if(document.getElementById('mod_szkol_'+intId+'_'+i)){
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_l').style.background = 'url(../pliki/modules/szkolenia/zak_c_l.png)';
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_p').style.background = 'url(../pliki/modules/szkolenia/zak_c_p.png)';
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_href').style.background = 'url(../pliki/modules/szkolenia/zak_c_bg.png)';
                document.getElementById('szkolenia_zakladka_'+i+'_'+intId+'_href').style.color = '#4C70B7';
                document.getElementById('mod_szkol_'+intId+'_'+i).style.display = 'none';
            }

   	}
    document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_href').style.color = '#666666';
    if(document.getElementById('mod_szkol_'+intId+'_'+id)){
        document.getElementById('mod_szkol_'+intId+'_'+id).style.display = 'block';
   	}
    if(id<=links){
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_l').style.background = 'url(../pliki/modules/szkolenia/zak_j_l.png)';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_p').style.background = 'url(../pliki/modules/szkolenia/zak_j_p.png)';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_href').style.background = 'url(../pliki/modules/szkolenia/zak_j_bg.png)';
    }
    else{
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_l').style.background = 'url(../pliki/modules/szkolenia/zak_j_l.png)';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_p').style.background = 'url(../pliki/modules/szkolenia/zak_j_p.png)';
        document.getElementById('szkolenia_zakladka_'+id+'_'+intId+'_href').style.background = 'url(../pliki/modules/szkolenia/zak_j_bg.png)';
    }
}

function showNext(pokaz,intId,ilosc){

	for (i=1;i<=ilosc;i++){
		document.getElementById('wydarzenia_art_'+i+'_'+intId).style.display='none';
		document.getElementById('wydarzenia_'+i+'_'+intId).style.background='url(../pliki/modules/wydarzenia-dnia/num_bg.gif)';
		document.getElementById('wydarzenia_next'+intId+'_'+i).style.display='none';
	}

	if (pokaz != 'next') {
		current = pokaz;
	}
	else{
		if(current==ilosc) current = 1; else current = current+1;
	}

	if(current==ilosc) next = 1; else next = current+1;

	document.getElementById('wydarzenia_next'+intId+'_'+next).style.display='block';
	document.getElementById('wydarzenia_art_'+current+'_'+intId).style.display='block';
	document.getElementById('wydarzenia_'+current+'_'+intId).style.background='url(../pliki/modules/wydarzenia-dnia/num_bg_s.gif)';

}

function showNextE(ilosc){

	//alert(ilosc);

	for (i=1;i<=ilosc;i++){
		if(document.getElementById('ebook_'+i).style.display=='block'){
			current = i;
		}
	}

	document.getElementById('ebook_'+current).style.display='none';
	if(current==ilosc) j=1; else j=current+1;
	//alert(j);
	document.getElementById('ebook_'+j).style.display='block';


}

function rozwin_kat(intId){

	document.getElementById('minus_'+intId).style.display='block';
	document.getElementById('plus_'+intId).style.display='none';
	document.getElementById('opcje_'+intId).style.display='block';
	document.getElementById('separator_'+intId).style.display='block';
	document.getElementById('opcje2_'+intId).style.display='block';
	document.getElementById('separator2_'+intId).style.display='block';
	document.getElementById('materialy_'+intId).style.display='block';
}

function zwin_kat(intId){

	document.getElementById('minus_'+intId).style.display='none';
	document.getElementById('plus_'+intId).style.display='block';
	document.getElementById('opcje_'+intId).style.display='none';
	document.getElementById('separator_'+intId).style.display='none';
	document.getElementById('opcje2_'+intId).style.display='none';
	document.getElementById('separator2_'+intId).style.display='none';
	document.getElementById('materialy_'+intId).style.display='none';
}

function zwin_rozwin_kat(intId){
	if (document.getElementById('materialy_' + intId).style.display == "block") {

		document.getElementById('minus_'+intId).style.display='none';
		document.getElementById('plus_'+intId).style.display='block';
		document.getElementById('opcje_'+intId).style.display='none';
		document.getElementById('separator_'+intId).style.display='none';
		document.getElementById('opcje2_'+intId).style.display='none';
		document.getElementById('separator2_'+intId).style.display='none';
		document.getElementById('materialy_'+intId).style.display='none';

	}
	else{

		document.getElementById('minus_'+intId).style.display='block';
		document.getElementById('plus_'+intId).style.display='none';
		document.getElementById('opcje_'+intId).style.display='block';
		document.getElementById('separator_'+intId).style.display='block';
		document.getElementById('opcje2_'+intId).style.display='block';
		document.getElementById('separator2_'+intId).style.display='block';
		document.getElementById('materialy_'+intId).style.display='block';

	}

}

function pokaz_ukryj(strId){
	if(document.getElementById(strId).style.display=="block") document.getElementById(ukryj).style.display="none";
	else document.getElementById(strId).style.display="block";
}

function polec(intLiczba){

	maile=''
	for (i = 1; i < intLiczba+1; i++) {
		if(i!=1) maile+=";";
		maile+=document.getElementById("mail_"+i).value;
	}

	advAJAX.post({

	url: cnfg_url+"apps/php/polec.php",
	parameters: {
		"maile": maile,
		"polecajacy": document.getElementById("polecajacy").value
	},
	onLoading: function(obj){
	document.getElementById("polecenie").innerHTML='<br style="clear:both;"/><img style="float:left;margin:-3px 0px 0px 90px" src="http://www.eksportuj.pl/pliki/ajax-loader.gif"/><br style="clear:both;"/>';
	},
	onComplete: function(obj){
	},
	onSuccess: function(obj){

		document.getElementById("polecenie").innerHTML = obj.responseText;

	},
	onError: function(obj){
	}
	});
}

function polec_mat(intLiczba,intIdMaterialu){

	maile=''
	for (i = 1; i < intLiczba+1; i++) {
		if(i!=1) maile+=";";
		maile+=document.getElementById("mail_mat_"+i).value;
	}

	advAJAX.post({

	url: cnfg_url+"apps/php/polec_mat.php",
	parameters: {
		"id_materialu": intIdMaterialu,
		"maile": maile,
		"polecajacy": document.getElementById("polecajacy_mat").value
	},
	onLoading: function(obj){
	document.getElementById("polecenie_mat").innerHTML='<br style="clear:both;"/><img style="float:left;margin:-3px 0px 0px 90px" src="http://www.eksportuj.pl/pliki/ajax-loader.gif"/><br style="clear:both;"/>';
	},
	onComplete: function(obj){
	},
	onSuccess: function(obj){

		document.getElementById("polecenie_mat").innerHTML = obj.responseText;

	},
	onError: function(obj){
	}
	});
}

function polec_mat2(intLiczba,intIdMaterialu){

	maile=''
	for (i = 1; i < intLiczba+1; i++) {
		if(i!=1) maile+=";";
		maile+=document.getElementById("mail_mat_"+intIdMaterialu+"_"+i).value;
	}

	advAJAX.post({

	url: cnfg_url+"apps/php/polec_mat2.php",
	parameters: {
		"id_materialu": intIdMaterialu,
		"maile": maile,
		"polecajacy": document.getElementById("polecajacy_mat_"+intIdMaterialu).value
	},
	onLoading: function(obj){
	document.getElementById("polecenie_mat_"+intIdMaterialu).innerHTML='<br style="clear:both;"/><img style="float:left;margin:-3px 0px 0px 90px" src="http://www.eksportuj.pl/pliki/ajax-loader.gif"/><br style="clear:both;"/>';
	},
	onComplete: function(obj){
	},
	onSuccess: function(obj){

		document.getElementById("polecenie_mat_"+intIdMaterialu).innerHTML = obj.responseText;

	},
	onError: function(obj){
	}
	});
}

function rejestruj(intIdMaterialu){


	advAJAX.post({

	url: cnfg_url+"apps/php/zarejestruj.php",
	parameters: {
		"id_materialu": intIdMaterialu,
		"rejestrujacy": document.getElementById("rejestrujacy_"+intIdMaterialu).value
	},
	onLoading: function(obj){
	document.getElementById("zarejestruj_"+intIdMaterialu).innerHTML='<br style="clear:both;"/><img style="float:left;margin:-3px 0px 0px 90px" src="http://www.eksportuj.pl/pliki/ajax-loader.gif"/><br style="clear:both;"/>';
	},
	onComplete: function(obj){
	},
	onSuccess: function(obj){

		document.getElementById("zarejestruj_"+intIdMaterialu).innerHTML = obj.responseText;

	},
	onError: function(obj){
	}
	});
}

function schowaj(materialy){


	var brokenstring = materialy.split(";");

	for ( var i in brokenstring ){

		document.getElementById("zarejestruj_"+brokenstring[i]).style.display="none";
		document.getElementById("polecenie_mat_"+brokenstring[i]).style.display="none";
	}


}

function nad(intKlucz,intLiczba){
	//alert(intLiczba);

	for (i = 0; i < intLiczba; i++) {

		document.getElementById("premium_kat_"+i).style.zIndex="10";
	}
	document.getElementById("premium_kat_"+intKlucz).style.zIndex="15";

	//document.getElementById(materialy).style.zindex="5";

}

function profil_zakladki(pokaz){
    if(pokaz=='wszystkie'){
        document.getElementById('profil_all').style.color="#4c70b7";
        document.getElementById('profil_all').style.background="url("+cnfg_url+"pliki/profile/wszystkie_a.gif)";
        document.getElementById('profil_info').style.color="#666666";
        document.getElementById('profil_info').style.background="url("+cnfg_url+"pliki/profile/prasowe_b.gif)";
        document.getElementById('profil_art').style.color="#666666";
        document.getElementById('profil_art').style.background="url("+cnfg_url+"pliki/profile/artykuly_b.gif)";
   	}
    if(pokaz=='info'){
        document.getElementById('profil_all').style.color="#666666";
        document.getElementById('profil_all').style.background="url("+cnfg_url+"pliki/profile/wszystkie_b.gif)";
        document.getElementById('profil_info').style.color="#4c70b7";
        document.getElementById('profil_info').style.background="url("+cnfg_url+"pliki/profile/prasowe_a.gif)";
        document.getElementById('profil_art').style.color="#666666";
        document.getElementById('profil_art').style.background="url("+cnfg_url+"pliki/profile/artykuly_b.gif)";
    }
   if(pokaz=='artykuly'){
        document.getElementById('profil_all').style.color="#666666";
        document.getElementById('profil_all').style.background="url("+cnfg_url+"pliki/profile/wszystkie_b.gif)";
        document.getElementById('profil_info').style.color="#666666";
        document.getElementById('profil_info').style.background="url("+cnfg_url+"pliki/profile/prasowe_b.gif)";
        document.getElementById('profil_art').style.color="#4c70b7";
        document.getElementById('profil_art').style.background="url("+cnfg_url+"pliki/profile/artykuly_a.gif)";
    }
}


function setProfilPage(dzial,strona,alias_name){

	advAJAX.get({
	    url: cnfg_url+"apps/modules/profil/profilAjax_art.php",
	    parameters : {
	      "dzial" : dzial,
	      "strona" : strona,
	      "alias_name" : alias_name
	    },
	    onLoading : function(obj){
			document.getElementById(dzial).innerHTML = '<div style="margin: 40px 0px 0px 240px;"><img src="'+cnfg_url+'pliki/profile/ajax-loader-profil.gif" alt=""></div>';

	    },
	    onComplete : function(obj) {
			document.getElementById(dzial).innerHTML = obj.responseText;
	    },
	    onSuccess : function(obj) {

	    },
	    onError : function(obj) {
	    	document.getElementById(dzial).innerHTML = "<b>Wystąpił bład ładowania strony. Prosze spróbować ponownie.</b>";
	    }
	});
}




function profilFormRegister(nameElement){
		if(nameElement == 'firma'){
			pokaz('form_rejestracja_firmy');
			ukryj('newsletterTable');
			ukryj('form_rejestracja_uzytkownika');
			document.getElementById('profil_firma').style.background="url("+cnfg_url+"pliki/profile/button_profil_off.gif)";
			document.getElementById('profil_dane').style.background="url("+cnfg_url+"pliki/profile/button_dane_off.gif)";
			document.getElementById('profil_uzytkownik').style.background="url("+cnfg_url+"pliki/profile/button_profil_pryw_on.gif)";
		}
		else if(nameElement == 'dane'){
			pokaz('newsletterTable');
			ukryj('form_rejestracja_firmy');
			ukryj('form_rejestracja_uzytkownika');
			document.getElementById('profil_dane').style.background="url("+cnfg_url+"pliki/profile/button_dane.gif)";
			document.getElementById('profil_firma').style.background="url("+cnfg_url+"pliki/profile/button_profil_on.gif)";
			document.getElementById('profil_uzytkownik').style.background="url("+cnfg_url+"pliki/profile/button_profil_pryw_on.gif)";
		}
		else if(nameElement == 'uzytkownik'){
			pokaz('form_rejestracja_uzytkownika');
			ukryj('form_rejestracja_firmy');
			ukryj('newsletterTable');
			document.getElementById('profil_dane').style.background="url("+cnfg_url+"pliki/profile/button_dane_off.gif)";
			document.getElementById('profil_firma').style.background="url("+cnfg_url+"pliki/profile/button_profil_on.gif)";
			document.getElementById('profil_uzytkownik').style.background="url("+cnfg_url+"pliki/profile/button_profil_pryw_off.gif)";
		}
}

function szkoleniaCalendar(month,year){
	advAJAX.get({
	    url: cnfg_url+"apps/calendar_szkolenia/szkolenia_calendar.php",
	    parameters : {
	      "month" : month,
	      "year" : year
	    },
	    onLoading : function(obj){
			document.getElementById('szkolenia_kalendarz_con').innerHTML = '<div style="text-align: center; width: 200px; margin: 53px 0px 53px 0px"><img src="'+cnfg_url+'pliki/szkolenia/ajax-loader-szkolenia.gif" alt=""></div>';
	    },
	    onComplete : function(obj) {
			document.getElementById('szkolenia_kalendarz_con').innerHTML = obj.responseText;
			szkoleniaTooltip();
	    },
	    onSuccess : function(obj) {

	    },
	    onError : function(obj) {
	    	document.getElementById('szkolenia_kalendarz_con').innerHTML = "Błąd generowania kalendarza";
	    }
	});
}


function szkoleniaTooltip(){ // Dymek w dacie w module kalendarza szkolen - uzywa jquery
	$(".dyna ").tooltip({
	   offset: [10, 2],
	   effect: 'slide'
	}).dynamic({ bottom: { direction: 'down', bounce: true } });
}

function szkolenieZakladki(nameElement){
	for(var i=1;i<6;i++){
		ukryj(i+'_wlacz');
		document.getElementById('zak_'+i).style.color='#012f87';
	}
		pokaz(nameElement+'_wlacz');
		document.getElementById('zak_'+nameElement).style.color='#ff740b';
}

function szkolenie_rezerwacja(nrSzkolenia){
	//dane z formularza
	imie = document.getElementById('szkolenie_rezerwacja_imie').value;
	nazwisko = document.getElementById('szkolenie_rezerwacja_nazwisko').value;
	tel = document.getElementById('szkolenie_rezerwacja_nazwisko').value;
	email = document.getElementById('szkolenie_rezerwacja_email').value;

	firma = document.getElementById('szkolenie_rezerwacja_firma').value;
	adres = document.getElementById('szkolenie_rezerwacja_adres').value;
	miasto = document.getElementById('szkolenie_rezerwacja_miasto').value;
	kodpocztowy = document.getElementById('szkolenie_rezerwacja_kodpocztowy').value;
	dzial = document.getElementById('szkolenie_rezerwacja_dzial').value;
	stanowisko = document.getElementById('szkolenie_rezerwacja_stanowisko').value;
	fax = document.getElementById('szkolenie_rezerwacja_fax').value;

	if(imie=='' || nazwisko=='' || tel=='' || email==''){
		document.getElementById('formularz_rezerwacji_wiadomosc').innerHTML = "Aby złozyc rezerwacje nalezy wypełnic wymagane pola!<br/><br/>";
		return;
	}

	advAJAX.get({
	    url: cnfg_url+"apps/szkolenia/rezerwacja.php",
	    parameters : {
	      "imie" : imie,
	      "nazwisko" : nazwisko,
	      "tel" : tel,
	      "email" : email,
	      "firma" : firma,
	      "adres" : adres,
	      "miasto" : miasto,
	      "kodpocztowy" : kodpocztowy,
	      "dzial" : dzial,
	      "stanowisko" : stanowisko,
	      "fax" : fax,
	      "nr_szkolenia" : nrSzkolenia
	    },
	    onLoading : function(obj){
			document.getElementById('formularz_rezerwacji').innerHTML = '<div style="text-align: center; width: 550px; margin: 53px 0px 53px 0px"><img src="'+cnfg_url+'pliki/szkolenia/ajax-loader-szkolenia.gif" alt=""></div>';
	    },
	    onComplete : function(obj) {
	    	if(obj.responseText=="OK"){
	    		document.getElementById('formularz_rezerwacji').innerHTML = '<div style="color: 417624; font-weight: bold;">Twoje zgloszenie zostalo przyjete.</div>';
	    	}
	    	else{
	    		document.getElementById('formularz_rezerwacji').innerHTML = '<div style="color: b33434; font-weight: bold;">Blad przyjecia zgloszenia. Sprobuj ponownie.</div>';
	    	}
	    },
	    onSuccess : function(obj) {
	    },
	    onError : function(obj) {
	    }
	});
}

function polec_szkolenie(nrSzkolenia){

	polecajacy = document.getElementById('polecajacy_szkolenie').value;

	maile= "";
	for (i = 1; i < 3; i++) {
		if(i!=1) maile+=";";
		maile+=document.getElementById("mail_szkolenie_"+i).value;
	}

	if(polecajacy==''){
		document.getElementById('polec_szkolenie_wiadomosc').innerHTML = 'Podaj swoj adres email';
		return;
	}

	if(maile==''){
		document.getElementById('polec_szkolenie_wiadomosc').innerHTML = 'Nalezy podac co najmniej jeden adres';
		return;
	}

	advAJAX.get({
	    url: cnfg_url+"apps/szkolenia/polec_szkolenie.php",
	    parameters : {
	      "nr_szkolenia" : nrSzkolenia,
	      "maile" : maile,
	      "polecajacy" : polecajacy
	    },
	    onLoading : function(obj){
			document.getElementById('polec_szkolenie_box').innerHTML = '<div style="text-align: center; width: 200px; margin: 53px 0px 53px 0px"><img src="'+cnfg_url+'pliki/szkolenia/ajax-loader-polecenia.gif" alt=""></div>';
	    },
	    onComplete : function(obj) {

	    },
	    onSuccess : function(obj) {
	    	if(obj.responseText=="OK"){
	    		document.getElementById('polec_szkolenie_box').innerHTML = '<div style="font-weight: bold;">Dziekujemy! polecenia zostaly wyslane !</div> <a style="cursor: pointer; font-weight: bold; color: #47596c;" onclick="ukryj(\'polec_szkolenie_box\')">Zamknij okno</a>';
	    	}
	    	else{

	    		document.getElementById('polec_szkolenie_box').innerHTML = obj.responseText;
	    	}
	    },
	    onError : function(obj) {

	    }
	});
}

function szkolenie_broszura(nrSzkolenia){

	mail = document.getElementById('pobranie_broszury').value;

	advAJAX.get({
	    url: cnfg_url+"apps/szkolenia/pobierz_broszure.php",
	    parameters : {
	      "nr_szkolenia" : nrSzkolenia,
	      "mail" : mail
	    },
	    onLoading : function(obj){
	    	document.getElementById('pobierz_broszure').innerHTML = '<div style="text-align: center; width: 245px; margin: 20px 0px 20px 0px"> Wysyłanie...</div>';
	    },
	    onComplete : function(obj) {

	    },
	    onSuccess : function(obj) {

	    	if(obj.responseText=="OK"){
	    		document.getElementById('pobierz_broszure').innerHTML = '<div style="marigin: 0 auto;"> <b>Dziekujemy!</b><br/> Aby pobrać broszure odbierz maila i kliknij w link. <br/><a style="color: #385a14; cursor:pointer; font-weight: bold;" onclick="ukryj(\'pobierz_broszure\');">Zamknij okno</a></div>';
	    	}
	    	else{
	    		document.getElementById('pobierz_broszure').innerHTML = obj.responseText;
	    	}
	    },
	    onError : function(obj) {
	    }
	});

}

