var sj6=function(){
	var now="top";
	var Setup=function(){
		if (typeof document.body.style.maxHeight != "undefined") {
		// IE 7, mozilla, safari, opera 9
			$("#top_menu").hide();
			$(".m_container").hide();
			$("#main").hide();
			$("#top_menu").slideDown("slow");
		} else {
		// IE6, older browsers
			hideAndShow("top");
		}
		$(".top a").click(function (e) {
			hideAndShow("top");
			return false;
		});
		$(".about a").click(function (e) {
			hideAndShow("about");
			return false;
		});
		$(".portfolio a").click(function (e) {
			hideAndShow("portfolio");
			return false;
		});
		$(".contact a").click(function (e) {
			hideAndShow("contact");
			return false;
		});
		$(".blog a").click(function (e) {
			hideAndShow("blog");
			return false;
		});
	};
	var hideAndShow = function(page){
		$(".m_container").fadeOut("fast");
		$("#top_menu").slideUp("slow",
			function(){$("#main").slideUp("slow",
				function(){
					if(page!="top"){
						$("#main").slideDown("slow",function(){$("#c_"+page).fadeIn("slow");});
					}else{
						$("#top_menu").slideDown("slow");
					}

				}
			);
			}
		);
	};
	var ajax = function(sendType,sendUrl,sendData){
		$("#refresh").css("top",$("html").scrollTop()+$(window).height()/2-25);
		$("#refresh").css("background-color","#FF4F4F");
		$("#refresh").text("更新中");
		$("#refresh").fadeIn("slow");
		$.ajax({
			   type: sendType,
			   url: sendUrl,
			   data: sendData,
			   success: function(msg){
			     //alert( "Data Saved: " + msg );
			     $("iframe").attr("src","/admin_m/topview?"+create_privateid(5));
			     $("#refresh").css("background-color","#4FF2FF");
			     $("#refresh").text("更新完了");
				$("#refresh").fadeOut("slow");
			   }
		 });
	};
	var create_privateid = function create_privateid( n ){
	    var CODE_TABLE = "0123456789"
	        + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	        + "abcdefghijklmnopqrstuvwxyz";
	    var r = "";
	    for (var i = 0, k = CODE_TABLE.length; i < n; i++)
	        r += CODE_TABLE.charAt(Math.floor(k * Math.random()));
		return r;
	};
	return {
		init : function(){
			Setup();
		}
	};
}();

$(document).ready(function(){
	sj6.init();
});



