	/** age verification functions and variables */
	var cookieName = 'ravenswood.age_verification';
	var fail_redirect = 'http://www.centurycouncil.org/';
	
	function checkCookie() {
		return $.cookie(cookieName);
	}
	
	function passValidation() {
		$.closeDOMWindow();
		$.cookie(cookieName,true,{path: '/'});
	}
	
	function failValidation() {
		location.href = fail_redirect;
	}
	
	function displayVerification() {
		$.openDOMWindow({ 
				borderSize: 0,
				overlayColor:'#000' /* D7A865 */,
				overlayOpacity:'99.9',
				borderColor:'#c0321e',
				borderSize:'5',
				draggable: 0,
				modal: 1,
				width: 500,
				height: 530,
				loader:1,
				modal:1, 
				//positionTop: 50,
				//positionType: 'absolute',
				loaderImagePath:'/dom_window/img/spinner.gif', 
				loaderHeight:16, 
				loaderWidth:17, 
				windowSource:'iframe',
				windowPadding:0,
				windowSourceURL: '/AgeCheck' 
			});
	}
	/** END age verification functions and variables */

	// a function mathias can use from the flash to inspire the contact popup
	function inquiry_popup() {
		window.open('/QuestionsAndComments','mywin','left=200,top=100,width=800,height=750,toolbar=0,resizable=1');
	}
	
	function product_feedback() {
		window.open('/ProductFeedback','mywin','left=200,top=100,width=800,height=750,toolbar=0,resizable=1');
	}

	// this launches the vino visit modal popup, from flash or html
	function vino_visit(url){
	    $(function(){
			$.openDOMWindow({ 
					borderSize: 0,
					overlayColor:'#333',
					overlayOpacity:'80',
					draggable: 0,
					modal: 0,
					width: 300,
					height: 400,
					loader:1, 
					loaderImagePath:'/dom_window/img/spinner.gif', 
					loaderHeight:16, 
					loaderWidth:17, 
					windowSource:'iframe',
					windowPadding:0,
					windowSourceURL: url
				});
	    });
	}

$(document).ready(function(){       
	
	//form popups
	$('a.formPop').click(function() {
        window.open($(this).attr('href'),'mywin','left=200,top=100,width=800,height=750,toolbar=0,resizable=1');
        return false;
    });

	// if there is no cookie put up the age verification modal
	
	if (!swfobject.hasFlashPlayerVersion("10")) {
		if(!checkCookie(cookieName)) {
			displayVerification();
		}
	}

});