//main function to set cookie value, used by VHP Animations to say that this user has seen the animation and should not see it again.

function setVHPCookie(name) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
//var name = "mks07";
var value = "true";
var expires =65;
var path =  "/";
var domain = "";
var secure = "";

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


//main function to get cookie values
function getVHPCookie(gname) {
		var cookie=document.cookie;
		var chkdCookie=removeBlank(cookie);
		var nvpair=chkdCookie.split(";");
		var tvalue = "false";
		if(IsInCookies(nvpair,gname)){
			tvalue=getValues(nvpair,gname);
		}

		return tvalue;
		
	}
	


//subfunction1	 for getting cookies
function removeBlank(strng){
		var result="";
		var i;
		var chrn;
		for (i=0;i<strng.length;++i) {
			chrn=strng.charAt(i);
			if (chrn!=" ") result += chrn;
		}
		return result;
	}
//subfunction2	 for getting cookies
function IsInCookies(ckie,nme){
		var splitValues;
		var i;
		for (i=0;i<ckie.length;++i){
			splitValues=ckie[i].split("=");
			if (splitValues[0]==nme) return true;
		}
		return false;
	}
//subfunction3	 for getting cookies
	function getValues(ckie,nme){
		var splitValues;
		var i;
		var retValue = ""
		for(i=0;i<ckie.length;++i) {
			splitValues=ckie[i].split("=");
			if(splitValues[0]==nme){
			retValue = splitValues[1]
				break
			}
		}
		return retValue;
	}