// JavaScript Document
function formsetfocus(ob)
{
	var getob=document.getElementById(ob)
	getob.focus()
	}

function clearinput()
{
	var getOb=document.getElementById("text")
	if(getOb.value=="Input at least 3 letters")
	{
	getOb.value=""
	}
	}

function showpage(url) {
	new Ajax(url, {
		 method: "get",
		 update: "etw_content",
		 onload: $("etw_content").setHTML('<span class="span"><img src="../img/load_img.gif" align="absmiddle" alt="" width="30" height="30" /> Retrieving data...</span>')
		 }).request();
}

function doSubmit() {
	var getOb=document.getElementById("text")
	if(getOb.value.length<3)
		{
			getOb.value="Input at least 3 letters"
			return false;
			}
}
function formfocus()
{
	var getob=document.getElementById('text')
	getob.focus()
	}

// get current date
var d = new Date();
var y = d.getFullYear();

var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        }
    }
} 





