// 문자열에서 한글 제거
function delKor(strValue){
var tmp = "";
for(var i=0;i<strValue.length;i++) {
var code=strValue.charCodeAt(i);
if (code > 128) {
if(!tmp){
tmp = strValue;
}
tmp = tmp.replace(strValue.substring(i, i + 1), "");
}
}
return trim(tmp);
}
// 숫자 체크
function isNumber(value)
{
if (value.match(/^[0-9]*$/g))
return true;
else
return false;
}
// 문자열 trim
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
// checkbox 전체 선택
function checkAll( checkObject )
{
if(!checkObject) return;
if(checkObject.length)
{
for( var i=0; i<checkObject.length ; i++)
{
if(!checkObject[i].disabled)
{
checkObject[i].checked = true;
}
}
}
else
{
if(!checkObject.disabled)
{
checkObject.checked = true;
}
}
}
// checkbox 전체 선택 해제
function uncheckAll( checkObject )
{
if(!checkObject) return;
if(checkObject.length)
{
for( var i=0; i<checkObject.length ; i++)
{
if(!checkObject[i].disabled)
{
checkObject[i].checked = false;
}
}
}
else
{
if(!checkObject.disabled)
{
checkObject.checked = false;
}
}
}
// checkbox 체크된 개수 반환
function getCheckCount( checkObject )
{
var cnt = 0;
if(checkObject.length)
{
for( var i=0; i<checkObject.length ; i++)
{
if(checkObject[i].checked)
{
cnt++;
}
}
}
else
{
if(checkObject.checked)
{
cnt++
}
}
return cnt;
}
// selectbox 전체 선택
function selectAll( checkObject )
{
var items = checkObject.options;
for( var i=0; i<items.length ; i++)
{
items[i].selected = true;
}
}
// selectbox 전체 선택 해제
function unselectAll( checkObject )
{
var items = checkObject.options;
for( var i=0; i<items.length ; i++)
{
items[i].selected = false;
}
}
// select1 에서 선택된 option들을 select2로 옮김
function moveSelect( select1, select2 )
{
var items = select1.options;
for( var i=0; i<items.length; i++)
{
if( items[i].selected )
{
var opt = document.createElement("OPTION");
if(IE)
{
select2.insertBefore(opt);
}
else
{
select2.appendChild(opt,null);
}
opt.value = items[i].value;
opt.innerHTML = items[i].innerHTML;
select1.removeChild(items[i]);
i--;
}
}
}
// 팝업창 띄우기
function open_window(url, name, width, height, feature)
{
var oWnd;
if (IE && width < window.screen.width && height < window.screen.height)
{
var windowX = Math.ceil( (window.screen.width - width) / 2 );
var windowY = Math.ceil( (window.screen.height - height) / 2 );
oWnd = window.open(url, name, feature+",width=" + width +",height=" + height+",left="+windowX+",top="+windowY + ",resizable=yes");
}
else
{
oWnd = window.open(url, name, feature+",width=" + width +",height=" + height + ",resizable=yes");
}
return oWnd;
}
// 팝업창 리사이즈
function resizepopup(wid,minH)
{
if (IE) {
var winW = wid, winH = 200;
winW = wid;
winH = document.body.scrollHeight;
if(winH > 750)
{
winH = 750;
}
if(winH < minH)
{
winH = minH
}
var deltaW = 0;
var deltaH = 0;
if(document.body.clientHeight)
{
deltaW = winW - document.body.clientWidth;
deltaH = winH - document.body.clientHeight;
}else
{
deltaW = winW - window.innerWidth;
deltaH = winH - window.innerHeight;
}
if(deltaH>=4) deltaH = deltaH-4;
var windowX = Math.ceil( (window.screen.width - winW) / 2 );
var windowY = Math.ceil( (window.screen.height - winH) / 2 );
window.moveTo(windowX, windowY);
window.resizeBy(deltaW, deltaH);
} else {
var width_adjustment = 6;
var height_adjustment = 32;
var oW = window.document.body;
var oW = oW.clip ? oW.clip.width : oW.offsetWidth;
var oH = window.document.body;
var oH = oH.clip ? oH.clip.height : oH.offsetHeight;
var myW = 0, myH = 0, d = window.document.documentElement, b = window.document.body;
if( window.innerWidth ) {
myW = window.innerWidth; myH = window.innerHeight;
}
else if( b && b.clientWidth ) {
myW = b.clientWidth; myH = b.clientHeight;
}
else if( d && d.clientWidth ) {
myW = d.clientWidth; myH = d.clientHeight;
}
//alert(oH+","+myH);
if( window.opera && !document.childNodes ) { myW += 16; }
var winW = parseInt(wid) + width_adjustment;
var winH = oH+50 ;//+ ( (oH + 200 ) - myH ) + height_adjustment;
if(winH > 750)
{
winH = 750;
}
if(winH<minH) winH = minH
var windowX = Math.ceil( (window.screen.width - wid) / 2 );
var windowY = Math.ceil( (window.screen.height - winH) / 2 );
window.moveTo(windowX, windowY);
window.resizeTo( winW, winH );
}
}
function delKor(strValue){
var tmp = "";
for(var i=0;i<strValue.length;i++) {
var code=strValue.charCodeAt(i);
if (code > 128) {
if(!tmp){
tmp = strValue;
}
tmp = tmp.replace(strValue.substring(i, i + 1), "");
}
}
return trim(tmp);
}
// 숫자 체크
function isNumber(value)
{
if (value.match(/^[0-9]*$/g))
return true;
else
return false;
}
// 문자열 trim
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
// checkbox 전체 선택
function checkAll( checkObject )
{
if(!checkObject) return;
if(checkObject.length)
{
for( var i=0; i<checkObject.length ; i++)
{
if(!checkObject[i].disabled)
{
checkObject[i].checked = true;
}
}
}
else
{
if(!checkObject.disabled)
{
checkObject.checked = true;
}
}
}
// checkbox 전체 선택 해제
function uncheckAll( checkObject )
{
if(!checkObject) return;
if(checkObject.length)
{
for( var i=0; i<checkObject.length ; i++)
{
if(!checkObject[i].disabled)
{
checkObject[i].checked = false;
}
}
}
else
{
if(!checkObject.disabled)
{
checkObject.checked = false;
}
}
}
// checkbox 체크된 개수 반환
function getCheckCount( checkObject )
{
var cnt = 0;
if(checkObject.length)
{
for( var i=0; i<checkObject.length ; i++)
{
if(checkObject[i].checked)
{
cnt++;
}
}
}
else
{
if(checkObject.checked)
{
cnt++
}
}
return cnt;
}
// selectbox 전체 선택
function selectAll( checkObject )
{
var items = checkObject.options;
for( var i=0; i<items.length ; i++)
{
items[i].selected = true;
}
}
// selectbox 전체 선택 해제
function unselectAll( checkObject )
{
var items = checkObject.options;
for( var i=0; i<items.length ; i++)
{
items[i].selected = false;
}
}
// select1 에서 선택된 option들을 select2로 옮김
function moveSelect( select1, select2 )
{
var items = select1.options;
for( var i=0; i<items.length; i++)
{
if( items[i].selected )
{
var opt = document.createElement("OPTION");
if(IE)
{
select2.insertBefore(opt);
}
else
{
select2.appendChild(opt,null);
}
opt.value = items[i].value;
opt.innerHTML = items[i].innerHTML;
select1.removeChild(items[i]);
i--;
}
}
}
// 팝업창 띄우기
function open_window(url, name, width, height, feature)
{
var oWnd;
if (IE && width < window.screen.width && height < window.screen.height)
{
var windowX = Math.ceil( (window.screen.width - width) / 2 );
var windowY = Math.ceil( (window.screen.height - height) / 2 );
oWnd = window.open(url, name, feature+",width=" + width +",height=" + height+",left="+windowX+",top="+windowY + ",resizable=yes");
}
else
{
oWnd = window.open(url, name, feature+",width=" + width +",height=" + height + ",resizable=yes");
}
return oWnd;
}
// 팝업창 리사이즈
function resizepopup(wid,minH)
{
if (IE) {
var winW = wid, winH = 200;
winW = wid;
winH = document.body.scrollHeight;
if(winH > 750)
{
winH = 750;
}
if(winH < minH)
{
winH = minH
}
var deltaW = 0;
var deltaH = 0;
if(document.body.clientHeight)
{
deltaW = winW - document.body.clientWidth;
deltaH = winH - document.body.clientHeight;
}else
{
deltaW = winW - window.innerWidth;
deltaH = winH - window.innerHeight;
}
if(deltaH>=4) deltaH = deltaH-4;
var windowX = Math.ceil( (window.screen.width - winW) / 2 );
var windowY = Math.ceil( (window.screen.height - winH) / 2 );
window.moveTo(windowX, windowY);
window.resizeBy(deltaW, deltaH);
} else {
var width_adjustment = 6;
var height_adjustment = 32;
var oW = window.document.body;
var oW = oW.clip ? oW.clip.width : oW.offsetWidth;
var oH = window.document.body;
var oH = oH.clip ? oH.clip.height : oH.offsetHeight;
var myW = 0, myH = 0, d = window.document.documentElement, b = window.document.body;
if( window.innerWidth ) {
myW = window.innerWidth; myH = window.innerHeight;
}
else if( b && b.clientWidth ) {
myW = b.clientWidth; myH = b.clientHeight;
}
else if( d && d.clientWidth ) {
myW = d.clientWidth; myH = d.clientHeight;
}
//alert(oH+","+myH);
if( window.opera && !document.childNodes ) { myW += 16; }
var winW = parseInt(wid) + width_adjustment;
var winH = oH+50 ;//+ ( (oH + 200 ) - myH ) + height_adjustment;
if(winH > 750)
{
winH = 750;
}
if(winH<minH) winH = minH
var windowX = Math.ceil( (window.screen.width - wid) / 2 );
var windowY = Math.ceil( (window.screen.height - winH) / 2 );
window.moveTo(windowX, windowY);
window.resizeTo( winW, winH );
}
}