var ca="v";var h=0; var co=1;
var Ef=new Array(); var En=new Array();
p1='<area shape="rect" coords="';
p2='" href="javascript:WRT(';
p3=')" title=" ';
p4=' ">';
p5='icon.gif" title=" ';
p6='" border="0" onclick="clk(';
p7='.gif" border="0" usemap="#m';
p8='" id="m';
p9='"><map name="m';
q1='<span class="sw"><a href="#E';
q2='" title="記事開閉" onclick="chg(';
q3=')">■</a></span>';

function cls() {for (k=1;k<=h;k++) {del('et'+En[k]); Ef[k]=0;}
}
function opn() {for (k=1;k<=h;k++) {shw('et'+En[k]); Ef[k]=1;}
}
function mksw() {
document.write('<input type="button" onclick="SW()" value=" SW " title=" 全記事開閉 ">');}

function SW() {if (co==1) {cls();co=0} else {opn();co=1} }



function eS(n) {h++; Ef[h]=1; En[h]=n; document.write(q1+n+q2+n+q3)}
function chg(n) {
x=0; eX=0; for (i=1;i<=h;i++) {if (En[i]==n) {x=Ef[i];eX=i} }
cls(); if (x<1) {shw('et'+n);Ef[eX]=1}
}

function del(n){document.getElementById(n).style.display="none"}
function shw(n){document.getElementById(n).style.display="block"}

function edit(n){ location.href='./admin.php?mode=editentry&no='+n;}
function mkTgt(id) {
var A='onclick="OAW(this.href);return false" href='
var B=document.getElementById( id );
B.innerHTML  = B.innerHTML.replace(/href=/g, A);
}
function OAW(u) {
if(window.confirm("Open Another Window ?")) {
window.open(u,'_blank')} else {location.href=u}
} 
function SetMap(u1,u2,u3,u4,u5) {
w=0; h=0; for(i=u1;i<=u2;i++){ if (w>=u3){w=0;h=h+u5}
document.write(p1+w+','+h+','+(w+u4)+','+(h+u5)+p2+i+p3+i+p4);
w=w+u4; }
document.write('</map>');
}
function clk(n) {
ca="v";if (n>2){ca="e";if (n<4) ca="i"}
for (i=1;i<=6;i++) {del('m'+i)}
shw('m'+n);
}
function WRT(no){
document.comment_form.comment.value += '[絵文字:'+ca+'-'+no+']';
}
function Emoji(SURL) {
sv=SURL.replace( /(http:\/\/)\w+\.(\w+\.fc2\.com\/)/, '<img src="$1$2admin\/image\/');
sv2=sv.replace( /admin\//,"");
document.write(sv+'v'+p7+'1'+p8+'1'+p9+'1">');
SetMap(1,275,225,15,15);
document.write(sv+'v2'+p7+'2'+p8+'2'+p9+'2">');
SetMap(276,545,225,15,15);
document.write(sv+'i'+p7+'3'+p8+'3'+p9+'3">');
SetMap(1,282,240,12,12);
document.write(sv+'e'+p7+'4'+p8+'4'+p9+'4">');
SetMap(1,260,210,14,15);
document.write(sv+'e2'+p7+'5'+p8+'5'+p9+'5">');
SetMap(261,518,210,14,15);
document.write('<span id="m6">.</span>');
document.write(sv+'v'+p5+'V 絵文字 1'+p6+'1)">');
document.write(sv+'v'+p5+'V 絵文字 2'+p6+'2)">');
document.write(sv+'i'+p5+'I 絵文字'+p6+'3)">');
document.write(sv+'e'+p5+'E 絵文字 1'+p6+'4)">');
document.write(sv+'e'+p5+'E 絵文字 2'+p6+'5)">');
document.write(sv2+'e/61.gif'+p6+'6)">');
}

function findElement(n) {
  return document.all ? document.all(n) : document.getElementById(n);
}

menuList = ["pdMENU1","pdMENU2","pdMENU3","pdMENU4","pdMENU5","pdMENU6","pdMENU7"];
function pulldownmenu(mObj)
{
	pdMENU = getMenuObj(mObj);
	flag = pdMENU.style.visibility;
	for (i=0; i<menuList.length; i++)
	{
		pdMENU = getMenuObj(menuList[i]);
		pdMENU.style.visibility = "hidden";
	}
	pdMENU = getMenuObj(mObj);
	if (flag == "visible") pdMENU.style.visibility = "hidden"; else pdMENU.style.visibility = "visible";
}

function plldownclose(cObj)
{
		pdMENU = getMenuObj(cObj);
		pdMENU.style.visibility = "hidden";	
}

function getMenuObj(obj)
{
	if (document.all) return document.all(obj);
	if (document.getElementById) return document.getElementById(obj);
	return obj;
}


