﻿//提交搜索
function doSearch() {
    $("#key").val($("#skey").val());
    document.frmSearch.submit();
}
//提交登陆
function doLogin() {
    $("#user").val($("#LoginName").val());
    $("#pass").val($("#LoginPassword").val());
    document.frmLogin.submit();
}
function resizeImage(ImgD,imgW){  
    var image=new Image();  
    image.src=ImgD.src;  
    if(image.width>0 && image.height>0){          
        if(image.width>imgW){
            ImgD.height = ImgD.height * imgW / image.width;
            ImgD.width = imgW;        
        }          
    }
}
//对话框显示图片,按原始大小
function dlgImage(ImgD) {
    var w;
    var h;
    var image = new Image();
    image.src = ImgD.src;      
    w = image.width;
    h = image.height;

    //alert(w + "," + h + "," + ImgD.src);
    
    $("#dlgImage").html("<img src='" + ImgD.src + "' width='"+w+"' height='"+h+"' />");   
    $("#dlgImage").dialog({
        height: h+52,
        width: w+28,
        modal: true         
    });
}
//打开对话框
function showModel(title, content, w, h) {

    $("#dlgImage").attr("title", title);
    $("#dlgImage").html(content);
    $("#dlgImage").dialog({
        height: h + 52,
        width: w + 28,
        modal: true
    });
}
//关闭对话框
function closeModel() {
    $("#dlgImage").dialog("close");
}
