var combo;var swfu;SWFUpload.onload=function(){var A={flash_url:"/scripts/swfupload/swfupload.swf",upload_url:"/upload-photo.html",file_size_limit:"200 KB",file_types:"*.jpg; *.jpeg",file_types_description:"Pliki graficzne",file_upload_limit:10,file_queue_limit:10,custom_settings:{progressTarget:"fsUploadProgress",uploadedIdList:"photoIdList"},debug:false,button_image_url:"/images/btn.upload.png",button_placeholder_id:"uploader",button_text:"<font face='Arial' size='13pt'>Przeglądaj...</font>",button_text_left_padding:18,button_text_top_padding:1,button_width:109,button_height:22,swfupload_loaded_handler:swfUploadLoaded,file_queued_handler:fileQueued,file_queue_error_handler:fileQueueError,file_dialog_complete_handler:fileDialogComplete,upload_start_handler:uploadStart,upload_progress_handler:uploadProgress,upload_error_handler:uploadError,upload_success_handler:uploadSuccess,upload_complete_handler:uploadComplete,queue_complete_handler:queueComplete,minimum_flash_version:"9.0.28",swfupload_pre_load_handler:swfUploadPreLoad,swfupload_load_failed_handler:swfUploadLoadFailed};swfu=new SWFUpload(A)};function Suggestions(B){this.cities=B;this.withoutPolish=[];for(var A=0;A<this.cities.length;A++){this.withoutPolish.push(UnifyChars(this.cities[A]))}}Suggestions.prototype.requestSuggestions=function(E,A){combo.Clear();var C=[];var D=E.textbox.value;if(D.length>0){found=this.withoutPolish.binarySearch(UnifyChars(D));if(found!=null){C.push(this.cities[found])}}var B=E.autosuggest(C);if(C.length==0){D=E.textbox.value.substring(0,E.textbox.value.length-1);E.textbox.value=D}if((D.length>2)&&(B==true)){combo.Reload("/ajax_handler.html","post",{mode:"suggest",city:$("city").value},A)}};function ReloadQuarter(){if($("city").value.length>2){combo.Reload("/ajax_handler.html","post",{mode:"suggest",city:$("city").value},true)}}function onFormLoad(){setTimeout("AddEventToCheck('copyProfileContact', 'CopyUserDataHandler()');",100);setTimeout("RegisterAutocomplete();",200);if($("copyProfileContact").checked){$("contactEmail").disabled=true;$("contactMobilePhone").disabled=true;$("contactPhone").disabled=true}else{$("contactEmail").disabled=false;$("contactMobilePhone").disabled=false;$("contactPhone").disabled=false}if((typeof (city)!="undefined")&&(GBrowserIsCompatible())){var B=new GMap2(document.getElementById("map"));B.addControl(new GLargeMapControl());B.addControl(new GMapTypeControl());GEvent.addListener(B,"click",function(D,C){if(D){B.removeOverlay(D)}else{B.clearOverlays();B.addOverlay(new GMarker(C));$("mapLat").value=C.y;$("mapLng").value=C.x}});var A=new GClientGeocoder();A.getLatLng(city+", "+street+", polska",function(C){if(C){B.setCenter(C,15);B.clearOverlays();B.addOverlay(new GMarker(C));$("mapLat").value=C.y;$("mapLng").value=C.x}else{A.getLatLng(city+", polska",function(D){if(D){B.setCenter(D,12)}else{A.getLatLng("polska",function(E){if(E){B.setCenter(E,6)}})}})}})}}function CopyUserDataHandler(){if($("copyProfileContact").checked){$("contactEmail").disabled=true;$("contactEmail").value="";$("contactMobilePhone").disabled=true;$("contactMobilePhone").value="";$("contactPhone").disabled=true;$("contactPhone").value=""}else{$("contactEmail").disabled=false;$("contactMobilePhone").disabled=false;$("contactPhone").disabled=false}}function RegisterAutocomplete(){combo=new AjaxCombo("quarter");$("city").disabled=true;var A=$("city").value;$("city").value=" --- pobieranie danych... ---";new Ajax.Request("/ajax_handler.html",{method:"post",parameters:{mode:"suggest",allCities:0},onSuccess:function(D){$("city").disabled=false;$("city").value=A;var C=D.responseText.evalJSON(true);var B=new AutoSuggestControl($("city"),new Suggestions(C),combo.Clear.bind(combo));$("reload").onclick=new Function("ReloadQuarter()")}})}Event.observe(window,"load",onFormLoad);
