// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") +
(path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
document.cookie = curCookie;
}

function getCookie (name) {
var prefix = name + '=';
var c = document.cookie;
var nullstring = '';
var cookieStartIndex = c.indexOf(prefix);
if (cookieStartIndex == -1)
return nullstring;
var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
if (cookieEndIndex == -1)
cookieEndIndex = c.length;
return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
if (getCookie(name))
document.cookie = name + "=" + ((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
var base = new Date(0);
var skew = base.getTime();
if (skew > 0)
date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
var now = new Date();
fixDate(now);
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
now = now.toGMTString();
if (f.author != undefined)
setCookie('mtcmtauth', f.author.value, now, '/', '', '');
if (f.email != undefined)
setCookie('mtcmtmail', f.email.value, now, '/', '', '');
if (f.url != undefined)
setCookie('mtcmthome', f.url.value, now, '/', '', '');
}

function forgetMe (f) {
deleteCookie('mtcmtmail', '/', '');
deleteCookie('mtcmthome', '/', '');
deleteCookie('mtcmtauth', '/', '');
f.email.value = '';
f.author.value = '';
f.url.value = '';
}

function hideDocumentElement(id) {
var el = document.getElementById(id);
if (el) el.style.display = 'none';
}

function showDocumentElement(id) {
var el = document.getElementById(id);
if (el) el.style.display = 'block';
}

function showAnonymousForm() {
showDocumentElement('comments-form');

captcha_timer = setInterval('delayShowCaptcha()', 1000);

}

var captcha_timer;
function delayShowCaptcha() {
clearInterval(captcha_timer);
var div = document.getElementById('comments-open-captcha');
if (div) {
div.innerHTML = '<div class="label"><label for="captcha_code">Captcha:</label></div><div class="field"><input type="hidden" name="token" value="EqoURhxhU2PyHHSdAsXVhpn93tsLGsR8kxlQZ8zd" /><img src="/mt-comments.cgi/captcha/1/EqoURhxhU2PyHHSdAsXVhpn93tsLGsR8kxlQZ8zd" width="150" height="35" /><br /><input name="captcha_code" id="captcha_code" value="" /><p>画像の中に見える文字を入力してください。</p></div>';
}
}


var commenter_name;
var commenter_blog_ids;
var is_preview;
var mtcmtmail;
var mtcmtauth;
var mtcmthome;

function individualArchivesOnLoad(commenter_name) {






// comments are allowed but registration not required
if ( commenter_name &&
( !commenter_id
|| commenter_blog_ids.indexOf("'1'") > -1))
{
hideDocumentElement('comment-form-name');
hideDocumentElement('comment-form-email');
} else if (is_preview) {
delayShowCaptcha();
} else {
hideDocumentElement('comments-form');
}



if (document.comments_form) {
if (!commenter_name && (document.comments_form.email != undefined) &&
(mtcmtmail = getCookie("mtcmtmail")))
document.comments_form.email.value = mtcmtmail;
if (!commenter_name && (document.comments_form.author != undefined) &&
(mtcmtauth = getCookie("mtcmtauth")))
document.comments_form.author.value = mtcmtauth;
if (document.comments_form.url != undefined &&
(mtcmthome = getCookie("mtcmthome")))
document.comments_form.url.value = mtcmthome;
if (document.comments_form["bakecookie"]) {
if (mtcmtauth || mtcmthome) {
document.comments_form.bakecookie.checked = true;
} else {
document.comments_form.bakecookie.checked = false;
}
}
}
}

function writeCommenterGreeting(commenter_name, entry_id, blog_id, commenter_id, commenter_url) {

if ( commenter_name &&
( !commenter_id
|| commenter_blog_ids.indexOf("'" + blog_id + "'") > -1))
{
var url;
if (commenter_id) {
url = 'http://mishuku.net/mt-comments.cgi?__mode=edit_profile&commenter=' + commenter_id + '&blog_id=' + blog_id;
if (entry_id) {
url += '&entry_id=' + entry_id;
} else {
url += '&static=1';
}
} else if (commenter_url) {
url = commenter_url;
} else {
url = null;
}
var content = ' ';
if (url) {
content += '<a href="' + url + '">' + commenter_name + '</a>';
} else {
content += commenter_name;
}
content += 'さん、コメントをどうぞ。 (<a href="http://mishuku.net/mt-comments.cgi?__mode=handle_sign_in&amp;static=1&amp;logout=1&entry_id=' + entry_id + '">サインアウト</a>)';
document.write(content);
} else if (commenter_name) {
document.write('このブログにはコメントする権限を持っていません。 (<a href="http://mishuku.net/mt-comments.cgi?__mode=handle_sign_in&amp;static=1&amp;logout=1&entry_id=' + entry_id + '">サインアウト</a>)');
} else {

document.write('<a href="http://mishuku.net/mt-comments.cgi?__mode=login&entry_id=' + entry_id + '&blog_id=' + blog_id + '&static=1">サインイン' + '</a>' + 'してからコメントしてください。 <a href="javascript:void(0);" onclick="showAnonymousForm();">匿名でコメントすることもできます。</a>');

}

}


if ('mishuku.net' != 'mishuku.net') {
document.write('<script src="http://mishuku.net/mt-comments.cgi?__mode=cmtr_name_js"></script>');
} else {
commenter_name = getCookie('commenter_name');
ids = getCookie('commenter_id').split(':');
commenter_id = ids[0];
commenter_blog_ids = ids[1];
commenter_url = getCookie('commenter_url');
}










////////////////////////////////////////////////////////////////////////////////////////
// AC FLASH RUN 
////////////////////////////////////////////////////////////////////////////////////////

function RunIndexImg()		// INDEX LOGO
{
	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="900" height="400">\n');
	document.write('<param name="movie" value="http://mishuku.net/img/top/siteTop.swf">\n');
	document.write('<param name="wmode" value="transparent">\n');
	document.write('<param name="quality" value="high">\n');
	document.write('<embed src="http://mishuku.net/img/top/siteTop.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="900" height="400"></embed>\n');
	document.write('</object>\n');
}

function RunBlogWatch()		// 時計
{
	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="75" height="75" align="middle">\n');
	document.write('<param name="wmode" value="transparent">\n');
	document.write('<param name="movie" value="http://mishuku.net/img/common/clock03.swf">\n');
	document.write('<param name="quality" value="high">\n');
	document.write('<embed src="http://mishuku.net/img/common/clock03.swf" width="75" height="75" align="middle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>\n');
	document.write('</object>\n');
}




function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

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_displayStatusMsg(msgStr) { 			//v1.0
status=msgStr;
document.MM_returnValue = true;
}

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);


