
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // se existir cookie
      offset += search.length
      // pegando o inicio do valor
      end = document.cookie.indexOf(";", offset);
      // pegando o fim do valor
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function save_cookie(){
	expireDate = new Date;
	expireDate.setMonth(expireDate.getMonth()+6);
	document.cookie = 'cadNews=1;expires=' + expireDate.toGMTString();
}

function openPopUpInicial(){
  if (get_cookie('cadNews')=='' && get_cookie('popupinicial')==''){
    popInicialSeducaoMagnetica = window.open('http://www.seducaomagnetica.com.br/popup.asp','popInicialSeducaoMagnetica','width=350,height=260');
    document.cookie="popupinicial=yes";
	popInicialSeducaoMagnetica.focus();
  }
}