function checkCookie(cookieName) {
	var cookieExists;
	if(getCookieValue(cookieName) == null) {
		//popWinAd();
		//showPopOver();
		setAdCookie(cookieName);
		cookieExists = false;
	}
	else {
		cookieExists = true;
	}
	return cookieExists;


}
function showPopOver() {
	MM_showHideLayers('popover','','show');
}

function popWinAd() {
var newWindow;
var winTop = (screen.height /2)-(224);
var winLeft = (screen.width /2)-(420/2);
var windowFeatures = "width=420,height=225,";
windowFeatures = windowFeatures + "left=" + winLeft + ",";
windowFeatures = windowFeatures + "top=" + winTop ;

newWindow = window.open("mw_pop_up.php","POPad",windowFeatures);
}

function setAdCookie(cookiename) {
setCookie(cookiename,'false',"","");
}

function setCookie(cookieName, cookieValue, cookiePath,cookieExpires) {
	cookieValue = escape(cookieValue);
	if(cookieExpires != "") {
		cookieExpires = ";expires="+cookieExpires;
	}
	if(cookiePath != "") {
		cookiePath=";Path=" + cookiePath;
		
	}
	document.cookie = cookieName + "=" +cookieValue + cookieExpires + cookiePath;
}

function getCookieValue(cookieName) {
	var cookieValue = document.cookie;
	var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
	if (cookieStartsAt == -1) {
		cookieStartsAt = cookieValue.indexOf(cookieName + "=");
	}
	if (cookieStartsAt == -1) {
		cookieValue = null;
	}
	else {
		cookieStartsAt = cookieValue.indexOf("=",cookieStartsAt +1);
		var cookieEndsAt = cookieValue.indexOf(";",cookieStartsAt);
		if(cookieEndsAt== -1) {
			cookieEndsAt = cookieValue.length;
		}
		cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));
	}
	return cookieValue;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

