var nowDate = new Date();  
var CurrentMonth = nowDate.getMonth(); 

function SetCookie(cookieName, cookieValue, cookiePath, cookieExpires)  
{ 

cookieValue = escape(cookieValue);  

// Set Default Expiration to 24 hours from present
if (cookieExpires == "")  
{  
nowDate.setHours(nowDate.getHours() + 24);  
cookieExpires = nowDate.toGMTString();  
}  

if (cookiePath != "")  
{  
cookiePath = ";Path=" + cookiePath;  
}  

document.cookie = cookieName + "=" + cookieValue +  
";expires=" + cookieExpires + cookiePath; 
} 

/////////////////////////////////////////////////////////

function getCookie(name)  
{ 
var cookieString = document.cookie;  
var index = cookieString.indexOf(name + "=");  

if (index == -1) 
{ 
return null;  
} 

index = cookieString.indexOf("=", index) + 1;  
var endstr = cookieString.indexOf(";", index);  

if (endstr == -1) 
{ 
endstr = cookieString.length;  
} 

return unescape(cookieString.substring(index, endstr)); 
} 


/////////////////////////////////////////////////////////

function AddtoCart() { 

// Check if cookie is not present

var CookiePresent = getCookie('NoAlert');

if (CookiePresent == null) {

	var Text=('You have added this item to your cart.  \n\nThe updated cart quantity appears above next to the \"View Cart\" button. \n\nClick \"View Cart\" to review your current selections or proceed to checkout.');
	
	window.alert(Text);

	SetCookie('NoAlert', 'Yes', '/', '');  // Write default 24 hour OptOut cookie
}
}