(function($) {

function consoleLog( logdata ){
	if(typeof(window.console)=="object"){
		console.log(logdata);
	}
}

function consoleError( logdata ){
	if(typeof(window.console)=="object"){
		console.error(logdata);
	}
}



$(document).ready(function(){
	
	/* 自動外部リンク */
	var checkArea = 'div.post-inner a:not([href^="http://hazisarashi.com"],.snap_noshots):not([href^=/]) ';
	var anchorObject = '<img src="http://hazisarashi.com/js/images/external.png" width="12" height="11" alt="リンクを新しいウインドウで開く" title="リンクを新しいウインドウで開く" />';
	var className = 'newWin'
	
	$(checkArea).each(function(){
		var target = this;
		var img = $(target).find("img").length;
		
		var url = $(target).attr('href');
		if ( url != '' && img == 0 ){
			$(target).after( $('<a class="'+className+'" href="javascript:void(0);">'+anchorObject+'</a>').click(function(){ window.open(url, "_blank", "status=yes,scrollbars=yes,directories=yes,menubar=yes,resizable=yes,toolbar=yes"); return false; }) );
		}
		
	});
	
	/* code のカラーリング */
	$("div.post-inner code, div.post-inner pre").addClass("prettyprint");
	prettyPrint();
	
	/* ヘッダーのツール一覧部分の透過PNG対応 */
	$("#header-tools img[src$='png'], #social li a, #addthis_toolbox img[src$='png']").pngfix();
	
})


})(jQuery);

if(typeof(window.console)=="object"){
	console.log('myscript.js : check ok');
}