var oScore_CounterLayer = "";
var Score_Counter_flashvars_labels = ["myUrl"];
var Score_Counter_flashvars_values = [location.host];//location.hostnameにすると、ホスト名を取得しますよ。
var Score_Counter_zIndex = 1;

//--------------------------------------------------------------------
//load時の処理
//--------------------------------------------------------------------
function loadScore_Counter(data){
	oScore_CounterLayer = new SWFLayer();
	oScore_CounterLayer.zIndex = Score_Counter_zIndex;
	oScore_CounterLayer.swf_url = "http://parts.kuru2jam.com/js/score_counter.swf";
	oScore_CounterLayer.swf_id = "score_counter_swf";
	oScore_CounterLayer.layer_name = "score_counter";
	
	oScore_CounterLayer.flashvars_labels = Score_Counter_flashvars_labels;
	oScore_CounterLayer.flashvars_values = Score_Counter_flashvars_values;
	
	oScore_CounterLayer.create();
	oScore_CounterLayer.setSize(200,"full");//win IEでは必須
	oScore_CounterLayer.setWindowAlign('right');
	oScore_CounterLayer.setWindowValign('top');
	if(checkBrowser() == "Safari"){
		window.resizeBy(1,0);
	}
}

eventObserve(window, 'load', loadScore_Counter, false);

//--------------------------------------------------------------------
//resize時の処理
//--------------------------------------------------------------------
var iii = 0;
function resizeScore_Counter(){
	oScore_CounterLayer.correctWindowSize();
	//サイズがfullの時におこなう↑
	oScore_CounterLayer.setWindowAlign('right');
	oScore_CounterLayer.setWindowValign('top');

}
//window.resizeにresizeToolイベントハンドラを追加
eventObserve(window, 'resize', resizeScore_Counter, false);


//--------------------------------------------------------------------
//scroll時の処理
//--------------------------------------------------------------------
function scrollScore_Counter(){
	oScore_CounterLayer.setWindowAlign('right');
	oScore_CounterLayer.setWindowValign('top');
}
//window.scrollにscrollToolイベントハンドラを追加
eventObserve(window, 'scroll', scrollScore_Counter, false);

//--------------------------------------------------------------------
//カスタム
//--------------------------------------------------------------------
//スクロールバー対策
document.getElementsByTagName("html")[0].style.overflow="scroll";

function hideScore_Counter(){
	oScore_CounterLayer.setVisible("hidden");
}

function setClose(){
	oScore_CounterLayer.setSize(0,0);
}

function checkBrowser(){
	var uName = navigator.userAgent;
	if (uName.indexOf("Safari") > -1) return "Safari";
	if (uName.indexOf("MSIE") > -1){
		return "MSIE";
	}
	return "Netscape";
};



//バナー用JS
function writeBanner(){
	var html = "";
	html += '<a href="http://parts.kuru2jam.com/parts/score_counter/"><img src="http://parts.kuru2jam.com/js_banner/score_counter_bana.png" alt="くるくるパーツ ネタ系ブログパーツ 得点カウンター" border="0"></a>';
	document.write(html);
}
writeBanner();