function setCookie( cookieName, cookieValue, expires, path, domain, secure ) {
	var date = new Date();
	date.setTime(date.getTime() + (30 * 60 * 1000));
	document.cookie = cookieName + "=" +escape( cookieValue ) + ";expires=" + date;
}

function getCookie(cookieName) {
  var cookieDataBeg, cookieDataEnd;
  cookieDataBeg = document.cookie.indexOf(cookieName + "=");
  if (cookieDataBeg >= 0) {
    cookieDataBeg += cookieName.length + 1;
    cookieDataEnd = document.cookie.indexOf(";",cookieDataBeg);
    if (cookieDataEnd < 0) cookieDataEnd = document.cookie.length;
    return unescape(document.cookie.substring(cookieDataBeg,cookieDataEnd));
  }
  return null;
}

function checkCookie() {
  var cookData = getCookie('popUnderEI');
  if ( cookData == null ) {
    var ver = navigator.appVersion;
	if (ver.indexOf("MSIE") == -1) {
    	openSiteUnder();
	}
    setCookie('popUnderEI','true');
  }
}

function openSiteUnder() {
  var siteUnder = window.open('http://www.mederic.fr', 'pucd', 'left=0, top=0, width=' + screen.availWidth + ', height=' + screen.availHeight + ', scrollbars=1');
  siteUnder.blur();
  window.focus();
}
