// ##################################################
// WindowOpener Object ###################################

WindowOpener = new Object();

// --------------------------------------------------
// Private Methods

WindowOpener.open = function(url, name, width, height, chrome, scroll, address, xpos, ypos){
	
	chrome = chrome ? "yes" : "no";
	scroll = scroll ? "yes" : "no";
	address = address ? "yes" : "no";
	
	var features = "";
	features += "toolbar="+chrome+",status="+chrome+",menubar="+chrome;
	features += ",scrollbars="+scroll+",resizable="+scroll;
	features += ",location="+address;
	
	if(width) features += ",width="+width;
	if(height) features += ",height="+height;
	if(xpos) features += ",screenX="+xpos+",left="+xpos;
	if(ypos) features += ",screenY="+ypos+",top="+ypos;
	
	this.reference = window.open(url,name,features);
	if(this.reference != null && !this.reference.closed){
		this.reference.focus();
	}
}
WindowOpener.openCenter = function(url, name, width, height, chrome, scroll, address){
	var xpos = window.screen.availWidth ? Math.round((window.screen.availWidth-parseInt(width))/2) : null;
	var ypos = window.screen.availHeight ? Math.round((window.screen.availHeight-parseInt(height))/2) : null;
	this.open(url, name, width, height, chrome, scroll, address, xpos, ypos);
}

// --------------------------------------------------
// Public Methods

WindowOpener.openCenterChromeless = function(url,name,width,height){
	this.openCenter(url,name,width,height,false,false,false);
}
WindowOpener.openCenterChrome = function(url,name,width,height){
	this.openCenter(url,name,width,height,true,false);
}
WindowOpener.openCenterScroll = function(url,name,width,height){
	this.openCenter(url,name,width,height,false,true,false);
}
WindowOpener.openCenterChromeScroll = function(url,name,width,height){
	this.openCenter(url,name,width,height,true,true,false);
}
WindowOpener.openCenterFull = function(url,name,width,height){
	this.openCenter(url,name,width,height,true,true,true);
}

// ##################################################

function openSignupform(){
	var url = "http://promotions.lookandfeel.com/promotions/promotions/PromoForm.jsp?site=Duncan+Site&campaign=Duncan+75th+Anniversary+Game";
	WindowOpener.openCenterChromeScroll (url, "signupform", "400", "450");
}
function openEmailform(){
	var url = "http://www.lafevoka.com/saf/safduncan.asp";
	WindowOpener.openCenterChromeScroll (url, "emailform", "530", "500");
}
