﻿$(function (){

	//toppage main image change
	
	function cngImg(){

		$("img:last-child","#topMainImg").fadeOut(1500,function(){
		$(this).prependTo("#topMainImg").show();
		});

	}
	setInterval(cngImg,5000);
	
	
	//IE6
	if (typeof document.body.style.maxHeight == "undefined") {
		$("#footImg").attr("src","/img/common/foot_bg.gif");
	} else {
	
	
	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});
	}

	//footer copyright
	var myDate = new Date();
	var myYear = myDate.getFullYear();
	$("#myDate").html(myYear);


});
