 function retrieveCookie( cookieName ) {
	/* retrieved in the format
	cookieName4=value; cookieName3=value; cookieName2=value; cookieName1=value
	only cookies for this domain and path will be retrieved */
	var cookieJar = document.cookie.split( "; " );
	for( var x = 0; x < cookieJar.length; x++ ) {
		var oneCookie = cookieJar[x].split( "=" );
		if( oneCookie[0] == escape( cookieName ) ) { return unescape( oneCookie[1] ); }
	}
	return null;
}

function setCookie( cookieName, cookieValue, lifeTime, path, domain, isSecure ) {
	if( !cookieName ) { return false; }
	if( lifeTime == "delete" ) { lifeTime = -10; } //this is in the past. Expires immediately.
	/* This next line sets the cookie but does not overwrite other cookies.
	syntax: cookieName=cookieValue[;expires=dataAsString[;path=pathAsString[;domain=domainAsString[;secure]]]]
	Because of the way that document.cookie behaves, writing this here is equivalent to writing
	document.cookie = whatIAmWritingNow + "; " + document.cookie; */
	document.cookie = escape( cookieName ) + "=" + escape( cookieValue ) +
		( lifeTime ? ";expires=" + ( new Date( ( new Date() ).getTime() + ( 1000 * lifeTime ) ) ).toGMTString() : "" ) +
		( path ? ";path=" + path : "") + ( domain ? ";domain=" + domain : "") + 
		( isSecure ? ";secure" : "");
	//check if the cookie has been set/deleted as required
	if( lifeTime < 0 ) { if( typeof( retrieveCookie( cookieName ) ) == "string" ) { return false; } return true; }
	if( typeof( retrieveCookie( cookieName ) ) == "string" ) { return true; } return false;
}

	/*var hm = 0;var ns = 0;var ie = 0;var wc = 0;if (document.getElementById) {wc = 1; hm = 1;} else if (document.all) {ie = 1; hm = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1)
	&& (browserVersion == 4)) {ns = 1; hm = 1;}} function dm(oi,ws) {if (ws == 1) { if (wc) return (document.getElementById(oi).style); else if (ie) return (document.all[oi].style); else if (ns) return (document.layers[oi]);}
	else {if (wc) return (document.getElementById(oi)); else if (ie) return (document.all[oi]); else if (ns) return (document.layers[oi]);}} function wd() {if (window.innerWidth != null) return window.innerWidth; if (document.body.clientWidth != null)
	return document.body.clientWidth; return (null);} function showAd(oi,tm,al) {if (hm) {var wp = wd(); ds = dm(oi,1); dx = dm(oi,0); if (dx.offsetWidth) ew = dx.offsetWidth; else if (dx.clip.width) ew = dx.clip.width; st = ds.visibility;
	if (st == "visible" || st == "show") ds.visibility = "hidden"; else {wp -= ew; if (al) wp /=2; else wp -= 10;if (!ns) wp += 'px'; ds.visibility = "visible"; setTimeout("showAd('"+oi+"')",tm * 1500);}}}
	*/

function openoverlay(div)
{
    document.getElementById(div).style.display = 'block';

}

function closeoverlay(div)
{
    document.getElementById(div).style.display = 'none';

}

function overlaymgt() {
 var myCookie = retrieveCookie("coockioverlay");
 if (myCookie==null) {
  	//showAd('a1',12,0);
  	openoverlay('a1');
  	setCookie('coockioverlay', 'ON', '');
  	setTimeout("closeoverlay('a1')", 15000);
 }
}

window.onload= function(){
    overlaymgt();
}
