(function() {

function $(id) {
	return document.getElementById(id);
}

function setStyleDisplay(id, status) {
	$(id).style.display = status;
}

function goTop(acceleration, time) {
	acceleration = acceleration || 0.1;
	time = time || 16;

	var dx = 0;
	var dy = 0;
	var bx = 0;
	var by = 0;
	var wx = 0;
	var wy = 0;

	if (document.documentElement) {
		dx = document.documentElement.scrollLeft || 0;
		dy = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		bx = document.body.scrollLeft || 0;
		by = document.body.scrollTop || 0;
	}
	var wx = window.scrollX || 0;
	var wy = window.scrollY || 0;

	var x = Math.max(wx, Math.max(bx, dx));
	var y = Math.max(wy, Math.max(by, dy));

	var speed = 1 + acceleration;
	window.scrollTo(Math.floor(x / speed), Math.floor(y / speed));
	if(x > 0 || y > 0) {
		var invokeFunction = "MGJS.goTop(" + acceleration + ", " + time + ")"
		window.setTimeout(invokeFunction, time);
	}
}

window['MGJS'] = {};
window['MGJS']['$'] = $;
window['MGJS']['goTop'] = goTop;

})();

$(function(){
  $("#logo a").html('<img src="http://pmdesign.jp/wp-content/themes/emblem/img/logo.gif" height="55" width="257" title="オリジナルTシャツ、ユニフィーム、クラスTシャツの作成、販売サイトEMBLEM" alt="オリジナルTシャツ、ユニフィーム、クラスTシャツの作成、販売サイトEMBLEM" />');
  $("a").bind("focus",function(){if(this.blur)this.blur();});
  $("#index_old_news li:first-child,#index_right_col li:first-child,,#left_col li:first-child").css({background:"none"});
  $('#header_button img,#header_menu li img,#index_more_button img,#index_gallery_button img,#index_rss img,#index_old_news_button img,#category_list li img,.index_campaign_more img,#return_top img').rollover();

  $("#switch1").click(function(){
    $("#order_info2").animate({opacity: 'show'}, 500);
    return false;
  });

  $("#switch2").click(function(){
    $("#order_info2").animate({opacity: 'hide'}, 500);
    return false;
  });

});
