function decrementViewCookie()
{
	if (!window.opener)
	{
		var URL = document.location + "";
		var queryString = URL.substring(URL.indexOf("?") + 1);

		site = location.hostname.indexOf('atomfilms') == -1 ? 'sw' : 'af';

		// NEED TO DECIDE WHAT TO DO WITH THIS STMT
		//window.location.replace("/" + site + "/content/" + keyword)
	}

	var currentviews = util_getCookie("contentviews");

	if (currentviews)
	{
		currentviews = parseInt(currentviews) - 1;
		currentviews = currentviews > 0 ? currentviews : 0;
		util_setCookie("contentviews", currentviews, true);
	}
}

function launchWindow(contentUrl,winWidth,winHeight,winName)
{
   if (!winName) winName = "sw_daughter";

   window.open(contentUrl, winName, "width="+winWidth+",height="+winHeight);
}

function tellafriend(send)
{
	launchWindow("/landing/tellafriend/sendForm.jsp?"+send,550,530,"asw_tellafriend")
}

function review(keyword)
{
	launchWindow("/landing/review/reviewForm.jsp?id=" + keyword, 340, 510, "asw_review");
}

function gotoInParent(url,stayOpen)
{
   window.opener.location = url;

	if (!stayOpen)
	{
   	window.close();
	}
}

function voteStarWarsFanFilms()
{
	gotoInParent("/bin/vote/index.jsp",true);
}

//***************************
// get started
decrementViewCookie();

