$(function(){

// BlockSkip

	$(".skip a").focus(function(){
		$(this).addClass("show");
	});
	$(".skip a").blur(function(){
		$(this).removeClass("show");
	});


// Change Font Size

	var history = $.cookie("fsize");
	(!history)? $("body").addClass("fontS"):$("body").addClass(history);

	$("#fontSize a").click(function() {
		var textSize = $(this).parent().attr("class");
		$("body").removeClass("fontS fontM fontL").addClass(textSize);
		$.cookie("fsize",textSize, { path: "/", expires: 7 });
		return false;
	});


// GoogleCustomSearch

	$("#cse-search-box").attr("action","/search-result/");
	$("#cse-search-box div.searchBox").prepend("<input type='hidden' name='cof' value='FORID:11' />");


// ExternalIcon

	$("div#homeContent a[href^='http'], div#homeNav a[href^='http'] span.siteTitle, div#content a[href^='http'], div#nav a[href^='http']").not("[href*='www.will3in.jp']").append(" <img src='/images/external.gif' alt='外部のサイトに移動します' title='外部のサイトに移動します' width='13' height='11' class='external' />");

	$(".getAdobe a img.external, #contact a img.external").remove();

	$("#contact div#nav a[href^='http']").not("[href*='www.will3in.jp']").append(" <img src='/www.will3in.jp/images/external.gif' alt='外部のサイトに移動します' title='外部のサイトに移動します' width='13' height='11' class='external' />");


// FileIcon

	$("div#homeContent a[href$='.pdf'], div#content a[href$='.pdf']").prepend("<img src='/images/pdf_icon.gif' alt='PDFファイル' width='16' height='16' class='fileIcon' /> ");
	$("div#homeContent a[href$='.doc'], div#content a[href$='.doc']").prepend("<img src='/images/doc_icon.gif' alt='Wordファイル' width='16' height='16' class='fileIcon' /> ");
	$("div#homeContent a[href$='.docx'], div#content a[href$='.docx']").prepend("<img src='/images/doc_icon.gif' alt='Wordファイル' width='16' height='16' class='fileIcon' /> ");
	$("div#homeContent a[href$='.xls'], div#content a[href$='.xls']").prepend("<img src='/images/xls_icon.gif' alt='Excelファイル' width='16' height='16' class='fileIcon' /> ");
	$("div#homeContent a[href$='.xlsx'], div#content a[href$='.xlsx']").prepend("<img src='/images/xls_icon.gif' alt='Excelファイル' width='16' height='16' class='fileIcon' /> ");


// MailForm

	$(":input.inputField").css("background","#f7faff").focus(function(){
		$(this).css("background","#fff");
	}).blur(function(){
		$(this).css("background","#f7faff");
	});

	$(":input.error").css("background","#fcf2f2").focus(function(){
		$(this).css("background","#fff");
	}).blur(function(){
		$(this).css("background","#fcf2f2");
	});


	$("textarea.blank").val("お問い合わせの内容をご入力ください。").css("color","#666").one("focus",function(){
		$(this).val("").css("color","#000");
	}).blur(function(){
		if($(this).val()==""){
			$(this).val("お問い合わせの内容をご入力ください。").css("color","#666").one("focus",function(){
				$(this).val("").css("color","#000");
			});
		}
	});


	$("textarea.no-comment").val("コメントを入力ください。").css("color","#666").one("focus",function(){
		$(this).val("").css("color","#000");
	}).blur(function(){
		if($(this).val()==""){
			$(this).val("コメントを入力ください。").css("color","#666").one("focus",function(){
				$(this).val("").css("color","#000");
			});
		}
	});


});


