$(document).ready(function(e) {
	/*
	var ageCookie = $.readCookie('ageCookie');
	if (!ageCookie && (window.location.hostname == 'tfewines.com' || window.location.hostname == 'www.tfewines.com')) {
		$('#age-verification').overlay({
			api: true,
			closeOnClick: false,
			top: 150,
			expose: {
				maskId: 'age-mask',
				color: '#6b0d03',
				loadSpeed: 200,
				opacity: 0.98,
				onBeforeLoad: function() {
					$('#age-mask').append('<div class="left"/><div class="right"/>');
					this.getExposed().click(function() {
						$.setCookie('ageCookie', 1, { duration: 0 });
					});
				}
			}
		}).load();
	}
	*/
	$("#site-listing select").msDropDown();
	if(flashembed.isSupported([10, 0]))
	{
		$('#slider-flash').flashembed(
			{
				src:'http://tfewines.com/slider.swf',
				id:'slider',
				height:167,//$(window).height()-41,
				width:962,//$(window).width(),
				wmode:'transparent',
				quality:'high',
				menu: 'true',
				play: 'true',
				loop: 'true',
				scale: 'showall',
				allowFullScreen: 'false',
				allowScriptAccess: 'sameDomain',
				expressInstall:'/include/flash/flebExpressInstall.swf',
				version: [10, 0]
			},
			{}
		);
		$('.homepage #content-box').flashembed(
			{
				src:'/accordion.swf',
				id:'accordion',
				height:548,//$(window).height()-41,
				width:962,//$(window).width(),
				wmode:'transparent',
				quality:'high',
				menu: 'true',
				play: 'true',
				loop: 'true',
				scale: 'showall',
				allowFullScreen: 'false',
				allowScriptAccess: 'sameDomain',
				expressInstall:'/include/flash/flebExpressInstall.swf',
				version: [10, 0]
			},
			{}
		);
		$('#flashPhotoGallery').flashembed(
			{
				src:'/imagegallery-slideshowpro.swf',
				id:'imagegallery',
				height:523,//$(window).height()-41,
				width:720,//$(window).width(),
				wmode:'transparent',
				quality:'high',
				menu: 'true',
				play: 'true',
				loop: 'true',
				scale: 'showall',
				allowFullScreen: 'false',
				allowScriptAccess: 'sameDomain',
				expressInstall:'/include/flash/flebExpressInstall.swf',
				version: [10, 0]
			},
			{}
		);
	}
	  newsScroller = $("#company-news-scroller .scrollable").scrollable({
	    size: 1,
	    vertical:true
	  }).circular().autoscroll({api:true, interval: 3000});
	$('#site-listing-dd_child a').click(function(){
		loc = $('#site-listing-dd').find("option:selected").val()
		if(loc != "" && loc.substring(0,7) == 'http://')
			window.open(loc);
		else
			window.location = loc;
	});
	$('a[rel*=external]').click( function() {
        window.open(this.href);
	    return false;
    });
});