var _cols=new Array();

var favorite_div_click=new Array();
var favorite_div_no;
var favorite_page_total;
var favorite_page_num;
var favorite_page_this;
var favorite_div=new Array();
ajax.ContentLoader.prototype.favorite_xml_list=function(){
	var a=eval(this.req.responseText)
	//alert(a[0].nno + " " + a[0].sno + " " + a[0].cate)
	favorite_div=_gel('favorite_div1');

	favorite_div.innerHTML="";
	for (var i=0; i<a.length; i++)
	{


			if (!a[i].nno) continue;
		

			favorite_div[i]=document.createElement("div");
			favorite_div[i].setAttribute('id',"favorite_div1_"+i);
			favorite_div[i].setAttribute('nno',a[i].nno);
			favorite_div[i].setAttribute('sno',a[i].sno);
			favorite_div[i].setAttribute('cate',a[i].cate);
			favorite_div[i].setAttribute('fno',a[i].fno);
			favorite_div[i].setAttribute('name',a[i].fno);
			favorite_div[i].setAttribute('inhtml',"<table width=100% height='16px' border=0 cellpadding=0 cellspacing=0 onclick=f_list('favorite_div1_"+i+"',"+a[i].nno+")><tr><td id=favorite_div1_"+i+"_h><span id=favorite_div1_"+i+"_t ><img src='"+Loadings.directory+"/OUTPUT/IMAGE/folder_icon.gif' align=absmiddle>&nbsp;"+a[i].cate+"</span> ("+a[i].fno+")</td></tr></table>");

			favorite_div[i].style.cursor="hand";
			//favorite_div[i].className="div_favorite";
			if (i<6) {
				
				favorite_div.appendChild(favorite_div[i]);
			
			}
			
			favorite_div[i].innerHTML="<table width=100% height='16px' border=0 cellpadding=0 cellspacing=0 onclick=f_list('favorite_div1_"+i+"',"+a[i].nno+")><tr><td id=favorite_div1_"+i+"_h><span id=favorite_div1_"+i+"_t ><img src='"+Loadings.directory+"/OUTPUT/IMAGE/folder_icon.gif' align=absmiddle>&nbsp;"+a[i].cate+"</span> ("+a[i].fno+")</td></tr></table>";
	}


	favorite_page_total=i;
	favorite_page_this=1
	favorite_page_num=Math.ceil(favorite_page_total/6)
	_gel('favorite_menu_cnt').innerHTML="<font color='#F26522'>1/"+favorite_page_num+"</font>";

//alert(favorite_page_total)
}














var option1="";



function favorite_delete(){
	var a="";


	for (var i=0; i<10; i++)
	{

		if (!_gel('nochk'+i)) continue;
		//alert(_gel('nochk'+i).checked + " " + _gel('nochk'+i).value)

		if (_gel('nochk'+i).checked==true)
		{
			if (a=="") a+=_gel('nochk'+i).value;
			else a+=","+_gel('nochk'+i).value;
		}
		
	}

	if (a!=="")
	{
		if (confirm("Will you remove ePosition from the bookmark? \n\nePosition still exists after removal from the bookmark. ")){
	
			params="q_array="+a;

			var option3=new ajax.xhr.Request("EXEC/exec_favorite_delete.php",params,ajax.ContentLoader.prototype.favorite_xml_delete,"GET","");

		
		}
	}else{
	
		alert("Select ePosition to be deleted.");return false;
	}

}
ajax.ContentLoader.prototype.favorite_xml_delete=function(){
	search_location(3)

}


function favorite_add(epid,epdomain,clickdiv,detail){

	if (Login.users.ulogin!=true) {
		
		//alert('로그인후 사용 하실수 있습니다');return false;
		
		if (confirm("Try it again, after log-in.\n\nWill you log-in?")){
			Login.Members.prototype.Login_popup();return false;
		}else{
			return false;
		}	
	}

	if (_gel('fam_div'))
	{		
		_gel('fam_div').parentNode.removeChild(_gel('fam_div'))
	}

	option1="";

	var e=true;
	var a="";
	var s=""
	//alert(a+" "+b+" "+c);
	
	var b=_gel(clickdiv)
	fam=document.createElement('div');

	fam.setAttribute("id","fam_div");
	fam.style.position='absolute';

	if (detail=="ok")
	{
		fam.style.top=parseInt(ao(b,false)+36) + "px";
		fam.style.left=parseInt(ao(b,false)-50) + "px";

	}else{
		fam.style.top=parseInt(ao(b,false)-190) + "px";
		fam.style.left=parseInt(ao(b,false)-50) + "px";


	}
	fam.style.left='260px';
	
	fam.innerHTML="<table style='border: solid #8B8B8B 1px;' bgcolor='#E3E3E3' width=170px height=40px><tr style='padding:10px;' onMouseover=cl(true) onMouseout='cl(false)'><td><select onclick=option_loader() id=select_fav><option>Category</option></select></td><td><img src='"+Loadings.directory+"/OUTPUT/IMAGE/favorite_bt_submit.gif' align=absmiddle onclick=add_save('"+epid+"','"+epdomain+"') style='cursor:hand;width:54px;height:19px'><img src='"+Loadings.directory+"/OUTPUT/IMAGE/favorite_bt_cancel.gif' align=absmiddle onclick=\"var b=document.getElementById('"+clickdiv+"');b.removeChild(document.getElementById('fam_div'))\"; style='cursor:hand'></td></tr></table>";

	b.appendChild(fam);
	
	cl=function(bl){
		e=bl
		if (e==false && _gel('fam_div')){
			s=setTimeout("cremovel()","5000");
		}else{
			clearTimeout(s)
		}
	
	}
	cremovel=function(){
		if (e==false && _gel('fam_div')) {
			option1="";
			_gel('fam_div').parentNode.removeChild(_gel('fam_div'))
		}
	}

	add_save=function(){
	
		var cate_select=_gel('select_fav');

		if (epid=="" || epdomain=="" ||cate_select.value=="")
		{
			alert("Select Category"); return false;
		}


		//alert(epid +" -> "+ cate_select.value)
		

		epid=encodeURIComponent(epid);
		epdomain=encodeURIComponent(epdomain);
		params="epid="+epid+"&epdomain="+epdomain+"&q_select="+cate_select.value;

		var option2=new ajax.xhr.Request("EXEC/exec_favorite_add.php",params,ajax.ContentLoader.prototype.favorite_xml_add,"GET","");
	
		//window.open("EXEC/exec_favorite_add.php?"+params)
	}

}


ajax.ContentLoader.prototype.favorite_xml_add=function(){

	if (confirm("It is added to bookmark. \n\nWill you move to the bookmark? "))
	{
		search_location(3)
	}else{
		if (_gel('fam_div'))
		{		
			_gel('fam_div').parentNode.removeChild(_gel('fam_div'))
		}

	
	}

}

function favorite_move(){

	option1="";
//var list_size = document.nochk.elements.length; 
//alert(_gel('nochk'+0).checked)

	var e=true;
	var a="";
	var s=""
	

	if (_gel('fam_div'))
	{		
		var b=_gel('favorite_table_div')
		b.removeChild(_gel('fam_div'))
	return false;
	}


	for (var i=0; i<10; i++)
	{

		if (!_gel('nochk'+i)) continue;
		//alert(_gel('nochk'+i).checked + " " + _gel('nochk'+i).value)

		if (_gel('nochk'+i).checked==true)
		{
			if (a=="") a+=_gel('nochk'+i).value;
			else a+=","+_gel('nochk'+i).value;
		}
		
	}

	if (a!=""){
	
		var b=_gel('favorite_table_div')
		fam=document.createElement('div');
		
		
		fam.setAttribute("id","fam_div");
		fam.style.position='absolute';

		

		



		//onmouseover=\"this.style.backgroundColor='#F1F1F1'\" onmouseout=\"this.style.backgroundColor='#FFFFFF'\"
		fam.innerHTML="<table style='border: solid #8B8B8B 1px;' bgcolor='#E3E3E3' width=170px height=40px><tr style='padding:10px;' onMouseover=c(true) onMouseout='c(false)'><td><select onclick=option_loader() id=select_fav><option>카테고리</option></select></td><td><img src='"+Loadings.directory+"/OUTPUT/IMAGE/favorite_bt_submit.gif' align=absmiddle  onclick=move_save() style='cursor:hand'><img src='"+Loadings.directory+"/OUTPUT/IMAGE/favorite_bt_cancel.gif' align=absmiddle  onclick=\"var b=document.getElementById('favorite_table_div');b.removeChild(document.getElementById('fam_div'))\"; style='cursor:hand'></td></tr></table>";

		b.appendChild(fam);
		option_loader();

	}else{
		alert("Select ePosition to be deleted.");return false;
	}





	c=function(bl){
		e=bl
		if (e==false && _gel('fam_div')){
			s=setTimeout("cremove()","5000");
		}else{
			clearTimeout(s)
		}
	
	}
	cremove=function(){
		var b=_gel('favorite_table_div')
		if (e==false && _gel('fam_div')) {
			option1="";
			b.removeChild(_gel('fam_div'))
		}
	}

	move_save=function(){
	
		a="";
		for (var i=0; i<10; i++)
		{

			if (!_gel('nochk'+i)) continue;
			//alert(_gel('nochk'+i).checked + " " + _gel('nochk'+i).value)

			if (_gel('nochk'+i).checked==true)
			{
				if (a=="") a+=_gel('nochk'+i).value;
				else a+=","+_gel('nochk'+i).value;
			}
			
		}
		var cate_select=_gel('select_fav');

		if (a=="" || cate_select.value=="")
		{
			alert("Select Category"); return false;
		}


		//alert(a +" -> "+ cate_select.value)
		
		a=encodeURIComponent(a);
		params="q_array="+a+"&q_select="+cate_select.value;
		var option2=new ajax.xhr.Request("EXEC/exec_favorite_moveall.php",params,ajax.ContentLoader.prototype.favorite_xml_moveall,"GET","");
	//	window.open("EXEC/favorite_xml_moveall.php?"+params)

	}
	
}
ajax.ContentLoader.prototype.favorite_xml_moveall=function(){
	//alert(this.req.responseText)

	//alert(q);return false;
	search_location(3)


}
function option_loader(){
	if (!option1)
	{
		var option2=new ajax.xhr.Request("XML_PHP/favorite_xml_list.php","",ajax.ContentLoader.prototype.favorite_xml_option,"GET","");
	}

}




ajax.ContentLoader.prototype.favorite_xml_option=function(){
	
	option1=eval(this.req.responseText)
	document.getElementById('select_fav').options.length=0;
	document.getElementById('select_fav').options[0]=new Option("Category","");
		

	for (var i=0; i<option1.length; i++)
	{
		
		newItem=new Option(option1[i].cate);
		newItem.value = option1[i].nno;
		document.getElementById('select_fav').options.add(newItem,i+1);

	}
}
function favorite_menu_arrow(a){
	
	var favorite_div1=_gel('favorite_div1');

	if (a=="left")
	{
		if (favorite_page_this > 1)
		{	
			favorite_page_this=favorite_page_this-1

			j=(favorite_page_this * 6)-6

			favorite_div1.innerHTML=''
			for (var i=j; i<j+6; i++){
			//	alert(favorite_page_this + " " + j + " " + i )
				if (!favorite_div[i]) continue;

				//alert(favorite_page_this + " " + j + " " + i )
				favorite_div[i].innerHTML=favorite_div[i].getAttribute('inhtml')
				favorite_div1.appendChild(favorite_div[i]);
			}
			_gel('favorite_menu_cnt').innerHTML="<font color='#F26522'>"+favorite_page_this +"/"+ favorite_page_num+"</font>";
		}	
		

	}else{
		if (favorite_page_this < favorite_page_num)
		{
			j=favorite_page_this * 6
			favorite_page_this=favorite_page_this+1

			favorite_div1.innerHTML=''
			for (var i=j; i<j+6; i++){
				
				if (!favorite_div[i]) continue;

				//alert(favorite_page_this + " " + j + " " + i )
//				alert(favorite_div[i].innerHTML)
				favorite_div[i].innerHTML=favorite_div[i].getAttribute('inhtml')
				favorite_div1.appendChild(favorite_div[i]);
			}
			_gel('favorite_menu_cnt').innerHTML="<font color='#F26522'>"+favorite_page_this +"/"+ favorite_page_num+"</font>";
		}	
	}


}
var q_cate;

function f_list(a,q){
	var d=document.getElementById("div2_3");	
	d.style.display="none";

	if (a)
	{
		a=_gel(a);
		code_name=_gel('favorite_div1');

		code_count=code_name.childNodes.length;
		for(i=0;i<code_count;i++){
			
			if (a.id==code_name.childNodes[i].id)
			{
				code_name.childNodes[i].style.backgroundColor='#000000'

			}else{
				code_name.childNodes[i].style.backgroundColor='#FFFFFF'
			}
			
		}
	}

	var a=document.getElementById("div2_7");	
	a.innerHTML=Loadings.list

	var params="q="+q+"&page=1";
	q_cate=q;
	var loader1=new ajax.xhr.Request("XML_PHP/favorite_xml_eplist.php",params,ajax.ContentLoader.prototype.favorite_xml_eplist,"GET","");
	

}
ajax.ContentLoader.prototype.favorite_xml_edit=function(){
//	document.getElementById('favorite_div1').innerHTML=Loadings.text
	var a=eval(this.req.responseText)
	//alert(a[0].nno + " " + a[0].sno + " " + a[0].cate)

	var favorite_div=_gel('favorite_div1');
	favorite_div.innerHTML="";
	for (var i=0; i<a.length; i++)
	{
			if (!a[i].nno) continue;

			favorite_div[i]=document.createElement("div");
			favorite_div[i].setAttribute('id',"favorite_div1_"+i);
			favorite_div[i].setAttribute('nno',a[i].nno);
			favorite_div[i].setAttribute('sno',a[i].sno);
			favorite_div[i].setAttribute('cate',a[i].cate);
			favorite_div[i].setAttribute('fno',a[i].fno);
			//favorite_div[i].className="div_favorite";
			favorite_div.appendChild(favorite_div[i]);
			favorite_div[i].innerHTML="<table width=100% height='16px' border=0 cellpadding=0 cellspacing=0><tr><td id=favorite_div1_"+i+"_h><span id=favorite_div1_"+i+"_t><img src='"+Loadings.directory+"/OUTPUT/IMAGE/folder_icon.gif' align=absmiddle>&nbsp;"+a[i].cate+"</span> ("+a[i].fno+")</td></tr></table>";

			if (!favorite_div_no)
			{
				favorite_div_no=a[i].nno;
			
			}else{
				favorite_div_no=parseInt(favorite_div_no)<parseInt(a[i].nno)?parseInt(a[i].nno):parseInt(favorite_div_no);
		
			}

			//a!=""?":":"";
	}
	//마지막 div
	dim=document.createElement("div");
	dim.setAttribute('id',"dim");

	//dim.innerHTML="dim";
	favorite_div.appendChild(dim);
	ax=false;
	_cols=[favorite_div];
	aH(_cols);

}

//<DIV id=favorite_div1_1 style="BACKGROUND-COLOR: #000000" pagePosTop="115" pagePosLeft="249" cate="지하철" sno="0" nno="3">


function _gel(vl){
	return document.getElementById?document.getElementById(vl):null
}

function _gelstn(a){
	return document.getElementsByTagName?document.getElementsByTagName(a):new Array()

}

function _uc(a){
	return a.toUpperCase()
}

function _trim(a){
	return a.replace(/^\s*|\s*$/g,"")
}

function _esc(a){
	return window.encodeURIComponent?encodeURIComponent(a):escape(a)
}

var aO=function(a){ 
	
	return window.decodeURIComponent?decodeURIComponent(a):unescape(a)

};

var _unesc=aO;

function _hesc(a){
	return a.replace(/</g,"&lt;").replace(/>/g,"&gt;")
}

var aN=0;

function _uid(){
	return"obj"+aN++
}




var aI=navigator.userAgent.indexOf("Safari")>=0;

function _sendx(a,aa){
	var ab=aP();
	
	if(!ab||aI&&!aa){
		(new Image()).src=a
	}else{
		ab.open("GET",a,true);
		
		if(aa){
			ab.onreadystatechange=function(){
				if(ab.readyState==4){
					aa(ab.responseText)
				}
			}
		}
		ab.send(null)
	}
}



function aP(){
	var a=null;
	if(window.ActiveXObject){
		a=new ActiveXObject("Msxml2.XMLHTTP");
		if(!a){
			a=new ActiveXObject("Microsoft.XMLHTTP")
		}
	}else 

		if(window.XMLHttpRequest){
			a=new XMLHttpRequest()
		}
return a

}


var _et="";
var _pid="";
var as="/ig/setp";

function an(a,aa,ab){
	var ac=document.createElement("input");
	ac.type="hidden";
	ac.name=aa;
	ac.value=ab;
	a.appendChild(ac)
}


function aF(){
	var a=new Object();
	var aa=document.location.search.substring(1);
	var ab=aa.split("&");
	
	for(var i=0;i<ab.length;i++){
		var ad=ab[i].indexOf("=");
		
		if(ad==-1)continue;
		
		var ae=ab[i].substring(0,ad);
		var af=ab[i].substring(ad+1);
		af=af.replace(/\+/g," ");
		a[ae]=_unesc(af)
	}
return a

}

function ar(){
	var a={pid:1,host:1,hl:1};
	var aa=aF();
	var ab="?";
	for(var ac in aa){
		if(a[ac]){	ab+=ac+"="+_esc(aa[ac])+"&"}
	}
	return ab

}

function _fsetp(a,aa,ab){
	a.action=as;
	a.method="get";
	an(a,"url",document.location);
	an(a,"et",_et);
	an(a,"pid",_pid);
	an(a,"m_"+aa+"_t",ab);
return true

}

function _xsetp(a){
	_sendx(as+ar()+"et="+_et+"&pid="+_pid+"&"+a,null)
}

function _dlsetp(a,aa){
	if(!aa){
		aa=_esc(document.location)
	}
	document.location=as+ar()+"et="+_et+"&pid="+_pid+"&url="+aa+"&"+a
}

function _ssbc(a,aa,ab){
	
	var ac=_gelstn("*");
	
	for(var i=0;i<ac.length;i++){
		if(ac[i].className==a){
			ac[i].style[aa]=ab

		}
	}
}


var aE="";

function _enableGS(a,aa){
	a.action=aE+"/CheckCookie";
	
	a.method="get";
	an(a,"service",aa);
	an(a,"continue",document.location);
	an(a,"skipvpage",true);
	return true
}

function aM(a){
	_xsetp("pnlo="+(a?1:0))
}

var _uli;
var _pnlo;
var _pl;
var _mod;
var az=false;


function _upc(){

	_ssbc("medit","display",_pnlo||_uli?"":"none");
	if(_pl&&(_uli||_pnlo)){
		if(!az){
			aH(_cols);
			az=true
		}
		_ssbc("mttl","cursor","move")
	}
}

var aq=0;
function _tp(a){

	//alert("카테고리 목록을 드래그 해서 순서를 바꾸세요");
	//if(aq>0)clearInterval(ap);
	_pnlo=a;
	_mod=a;
	aM(a);
	//aH(a);
	_upc();

	return false

}


function _tp_(a){

location.reload();

return false
}


function _add_m(a){
	_dlsetp(a)
}

function _add_m_confirm(a,b){
	if(confirm(b)){
		_add_m(a)
	}
}

function _add_f(a){
	_dlsetp("n_25="+_esc("url="+_esc(a)))
}

var aw=/^_add_m(_confirm)?\(\"[^"]+\"(, *\"[^"]+\")?\)$/;



function aD(a){
	var aa=_gel("ffresults");
	if(a.length>0&&a.charAt(0)=="<"){
		aa.innerHTML=a
	}else if(a.match(aw)!=null){
		eval(a)
	}
}


function aB(a){
	var aa=/^alert\(\"[^"]+\"\)$/;
	if(a.match(aw)!=null||a.match(aa)!=null){
		eval(a)
	}
}

var aj=[];
var ap=0;
var am=null;

function ag(){
	
	if(!am){
		am=document.createElement("DIV");
		am.style.display="none";
		am.style.position="absolute";
		am.style.cursor="move";
		am.style.backgroundColor="#ffffff";
		am.style.paddingBottom="0px";

		document.body.appendChild(am)
	}
	return am
}

var al={obj:null,init:function(a){
		a.onmousedown=al.start;
		if(isNaN(parseInt(ag().style.left)))ag().style.left="0px";
		if(isNaN(parseInt(ag().style.top)))ag().style.top="0px";
		a.onDragStart=new Function();
		a.onDragEnd=new Function();
		a.onDrag=new Function();
		a.onclick=new Function();
		
	},start:function(a){
		
		var aa=al.obj=this;
		a=al.fixE(a);
		ag().style.backgroundColor='#000000'

		var ab=parseInt(ag().style.top);
		var ac=parseInt(ag().style.left);

		aa.onDragStart(ac,ab,a.clientX,a.clientY);
		//alert(ag().style.top)
		aa.lastMouseX=a.clientX;
		aa.lastMouseY=a.clientY;
		document.onmousemove=al.drag;
		document.onmouseup=al.end;
		
		return false
	},drag:function(a){
		a=al.fixE(a);
		//alert(a.clientY)
		var aa=al.obj;
		var ab=a.clientY;
		var ac=a.clientX;
		var ad=parseInt(ag().style.top);
		var ae=parseInt(ag().style.left);
		var af,ah;
		af=ae+ac-aa.lastMouseX;
		ah=ad+ab-aa.lastMouseY;
		ag().style.left=af+"px";
		ag().style.top=ah+"px";
		aa.lastMouseX=ac;
		aa.lastMouseY=ab;
		aa.onDrag(af,ah,a.clientX,a.clientY);
		//alert(ah)
		return false
	},click:function(a){
		aa.onclick(1,2);
	},end:function(){
		document.onmousemove=null;
		document.onmouseup=null;
		al.obj.onDragEnd(parseInt(ag().style.left),parseInt(ag().style.top));
		al.obj=null

	},fixE:function(a){
		if(typeof a=="undefined")a=window.event;
		if(typeof a.layerX=="undefined")a.layerX=a.offsetX;
		if(typeof a.layerY=="undefined")a.layerY=a.offsetY;
		return a
	}
};
var ax=false;

function aH(a){
	if(ax)return;
	

	ax=true;
	aj=a;
	for(var i=0;i<aj.length;i++){
		for(var j=0;j<aj[i].childNodes.length;j++){
			
			var ac=aj[i].childNodes[j];
			var ad=_gel(ac.id+"_h");

			if(!ad)continue;
			ad.module=ac;
			al.init(ad);
			var ae=_gel(ac.id+"_url");
			if(ae){
				ae.h=ad;
				ae.onmousedown=function(){
					this.h.href=this.href;
					this.h.target=this.target
				}
			}

			ad.onDragStart=function(af,ah){

				clearInterval(ap);
				
				var ai=this.module
//				alert(ai.id);
				aC(ai);

				ai.origNextSibling=ai.nextSibling;
				//alert(ai.nextSibling)
				var ak=ag();
				ak.style.left=ao(ai,true);
				ak.style.top=ao(ai,false);

				ak.style.height=ai.offsetHeight;
				ak.style.width=ai.offsetWidth;
				ak.style.display="block";
				ak.style.opacity=0.8;
				ak.style.filter="alpha(opacity=80)";
				ak.innerHTML=ai.innerHTML;
				
				ak.className='div_favorite';
				this.onclick(af,ah);
				this.dragged=false
				
			};
			
			ad.onDrag=function(af,ah){
				//alert(this.module.id + " " +af+ " " + ah)
				aJ(this.module,af,ah);
				this.dragged=true
			};
			
			ad.onclick=function(af,ah){

				code_name=_gel('favorite_div1');
		
				code_count=code_name.childNodes.length;


				for(i=0;i<code_count;i++){
					
					if (this.module.id==code_name.childNodes[i].id)
					{
						favorite_div_click['this']=this.module
						
						code_name.childNodes[i].style.backgroundColor='#000000'

					}else{
						code_name.childNodes[i].style.backgroundColor='#FFFFFF'
					}
					
				}
				
				//alert(this.module.getAttribute('cate'))
				_gel('favorite_q').value=this.module.getAttribute('cate')
				

				


			};
			
			ad.onDragEnd=function(af,ah){
				//writet=('1')
				if(this.dragged){
					ap=aG(this.module,150,15)
				}else{
					ay();
					if(this.href){
						if(this.target){
							window.open(this.href,this.target)
						}else{
							document.location=this.href
						}
					}
				}

				this.target=null;
				this.href=null;
				//alert(this.module.nextSibling);
				if(this.module.nextSibling!=this.module.origNextSibling){
					aL()
				}

			}
		}
	}
}

function savediv(){

	var divname=_gel('favorite_div1');
	var a="";
	divname_count=divname.childNodes.length;
	//alert(code_count)

	for(i=0;i<divname_count-1;i++){

		a+=divname.childNodes[i].getAttribute('nno') +"||||"+divname.childNodes[i].getAttribute('sno')+"||||"+divname.childNodes[i].getAttribute('cate')+"\n"
		
	
	}
//document.write(a+"\n");
	a=encodeURIComponent(a)

	var params="q=" + a;
	//window.open("EXEC/exec_favorite_update.php?"+params)
	var favorite=new ajax.xhr.Request("EXEC/exec_favorite_update.php",params,ajax.ContentLoader.prototype.favorite_menu_list,"POST","");

}

function deldiv(){
	if (!favorite_div_click['this'])return false;
	var favorite_div=_gel('favorite_div1');
	var del_div=favorite_div_click['this'];
	
	if (del_div.getAttribute('fno')>0)
	{
		alert('\n※ Contents should be removed ahead, \nif you want delete a bookmark');return false;
	}else{
	
	favorite_div.removeChild(del_div);
	favorite_div_click['this']=null;
	}
	ax=false;
	_cols=[favorite_div];
	aH(_cols);
}

function  adddiv(){


	favorite_div_no=parseInt(favorite_div_no+1);

	var favorite_div=_gel('favorite_div1');

	var a=document.createElement("div");
	a.setAttribute("id","favorite_div1_"+favorite_div_no)
	a.setAttribute('nno',favorite_div_no);
	a.setAttribute('sno',0);
	a.setAttribute('cate',"UNDEFINED");
	a.setAttribute('fno',0);

	//a.innerHTML="<table border=0 cellpadding=0 cellspacing=0><tr><td id=favorite_div1_"+favorite_div_no+"_h><div id=favorite_div1_"+favorite_div_no+"_t>"+a.cate+"</div></td></tr></table>";
	//favorite_div.appendChild(a)
	dim=_gel("dim");
	
	
	a.innerHTML="<table border=0 height='16px' cellpadding=0 cellspacing=0><tr><td id=favorite_div1_"+favorite_div_no+"_h><span id=favorite_div1_"+favorite_div_no+"_t><img src='"+Loadings.directory+"/OUTPUT/IMAGE/folder_icon.gif' align=absmiddle>&nbsp;"+a.getAttribute('cate')+"</span> (0)</td></tr></table>";
	//alert(favorite_div.parentNode.id)
	//alert(dim.id + " " + a.id)
	favorite_div.insertBefore(a,dim);

	ax=false;
	_cols=[favorite_div];
	aH(_cols);

}

function applyMenu(){
	if (!favorite_div_click['this'])return false;
	



	//favorite_div_click['this'].setAttribute('cate',"dd");
	
	//alert(favorite_div_click['this'].id)

	var a=document.getElementById('favorite_q');

	if (a.value.indexOf("|")!="-1"){
		a.value=a.value.replace("|","",a.value)
		a.focus();
		alert(" Special character '|' can't be used ");

		return false;
	}


	favorite_div_click['this'].setAttribute('cate',a.value);
	var b=_gel(favorite_div_click['this'].id+"_t");
	
	//alert(b.innerHTML)
	b.innerHTML=a.value
	//favorite_div_click['this'].innerHTML="<table border=0 cellpadding=0 cellspacing=0><tr id="+favorite_div_click['this'].id+"_h><td>"+b.value+"</td></tr></table>";


/*
	var a=document.createElement("div");
	var b=document.getElementById('favorite_q');
	a.setAttribute("id",favorite_div_click['this'].id)
	a.setAttribute('nno',favorite_div_click['this'].nno);
	a.setAttribute('sno',favorite_div_click['this'].sno);
	a.setAttribute('cate',b.value);

*/
	//favorite_div_click['this'].parentNode.replaceChild(a,favorite_div_click['this']);

//	replaceChild

//alert(favorite_div_click['this'].cate)
}

div_upanddown=function(a){
				
	if (!favorite_div_click['this'])return false;

	code_name=_gel('favorite_div1');

	code_count=code_name.childNodes.length;
	//alert(code_count)

	for(i=0;i<code_count;i++){
		
		if (favorite_div_click['this'].id==code_name.childNodes[i].id)
		{
			favorite_div_click['this']=favorite_div_click['this']

			if (i==0){
				favorite_div_click['prev']=favorite_div_click['this']
				favorite_div_click['next']=code_name.childNodes[(i+1)]
			}else	if (i==code_count-1){
				favorite_div_click['prev']=code_name.childNodes[(i-1)]
				favorite_div_click['next']=favorite_div_click['this']
			}else{
				favorite_div_click['prev']=code_name.childNodes[(i-1)]
				favorite_div_click['next']=code_name.childNodes[(i+1)]
			}
		}
	}

	favorite_div_click['prev_top']=ao(code_name.childNodes[0],false);
	favorite_div_click['prev_bottom']=ao(code_name.childNodes[(code_count-1)],false);
		
		
	if (a==1){
		if (favorite_div_click['this'].id!=favorite_div_click['prev'].id)	aJ(favorite_div_click['this'],249,favorite_div_click['prev_top']);
	}else if (a==2)	{
		if (favorite_div_click['this'].id!=favorite_div_click['prev'].id)	aJ(favorite_div_click['this'],249,parseInt(ao(favorite_div_click['this'],false)-16));
	}else if (a==3)	{
		if (favorite_div_click['this'].id!=favorite_div_click['next'].id)	aJ(favorite_div_click['this'],249,parseInt(ao(favorite_div_click['this'],false)+16));
	}else if (a==4)	{
		aJ(favorite_div_click['this'],249,favorite_div_click['prev_bottom']);
	}

}


function ay(){
	ag().style.display="none"
}
/*
function clearInterval(){
	[native code]
}
*/
function aG(a,aa,ab){
	//alert(a.id + " " + aa +" - "+ ab)
	var ac=parseInt(ag().style.left);
	var ad=parseInt(ag().style.top);
	var ae=(ac-ao(a,true))/ab;
	var af=(ad-ao(a,false))/ab;
	return setInterval(function(){
		if(ab<1){
			clearInterval(ap);
			ay();
			return
		}
		ab--;
		ac-=ae;
		ad-=af;
		ag().style.left=parseInt(ac)+"px";
		ag().style.top=parseInt(ad)+"px"
	},aa/ab)
}

function aC(a){
	for(var i=0;i<aj.length;i++){
		var ab=0;
		for(var ac=0;ac<aj[i].childNodes.length;ac++){
			var ad=aj[i].childNodes[ac];
			if(ad==a)ab=ad.offsetHeight;
			ad.pagePosLeft=ao(ad,true);
			ad.pagePosTop=ao(ad,false)-ab
		}
	}
}

function ao(a,aa){
	var ab=0;
	while(a!=null){
		ab+=a["offset"+(aa?"Left":"Top")];
		a=a.offsetParent
	}
	return ab
}

function aJ(a,aa,ab){
//	alert(aj.length)
	var ac=null;
	var ad=100000000;
	for(var i=0;i<aj.length;i++){
		for(var af=0;af<aj[i].childNodes.length;af++){
		//	alert(aj[i].childNodes.length)
			var ah=aj[i].childNodes[af];
			if(ah==a)continue;
			var ai=Math.sqrt(Math.pow(aa-ah.pagePosLeft,2)+Math.pow(ab-ah.pagePosTop,2));
			if(isNaN(ai))continue;
			if(ai<ad){ad=ai;ac=ah}
		}
	}
	//alert(ac +" " + a.nextSibling)
	if(ac!=null&&a.nextSibling!=ac){
		
		ac.parentNode.insertBefore(a,ac);
		aK(a)
		//alert(a.id + " " +ac.id)
	}
}

function aK(a){
	a.parentNode.style.display="none";
	a.parentNode.style.display=""
}

function aL(){
	var a="";
	for(var i=0;i<aj.length;i++){
		for(var ab=0;ab<aj[i].childNodes.length;ab++){
			var ac=aj[i].childNodes[ab];
			a+=a!=""?":":"";
			a+=ac.id.substring(2)+"_"+ac.parentNode.id.substring(2)
		}
	}
	_xsetp("&mp="+_esc(a))
}