
var allcookies = document.cookie;
var pos = allcookies.indexOf("myStatus=");
var newDisplayState = 'false';

//ToggleWindow(); //uncomment for auto-alert

function ShowDisclosure(myURL) // This function sets a cookie variable and pops a new window.
	{
	window.open("LinkDisclosure.htm?myURL=" + escape(myURL),"newWindow","width=400,height=250");
	return false;
	}

function getCookie()
	{
	var allcookies = document.cookie;
	// var pos = allcookies.indexOf("myStatus=");
	var pos = allcookies.indexOf("ShowAlert=");
	if (pos != -1)
		{
		var start = pos + 10;
		var end = allcookies.indexOf(";",start);
		if (end==-1) end = allcookies.length;
		var value = allcookies.substring(start,end);
		newDisplayState=unescape(value);
		}
	}

function ToggleWindow(myURL)
	{
	getCookie();
	// alert(newDisplayState);
	if (newDisplayState!='true') ShowDisclosure(myURL);
	else window.open(myURL,"_blank");
	
	//setCookie('false'); //Reset cookie for testing
	}

function LinkAlert(myURL) {
	ToggleWindow(myURL);
	}


function setCookie(DisplayState) // This function resets a cookie variable for testing.
	{
	document.cookie = "ShowAlert=" + DisplayState;
	alert(DisplayState);
	}

function LaunchLink(URL,target,attributes)
	{
	window.open(URL,target,attributes);
	}
