function getHTML(url,pars,parwhere)
{

var myAjax = new Ajax.Updater( parwhere, url, {method: 'post',parameters: pars});

}

function getRequest(url,pars,GetComplete)
{
var myAjax = new Ajax.Request(url,{method: 'post',parameters: pars,asynchronous:true,onComplete:GetComplete});
}



//图片按比例缩放 
var flag=false; 
function DrawImage(ImgD,iwidth,iheight){ 
 var image=new Image(); 
 //var iwidth = 770;  //定义允许图片宽度 
 //var iheight = 700;  //定义允许图片高度 
 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; 
  } 
  //ImgD.alt=image.width+"×"+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; 
  } 
  } 
 } 
}  
function DrawImage2(ImgD,iwidth,iheight,msg) 
{ 
	DrawImage(ImgD,iwidth,iheight);
	if (msg!="")
	{	ImgD.alt=msg;
		}
	}

//表单数据化为字符串
function formToRequestString(form_obj)
{
var query_string='';
var and='';
//alert(form_obj.length);
for (i=0;i<form_obj.length ;i++ )
{
e=form_obj[i];
if (e.name!='')
{
if (e.type=='select-one')
{
element_value=e.options[e.selectedIndex].value;
}
else if (e.type=='checkbox' || e.type=='radio')
{
if (e.checked==false)
{
continue;	
}
element_value=e.value;
}
else
{
element_value=e.value;
}
query_string+=and+e.name+'='+escape(element_value.replace(/\&/g,"%26"));
and="&"
}
}
return query_string;
}

function dbok(ms) 
{alert(ms);
window.close();
window.opener.location.reload();
}

function dboknoclose(ms,url) 
{alert(ms);
window.document.location=url;
}

function showback(ms) 
{	alert(ms);
	history.back();
}