function resizeDialog(obj){
var drag_=false;
var x;
$$(obj).onmousedown=function(e){
drag_=true;
with(this){
var temp1=style.width;
//如果未设置过大小,设置为offsetWidth
if(!temp1 || temp1==""){
//默认值,设置大小
style.width=offsetWidth;
temp1=style.width;
}else{
//获取当前style的大小
if(temp1.indexOf("px")>0){
temp1=temp1.substring(0,temp1.indexOf("px"));
}
//如果小于offsetWidth
if(temp1<offsetWidth){
//重新设置为offsetWidth
style.width=offsetWidth;
temp1=offsetWidth;
}
}
x=getEvent(e).clientX;
document.onmousemove=function(e){
if(!drag_){
return true;
}
with(this){
var changeSize=getEvent(e).clientX-x;
if(parseInt(temp1)+parseInt(changeSize)>380){
style.width=parseInt(temp1)+parseInt(changeSize);
}
}
}
}
document.onmouseup=function(){
drag_=false;
}
}//
}
//去除空格
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*)$/g, '');
};
//去除最右边的逗号
String.prototype.rTrimComma = function(){
return this.replace(/,$/, '');
};
//获取Id
function $$(id, isParent){
var dom;
if(isParent){
dom = parent.document.getElementById(id);
}else{
dom = document.getElementById(id);
}
return dom;
};
//切换页面鼠标点击事件
function documentKeyDownListener(){
//如果点击Esc
if(window.event.keyCode == 27){
Dialog.hide();
}
//按回车
else if(window.event.keyCode == 13){
//修改时按回车继续添加问题 20101123 xkf27471
if($$('dialogModify').style.display == 'none'){
$$('dialogAdd').click();
}else{
$$('dialogModify').click();
}
}
};
var drag_=false;
var x;
$$(obj).onmousedown=function(e){
drag_=true;
with(this){
var temp1=style.width;
//如果未设置过大小,设置为offsetWidth
if(!temp1 || temp1==""){
//默认值,设置大小
style.width=offsetWidth;
temp1=style.width;
}else{
//获取当前style的大小
if(temp1.indexOf("px")>0){
temp1=temp1.substring(0,temp1.indexOf("px"));
}
//如果小于offsetWidth
if(temp1<offsetWidth){
//重新设置为offsetWidth
style.width=offsetWidth;
temp1=offsetWidth;
}
}
x=getEvent(e).clientX;
document.onmousemove=function(e){
if(!drag_){
return true;
}
with(this){
var changeSize=getEvent(e).clientX-x;
if(parseInt(temp1)+parseInt(changeSize)>380){
style.width=parseInt(temp1)+parseInt(changeSize);
}
}
}
}
document.onmouseup=function(){
drag_=false;
}
}//
}
//去除空格
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*)$/g, '');
};
//去除最右边的逗号
String.prototype.rTrimComma = function(){
return this.replace(/,$/, '');
};
//获取Id
function $$(id, isParent){
var dom;
if(isParent){
dom = parent.document.getElementById(id);
}else{
dom = document.getElementById(id);
}
return dom;
};
//切换页面鼠标点击事件
function documentKeyDownListener(){
//如果点击Esc
if(window.event.keyCode == 27){
Dialog.hide();
}
//按回车
else if(window.event.keyCode == 13){
//修改时按回车继续添加问题 20101123 xkf27471
if($$('dialogModify').style.display == 'none'){
$$('dialogAdd').click();
}else{
$$('dialogModify').click();
}
}
};