// JavaScript Document

function setCookie(c_name,value,expiredays,path)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) +
( ( path ) ? ";path=" + path : "" )
}


function getNudiCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }	
  } 
return "";
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookieNoPath(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); 
}

function restoreNavNudiOldCookie()
{if (window == top) 
	{	
	setCookie('ThumbFile','NudiThumbPages/NudiList.html',365,'/');
	setCookie('GenSpecFile','NudiThumbPages/Intro.html',365,'/');
	document.write ('you probably came to this page directly via a search engine - <a href = "../NudiFrame"> click</a> here to restore menus'); 
	}
}

function restoreNavNudi()
{if (window == top) 
	{	
	document.write ('you probably came to this page directly via a search engine - <a href = "../NudiFrame.php?Tname=NudiList&Aname=NudiThumbPages/Intro"> click</a> here to restore menus'); 
	}
}

function ExWindow(url)
{myWindow= window.open(url, 'exwindow', 'width=600, height=600, screenX=50, screenY=50, resizable =yes, scrollbars=yes,location=yes, toolbar=yes, alwaysraised =yes'); 
}

function CheckCookiesEnabled()
{var cookieEnabled=(navigator.cookieEnabled)? true : false;
    //if navigator,cookieEnabled is not supported
    if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
        document.cookie="testcookie";
        cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false;
    }

    if (cookieEnabled);
	else(alert('Your browser is not set to accept cookies. You will not be able to see the Nudibranch section properly.'));
}