function my_set_innerHTML(obj,text){
  var el=document.getElementById(obj);
  el.innerHTML = text;  
} 
var sb_button=0;
function my_submit(id) {
  var obj = document.getElementById(id);
  if(sb_button==0) {
    sb_button=1;
    obj.submit();
  }
} 

function m_thawte(){
  window.open('https://secure.przelewy24.pl/thawte.htm', 'thaw', config='height=640,width=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}

function m_edytor(a,b,c,d) {
  window.open("edytor/edytor.php?i="+a+","+b+","+c+","+d,"edytor",'width=720,height=490,left=20,top=10,scrollbars=yes,resizable=yes,status=yes'); 
}

function m_oferta(id) {
  window.open('pop_praca.php?o='+id,'oferta'+id,'width=690,height=600,left=20,top=10,scrollbars=yes,resizable=yes,status=yes');
}
function m_polec(url) {
  window.open('pop_powiadom.php?i='+url,'polec','width=420,height=390,left=20,top=10,scrollbars=yes,resizable=yes,status=yes');
}
function m_pytanie(email) {
  window.open('pop_pytanie.php?i='+email,'pytanie','width=465,height=390,left=20,top=10,scrollbars=yes,resizable=yes,status=yes');
}

function m_zgloszenie(url,tytul,tresc,id) {
  var str = 'user/pop_zgloszenie.php'+'?u='+url+'&t='+tytul+'&id='+id+'&tr='+tresc;
  popup(str,'wiadomosc');
}

function m_wiadomosc(id, tytul, org) {
  popup('user/pop_wiadomosc.php?a=w&p='+id+','+tytul+','+org,'wiadomosc');
} 

function m_cms_druk(id) {
  popup('cms_druk.php?i='+id,'druk');
} 
function m_oferta_druk(id) {
  popup('oferta_druk.php?o='+id,'druk');
} 

function m_image(pict) {
  popup('pop_image.php?i='+pict,'foto');
}
function my_image(pict) {
  popup('pop_image.php?i='+pict,'foto');
}

function m_image_big(pict,obj) {
  var el=document.getElementById(obj);
  //MM_swapImage('icodef','',pict+'_def.jpg',1);
  var code = '<a href="javascript:;" onclick="m_image(\''+pict+'.jpg\')"> <img src="'+pict+'_def.jpg" alt="" width="250"/></a>';
  el.innerHTML = code;  
}

function m_poradnik(id) {
  popup('cms.php?i='+id,'poradnik');
} 
function m_pomoc(id) {
  popup('cms.php?i='+id,'pomoc');
} 
var menu_link=1;

function m_sel(obj,mode){
  
  for(i=0;i<obj.elements.length;i++) {
    if(obj.elements[i].name.indexOf('op_')!=-1) {
      if(mode==1) obj.elements[i].checked=true;
      else obj.elements[i].checked=false;
    }
  }
  
}
function my_kontakt(email,tytul) {
  popup('pop_kontakt.php?e='+email+'&t='+tytul,'window3');
} 

function m_profil(id){
  alert(id);
}

var inf_modul=0;
var inf_modul_ile=0;

function m_inf_dodaj() {
inf_modul=inf_modul+1;
inf_modul_ile=inf_modul_ile+1;
  
var code="<table><tr><td colspan=\"2\"><b>Osoba "+inf_modul_ile+"</b></td></tr>";
code+="<tr><td style=\"width:100px;\">Imię i nazwisko:</th>";
code+="<td><input type=\"text\" name=\"ag_nazwisko_"+inf_modul+"\" value=\"\" maxlength=\"100\" style=\"width:230px;\" class=\"txt_dl\" /></td></tr>";
code+="<tr><td style=\"\">Telefon:</td>";
code+="<td>+48(<input type=\"text\" name=\"ag_telefon_kier_"+inf_modul+"\" value=\"\" maxlength=\"2\" style=\"width:20px;\" class=\"txt_dl\" />)-<input type=\"text\" name=\"ag_telefon_"+inf_modul+"\" value=\"\" maxlength=\"7\" style=\"width:100px;\" class=\"txt_dl\" /></td></tr>";
code+="<tr><td style=\"\">Tel.komórkowy:</td>";
code+="<td>+48<input type=\"text\" name=\"ag_komorka_"+inf_modul+"\" value=\"\" maxlength=\"9\" style=\"width:100px;\" class=\"txt_dl\" /></td></tr>";
code+="<tr><td style=\"\">E-mail:</td>";
code+="<td><input type=\"text\" name=\"ag_email_"+inf_modul+"\" value=\"\" maxlength=\"100\" style=\"width:230px;\" class=\"txt_dl\" /></td></tr>";
code+="<tr><td style=\"\">Funkcja/Opis:</td>";
code+="<td><input type=\"text\" name=\"ag_opis_"+inf_modul+"\" value=\"\" maxlength=\"100\" style=\"width:230px;\" class=\"txt_dl\" /></td></tr>";
code+="<tr><td style=\"\">Plik: <em>(maks. 200kB)</em></td>";
code+="<td><input type=\"file\" name=\"ag_plik_"+inf_modul+"\"  style=\"width:230px;\" /></td></tr></table>";  

var el=document.getElementById("infmodul");
el.innerHTML = el.innerHTML+code;  
  
}

function m_over(obj, mode) {
  if(mode==1) {
    obj.className+="_over";
  } else {
    obj.className=obj.className.replace("_over", "");
  }
}

function m_hide(id){
  var obj = document.getElementById(id);
  if(obj.style.display=='block') { 
    obj.style.display='none';
  } else {
    obj.style.display='block'; 
  }
}


function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function my_pict(url,w,h) {
  popup('pop_image.php?i='+url,'foto',"width="+h+",height="+h+",scrollbars=yes,resizable=yes,status=yes");
}

function my_zamien(hide, show) {
  var obj=document.getElementById(hide);  
  obj.style.display='none';

  obj=document.getElementById(show);  
  obj.style.display='';
}

function my_thawte(){
	thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=PLDIAL2&lang=pl', 'thaw', config='height=640,width=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}

