

// Global Constants
var cookieName = 'kinipopospecials';
		
var cookieValue = '1'; 		//first image to show on the page.(value represents index of Img Array)

	



function updateFlash()
{
	

	var flashCookie = getCookieValue(cookieName);

	if(!flashCookie) {
			
			 window.document.fs.SetVariable("visits",0);
			 writeSessionCookie(cookieName,1);
			 
				
	}else {
		window.document.fs.SetVariable("visits",flashCookie);
		
			
	    			
					
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
// STANDARD SESSION COOKIE FUNCTIONS 
//////////////////////////////////////////////////////////////////////////////////////////////////////////

function writeSessionCookie (cookieName, cookieValue) {
  if (testSessionCookie()) {
    document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/";
    return true;
  }
  else return false;
}




function getCookieValue (cookieName) {
  var exp = new RegExp (escape(cookieName) + "=([^;]+)");
  if (exp.test (document.cookie + ";")) {
    exp.exec (document.cookie + ";");
    return unescape(RegExp.$1);
  }
  else return false;
}

function testSessionCookie () {
  document.cookie ="testSessionCookie=Enabled";
  
  if (getCookieValue ("testSessionCookie")=="Enabled")
    return true 
  else
    return false;
}