
function setmCookie( name, value, expires)
{
    var today = new Date();
    today.setTime( today.getTime() );
    
    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() : "" );
}

function getmCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}
function ageVerificationCheck () {
		//if(_wrapper.getCookie('ageVerified')==null&&window.location.href.search('/marketing/')===-1&&!jQuery.getUrlVar('promo')) { 
		  if(getmCookie('ageVerified')==null) {
			jQuery('body').append("<div class='age-panel'><div class='age-warning'><img src='/_images/age/age_warning.gif'/></div><p>This Site is for adults only! By entering this Site, you agree to the following terms and conditions: You certify that you are 18 years of age or older, and are not offended by sexually explicit imagery. You agree that you will not permit any person(s) under 18 years of age to have access to any of the materials contained within this Site.</p><div class='buttons'><a class='age-yes'><img src='/_images/age/age_yes.jpg'/></a><a href='http://www.disney.com'><img src='/_images/age/age_no.jpg'/></a></div></div> ");
            jQuery('.age-panel').dialog({ modal: true, autoOpen: false, draggable: false, width: 525, left:0, resizable: false, dialogClass: 'alert', closeOnEscape: false, });
            jQuery('.ui-dialog-titlebar').hide();
            jQuery('.age-panel').dialog('open');
			jQuery('.age-yes').click(function(){
				jQuery('.age-panel').remove();
				setmCookie('ageVerified',1,3650)
			});
			jQuery('.age-panel').show()
		} else { 
			if(getmCookie('ageVerified')==null) {
				setmCookie('ageVerified',1,3650)
			}
		}
}
