function getCookie(name) 
{
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) {end = dc.length;}
  return unescape(dc.substring(begin + prefix.length, end));
}

function setCookie(NameOfCookie, value, expiredays) 
{ 
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}



function delCookie (NameOfCookie) 
{ 
	if (getCookie(NameOfCookie)) 
	{
		document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

//pop up con scadenza
function popup_cookie() {
  var p_up = false;
  p_up = getCookie("popup1");
  if (!p_up) {
	  jQuery.blockUI({ 
		  message: jQuery('#hvlay'),
          css: { top: '10px', width: '600px' } 
		  });
	  //jQuery('.blockOverlay').attr('title','Clicca per scaricare la brochure').click(window.location.href="/public/files/2011/10/programma-Congresso-nazionale-2011-PO.pdf");
      setTimeout(jQuery.unblockUI, 18000);
	  setCookie ("popup1","true","1");
  }
}


jQuery(document).ready(function() { 
	//popup_cookie();   
	
	jQuery('#hvlay img').click(function() {
		window.location.href="/public/files/2011/10/programma-Congresso-nazionale-2011-PO.pdf";
	});
	
}); 
