/*=======================================================================
Function : fnTrim
       : ڿ Trim
     : 
ۼ : 2008 07 15
 :
========================================================================*/
function fnTrim(strVal)
{
  return strVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

/*=======================================================================
Function : fnEnterNumeric
       : ڸ 
     : 
ۼ : 2008 07 15
 :
========================================================================*/
function fnEnterNumeric(objEle, strValue, blType)
{
  if (isNaN(strValue))
  {
    alert('ڸ Է մϴ');

    if (blType)
      objEle.value = objEle.value.substr(0, objEle.value.length - 1);
    else
      objEle.value = '';

    return;
  }
}

// png 
function setPng24(obj)
{
  obj.width = obj.height = 1;
  obj.className = obj.className.replace(/\bpng24\b/i, '');
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + obj.src + "',sizingMethod='image');"
  obj.src = '';
  return '';
}



/*=======================================================================
Function?: setcalenderzIndex
?용 : AJAX.NET Calendar ?이??ON-TOP 보기 기능
?? ?? ?? : 쿼터?강창??
최초?성?? : 2010??06??07??
최종?정?? : 2010??06??07??
========================================================================*/
function setcalenderzIndex(sender)
{
  sender._popupDiv.style.zIndex = 50000;
}



function fnCalendarDateChange(sender, args)
{
  //alert(sender._selectedDate.format('yyyy-MM-dd'));

}


function fntest(sender, args)
{
  alert('test1');

}

// focus  ̵
// : MoveFocus(this,6,jumin2)
// :  ڵ Ŀ ̵
function MoveFocus(val, len, nextfocus) {
    var myvalue = val.value;
    if (myvalue.length == len) {
        nextfocus.select();
        nextfocus.focus();
       
    }

}

function historyPUSH() {


    var callURL;

    if (historyValue == '2000') {
        callURL = '/vision/history2000.xml';
    }
    if (historyValue == '2001') {
        callURL = '/vision/history2001.xml';
    }
    if (historyValue == '2002') {
        callURL = '/vision/history2002.xml';
    }
    if (historyValue == '2003') {
        callURL = '/vision/history2003.xml';
    }
    if (historyValue == '2004') {
        callURL = '/vision/history2004.xml';
    }
    if (historyValue == '2005') {
        callURL = '/vision/history2005.xml';
    }
    if (historyValue == '2006') {
        callURL = '/vision/history2006.xml';
    }
    if (historyValue == '2007') {
        callURL = '/vision/history2007.xml';
    }
    if (historyValue == '2008') {
        callURL = '/vision/history2008.xml';
    }
    if (historyValue == '2009') {
        callURL = '/vision/history2009.xml';
    }
    if (historyValue == '2010') {
        callURL = '/vision/history2010.xml';
    }
	if (historyValue == '2011') {
        callURL = '/vision/history2011.xml';
    }
	/* 120207 ߰ */
	if (historyValue == '2012') {
        callURL = '/vision/history2012.xml';
    }
	/* //120207 ߰ */
    var thisSWF = swfCatch('historyV');
    thisSWF.historyPUSH(callURL);
}

function swfCatch(swfName) {

    if (navigator.appName.indexOf("Microsoft") != -1) {
        return getElementByTagAndId("object", swfName);
    } else {
        return getElementByTagAndName("embed", swfName);
    }
}

function getElementByTagAndId(tagName, id) {

    var el = null;
    var els = document.getElementsByTagName(tagName);

    for (var i = 0; i < els.length; i++) {
        if (els[i].id == id) {
            el = els[i]; break;
        }
    }
    return el;

}


var g_request;
var ver = "ie";

function AjaxXMLHttp() {
    if (window.ActiveXObject) {
        try {
            return new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e) {
            try {
                return new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e1) {
                return null;
            }
        }
    }
    else if (window.XMLHttpRequest) {
        ver = "other";
        return new XMLHttpRequest();
    }
    else {
        return null;
    }
}

function AjaxCounter(Bidx, Aidx) {
    g_request = AjaxXMLHttp();
    var vURL = "/Common/AJAXCounter.aspx?Bidx=" + Bidx + "&Aidx=" + Aidx;
    g_request.open("GET", vURL, true);
    g_request.send(null);
}
