/** ################################################################################
 *	popup.js
 *	link popup functionality
 *	chris casciano 7/23/2008
 *  ################################################################################
 */


window.clues.popup = window.clues.popup || {};

/** ------------------------------------------------------
 *	this namespace contains the popup logic
 */
clues.popup = {
	setup : function() {
	        var extlinks = document.getElementsByClassName("external");
		for (var x=0;x<extlinks.length;x++) {
			if (extlinks[x].hasClass("game")) {
			    extlinks[x].onclick = function() {
                                clues.popup.popGame();
                            };
			} else {
			    extlinks[x].onclick = function() {
                                clues.popup.popFull();
                            };
			}
		}
	},
	popGame : function(e) {
		window.open(this,"game","width=400,height=400,resizeable=no,scrollbars=no,location=no,toolbar=no,menubar=no");
		e.preventDefault();
	},
	popFull : function(e) {
		window.open(this);
		e.preventDefault();
	}
}

/** ------------------------------------------------------
 *	Page load 
 */
window.addEvent('domready', clues.popup.setup);


