/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * 根据日期是不是过去的三天，返回相应的图片代码。
 */
function imgCode(date) {
    var arr = date.split("-");
    var b = new Date(arr[0],arr[1]-1,arr[2]).getTime();
    var a = new Date().getTime();
    if(a-b<=3*1000*3600*24){
        return "<img src='"+arguments[1]+"'/>";
    }else{
        return "<img src='"+arguments[2]+"'/>";
    }
}
function drawImage(B,A){
    var _=new Image();
    _.src=B.src;
    var $=_.width,C=_.height;
    if($>C){
        B.style.width=A;
        B.style.height=Math.round(C*A/$);
    }else {
        B.style.height=A;
        B.style.width=Math.round($*A/C);
    }
}