var xmlDoc; 

// xmlhttprequest ¿¬°áÀ» ¸¸µë
function make_XmlHttpRequest()
{
    var xtr;
    try{
        xtr=new ActiveXObject("Msxml2.XMLHTTP.3.0");
    }
    catch(e){
        try{
             xtr=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(oc){
            xtr=null;
        }
    }

    if(! xtr&&typeof XMLHttpRequest!="undefined")
         xtr=new XMLHttpRequest();

    var SURL="/cate_xdata.xml" ;

    xtr.open("GET",SURL,false);
    xtr.send(null);

    xmlDoc =  xtr.responseXML.documentElement;


}

function themeCate_Load()
{ 

    //´ëºÐ·ù ÀÎµ¦½º °ª Á¤¸®ÇÏ±â 
    cnt=xmlDoc.getElementsByTagName("XCATE").length; 
    this.text=new Array(cnt); 
    this.code=new Array(cnt); 

    if(navigator.appName == "Netscape")
    {
        for(i=0,j=1;i<cnt;i++,j+=2)
        { 
    
            this.code[i]=xmlDoc.childNodes.item(j).getAttribute("code"); 
            this.text[i]=xmlDoc.childNodes.item(j).getAttribute("text");      
        } 
    }
    else
    {

        for(i=0;i<cnt;i++)
        { 
            this.code[i]=xmlDoc.childNodes.item(i).getAttribute("code");
            this.text[i]=xmlDoc.childNodes.item(i).getAttribute("text"); 
        }
    }
} 

//´ëºÐ·ù Ä«Å×¸®½ºÆ® Ãâ·Â 
function themeCate_List(sel) 
{ 
    //´ëºÐ·ù ¸®½ºÆ® °´Ã¼ ¹ÝÈ¯ 
    themeSel=new themeCate_Load(); 
    cnt=themeSel.code.length; 

    var opt=document.getElementById("big_opt");
    for(i=0;i<cnt;i++)
    { 
        selCnt=opt.options.length;
        opt.options.length++; 
        opt.options[selCnt].text=themeSel.text[i]; 
        opt.options[selCnt].value=themeSel.code[i]; 

		if(sel && themeSel.code[i] == sel) opt.options[selCnt].selected = true;
    }

} 

//¼ÒºÐ·ù ¼¿·ºÆ® Ãâ·Â 
function themeCate_Change(t,sel2) 
{
    var opt=document.getElementById("small_opt");
    opt.options.length=1; 
    sel=t.selectedIndex; 

	if(sel=='') return false;
    code=t.options[sel].value; 

    for(i=0,j=1;i<sel-1;i++,j+=2);
    
    if(navigator.appName == "Netscape")
    {
        tree=xmlDoc.childNodes.item(j).childNodes;
        cnt=(tree.length - 1) /2; 
    
        for(i=0,j=1;i<cnt;i++,j+=2)
        { 
            selCnt=opt.options.length++; 
            opt.options[selCnt].text=tree.item(j).getAttribute("text"); 
            opt.options[selCnt].value=tree.item(j).getAttribute("code");

			if(sel2 && tree.item(j).getAttribute("code") == sel2) opt.options[selCnt].selected = true;
        } 
    }

    else
    {
        tree=xmlDoc.childNodes.item(i).childNodes;
        cnt=tree.length-1; 

        for(i=0;i<=cnt;i++)
        { 
            selCnt=opt.options.length++; 
            opt.options[selCnt].text=tree.item(i).getAttribute("text"); 
            opt.options[selCnt].value=tree.item(i).getAttribute("code"); 
			
			if(sel2 && tree.item(i).getAttribute("code") == sel2) opt.options[selCnt].selected = true;
        } 
    }

    
} 


//»ç¿ëÇÏÁö ¾ÊÀ½...
//make_XmlHttpRequest(); 






/* ¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê

	/vns/pop_sp_search.php ¿¡¼­ »ç¿ëÇÒ ÁßºÐ·ù ¼¼ÆÃÇÔ¼ö

¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê¢Ê */
//´ëºÐ·ù Ä«Å×¸®½ºÆ® Ãâ·Â 
function themeCate_List2(sel) 
{ 
	
    var opt=document.getElementById("small_opt");
    for(i=0;i<opt.length;i++)
    { 
		if(sel && opt.options[i].value == sel) opt.options[i].selected = true;
    }

} 

