var Popup = new Object();

Popup.open = function (url, width, height, toolbar, scroll, center) {
	toolbar = toolbar ? "yes" : "no";
	scroll = scroll ? "yes" : "no";
	var features = "toolbar="+toolbar+",menubar="+toolbar+",location="+toolbar+",status="+toolbar+",scrollbars="+scroll+",resizable="+scroll;
	if (width) features += ",width="+width;
	if (height) features += ",height="+height;
	if (center) {
		var x = 0, y = 0;
		if (width && window.screen.availWidth) {
			x = Math.round ((window.screen.availWidth-parseInt (width)) / 2);
			features += ",screenX="+x+",left="+x;
		}
		if (height && window.screen.availHeight) {
			y = Math.round ((window.screen.availHeight-parseInt (height)) / 2);
			features += ",screenY="+y+",top="+y;
		}
	}
	var name = new Date();
	name = name.getTime();
	name = name.toString();
	this.windowReference = window.open (url, name, features);
	if (this.windowReference != null && !this.windowReference.closed) {
		this.windowReference.focus();
	}
}
Popup.centerScroll = function (url, width, height) {
	this.open (url, width, height, false, true, true);
}
Popup.centerChromeScroll = function (url, width, height) {
	this.open (url, width, height, true, true, true);
}
Popup.BABW = function (url, width, height) {
	this.open (url, width, height, true, true, true);
}

// ------------------------------------------------------------

function launchJockeyPromo () {
	Popup.centerChromeScroll ("http://promotions.lookandfeel.com:80/promotions/promotions/PromoForm.jsp?site=Jockey.com&campaign=Make+A+Flake+Survey", null, null);
}
function launchBABW(){
	Popup.open ("http://www.buildabear.com/default.aspx?sc_cid=md_hol_makeaflake",800,510,"yes","yes","true");
}

function launchTerms () {
	Popup.centerScroll ("http://www.lookandfeel.com/tos.html", 410, 450);
}

function launchPrivacy () {
	Popup.centerScroll ("http://www.lookandfeel.com/privacy.html", 410, 450);
}

function launchStore (id) {
	Popup.centerChromeScroll ("https://store.lookandfeel.com/snowflakes/store.jsp?flake_id="+id, null, null);
}