
function getContent( i_ContentKey )
{
    var returnValue = null;
    try{
		returnValue = GetCookie( i_ContentKey );		
	}
	catch(i_Exc){}
	
	return( returnValue );
}

function setContent( i_ContentKey, i_ContentValue )
{
    try{
	  if(i_ContentValue != "")
	  {
		  var thenewdate = new Date ();
		  thenewdate.setTime(thenewdate.getTime() + (365 * 24 * 3600 * 1000));
		  SetCookie( i_ContentKey, i_ContentValue, thenewdate);
	  }
	}catch(i_Exc){}
}

function removeContents(){
  var Keys = new Array("SERVICE_ID");
  for(var i = 0; i < Keys.length; i++){
    setContent( Keys[i], null);
  }
}


function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}


function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; 
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}



var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function menuFlash_DoFSCommand(command, args) {
	var menusObj = isInternetExplorer ? document.all.menuFlash : document.menuFlash;
	var key="menuFlash"
	//
	if ( command == "checkCookies" ) {
		var tempCook = getContent(args);
		if(tempCook == null || tempCook.length == 0){
			tempCook = 0;	
		}
		document.all["menuFlash"].SetVariable("v_content", tempCook);
	}
	
	if ( command == "SetCookies" ) {
		setContent( key, args );
	}
	
}
// Hook for Internet Explorer.
if (navigator.appName && isInternetExplorer && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub menuFlash_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call menuFlash_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}