//==============================================//
//magazine exit pop code
adURL = '';

 
adURL = 'http://ccare.hearstmags.com/cgi-bin/absplit.cgi?SplitFile=esqexitpopup.urls'
adEncURL = 'http%3A%2F%2Fccare%2Ehearstmags%2Ecom%2Fcgi%2Dbin%2Fabsplit%2Ecgi%3FSplitFile%3Desqexitpopup%2Eurls'
lb_offSite = 0

function popUp(theHref) { 
window.open(theHref,"pop","width=460,height=400,status=no,scrollbars=yes,toolbar=no,resizable=yes"); 
} 

var g_WINDOW_FLAG = true;
var webServer = '';

function outro() {
	if (g_WINDOW_FLAG) {
	 subscribe = window.open(adURL,"Subscribe","width=500,height=360,toolbar=no,location=no,status=no,scrollbars=no,menubar=no,resizable=yes");
	self.focus();
	}
}

function intro() {
	//no intro
}

function parseURL(clickURL) {
var g_LINK_RULE = new RegExp ("^http://*");
if (!g_LINK_RULE.test(clickURL)) return true;
	var ruleList = new Array('ivillage.com','hearstmags.com','divinems.com','esquire.com');	
	
	for(var i = 0; i < ruleList.length; i++) {
		if (new RegExp(ruleList[i]).test(clickURL)) { g_WINDOW_FLAG = false; break; }
	}
}


//support for netscape
if (document.layers) document.captureEvents(Event.ONCLICK);

// toggle between netscape's way or Ie's way
document[document.layers?"onmouseup":"onclick"]=function(e) {
  var s=e?e.target:event.srcElement;
  //provide form sBupport
  if (s.type == 'submit' || s.type == 'button' || s.type == 'image') g_WINDOW_FLAG = false;
  
  //provide image support 
  //if (s.parentElement.href) s.href = s.parentElement.href

  if (s.href && (s.target == "" || s.target == "_self" || s.target == null)) {
   	parseURL(s.href)    
  }	

};


// Reads a query string from the URL. Pass in the key name and get back the value. */ 
function queryString(keyName) { 
var keyValue = ""; 
keyName = keyName.toUpperCase() + "="; 

if (window.location.href.indexOf("?") != -1) { 
     var queryString = window.location.href.substring(window.location.href.indexOf("?")+1); 
     var searchString = queryString.toUpperCase(); 
     if (searchString.indexOf(keyName) != -1) { 
      var keyValueStart = parseInt(searchString.indexOf(keyName)) + keyName.length; 
      var keyValueEnd = searchString.indexOf("&", keyValueStart); 
      var keyValueEnd = (keyValueEnd != -1) ? keyValueEnd : searchString.length; 
      keyValue = queryString.substring(keyValueStart,keyValueEnd); 
     }

     var plusPos = keyValue.indexOf('+');
     while (plusPos != -1) {
         keyValue = keyValue.substring(0, plusPos) + " " + keyValue.substring(plusPos + 1, keyValue.length);
         plusPos = keyValue.indexOf('+');
     }
} 
return unescape(keyValue); 
} 

//Pop Up for 2003 Feature Article Puzzle Answers
function popAnswer(puzzle) {
	var url = "/features/articles/2003/puzzle/answer.html?puzzle="
	theHref = url+puzzle
    windowpop = window.open(theHref,"Answer","width=340,height=450,left=100,top=150,resizable,scrollbars");
	windowpop.focus();
}


//<!-- iVillage Header -->

document.writeln("<scr"+"ipt src='http://a820.g.akamai.net/f/820/822/1d/i.ivillage.com/includes/iv_header.js'></scr"+"ipt>");
