<!--
var MewXHTTP = null;
var MewXDOM = null;
var MewContainer = null;
var MewShowError = false;
var MewShowWait = false;
var MewErrCon = "";
var MewErrDisplay = "Error";
var MewWaitDisplay = '<div style="margin-top:10px;margin-left:10px;"><img src="/style0908/loading.gif" /> Loading...</div>';

function MewAjax(gcontainer,mShowError,mShowWait,mErrCon,mErrDisplay,mWaitDisplay)
{
	MewContainer = gcontainer;
	MewShowError = mShowError;
	MewShowWait = mShowWait;
	if(mErrCon!="") MewErrCon = mErrCon;
	if(mErrDisplay!="") MewErrDisplay = mErrDisplay;
	if(mErrDisplay=="x") MewErrDisplay = "";
	if(mWaitDisplay!="") MewWaitDisplay = mWaitDisplay;
	
	this.keys = Array();
	this.values = Array();
	this.keyCount = -1;
	this.sendlang = 'utf-8';
	
	this.rtype = 'text';
	
	
	if(window.ActiveXObject) {
		try { MewXHTTP = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { }
		if (MewXHTTP == null) try { MewXHTTP = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { }
	}
	else {
		MewXHTTP = new XMLHttpRequest();
	}
	
	this.AddKeyN = function(skey,svalue) {
		if(this.sendlang=='utf-8') this.AddKeyUtf8(skey, svalue);
		else this.AddKey(skey, svalue);
	};
	
	this.AddKey = function(skey,svalue) {
		this.keyCount++;
		this.keys[this.keyCount] = skey;
		svalue = svalue+'';
		if(svalue != '') svalue = svalue.replace(/\+/g,'$#$');
		this.values[this.keyCount] = escape(svalue);
	};
	
	this.AddKeyUtf8 = function(skey,svalue) {
		this.keyCount++;
		this.keys[this.keyCount] = skey;
		svalue = svalue+'';
		if(svalue != '') svalue = svalue.replace(/\+/g,'$#$');
		this.values[this.keyCount] = encodeURI(svalue);
	};
	
	this.AddHead = function(skey,svalue) {
		this.rkeyCount++;
		this.rkeys[this.rkeyCount] = skey;
		this.rvalues[this.rkeyCount] = svalue;
	};
	
	this.ClearSet = function() {
		this.keyCount = -1;
		this.keys = Array();
		this.values = Array();
		this.rkeyCount = -1;
		this.rkeys = Array();
		this.rvalues = Array();
	};
	MewXHTTP.onreadystatechange = function() {
		
		if(MewXHTTP.readyState == 4){
			if(MewXHTTP.status == 200)
			{
				if(MewXHTTP.responseText!=MewErrCon) {
					MewContainer.innerHTML = MewXHTTP.responseText;
				}
				else {
					if(MewShowError) MewContainer.innerHTML = MewErrDisplay;
				}
				MewXHTTP = null;
			}
			else { if(MewShowError) MewContainer.innerHTML = MewErrDisplay; }
		}
		else { if(MewShowWait) MewContainer.innerHTML = MewWaitDisplay; }
	};
	
	this.BarrageStat = function() {
		if(MewXHTTP==null) return;
		if(typeof(MewXHTTP.status)!=undefined && MewXHTTP.status == 200)
		{
			if(MewXHTTP.responseText!=MewErrCon) {
				MewContainer.innerHTML = MewXHTTP.responseText;
			}
			else {
				if(MewShowError) MewContainer.innerHTML = MewErrDisplay;
			}
		}
	};
	
	this.SendHead = function()
	{
		
		if(this.rkeyCount!=-1)
		{ 
			for(var i = 0;i<=this.rkeyCount;i++)
			{
				MewXHTTP.setRequestHeader(this.rkeys[i],this.rvalues[i]);
			}
		}
		　if(this.rtype=='binary'){
		　MewXHTTP.setRequestHeader("Content-Type","multipart/form-data");
	}else{
		MewXHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	}
};
this.SendPost = function(purl) {
	var pdata = "";
	var i=0;
	this.state = 0;
	MewXHTTP.open("POST", purl, true);
	this.SendHead();
	
	if(this.keyCount!=-1)
	{
		for(;i<=this.keyCount;i++)
		{
			if(pdata=="") pdata = this.keys[i]+'='+this.values[i];
			else pdata += "&"+this.keys[i]+'='+this.values[i];
		}
	}
	MewXHTTP.send(pdata);
};
this.SendGet = function(purl) {
	var gkey = "";
	var i=0;
	this.state = 0;
	
	if(this.keyCount!=-1)
	{ 
		for(;i<=this.keyCount;i++)
		{
			if(gkey=="") gkey = this.keys[i]+'='+this.values[i];
			else gkey += "&"+this.keys[i]+'='+this.values[i];
		}
		if(purl.indexOf('?')==-1) purl = purl + '?' + gkey;
		else  purl = purl + '&' + gkey;
	}
	MewXHTTP.open("GET", purl, true);
	this.SendHead();
	MewXHTTP.send(null);
};
this.SendGet2 = function(purl) {
	var gkey = "";
	var i=0;
	this.state = 0;
	
	if(this.keyCount!=-1)
	{ 
		for(;i<=this.keyCount;i++)
		{
			if(gkey=="") gkey = this.keys[i]+'='+this.values[i];
			else gkey += "&"+this.keys[i]+'='+this.values[i];
		}
		if(purl.indexOf('?')==-1) purl = purl + '?' + gkey;
		else  purl = purl + '&' + gkey;
	}
	MewXHTTP.open("GET", purl, false);
	this.SendHead();
	MewXHTTP.send(null);
	
	this.BarrageStat();
};
this.SendPost2 = function(purl) {
	var pdata = "";
	var i=0;
	this.state = 0;
	MewXHTTP.open("POST", purl, false);
	this.SendHead();
	
	if(this.keyCount!=-1)
	{
		for(;i<=this.keyCount;i++)
		{
			if(pdata=="") pdata = this.keys[i]+'='+this.values[i];
			else pdata += "&"+this.keys[i]+'='+this.values[i];
		}
	}
	MewXHTTP.send(pdata);
	
	this.BarrageStat();
};
} 

function GetCookie(c_name)
{
	if (document.cookie.length > 0)
	{
		c_start = document.cookie.indexOf(c_name + "=")
		if (c_start != -1)
		{
			c_start = c_start + c_name.length + 1;
			c_end   = document.cookie.indexOf(";",c_start);
			if (c_end == -1)
			{
				c_end = document.cookie.length;
			}
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return null
}
function SetCookie(c_name,value,expiredays)
{
	var exdate = new Date();
	exdate.setDate(exdate.getDate() + expiredays);
	document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); 
}
function $Nav()
{
	if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
	else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
	else return "OT";
}
function $Obj(objname)
{
	return document.getElementById(objname);
}
function ShowObj(objname)
{
	var obj = $Obj(objname);
	obj.style.display = ($Nav()=="IE" ? "block" : "table");
}
function HideObj(objname)
{
	var obj = $Obj(objname);
	obj.style.display = "none";
}
function   Ltrim(string){   
  return   string.replace(/^(   +)/g,"");   
  }   
 
function   Rtrim(string){   
  return   string.replace(/(   +)$/g,"$1");   
  }   
 
function   Trim(string){   
  return   string.replace(/(   +)$/g,"").replace(/^(   +)/g,"");   
  }



//*********************************************
function LoadQuickDiv(e, surl, oname, w, h)
{
	if($Nav()=='IE')
	{ 
		if(window.event)
		{
			var posLeft = window.event.clientX - 20;
			var posTop = window.event.clientY - 30;
		}
		else
		{
			var posLeft = e.clientX - 20;
			var posTop = e.clientY + 30;
		}
	}
	else
	{
		var posLeft = e.pageX - 20;
		var posTop = e.pageY - 30;
	}
	posTop += MyGetScrollTop();
	posLeft = posLeft - 400;
	
	if(fixupPos)
	{
		posLeft = posTop = 50;
	}
	var newobj = $Obj(oname);
	if(!newobj)
	{
		newobj = document.createElement("DIV");
		newobj.id = oname;
		
		newobj.style.position = 'relative';
		newobj.className = 'pubdlg';
		newobj.style.top = '-600px';
		newobj.style.left = '250px';
		newobj.style.width = w;
		newobj.style.height = h;
		document.body.appendChild(newobj);
	}
  if(posTop > 500) posTop = 500;
  if(posLeft < 50) posLeft = 50;
  
	
	newobj.innerHTML = '<div style="margin-top:10px;margin-left:10px;"><img src="/style0908/loading.gif" /> Loading...</div>';
	newobj.style.display = 'block';
	var myajax = new MewAjax(newobj);
	myajax.SendGet(surl);
	fixupPos = false;
}
function MyGetScrollTop()
{
    return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
}
function ClearDivCt(objname)
{
	if(!$Obj(objname)) return;
	$Obj(objname).innerHTML = '';
	$Obj(objname).style.display = 'none';
	ChangeFullDiv("hide");
}
function ChangeFullDiv(showhide)
{
	var newobj = $Obj('fullpagediv');
	if(showhide=='show')
	{
		if(!newobj)
		{
			newobj = document.createElement("DIV");
			newobj.id = 'fullpagediv';
			newobj.style.position='absolute';
			newobj.className = 'fullpagediv';
			//newobj.style.height =document.body.clientHeight;
			document.body.appendChild(newobj);
		}
		else
		{
			newobj.style.display = 'block';
		}
	}
	else
	{
		if(newobj) newobj.style.display = 'none';
	}
}

function ShowAddDec(e,aid)
{
	fixupPos = true;
	LoadQuickDiv(e, '/plus/0_addon.php?at=dec&aid='+ aid, 'getCatMap', '400px', '250px');
	ChangeFullDiv('show');
}
function ShowAddCon(e,aid)
{
	fixupPos = true;
	LoadQuickDiv(e, '/plus/0_addon.php?at=con&aid='+ aid, 'getCatMap', '400px', '250px');
	ChangeFullDiv('show');
}

function saveUserInfo()
{
var taget_obj = document.getElementById("mewaddform");
var f = document.user_info;
var aid = f.aid.value;
var info = Trim(f.info.value);
var oname = f.oname.value;
var mid = f.mid.value;
var at = f.at.value;
var url = "/plus/0_addon_action.php";
if(info=='')
	{
	if(at=="dec"){alert(' Must Input Description ');}
    else{alert(' Must Input Contral ');}
		return false;
	}

myajax = new MewAjax(taget_obj,false,false,'','','');
	myajax.sendlang = 'utf-8';
    myajax.AddKeyN('aid', aid);
    myajax.AddKeyN('info', info);
    myajax.AddKeyN('oname', oname);
    myajax.AddKeyN('mid', mid);
	myajax.AddKeyN('at', at);
	myajax.SendPost2(url);
	
}
-->