/* ------------------------------------------------------------------------ */
/* -------------->>>   G L O B A L   S I T E   O B J E C T   <<<----------- */
/* ------------------------------------------------------------------------ */
var Site = {
	Reload: function(){
		window.location.reload();
	},
/* ------------------------------------------------------------------------ */
/* ------------------>>>   E N H A N C E  S I T E  <<<--------------------- */
/* ------------------------------------------------------------------------ */
	EnhanceSite: function(){
		Site.Add.NiftyCorners ();
		Site.Add.pageOptions ();
	},
/* ------------------------------------------------------------------------ */
/* --------------------------->>>   A D D  <<<----------------------------- */
/* ------------------------------------------------------------------------ */
	Add: {
/* ------------------------------------------------------------------------ */
/* ---------------------->>> P A G E    O P T I O N S  <<<----------------- */
/* ------------------------------------------------------------------------ */
		pageOptions: function(){
			// set the var "pageID" to the pages body class
			var pageID =  $("body").attr('id');
			// run a conditional statement on "pageID" 
			switch(pageID)
			{
				case 'home':
					 console.log("body id = " + pageID);
					break;
				default:
					break;
			}
		},


/* ------------------------------------------------------------------------ */
/* ------------------->>> N I F T Y  C O R N E R S  <<<-------------------- */
/* ------------------------------------------------------------------------ */
		NiftyCorners: function(){
		// console.log("NiftyCorners invoked");
		Nifty("#nav a","medium top");
		Nifty("#sidebar","medium top");
		Nifty("div.quote","medium");
		}, 


/* ------------------------------------------------------------------------ */
/* ------------------>>> T O G G L E  R E V I E W    <<<------------------- */
/* ------------------------------------------------------------------------ */
		ReviewToggles: function(){
			// hide full-entries
			$(".full-entry").addClass('nodisplay');
			$(this).parent().parent().next().slideToggle("slow");
			// console.log("ReviewToggles invoked");
			$(".more").click(function () {
				// console.log($(this).parent().parent().html());
			   $(this).parent().parent().next().slideToggle("slow");
			});
		},


/* ------------------------------------------------------------------------ */
/* ------- ------>>>  N E W   W I N D O W   H A N D L E R   <<<------------ */
/* ------------------------------------------------------------------------ */
		newWindowHandler: function(){
			// console.log("popupHandler invoked");
			$("#newWindow").click(function (event) { 
			event.preventDefault();
			// console.log("newWindowHandler")
			openNewWin(this.href);
			});
		}
	}
}

/* ------------------------------------------------------------------------ */
/* ------------------>>> O P E N  N E W  W I N D O W  <<<------------------ */
/* ------------------------------------------------------------------------ */
function openNewWin(URL){
	window.focus();
	window.open(URL,'openNewWin','width=980,height=660,toolbar=yes,personalbar=no,location=no,directories=no,statusbar=no,menubar=yes,status=no,resizable=yes,left=60,screenX=60,top=100,screenY=100');
}