Ballantines = function ( ) {
	var regionId = null ;
	var birthYear = null ;
	
	this.setRegion = function ( regionId ) {
		this.regionId = regionId ;
	}
	
	this.setBirthYear = function ( year ) {
		this.birthYear = year ;
	}
	
	this.checkWindow = function ( winType ) {
		var url, w, h, name, specs ;
		name = "ballantines_window" ;
		specs = "resizable=no,scrollbars=yes" ;
		
		switch ( winType ) {
			case "terms" :
				url = "window.php?type=" + winType ;
				w = 512 ;
				h = 725 ;
				break ;
			case "privacy" :
				url = "window.php?type=" + winType ;
				w = 512 ;
				h = 725 ;
				break ;
			case "termsPhoto" :
				url = "window.php?type=" + winType ;
				w = 512 ;
				h = 725 ;
				break ;
			case "privacyPhoto" :
				url = "window.php?type=" + winType ;
				w = 512 ;
				h = 725 ;
				break ;
			case "responsibly" :
				url = "http://www.pernod-ricard.com/en/pages/399/pernod/Corporate-responsability/Responsible-Consumption/Prevention/InformerEtSensibiliser.html"
				w = 800 ;
				h = 600 ;
				name = "_blank" ;
				specs = "location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes" ;
				break ;
			case "contact" :
				url = "window.php?type=" + winType ;
				w = 512 ;
				h = 725 ;
				break ;
			default :
				break ;
		}
		this.openWindow ( url , w , h , name , specs ) ;
	}
	
	this.openWindow = function ( url , w , h , name , specs ) {
		url = url + "&regionId=" + this.regionId + "&birthYear=" + this.birthYear ;
		window.open ( url , name , "width=" + w + ",height=" + h + "," + specs ) ;
	}
}
var jsBallantines = new Ballantines ( ) ;

/**
 * Functions accessed from Flash
 */

function openWindow ( winType ) {
	jsBallantines.checkWindow ( winType ) ;
}

function setRegion ( regionId ) {
	jsBallantines.setRegion ( regionId ) ;
}

function setBirthYear ( year ) {
	jsBallantines.setBirthYear ( year ) ;
}

