function insert_img(form,elem,id){
opener.window.document.forms[form][elem].value=id
img='i'+id;
opener.document.images[elem].src=window.document.images[img].src;
}
function op(url){open(url,'')}
function owi(url){window.open(url,'','toolbar=0,scrollbars=1,resizable=1,status=0');}


function anonymo_checkbox(id){
	


            advAJAX.get({
                  url : "newsanostatus.php?id=" + id,
                  onInitialization : function() {

                  },
                  onSuccess : function(obj) {

                 ///       do("id").innerHTML = obj.responseText;
                      
						///	 document.form.for_anonymouse.idx.value= id;
						if (document.getElementById("n"+id).innerHTML == " NIEWIDOCZNE ")
						{
						 	document.getElementById("n"+id).innerHTML = " WIDOCZNE " ;	
						}
						else
						{
						 	 document.getElementById("n"+id).innerHTML = " NIEWIDOCZNE " ;	
						}
						
                        
                  }
            });
}


function anonymo_checkbox_photo(id){
	


            advAJAX.get({
                  url : "photoanostatus.php?id=" + id,
                  onInitialization : function() {

                  },
                  onSuccess : function(obj) {

						

                 ///       do("id").innerHTML = obj.responseText;
                      
						///	 document.form.for_anonymouse.idx.value= id;
						if (document.getElementById("n"+id).innerHTML == ' _nie_ ')
						{						
						 	document.getElementById("n"+id).innerHTML = ' TAK ' ;	
						}
						else
						{					
						 	 document.getElementById("n"+id).innerHTML = ' _nie_ ' ;	
						 	 
						}
						
						
                        
                  }
            });
}

function import_sw(id){
	


            advAJAX.get({
                  url : "import_sw.php",
                  onInitialization : function() {

                  },
                  onSuccess : function(obj) {

						

						if (document.getElementById(id).innerHTML == ' wyłączony ')
						{						
						 	document.getElementById(id).innerHTML = ' WŁĄCZONY ' ;	
						}
						else
						{					
						 	 document.getElementById(id).innerHTML = ' wyłączony ' ;	
						 	 
						}
						
						
                        
                  }
            });
}


function tabela_pobran(dlakogo){
	
			var data_od = document._photoagetreport.dtf103.value ;
		
			var data_do = document._photoagetreport.dtt103.value ;
			
			var author = document._photoagetreport.wrk103.value ;
			
			var usrg   = document._photoagetreport.usrg103.value ;
			
			var szf103   = document._photoagetreport.szf103.value ;
			
			var szm103   = document._photoagetreport.szm103.value ;
			
	
			if (dlakogo == "dla_kli")
			{
				var u = "/tabela_pob_1.php?data_od=" + data_od + "&data_do=" + data_do + "&author=" + author + "&usrg=" + usrg + "&szf103=" + szf103 + "&szm103=" + szm103;
			}		
			
			if (dlakogo == "dla_ga")
			{
				var u = "/tabela_pob_0.php?data_od=" + data_od + "&data_do=" + data_do + "&author=" + author + "&usrg=" + usrg + "&szf103=" + szf103 + "&szm103=" + szm103;

			}
			

	
				
				
	advAJAX.setDefaultParameters({
      onSuccess : function(obj) {
        document.getElementById("layer0").innerHTML = obj.responseText;
    	  }
	   });

	 advAJAX.get({
         tag: "layer0",
         url : u
         			
   });
}





function nl_change(){
	


            advAJAX.get({
                  url : "nl_change.php",
                  
                  onLoading : function(obj)
        				{ 
        				  
			  		   },
			  		   
			  		   
                  onInitialization : function() {
                  	document.getElementById("nl_0").innerHTML = '<span class=green><b>PROSZĘ CZEKAĆ</b></span>' ;                  
                  },
                  
                  
                  onSuccess : function(obj) {

                  ///       do("id").innerHTML = obj.responseText;
                      
						///	 document.form.for_anonymouse.idx.value= id;
						
						
						if (document.getElementById("nl_").innerHTML == '<span class=red><b>wylaczony</b></span>' )
						{
						 	document.getElementById("nl_").innerHTML = '<span class=green><b>wlaczony</b></span>' ;	
						}
						else
						{
						 	 document.getElementById("nl_").innerHTML = '<span class=red><b>wylaczony</b></span>' ;	
						}
						
                  },
                                    
                  onFinalization : function() {
        				document.getElementById("nl_0").innerHTML = '<INPUT TYPE=button  VALUE="proces  newslettera" onclick="nl_change()">';
    					}
            });
}










function import_change(){
	


            advAJAX.get({
                  url : "import_change.php",
                  onInitialization : function() {

                  },
                  onSuccess : function(obj) {

                 ///       do("id").innerHTML = obj.responseText;
                      
						///	 document.form.for_anonymouse.idx.value= id;
						if (document.getElementById("import_").innerHTML == '<span class=red><b>wylaczony</b></span>' )
						{
						 	document.getElementById("import_").innerHTML = '<span class=green><b>wlaczony</b></span>' ;	
						}
						else
						{
						 	 document.getElementById("import_").innerHTML = '<span class=red><b>wylaczony</b></span>' ;	
						}
						
                        
                  }
    
    
            });
}




function alert_pobran(){
			
			var data_do = document._photoagetreport.dtt103.value ;
			var data_od = document._photoagetreport.dtf103.value ;
	alert("od: " + data_od + " ; do: " + data_do) ;
	
}