var site_url = "http://www.baoyi-food.com/";
var site_title = "Canada ICEFIELD  Spring Water 加拿大天然冰河水";

function facebook () {
	var u = site_url;
	var t = site_title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer', 'toolbar=0,status=0,width=626,height=486');
}

function twitter () {
	var u = site_url;
	window.open("http://twitter.com/home?status=Currently reading "+u,'share','toolbar=0,status=0,width=626,height=486');
}

function scroll_bar () {
	$("#bg").css({width:$("#body").width() - $.scrollbarWidth() + "px"});
	$("#footer_bar").css("width", $("#body").width() - $.scrollbarWidth() + "px");
	// $("#bg").css({position: "absolute",top:($("#body").scrollTop())+"px"});
	// $("#footer_bar").css({position: "absolute",top:($("#body").scrollTop()+$("#body").height()-$("#footer_bar").height())+"px"});
}

function resize() {
	if ($(window).height() < 580) {
		$("#main").css("top", "20px").css("width", "980px").css("height", "533px").css("background", "url(../images/bg1a.png) no-repeat");
	} else {
		$("#main").css("top", "40px").css("width", "980px").css("height", "653px").css("background", "url(../images/bg.png) no-repeat");
	}
	if ($(window).width() < 1024) {
		if ($("#top").attr("test") == 1) {
			$("#kong").css("right", "50px").css("top", "100px");
		}
		$("#logo").css("left", "55px");
		$("#menu").css("left", "330px");
		$("#footer_left").css("left", "50px");
		$("#footer_copy").css("left", "280px");
		$("#footer_right").css("right", "40px");
		$("#footer_copy").css("left", "280px");
		$("#shares").css("right", "35px");
	} else {
		if ($("#top").attr("test") == 1) {
			$("#kong").css("right", "120px").css("top", "150px");
		}
		$("#logo").css("left", "150px");
		$("#menu").css("left", "520px");
		$("#footer_left").css("left", "150px");
		$("#footer_copy").css("left", "450px");
		$("#footer_right").css("right", "80px");
		$("#footer_copy").css("left", "350px");
		$("#shares").css("right", "80px");
	}
	if ($(window).width() >= 1024) {
		$("#top").css("width", "1200px");
		if ($("#top").attr("test") == 1) {
			$("#top").css("width", "980px");
			$("#top").css("margin", "0 auto");
		} else {
			$("#top").css("margin-left", "150px").css("margin-top", "25px");
		}
		$("#left_bar").css("margin-left", "150px").css("margin-top", "220px");
		$("#content").css("margin-left", "350px");
	} else {
		$("#top").css("width", "980px");
		if ($("#top").attr("test") == 1) {
			$("#top").css("margin", "0 auto");
		} else {
			$("#top").css("margin-left", "25px").css("margin-top", "20px");
		}
		$("#left_bar").css("margin-left", "50px").css("margin-top", "165px");
		$("#content").css("margin-left", "250px");
	}
	if ($(window).width() < 950) {
		$("#shares").css("display", "none");
		$("#footer_right").css("display", "none");
	} else {
		$("#shares").css("display", "block");
		$("#footer_right").css("display", "block");
	}
}

