//
// Copyright 2002 K. Laskowski e-Work-Zone.com
// This script may not be modified except as specified in the
// readme file accompanying the script.
// Use of this script is subject to e-Work-Zone Terms of Use,
// and there is NO warranty of any kind provided.
// This script is provided 'as is',
// You assume any and all risk for your use of this script.
//
function subscribeme() {
var subscriber = cookieVal('subscriber');
if (subscriber == null) {
  subscribe = window.confirm("Subscribe to e-Work-News, e-Work-Zone's monthly ezine.\n\n With your Free subscription you get:\n ==> access to over $100 in subscriber-only bonuses!\n ==> cutting-edge work at home articles, tips, etc. the 15th of every month.\n\n To subscribe, just click OK, then send.\n\n Your email address will never be used for any other purpose.\n You can unsubscribe at any time.\n");
  if (!subscribe) {
    window.alert("If you decide to subscribe later, just fill out the subscription form.");
    subscriber = 'no';
    // set expiry to 1 month
    var smallExpDate = new Date();
    smallExpDate.setMonth(smallExpDate.getMonth() + 1);
    document.cookie='subscriber='+escape(subscriber)+'; expires='+ smallExpDate.toGMTString();
  } else {
    // set expiry date to 1 year
    parent.location.href='mailto:eworknews@in-the-e-zone.com?subject=subscribe me';
    subscriber='yes';
    var largeExpDate = new Date();
    largeExpDate.setMonth(largeExpDate.getMonth() + 12);
    document.cookie='subscriber='+escape(subscriber)+'; expires='+ largeExpDate.toGMTString();

  }}
else {
    if (subscriber == 'yes'){
    var largeExpDate = new Date();
    largeExpDate.setMonth(largeExpDate.getMonth() + 12);
    document.cookie='subscriber='+escape(subscriber)+' expires='+ largeExpDate.toGMTString();

  }
}}

function cookieVal(cookieName) {
thisCookie = document.cookie.split("; ");
for (i=0; i<thisCookie.length; i++){
	if (cookieName == thisCookie[i].split("=")[0]){
		return thisCookie[i].split("=")[1];
	}
}
return null;
}


