
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->




function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}



function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

 

//Flash Data
function showflash(str, wid, hei) { 
 document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>")
 document.write("<param name='movie' value='"+str+"'>")
 document.write("<param name='wmode' value='transparent'>")
 document.write(" <embed src='"+str+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed></object>")
}

function showflash2(str, wid, hei) {
 document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>")
 document.write("<param name='movie' value='"+str+"'>")
 document.write("<param name='quality' value='high'>")
 document.write(" <embed src='"+str+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed></object>")
}






// faq

var _height=null;
function sh(_d) {
  var _x = document.getElementById(_d);
  if(_height==null)_height=_x.style.height;
  _x.style.display=_x.style.display=="none"?"":"none";
  _x.style.height=_x.style.height=="1px"?"1em":"1px";
}

function showfaq(frm,act){

  frm.pfd11.style.display="none";
  frm.pfd21.style.display="none";

  frm.pfd1.style.display="";
  frm.pfd2.style.display="";

  faq_info1.style.visibility="hidden";
  faq_info2.style.visibility="hidden";

  faq_info1.style.position="absolute";
  faq_info2.style.position="absolute";

  switch(act){
    case "1" : faq_info1.style.visibility="visible"; faq_info1.style.position=""; frm.pfd11.style.display=""; frm.pfd1.style.display="none"; frm.faq_sel.value="1"; break;
    case "2" : faq_info2.style.visibility="visible"; faq_info2.style.position=""; frm.pfd21.style.display=""; frm.pfd2.style.display="none"; frm.faq_sel.value="2"; break;
  }
}

function popWindow(sUrl) {
var newsWin;
var window_width =1013;
var window_height =710;


var window_left = Math.floor((screen.width/2)-(window_width/2));
var window_top = Math.floor((screen.height / 2) - (window_height / 2));
window.open(sUrl, 'cViewopenrss', 'left=0,top=0,width=' + window_width + ',height=' + window_height + ',status=yes,scrollbars=yes,resizable=yes,top=' + window_top + ',left=' + window_left, '');
//newsWin =
//newsWin.focus();
}
function popWindow_common(sUrl, sWidth, sHeight) {

    var window_width = sWidth;
    var window_height = sHeight;
    var window_left = Math.floor((screen.width / 2) - (window_width / 2));

    var window_top = Math.floor((screen.height / 2) - (window_height / 2));

    window.open(sUrl, '', 'left=0,top=0,width=' + window_width + ',height=' + window_height + ',menubar=yes,status=yes,location=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=' + window_top + ',left=' + window_left, '');
    return true;
}

function popWindow_st11(sUrl,sWidth,sHeight){  

var window_width =sWidth;
var window_height =sHeight;
var window_left = Math.floor((screen.width/2)-(window_width/2)); 	

var window_top = Math.floor((screen.height/2)-(window_height/2));

window.open(sUrl, 'openrss11st', 'left=0,top=0,width=' + window_width + ',height=' + window_height + ',menubar=yes,status=yes,location=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=' + window_top + ',left=' + window_left, '');    
    return true;
}

function popWindow_st11_view(sUrl, sWidth, sHeight) {

    var window_width = sWidth;
    var window_height = sHeight;
    var window_left = Math.floor((screen.width / 2) - (window_width / 2));

    var window_top = Math.floor((screen.height / 2) - (window_height / 2));

    window.open(sUrl, 'openrss11st', 'left=0,top=0,width=' + window_width + ',height=' + window_height + ',menubar=no,status=no,location=no,scrollbars=yes,resizable=yes,toolbar=yes,top=' + window_top + ',left=' + window_left, '');
}

function popWindowkeyword2(sUrl,keyword){    
var window_width =610;
var window_height =680;
var window_left = Math.floor((screen.width/2)-(window_width/2)); 	
var window_top = Math.floor((screen.height/2)-(window_height/2)); 
    window.open(sUrl+escape(keyword),'outView','width='+window_width+',height='+window_height+',menubar=no,status=no,location=no,scrollbars=yes,resizable=no,toolbar=no,top='+window_top+',left='+window_left,'');    
}     

function popWindowkeyword(sUrl,keyword){        
var window_width =1013;
var window_height =710;
var window_left = Math.floor((screen.width/2)-(window_width/2)); 	
var window_top = Math.floor((screen.height/2)-(window_height/2)); 
    window.open(sUrl+escape(keyword),'cViewopenrss','left=0,top=0,width='+window_width+',height='+window_height+',status=yes,scrollbars=yes,resizable=yes,top='+window_top+',left='+window_left,'');    
}     
function toNextPage(kWord){
    location.href='autosearch_Log.aspx?Key='+escape(kWord);
}
function pageToNextPage(sUrl,sQry1,kword){
    location.href=sUrl+escape(kword)+sQry1;
}
function popWindow2(sUrl,sWidth,sHeight){        
var window_width =sWidth;
var window_height =sHeight;
var window_left = Math.floor((screen.width/2)-(window_width/2)); 	
var window_top = Math.floor((screen.height/2)-(window_height/2)); 

    window.open(sUrl,'cViewopenrss','left=0,top=0,width='+window_width+',height='+window_height+',status=yes,scrollbars=yes,resizable=yes,top='+window_top+',left='+window_left,'');    
}
//±âº» ½ºÅ©¸³Æ®
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->



//¸ÞÀÎ °øÁö»çÇ× ¹× º¸µµÀÚ·á ·¹ÀÌ¾î ½ÃÀÛ
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}



function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

var textsize=14;
var increase=5;
var decrease=5;
var origin=textsize;
//window.document.onkeypress=main;
function main()
{
switch(event.keyCode)
{
case 101:case 69:case 43:
  enlarge();
    break;
case 115:case 83:case 45:
  shrink();
    break;
case 111:case 79:case 42:
    orig();
    break;
case 98:case 66:
    makecolor("blue");
    break;
case 82:case 114:
  makecolor("red");
    break;
case 68:case 100:
  makecolor("black");
    break;
case 71:case 103:
  makecolor("green");
    break;
}
}
function enlarge(objID)
{
textsize>25?a=0:document.getElementById(objID).style.fontSize=textsize+=increase;
}
function shrink(objID)
{
textsize<10?a=0:document.getElementById(objID).style.fontSize=textsize-=decrease;
}
function orig()
{
     document.getElementById('sid0').style.fontSize=origin;
         textsize=origin;
}
function makecolor(COLOR)
{
     document.getElementById('sid0').style.color=COLOR;
}


function resizeImg(myIdName){


try{
    var myImgObj = document.getElementById(myIdName);
    for(a=eval(myImgObj.width);a>280;a--){
    
        if(myImgObj.width > 280 )
        {    
              myImgObj.width = myImgObj.width - (myImgObj.width/10)*1;    
              myImgObj.height = myImgObj.height - (myImgObj.height/10)*1;                            
        }              

    } 
  for(b=eval(myImgObj.height);b>200;b--){
    
        if(myImgObj.height> 200)
        {    
            //myImgObj.height= 380;
              myImgObj.width = myImgObj.width - (myImgObj.width/10)*1;    
              myImgObj.height = myImgObj.height - (myImgObj.height/10)*1;     
        }              

    } 
        
  

  
    

}
catch(e){
    //alert(e);
}



}
function cleanQueryTerm(objName) {
    
    var specialChars='~`!@#$%%^&*-=+\|[{]};:\',<.>/?';
    var sObj = document.getElementById(objName);

    
    
    var str=sObj.value;
    var i, j;
    if (str == '') {
	  return false;
    }else{
        for (i = 0; i < str.length; i++) {
          for (j = 0; j < specialChars.length; j++) {
            if (str.charAt(i) == specialChars.charAt(j))
	          str = str.replace(str.charAt(i), " ");	          
          }
        }
        sObj.value = str;
    }
    //sObjt.focus();
    

  }


    function handlerNum() 
    {
    //¼ýÀÚ¸¸ ÀÔ·Â 

        e = window.event; //À©µµ¿ìÀÇ event¸¦ Àâ´Â°ÍÀÔ´Ï´Ù. ±×³É ½áÁÖ½ÉµË´Ï´ç.

 

        //¼ýÀÚ¿­ 0 ~ 9 : 48 ~ 57, Å°ÆÐµå 0 ~ 9 : 96 ~ 105 ,8 : backspace, 46 : delete -->Å°ÄÚµå°ªÀ» ±¸ºÐÇÕ´Ï´Ù. Àú°ÍµéÀÌ ¼ýÀÚ¶ø´Ï´Ù.

        if(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode == 8 || e.keyCode == 46)

        {

            if(e.keyCode == 48 || e.keyCode == 96)//0À» ´­·¶À»°æ¿ì

            {

                if(txtMileage.value == "" ) //¾Æ¹«°Íµµ ¾ø´Â»óÅÂ¿¡¼­ 0À» ´­·¶À»°æ¿ì

                    e.returnValue=false; //-->ÀÔ·ÂµÇÁö¾Ê´Â´Ù.

                else //´Ù¸¥¼ýÀÚµÚ¿¡¿À´Â 0Àº

                    return; //-->ÀÔ·Â½ÃÅ²´Ù.

            }

            else //0ÀÌ ¾Æ´Ñ¼ýÀÚ

                return; //-->ÀÔ·Â½ÃÅ²´Ù.

        }

        else //¼ýÀÚ°¡ ¾Æ´Ï¸é ³ÖÀ»¼ö ¾ø´Ù.

            e.returnValue=false;

    }


function showLoading(){
    var strHtml = '';
    strHtml = "<img src='/images/12283763863.gif'>";
}
/*window.onunload=function(){
alert('aa');
}
function window.onload(){
alert('bb');
}
*/
function chkShoppingProduct(objID) {    
    var slObj = document.getElementById(objID);  
    if(slObj ==  null)
    {
        return false
    }else{
        return true;    
    }
}
function calculateOffsetLeft(field) {
    return calculateOffset(field, "offsetLeft");
}
function calculateOffsetTop(field) {
    return calculateOffset(field, "offsetTop");
}
function calculateOffset(field, attr) {
    var offset = 0;
    while (field) {
        offset += field[attr];
        field = field.offsetParent;
    }
    return offset;
}
function setObjOffsets(inputObjID, divObjID) {
    var inputObj = document.getElementById(inputObjID);
    var divObj = document.getElementById(divObjID);

    var end = inputObj.offsetWidth;
    var left = calculateOffsetLeft(inputObj);
    var top = calculateOffsetTop(inputObj) + inputObj.offsetHeight;
    divObj.style.border = "black 0px solid";
    divObj.style.left = left + "px";
    divObj.style.top = top + "px";
    
    //nameTable.style.width = end + "px";        
    //document.getElementById("sel_keyWord").style.width = end + "px";
    //document.getElementById("sel_keyWord").style.height = inputField.offsetHeight * 4 + "px";

    // alert(left+'/'+top+'/'+end);
}
function locationTimeDely(nUrl, stime) {
    setTimeout('timerMoveNode()', (stime*1000));
}
function locationTimeDely(nUrl, stime) {

    setTimeout("pageToNextPage('" + nUrl + "','', '')", stime);


}

