
// Choose to view the html version of the site
function chooseHTML( )
{
	// write the cookie to remember choice
	 document.cookie = "htmlVersion=true; path=/" ;
	
	// navigate to the html site
	window.location.href = "/html/"
}


// choose to view the flash version of the site
function chooseFlash( )
{
	// erase the cookie
	document.cookie = "htmlVersion=; expires=-1; path=/" ;
	
	// navigate to the flash version of the site
	window.location.href = "/" ;
}


// check if the html cookie is set
function checkHTMLCookie( )
{
	// check for the cookie
	if ( readCookie( 'htmlVersion' ) != 'true' )
	{
		window.location.href = "/"
	}
}

function checkRedirect( )
{
	// check for the cookie
	if ( readCookie( 'htmlVersion' ) == 'true' )
	{
		window.location.href = "html/"
	}
}


function readCookie(name)
{
  var ca = document.cookie.split(';');
  var nameEQ = name + "=";
  for(var i=0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
  return null;
}
