

//************popups*******************
function openAgeGrade(){//delegate to generic popup management
	openSupplPop("http://store.americangirl.com/static/popups/ageGrade.html")
}

var supplPop = null //store supplemental window handle
function openSupplPop(URL,w,h){
	if (supplPop && !supplPop.closed){//close existing window first
    closeSupplPop();
  }
  //if width and height are not explicit, use default values
  var width
  var height
  if(w) width = w
  else width = "400"
  if(h) height = h
  else height = "400"
  
  //open new popup, store in handle variable and set focus
  supplPop=window.open(URL,"supplPop","scrollbars=yes,resizable=yes,width="+width+",height="+height+",left=0,top=0");
  supplPop.focus();
}

function closeSupplPop() {
	//close existing window
  if(supplPop && !supplPop.closed) {
    supplPop.close()
    supplPop = null
  }
}