var row_class="even";
function showDetails(a,c,b,l,o,p,m,e){var d=$(m);d.toggleClass("selected");if(d.hasClass("selected")){d.hasClass("struct_img")&&d.attr("src",pmaThemeImage+"new_struct_selected.png");d.hasClass("data_img")&&d.attr("src",pmaThemeImage+"new_data_selected.png")}else{d.hasClass("struct_img")&&d.attr("src",pmaThemeImage+"new_struct.png");d.hasClass("data_img")&&d.attr("src",pmaThemeImage+"new_data.png")}m=document.getElementById("list").getElementsByTagName("table")[0].getElementsByTagName("tbody")[0];row_class=
row_class=="even"?"odd":"even";if(d.hasClass("selected")){d=document.createElement("tr");d.setAttribute("class",row_class);d.className=row_class;d.setAttribute("id",a);a=document.createElement("td");a.align="center";a.innerHTML=e;d.appendChild(a);a=document.createElement("td");a.align="center";e=document.createElement("td");e.align="center";var f=document.createElement("td");f.align="center";var g=document.createElement("td");g.align="center";var h=document.createElement("td");h.align="center";var i=
document.createElement("td");i.align="center";var j=document.createElement("td");j.align="center";var k=document.createElement("td");k.align="center";var n=document.createElement("img");n.src=PMA_getImage("s_success.png").attr("src");n.className=PMA_getImage("s_success.png").attr("class");if(c==""&&b==""&&l==""){a.appendChild(n);e.innerHTML="--";f.innerHTML="--";g.innerHTML="--";i.innerHTML="--";h.innerHTML="--";j.innerHTML="--";k.innerHTML="--"}else if(c==""&&l==""){a.innerHTML="--";e.innerHTML=
"--";f.innerHTML="--";g.innerHTML="--";h.innerHTML="--";i.innerHTML="--";j.innerHTML="--";k.innerHTML=b}else if(l==""){a.innerHTML="--";e.innerHTML="--";f.innerHTML="--";g.innerHTML="--";h.innerHTML="--";i.innerHTML="--";j.innerHTML=c;k.innerHTML=b}else{a.innerHTML="--";e.innerHTML=b;f.innerHTML=l;g.innerHTML=c;i.innerHTML=p;h.innerHTML=o;j.innerHTML="--";k.innerHTML="--"}d.appendChild(a);d.appendChild(e);d.appendChild(f);d.appendChild(g);d.appendChild(i);d.appendChild(h);d.appendChild(j);d.appendChild(k);
m.appendChild(d)}else{c=m.getElementsByTagName("tr");for(b=b=0;b<c.length;b++)c[b].id==a&&c[b].parentNode.removeChild(c[b]);for(b=0;b<c.length;b++){row_class_element=c[b].getAttribute("class");if(row_class_element=="even"){c[b].setAttribute("class","odd");c[b].className="odd"}else{c[b].setAttribute("class","even");c[b].className="even"}}}}
function ApplySelectedChanges(){for(var a={token:$("#synchronize_form input[name=token]").val(),server:$("#synchronize_form input[name=server]").val(),checked:$("#delete_rows").prop("checked")?"true":"false",Table_ids:1},c=$("#list tbody tr"),b=0;b<c.length;b++)a[b]=$(c[b]).attr("id");location.href+="?"+$.param(a)}
function validateSourceOrTarget(a){var c=true;if($("#"+a+"_type").val()!="cur")if($("input[name='"+a+"_username']").val()==""||$("input[name='"+a+"_pass']").val()==""||$("input[name='"+a+"_db']").val()==""||$("input[name='"+a+"_host']").val()==""&&$("input[name='"+a+"_socket']").val()=="")c=false;return c}function validateConnectionParams(){var a=true;if(!validateSourceOrTarget("src")||!validateSourceOrTarget("trg"))a=false;a||alert(PMA_messages.strFormEmpty);return a}
function hideOrDisplayServerFields(a,c){$tbody=a.closest("tbody");if(c=="cur"){$tbody.children(".current-server").css("display","");$tbody.children(".remote-server").css("display","none")}else if(c=="rmt"){$tbody.children(".current-server").css("display","none");$tbody.children(".remote-server").css("display","")}else{$tbody.children(".current-server").css("display","none");$tbody.children(".remote-server").css("display","");var b=c.split("||||");$tbody.find(".server-host").val(b[0]);$tbody.find(".server-port").val(b[1]);
$tbody.find(".server-socket").val(b[2]);$tbody.find(".server-user").val(b[3]);$tbody.find(".server-pass").val("");$tbody.find(".server-db").val(b[4])}}
$(document).ready(function(){$(".server_selector").change(function(a){var c=$(a.target).val();hideOrDisplayServerFields($(a.target),c)});$(".server_selector").each(function(){var a=$(this).val();hideOrDisplayServerFields($(this),a)});$(".struct_img").hover(function(){var a=$(this);a.addClass("hover");a.hasClass("selected")?a.attr("src",pmaThemeImage+"new_struct_selected_hovered.png"):a.attr("src",pmaThemeImage+"new_struct_hovered.png")},function(){var a=$(this);a.removeClass("hover");a.hasClass("selected")?
a.attr("src",pmaThemeImage+"new_struct_selected.png"):a.attr("src",pmaThemeImage+"new_struct.png")});$(".data_img").hover(function(){var a=$(this);a.addClass("hover");a.hasClass("selected")?a.attr("src",pmaThemeImage+"new_data_selected_hovered.png"):a.attr("src",pmaThemeImage+"new_data_hovered.png")},function(){var a=$(this);a.removeClass("hover");a.hasClass("selected")?a.attr("src",pmaThemeImage+"new_data_selected.png"):a.attr("src",pmaThemeImage+"new_data.png")});$("#buttonGo").click(function(a){validateConnectionParams()||
a.preventDefault()})});
