﻿/* Create a namespace */
var CreateAStir = {};

CreateAStir.enablePopLink = function() {
	$('a.poplink').click(function() {
		var myURL = $(this).attr("href");
		var myPopName;
		var winAttributes;
		if ($(this).hasClass("eligibilitypop")) {
			myPopName = "eligibility";
			winAttributes = "width=522,height=330,top=50,left=50,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no";		
		} else if ($(this).hasClass("essaypop")) {
			myPopName = "essay";
			winAttributes = "width=624,height=490,top=50,left=50,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no";		
		} else {
			myPopName = "officialrules";
			winAttributes = "width=522,height=550,top=50,left=50,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no";
		}
		win = window.open(myURL,myPopName,winAttributes);
 
		win.opener.name = "opener";
		win.focus();
		return false;
	});
};


/* Initialize everything when page is ready */
$(document).ready(function() {
	$("#slideshow").cycle();
	CreateAStir.enablePopLink();
});