function xxx(){
//alert('dupa');
 var currency_select = document.getElementById('payment2');
 var index = 1;
                 for(k=0; k<3; k++)
		   {
                    currency_select.options[index] = new Option(index,'dupaa');
                    index++;
                } 
}
 
 function updateJSONwhat(request, json, what){
  	if (what != 'end') {
			 
			if (what == 'county') {
			var sel = document.getElementById('county');
			sel.options.length = 0;
			sel.options[0] = new Option('-Wybierz region-', -1);			}
			
			if (what == 'country') {
 
			var sel = document.getElementById('country');
			sel.options.length = 0;
			sel.options[0] = new Option('-Wybierz państwo-', -1);
			 
			var sel2 = document.getElementById('county');
			sel2.options.length = 0; 
			sel2.options[0] = new Option('-Wybierz region-', -1);
 
			}
	}   
	 
		
		var point;
		var varArray  = new Array(); 
		var dupa = request.responseText;
		var test = eval(dupa); 
		var temp = new Array();
		temp = test.split(';');
		    
		   
		if( document.getElementById("mapka") != null)
		{
				 clear();
				 
				
				for(var i=0; i<temp.length; i++)
				{
					
					temp2 = temp[i].split(','); 
						 
					if (temp2[5] == "\"main\"") {  
					 
						map.setCenter(new GLatLng(temp2[2], temp2[3]), parseInt(temp2[4]));
						
					}
					else {
						//sel.options[i + 1] = new Option(decodeURI(unescape(utf8Decode(json[i][1]))), json[i][0]);
						sel.options[i + 1] = new Option(temp2[1], temp2[0]);
		 
						xxx = temp2[0];
						point = new GLatLng(temp2[2], temp2[3]);
						
						if(temp2[6] == 1)
						child = 'city';
						if(temp2[7] == 1)
						child = 'country';
						if(temp2[8] == 1)
						child = 'county';
						 
						marker = cm_createMarker(point, xxx, child, ikon, 'Some stuff to display in the<br>Third Info Window');
						 
						map.addOverlay(marker);
						MarkerPan.push(marker);
						 
					}
						
				}
				
				 
					map.enableDragging();
		}
		else
		{  
			for(var i=0; i<temp.length; i++)
				{
					temp2 = temp[i].split(','); 
					
					if (temp2[5] != "\"main\"")   
					sel.options[i + 1] = new Option(temp2[1], temp2[0]);
				}
				 
		}
	}
 
 //czyszczenie markerow i etykiet panstw
function clear() {
    
    for (i=0;i<MarkerPan.length;++i) {   
      map.removeOverlay(MarkerPan[i]);
    }
    for (i=0;i<MarkerEtyk.length;++i) {   
      map.removeOverlay(MarkerEtyk[i]);
    }
    MarkerPan = [];
    MarkerEtyk  = [];
} 
 
function updateJSONfuck(request, json){
		 var empCount3 = json.length;
		//  alert(empCount3);
	    for (var j = 0; j < empCount; j++) {
		    alert(json[j][1]);
			
		}
			
	}
	
function cm_createMarker(point, xxx, child, ikon, html) {
 	 
  var marker = new GMarker(point, ikon); 

  GEvent.addListener(marker, "click", function() 
													 {
													 info(xxx, child);
													 }
  );
 /*
 GEvent.addListener(marker, "mouseover", function() 
												  {
													marker.openInfoWindowHtml(html);

													}); 
 
 */
 
  return marker;
}
	
	
function set_search(fromDiv){

	document.getElementById(fromDiv).style.display='block';
 
		 if(fromDiv=='s_ads'){
			 document.getElementById('s_google').style.display='none';  
		}else if(fromDiv=='s_google'){ 
			 document.getElementById('s_ads').style.display='none'; 
		}	 
		 
	 	
	}
		

