function adjust(ratio) {
    var menuFont = 11 * ratio;
	var menuPad = 9 * ratio;
	var h1Font = 26 * ratio;
	var footerFont = 15 * ratio;
	var contentFont = 13.5 * ratio;
	var panesHeight = ratio * 406;
	var wineItemWidth = ratio * 563.2; 
	var wineItemHeight = ratio * 406 *.74; 
	var socH = 15 * ratio;
	var socW = 2 * socH;
	var GalPic = 50 * ratio;
	
	
    $("#nav a").css({'font-size' : menuFont + "px", 'padding-left' : menuPad + "px", 'padding-right' : menuPad + "px" });
	$("h2").css({'font-size' : menuFont + "px"});
	$("h3").css({'font-size' : (menuFont) + "px"});
    $(".pane").css({'font-size' : contentFont + "px" });
    $("#panes h1").css({'font-size' : h1Font + "px" });
    $("#footer").css({'font-size' : footerFont + "px" });
	$("#panes").css( "height", panesHeight + "px");
		$(".Wine_Page").height(panesHeight);
		$(".Wine_item").width(wineItemWidth).height(wineItemHeight);
		$(".Wine_pages").css('top', function () { this.style.top * ratio; });
		$("img.Gal").css('height', GalPic);
	$("#socials").css( {"height": socH + "px", "width": socW + "px"});
	$("#socials a img").css( {"height": socW + "px", "width": socH + "px"});
	$("#socials a img").mouseover( function(){ $(this).css( "margin-top", -1 * socH + "px" )}).mouseout( function(){ $(this).css( "margin-top", 0 )});
	$("#Gmedal img").attr("src", "commons/W11GOLD.png");
	
}

function iniSize() {
    var WinWidth = $(window).width();
	var iRatio =  WinWidth / 1024;

	adjust(iRatio);	
 
    $(window).resize(function()
    {
		var newWinWidth = $(window).width();
		var cRatio = newWinWidth/WinWidth;

		adjust(iRatio*cRatio);	

    })
};

function menu() {
	$("#menu").tabs("#panes > .pane", {
		effect: 'fade',
		fadeOutSpeed: 400,
	});
};
function vidView() {
	$(".thumbnail").click( function() {
		var currentVid = "." + $(this).attr("title");
		$(".MROVideo").fadeOut("slow");
		$(".MROVideo iframe").attr("src","");
		$(currentVid + " iframe").attr("src", function() { return $(currentVid + " iframe").attr("temp") });
		$(currentVid).fadeIn("slow");
	});
}

function Wine() {
	$("#Wine_main").scrollable({
		vertical: true,
/*		effect: 'fade',
		fadeOutSpeed: 400, */
		keyboard: 'static',
		onSeek: function(event, i) { horizontal.eq(i).data("scrollable").focus(); }
	}).navigator("#Wine_main_navi");

var horizontal = $(".scrollable").scrollable().navigator("ul.Wine_navi");
 
horizontal.eq(0).data("scrollable").focus();
}

