// JavaScript Document
$(function() {
	$("a[class='otherWindow'] , a[href^='http']:not([href^='http://www.technohorizon.co.jp/']) , a[href$='.pdf']")
	.each( function(){
		$(this).attr("target","_blank");
	});
	
/*	$("a[class='otherWindow']").click(function()
	{	//クリックした場合に、別ウィンドウでそのリンク先を開く。
		window.open(this.href,"").focus();
		return false;
	});	
	$("a[href^='http']").not("[href^='http://www.technohorizon.co.jp/']").click(function()
	{	//クリックした場合に、別ウィンドウでそのリンク先を開く。
		window.open(this.href,"").focus();
		return false;
	});	
	//pdfファイルへのリンク
	if($("a[href$='.pdf']"))
	{
		$("a[href$='.pdf']").click(function()
		{	//クリックした場合に、別ウィンドウでそのリンク先を開く。
		window.open(this.href,"").focus();
		return false;
		});
	}
	*/
	if($("a.attr('rel')"))
	{
		$("a[rel]").click(function()
		{	//クリックした場合に、rel属性で指定したサイズの別ウィンドウで、リンク先を開く。
			var hasRel = $(this);
			var windowSize =  hasRel.attr('rel').match(/(\d+)/g);
			var wWidth = windowSize[0] || 300;
			var wHeight = windowSize[1] || 300;
			window.open(hasRel.attr('href'),"","resizable=yes,scrollbars=yes,location=yes,width="+wWidth+",height="+wHeight).focus();
			return false;
		});
	}

});


