$(function() {

	$('input[type="text"],input[type="password"],textarea,select').focus(function() {
	//	$(this).css("background", "#f0ffff");
		$(this).css("border-color", "#ffc0c0");
	}).blur(function() {
		$(this).css("background", "#ffffff");
		$(this).css("border-color", "silver");
	});

	$(".tip").each(function() {
		$(this).simpletip({
			content: $(this).attr("title"),
			fixed: true,
			offset: [0, 20],
			hideTime: 0,
			baseClass: "simpletip"
		});
		$(this).removeAttr("title");
	});

	if (typeof document.body.style.maxHeight != "undefined") { // except IE6
		var external_link = $('a[href^="http:"]:not(.internal),a[href^="https:"]:not(.internal)');
		external_link.leaveNotice({
			exitMessage: '<p><strong>外部サイトへ移動します</strong></p><p>この先のページは、モグリーとは関係がありません。</p>',
			preLinkMessage: '<div class="setoff"><p>まもなく次のURLへ自動的に移動します<br/>{URL}</p></div>'
		});
	}

	$('input[type="submit"]:not([class^="sexybutton"])').addClass("sexybutton sexysimple sexygreen");

//	var submit = $('input[type="submit"]:not([class^="sexybutton"])');
//	submit.wrap('<span class="sexybutton sexyorange"><span><span></span></span></span>');
//	submit.addClass("sexybutton sexyorange");

	if ($.cookie("login")) {
		$(".onlymember").css("display", "inline");
		$(".onlyguest").empty();
	} else {
		$(".onlyguest").css("display", "inline");
		$(".onlymember").empty();
	}

	$.cookie("checkcookie", "true", { path: '/' });
	if (! $.cookie("checkcookie")) {
		$("#nocookie").append("Cookieが使用できません。当サイトの一部の機能が正しく動作しません。Cookieを有効にしてください。");
	}

});
