/*
	Webdesign Mika Salonen
	info@webdesignsalonen.com
	http://www.webdesignsalonen.com/en/

	Last modified: 2003-09-11
*/

// NOTE: if cookies are disabled or flash isn't intalled or it's too old, the flash/non-flash links won't be displayed

var flashVersion = getFlashVersion();

var cookies_enabled = 0;
document.cookie = 'cookies=on';
if (document.cookie.indexOf("cookies") != -1) cookies_enabled = 1; // if test cookie exists, cookies are enabled

var show_flash = 0;
if (document.cookie.indexOf("flash") != -1) show_flash = 1; // if flash cookie exists, user wants to see the flash version

if (cookies_enabled == 1 && show_flash == 1 && flashVersion >= 5) // this has to used in the script flash_nonflash.js
{
  // cookie expired 24 hours ago
  days_to_duedate = -1;
  duedate = new Date();
  duedate.setTime(duedate.getTime() + (days_to_duedate * 24 * 60 * 60 * 1000));
  expires = duedate.toGMTString();

  document.writeln('<a href="javascript: void (document.cookie = \'flash=hide; expires=' + expires + '\'); location.reload();"><img src="images/nonflash.gif" width="97" height="8" alt="Non-Flash version" border="0"></a>');
}
else if (cookies_enabled == 1 && flashVersion >= 5)
{
  // cookie expires when closing the browser
  document.writeln('<a href="javascript: void (document.cookie = \'flash=show\'); location.reload();"><img src="images/flash.gif" width="75" height="8" alt="Flash version" border="0"></a>');
}