//=============================================================================
// Display Right Banner Content
//=============================================================================
var displayContactBanner = function() {
	var contactBanner;
	
	contactBanner = "<p><a href='admission' title='お申し込み'><img src='img/banner/admission.png' width='236' height='82' border='0' alt='お申し込み' /></a></p>";
	contactBanner += "<p><img src='img/banner/tel.png' width='236' height='82' border='0' alt='電話受付' /></p>";

	document.write(contactBanner);
}



//=============================================================================
// Display Right Banner Content
//=============================================================================
var displayBanner= function() {
	var banner;
	
	banner = "<p><a href=\"cashback\" title=\"キャッシュバック率\"><img src='img/banner/cashback.png' width='236' height='102' border='0' alt='キャシュバック率' /></a></p>";
	banner += "<p><img src='img/banner/card.png' width='236' height='209' border='0' alt='クレジットカード会社一覧' /></p>";
	banner += "<p><img src='img/banner/cell.png' width='236' height='147' border='0' alt='携帯からも簡単にお申し込み' /></p>";
	banner += "<p><img src='img/banner/shop_tokyo.png' width='236' height='42' border='0' alt='東京コールセンター' /></p>";
	banner += "<p class=\"last\"><img src='img/banner/shop_wtokyo.png' width='236' height='42' border='0' alt='西東京コールセンター' /></p>";

	document.write(banner);
}



//=============================================================================
//	OS & Browser Check関数
//=============================================================================
function osCheck(obj) {
	var Agent = navigator.userAgent;
	
	if (Agent.indexOf("Safari") != -1) {
		document.write("<link rel=\"stylesheet\" href=\"css/safari.css\" type=\"text/css\" media=\"all\" />");
		return;
	}
	else if (Agent.indexOf("Opera") != -1) {
		document.write("<link rel=\"stylesheet\" href=\"css/opera.css\" type=\"text/css\" media=\"all\" />");
		return;
	}
	else if (Agent.indexOf("Firefox") != -1) {
		if (Agent.indexOf("Windows NT 5.1") != -1) {
			document.write("<link rel=\"stylesheet\" href=\"css/xp_ff.css\" type=\"text/css\" media=\"all\" />");
			return;
		}
		else if (Agent.indexOf("Windows NT 6.0") != -1) {
			document.write("<link rel=\"stylesheet\" href=\"css/vista_ff.css\" type=\"text/css\" media=\"all\" />");
			return;
		}
	}
	else if (Agent.indexOf("MSIE 7") != -1) {
		document.write("<link rel=\"stylesheet\" href=\"css/ie7.css\" type=\"text/css\" media=\"all\" />");
		return;
	}
	else if (Agent.indexOf("MSIE 6.0") != -1) {
		document.write("<link rel=\"stylesheet\" href=\"css/ie6.css\" type=\"text/css\" media=\"all\" />");
		return;
	}
}



//=============================================================================
//	Move to Page Top Function
//=============================================================================
var movePageTop = function() {
	var agent = navigator.appName;
	var posY = document.getElementById("pagetop").offsetTop;
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	
	//Select Browser
	if(agent = "Microsoft Internet Explorer") {
		posY+=50;
	}
	
	if (document.documentElement) {
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
	}
	
	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;
	
	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));
	
	if(y <= posY) {
		window.scrollTo(Math.floor(x / 2 * 1.6), Math.floor(y / 2 * 1.6));
	}
	else {
		window.scrollTo(x, posY);
	}

	if (x > 0 || y > 0) {
		window.setTimeout("movePageTop()", 25);
	}
}