/*
PDFリンクにはアイコン付加,
別ウインドウ,
プラグインダウンロード自動挿入
*/
$(function(){
	var $linkpdf = $("#main-content a[@href$='\.pdf']");
	//別ウインドウリンク
	$($linkpdf).click(function(){
		window.open(this.href, '');
		return false;
	});
	//プラグインダウンロード
	if($linkpdf.length != 0){
		var html = '<div id="plugin"><div class="text"><p>PDFをご覧になるにはAdobeReaderプラグインが必要です。<br>AdobeReaderはAdobe Systems Incorporatedの登録商標です。</p></div><div class="banner"><p><a href="http://www.adobe.com/jp/products/acrobat/readstep2.html" class="blank"><img src="/common/images/com_bt_adobe.gif" alt="Adobe Readerのダウンロード" width="112" height="33"></a></p></div></div>'
		if($("#main-content .bottom-content").length !=0){
			$("#main-content .bottom-content").before(html);
		}
		else if($('#home').length !=0){
			$("#home").append(html);
		}
		else{
			$("#main-content").append(html);
		}
	}

//class="blank"付加で別ウインドウ
	$('.blank').click(function(){
		window.open(this.href, '');
		return false;
	});
	var $mainContent = $('#main-content')
	$('.blank',$mainContent).each(function(){
		if($("img",this).length == 0){
			$(this).before('<img src="/common/images/icon_blank.gif" width="12" height="12" alt="" style="margin:3px 4px 3px 0;" align="absmiddle">');
		}
	});

//コピーガード
// 画像処理
	$('img').bind( 'contextmenu', function(){	// img right click
		if(this.className != 'copy'){
			return false;
		}
	});

// テキスト処理
	$().bind( 'selectstart',function(){//ie
		return false;
	});
	$('body').css({//mozilla & Safari
		'-moz-user-select':'none',
		'-khtml-user-select':'none'
	});
});
