// EmailerPopUp Script


function openpopup(){ 
var popurl="http://forms.imageworksstudio.com/hydraulic_net/email_signup.html" 
winpops=window.open(popurl,"es","width=600,height=480,") 
} 

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

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 loadornot(){ 
	popcnt = 1;
	cv = getCookie('poppedup');
	pcnt = (cv) ? parseInt(cv) : 0;
	if (pcnt == popcnt) openpopup();
	if (pcnt <= popcnt){
		pcnt ++;
		setCookie('poppedup',pcnt);
	}
} 

loadornot() 
// EmailerPopUp Script