/**START GLOBAL FUNCTIONS**/
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
	rnd.seed = (rnd.seed*9301+49297) % 233280;
	return rnd.seed/(233280.0);
}

function rand(number) {
	return Math.ceil(rnd()*number);
}

String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g, ''); };

imgOn = new Array();
imgOff = new Array();

imgOn[0] = new Image();
imgOn[0].src = "/anf/images/nav/nav_home_on.gif";
imgOn[1] = new Image();
imgOn[1].src = "/anf/images/nav/nav_mens_on.gif";
imgOn[2] = new Image();
imgOn[2].src = "/anf/images/nav/nav_womens_on.gif";
imgOn[3] = new Image();
imgOn[3].src = "/anf/images/nav/nav_kids_on.gif";
imgOn[4] = new Image();
imgOn[4].src = "/anf/images/nav/nav_photogallery_on.gif";
imgOn[5] = new Image();
imgOn[5].src = "/anf/images/nav/nav_headphones_on.gif";
imgOn[6] = new Image();
imgOn[6].src = "/anf/images/nav/nav_signin_on.gif";
imgOn[7] = new Image();
imgOn[7].src = "/anf/images/nav/nav_wishlist_on.gif";
imgOn[8] = new Image();
imgOn[8].src = "/anf/images/nav/nav_casting_on.gif";
imgOn[9] = new Image();
imgOn[9].src = "/anf/images/nav/af_shop_icon2.gif";
imgOn[10] = new Image();
imgOn[10].src = "/anf/images/nav/nav_join_on.gif";
imgOn[11] = new Image();
imgOn[11].src = "/anf/images/nav/nav_register_on.gif";
imgOn[12] = new Image();
imgOn[12].src = "/anf/images/nav/nav_account_on.gif";
imgOn[13] = new Image();
imgOn[13].src = "/anf/images/nav/nav_film_on.gif";

imgOff[0] = new Image();
imgOff[0].src = "/anf/images/nav/nav_home_off.gif";
imgOff[1] = new Image();
imgOff[1].src = "/anf/images/nav/nav_mens_off.gif";
imgOff[2] = new Image();
imgOff[2].src = "/anf/images/nav/nav_womens_off.gif";
imgOff[3] = new Image();
imgOff[3].src = "/anf/images/nav/nav_kids_off.gif";
imgOff[4] = new Image();
imgOff[4].src = "/anf/images/nav/nav_photogallery_off.gif";
imgOff[5] = new Image();
imgOff[5].src = "/anf/images/nav/nav_headphones_off.gif";
imgOff[6] = new Image();
imgOff[6].src = "/anf/images/nav/nav_signin_off.gif";
imgOff[7] = new Image();
imgOff[7].src = "/anf/images/nav/nav_wishlist_off.gif";
imgOff[8] = new Image();
imgOff[8].src = "/anf/images/nav/nav_casting_off.gif";
imgOff[9] = new Image();
imgOff[9].src = "/anf/images/nav/af_shop_icon.gif";
imgOff[10] = new Image();
imgOff[10].src = "/anf/images/nav/nav_join_off.gif";
imgOff[11] = new Image();
imgOff[11].src = "/anf/images/nav/nav_register_off.gif";
imgOff[12] = new Image();
imgOff[12].src = "/anf/images/nav/nav_account_off.gif";
imgOff[13] = new Image();
imgOff[13].src = "/anf/images/nav/nav_film_off.gif";

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  }

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) {
  var winObj;
  winObj = window.open(theURL,winName,features);
}

function nvp_struct(){
		var args = nvp_struct.arguments;
		this.nvp_qvpair = args[0];
		this.nvp_var = args[1];
		this.nvp_value = args[2];
}

var nvp_array = new Array;
function nvp_parse(){
	var querystring = location.search; nvp = querystring.indexOf('&'); searchstring = "true"; prev_nvp = 1; x = 0;
	do {
	if (nvp == -1){nvp = querystring.length; searchstring = "false";}
	var nvp_qvpair = querystring.substring(prev_nvp, nvp); nvp_var = nvp_qvpair.substring(0, nvp_qvpair.indexOf('=')); nvp_value = nvp_qvpair.substring(nvp_qvpair.indexOf('=')+1);
	nvp_array[x] = new nvp_struct(nvp_qvpair,nvp_var,nvp_value); querystring = querystring.substring(nvp + 1,querystring.length);
	if(querystring == null){searchstring = "false"} else {var prev_nvp = 0;		nvp = querystring.indexOf('&');		x++;}
	} while (searchstring == "true")
}

function nvp_get(){
	var args = nvp_get.arguments; nvpsearch = args[0]; nvpvalue = "noval"; nvp_length = nvp_array.length;
	for (var x = 0; x != nvp_length; x++){
		if(nvp_array[x].nvp_var == nvpsearch){nvpvalue = nvp_array[x].nvp_value};
	}
return nvpvalue;
}

function MM_validateForm() {
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	if (val) { nm=val.name; if ((val=val.value)!="") {
	  if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
		if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
	  } else if (test!='R') {
		if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
		if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
		  min=test.substring(8,p); max=test.substring(p+1);
		  if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
	} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

var numChars = 250;
function notTooBig() {
		if (document.pcard.message.value.length > numChars+1) {
		document.pcard.message.value = document.pcard.message.value.substring(0,numChars-1);
		alert("You cannot enter more than 250 characters in the message field."); }
}

var hostName = location.host;

var serverHostname = 'http://'+hostName;

var globalStoreId = readCookie('myStore');
if(globalStoreId == null){
	var globalStoreId = 10051
}
var globalCatalogId = 10901
var globalCatgroupId1 = 12202
var globalCatgroupId2 = 12203
var globalCatgroupId3 = 12204
var globalCatgroupId4 = 12205

var globalTopNavLink1 = serverHostname + '/webapp/wcs/stores/servlet/CategoryDisplay?langId=-1&storeId=' + globalStoreId + '&catalogId=' + globalCatalogId + '&categoryId=' + globalCatgroupId1
var globalTopNavLink2 = serverHostname + '/webapp/wcs/stores/servlet/CategoryDisplay?langId=-1&storeId=' + globalStoreId + '&catalogId=' + globalCatalogId + '&categoryId=' + globalCatgroupId2
var globalTopNavLink3 = serverHostname + '/webapp/wcs/stores/servlet/UserRegistrationForm?new=Y&langId=-1&catalogId=' + globalCatalogId +'&storeId=' + globalStoreId
var globalTopNavLink4 = serverHostname + '/anf/index.html'
var globalTopNavLink5 = contactUsLink
var globalTopNavLink7 = serverHostname + '/anf/onlinestore/html/help_home.html'
var globalTopNavLink8 = serverHostname + '/webapp/wcs/stores/servlet/LogonForm?page=register&langId=-1&catalogId=' + globalCatalogId + '&storeId=' + globalStoreId
var globalTopNavLink9 = serverHostname + '/webapp/wcs/stores/servlet/OrderItemDisplay?langId=-1&storeId=' + globalStoreId + '&catalogId=' + globalCatalogId + '&orderId=.'

var globalBotNavLink0 = serverHostname + '/anf/onlinestore/html/gear_tracking.html'
var globalBotNavLink1 = serverHostname + '/webapp/wcs/stores/servlet/InterestItemDisplay?storeId=' + globalStoreId + '&listId=.&langId=-1&catalogId=' + globalCatalogId
var globalBotNavLink2 = serverHostname + '/storelocator/basicSearch.jsp?storeId=' + globalStoreId 
var globalBotNavLink3 = joinEmailLink
var globalBotNavLink4 = serverHostname + '/anf/lifestyles/html/jobs.html';
var globalBotNavLink5 = serverHostname + '/webapp/wcs/stores/servlet/GiftCardDisplay?catalogId=' + globalCatalogId + '&storeId=' + globalStoreId + '&langId=-1';


function getTopNavLink(){
	var args = getTopNavLink.arguments;
	if(typeof(args[0]) == 'string') window.location = args[0];
	else if (typeof(args[0]) == 'function')args[0]()
}

var siteWidth = 859;		

function getTopNavLayers(pageType){
}

function productCartNumber(){
	var cartNum = readCookie('myCart');
	if(cartNum == null){
		if(readCookie('myStore') == '12406'){
			cartNum = '0,\u00A30.00';
		} else {
			cartNum = '0,$0.00';
		}
	}
	setCartNum(cartNum);
}

function showNav(img, state){
	for (i=0;i<5;i++){
		rollover(i, 0);
	}
	
	rollover(img, 1);
}

function rollover(img, state){
	oImg = eval("document.img" + img);
	if (state == 1){
		oImg.src = imgOn[img].src;
	}
	else if (state == 0){
		if(oImg){
			oImg.src = imgOff[img].src;
		}
	}
}

function getStyleObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
	} else if (document.all && document.all(objectId)) {
	return document.all(objectId).style;
	} else if (document.layers && document.layers[objectId]) {
	return document.layers[objectId];
	} else {
	return false;
	}
}

function changeObjectVisibility(objectId, newVisibility) {
	var styleObject = getStyleObject(objectId);
	if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
	} else {
	return false;
	}
}

function changeObjectProperty(objectId, cssProperty, newValue) {
	var styleObject = getStyleObject(objectId);
	if(styleObject) {
	eval("styleObject."+cssProperty+" = newValue");
	return true;
	} else {
	return false;
	}
}

function getElementsByClassName(node, classname){
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
}

function hasClass(el, className) {
	var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
    return re.test(el.className);
}

function addClass(el, className) {
	if (hasClass(el, className)) { return; } // already present
	el.className = [el.className, className].join(' ');
}

function removeClass(el, className){
    var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');
	if (!hasClass(el, className)) {
		return; // not present
	}                 
	var c = el.className;
    el.className = c.replace(re, ' ');
    if ( hasClass(el, className) ) { // in case of multiple adjacent
        removeClass(el, className);
    }
}

function hasAncestor(c,o){
	if(!o || !c){ return false; }
	o = $(o);
	var pn = c.parentNode, ret = false, x=0;
	while (pn.tagName.toUpperCase() != 'BODY'){
		if(pn === o){
			ret = true;
			break;
		}else{
			pn = pn.parentNode;
		}
	}
	return ret;
}

/**********COOKIES*****************************/
function createCookie(name,value,days){
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	var ck = name+"="+value+expires+"; path=/";
	document.cookie = ck;
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

var cartLeft = 515;
var cartTop = 40;

function getTopNav(){
	var html = '';
	if (readCookie('anf-country') == null) {
	  html += '<script type="text/javascript" src="/webapp/wcs/stores/servlet/webdir/countryCode.jsp?storeId=' + globalStoreId + '"></script>';
	}
	html += '<script language="JavaScript">';
	html += 'new ypSlideOutMenu("cart", "down", '+cartLeft+', '+cartTop+', 300, 260);';
	html += '</script> ';
	document.write(html);
	hideFooterElements();
}
var lang = readCookie('anf-lang');
if (lang == null){
	lang = "en";
}

var division = null;
var category = null;
function highlightMenu(){
	if(document.getElementById('navHolder')){
		if(division == 12202 || division == 12204) var target= 'mens'; 
		else if(division == 12203 || division == 12205) var target = 'womens';
		else return;
		var targetObj = eval('document.getElementById(\'' + target + 'MenuImg\')');
		targetObj.parentNode.onmouseover = null;
		targetObj.parentNode.onmouseout = null;
		targetObj.src = '/anf/images/nav/nav_' + target + '_on.gif';
		
		var link = (division == 12205 || division == 12204) ? document.getElementById('clearance') : category ? document.getElementById(category) : null;
		if(link){	
			link.className = 'menuHighlight'
			var arrow = document.createElement('img');
			arrow.className = 'menuArrow';
			arrow.src = '/anf/onlinestore/common/arrow.gif';
			link.insertBefore(arrow, link.firstChild);
		}
	}else return;
}

function getHeader(cart){
	var headerHtml = '<div id="wrapper">'
	headerHtml += '<div id="headerCtn">';
	headerHtml += '<div id="headerMenu"><a href="/anf/lifestyles/html/homepage.html" onmouseover="rollover(0, 1);" onmouseout="rollover(0, 0);" class="navSpace"><img src="/anf/images/nav/nav_home_off.gif" name="img0" alt="Home" width="45" height="20"/></a><a href="javascript:getTopNavLink(globalTopNavLink1);" onmouseover="rollover(1,1)" onmouseout="rollover(1,0)" class="navSpace"><img src="/anf/images/nav/nav_mens_off.gif" name="img1" alt="Mens" width="44" height="20"/></a><a href="javascript:getTopNavLink(globalTopNavLink2);" onmouseover="rollover(2,1)" onmouseout="rollover(2,0);" class="navSpace"><img name="img2" src="/anf/images/nav/nav_womens_off.gif" alt="Women" id="womensMenuImg" width="62" height="20"/></a><a href="javascript:goToKids();" onmouseover="rollover(3,1);" onmouseout="rollover(3, 0);"><img src="/anf/images/nav/nav_kids_off.gif" name="img3" alt="Kids" width="40" height="20"/></a><img src="/anf/images/nav/nav_maindivider.gif"/><a href="/anf/lifestyles/html/film.html" onmouseover="rollover(13,1)" onmouseout="rollover(13,0);" class="navSpace"><img src="/anf/images/nav/nav_film_off.gif" name="img13" id="nfMenuImg" alt="A&amp;F Film" width="60" height="20"/></a><a href="javascript:MM_openBrWindow(\'/anf/lifestyles/html/casting.html\',\'casting\', \'toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no,width=900px,height=737px\');" onmouseover="rollover(8,1)" onmouseout="rollover(8,0);" class="navSpace"><img src="/anf/images/nav/nav_casting_off.gif" name="img8" id="castingImg" alt="Casting" width="87" height="20"/></a><a href="javascript:getTopNavLink(globalBotNavLink3)"  onmouseover="rollover(10,1)" onmouseout="rollover(10,0)" class="navSpace"><img src="/anf/images/nav/nav_join_off.gif" name="img10" alt="Join Email" width="75" height="20"/></a><a href="javascript:MM_openBrWindow(\'/anf/lifestyles/flash/af_radio/af_radio.html\',\'music\', \'toolbar=no,menubar=no,status=no,scrollbars=no,resizable=yes,width=240px,height=100px\');" onmouseover="rollover(5,1)" onmouseout="rollover(5,0)" class="navSpace"><img name="img5" src="/anf/images/nav/nav_headphones_off.gif" alt="AF Playlist" width="23" height="20"/></a></div>';
	if(cart == 'nocart'){
		headerHtml += '	<div id="miniCart"><table border="0" cellpadding="0" cellspacing="0"><tr><td style="text-align:center; width:217px;padding-top:3px;"><a href="javascript:getTopNavLink(globalTopNavLink9);" style="width:217px;display:block;color:#ebe9e0;">Shopping Bag&nbsp;&nbsp;<b><span id="cartnum"></span></b>&nbsp;items&nbsp;:&nbsp;<span id="cartTotal"></span></a></td></tr></table></div>';
	}else{
		headerHtml += ' <div id="cartContainer"><div id="cartContent"><table border="0" cellspacing="0" cellpadding="0" width="220"  onmouseover="showCart();" onmouseout="hideCart();"><tr><td class="cartBorder"><table border="0" cellspacing="5" cellpadding="0"><tr><td bgcolor="#FFFFFF"><div id="cartlist" style="z-index:99;"></div></td></tr></table></td></tr></table></div></div>';
		headerHtml += '	<div id="miniCart"><table border="0" cellpadding="0" cellspacing="0"><tr><td onmouseover="miniCart();" onmouseout="hideCart()" style="text-align:center; width:217px; padding-top:3px;"><a href="javascript:getTopNavLink(globalTopNavLink9);" style="width:217px;display:block;color:#ebe9e0;">Shopping Bag&nbsp;&nbsp;<b><span id="cartnum"></span></b>&nbsp;items&nbsp;:&nbsp;<span id="cartTotal"></span></a></td></tr></table></div>';
	}
	headerHtml += '	<div id="topNavAcctOptions">';
	if(readCookie('afstatus') == '1'){headerHtml += '<a href="javascript:getTopNavLink(globalTopNavLink8)" onmouseover="rollover(12,1)" onmouseout="rollover(12,0)"><img name="img12" style="margin-top:2px;" src="/anf/images/nav/nav_account_off.gif" alt="Your Account" width="105" height="10"/></a><br/><a href="javascript:getTopNavLink(globalBotNavLink1)" onmouseover="rollover(7,1)" onmouseout="rollover(7,0)"><img name="img7" src="/anf/images/nav/nav_wishlist_off.gif"  alt="My Wish List" width="105" height="10"/></a></div>';}else{headerHtml += '<a href="javascript:getTopNavLink(globalTopNavLink8)" onmouseover="rollover(6,1)" onmouseout="rollover(6,0)"><img name="img6" src="/anf/images/nav/nav_signin_off.gif" alt="Sign in" width="49" height="20"/></a><img src="/anf/images/nav/nav_divider.gif"/><a href="javascript:getTopNavLink(globalTopNavLink3)" onmouseover="rollover(11,1)" onmouseout="rollover(11,0)"><img src="/anf/images/nav/nav_register_off.gif" alt="Register" name="img11" width="53" height="20"/></a></div>';}
	headerHtml += '<script type="text/javascript">productCartNumber();</script>';
	headerHtml += '</div>';
	headerHtml += '<div id="menuLine">&nbsp;</div>';
	
	document.write(headerHtml);
}

function getFooter(){
	var footerHtml = '<div id="footer"><div id="divCtn" style="width:900px;padding-left:14px;">';
	footerHtml += '<span id="creditCardLink"><a href="https://onlineaccess.mycreditcard.cc/abercrombie" target="window2" class="footerSpace"><img src="/anf/images/nav/footer_creditcard.gif" width="59" height="16"/><\/a></span>';
	footerHtml += '<a href="javascript:getTopNavLink(globalBotNavLink0)"  class="footerSpace"><img src="/anf/images/nav/footer_ordertracking.gif" width="79" height="16"/><\/a><a class="footerSpace" href="javascript:MM_openBrWindow(\'/anf/lifestyles/html/investorrelations.html\',\'investor\',\'toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=750,height=600\');"><img src="/anf/images/nav/footer_investors.gif" width="49" height="16"><\/a><a href="javascript:getTopNavLink(globalTopNavLink5)" class="footerSpace"><img src="/anf/images/nav/footer_contact.gif" width="42" height="16"/><\/a>';
	footerHtml += '<a href="javascript:MM_openBrWindow(\'/anf/careers/index.html\',\'careers\',\'\');" class="footerSpace"><img src="/anf/images/nav/footer_careers.gif" width="42" height="16"/><\/a><a href="javascript:MM_openBrWindow(\'/anf/careers/diversity.html\',\'careers\',\'\');" class="footerSpace"><img src="/anf/images/nav/footer_diversity.gif" width="46" height="16"/><\/a><a href="/anf/lifestyles/html/brandprotection.html" class="footerSpace"><img src="/anf/images/nav/footer_brandprotection.gif" width="89" height="16"/><\/a>';

	if(readCookie('myStore') == '11306'){
		footerHtml += '<a href="javascript:MM_openBrWindow(\'/anf/privacy_policy_ca.html\',\'privacy\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_privacy.gif" width="38" height="16"/><\/a><a href="javascript:MM_openBrWindow(\'/anf/site_use_ca.html\',\'siteuse\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_siteuse.gif" width="40" height="16"/><\/a>';
	}else if(readCookie('myStore') == '12406') {
		footerHtml += '<a href="javascript:MM_openBrWindow(\'/anf/privacy_policy_uk.html\',\'privacy\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_privacy.gif" width="38" height="16"/><\/a><a href="javascript:MM_openBrWindow(\'/anf/site_use_uk.html\',\'siteuse\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_siteuse.gif" width="40" height="16"/><\/a>';
	}else{
		footerHtml += '<a href="javascript:MM_openBrWindow(\'/anf/privacy_policy.html\',\'privacy\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_privacy.gif" width="38" height="16"/><\/a>';
		footerHtml += '<a href="javascript:MM_openBrWindow(\'/anf/privacy_policy_cali.html\',\'privacy\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_caprivacy.gif" width="56" height="16"/><\/a><a href="javascript:MM_openBrWindow(\'/anf/site_use.html\',\'siteuse\',\'scrollbars=yes,width=460,height=460\');" class="footerSpace"><img src="/anf/images/nav/footer_siteuse.gif" width="40" height="16"/><\/a>';
	}
	footerHtml += '<a href="javascript:getTopNavLink(globalBotNavLink2);" class="footerSpace"><img src="/anf/images/nav/footer_locator.gif" width="74" height="16"/></a>';
	
	if(readCookie('anf-lang') != 'ja'){
		if(readCookie('myStore') == '11306'){
			footerHtml += '<a href="/anf/onlinestore/html/help_home_ca.html" class="footerSpace"><img src="/anf/images/nav/footer_help.gif" width="30" height="16"/></a>';
		}else if(readCookie('myStore') == '12406') {
			footerHtml += '<a href="/anf/onlinestore/html/help_home_uk.html" class="footerSpace"><img src="/anf/images/nav/footer_help.gif" width="30" height="16"/></a>';
		} else{
			footerHtml += '<a href="javascript:getTopNavLink(globalTopNavLink7)" class="footerSpace"><img src="/anf/images/nav/footer_help.gif" width="30" height="16"/></a>';
		}
	}else{
		footerHtml += '<a href="/anf/onlinestore/html/help_home_jp.html" class="footerSpace"><img src="/anf/images/nav/footer_help_jp.gif" width="30" height="16"/></a>';			
	}
	
	footerHtml += '</div></div></div><br/>';

	document.write(footerHtml);
	
	if(readCookie('myStore') == '11306' || readCookie('myStore') == '12406'){
		changeObjectProperty('creditCardLink','display','none');
	}
}

function setCartNum(thenum){
	var parts = thenum.split(",");
	var q = encodeCharEntities(parts[0]);
	var amount = encodeCharEntities(parts[1]);
	if (parts[2]){
		amount = amount +','+ encodeCharEntities(parts[2]);
	}
	
	if (document.getElementById('cartContainer')){
		newHeight = (q*33+190);
		document.getElementById('cartContainer').style.height = newHeight+"px";
		document.getElementById('cartContainer').style.clip = "rect(0px, 300px, " + newHeight + "px, 0px)";
		document.getElementById('cartContent').style.height = newHeight+"px";
		document.getElementById('cartContent').style.clip = "rect(0px, 300px, " + newHeight + "px, 0px)";
		
	}
	
	setContent('cartnum',q);
	setContent('cartTotal',amount);
}

function hideFooterElements(){
	if(readCookie('myStore') == '11306' || readCookie('myStore') == '12406'){
		changeObjectProperty('creditCardLink','display','none');
	}
}

var abtest = "B";

ypSlideOutMenu.Registry = []
ypSlideOutMenu.aniLen = 200
ypSlideOutMenu.hideDelay = 125
ypSlideOutMenu.minCPUResolution = 10

function ypSlideOutMenu(id, dir, left, top, width, height){
	this.ie  = document.all ? 1 : 0
	this.ns4 = document.layers ? 1 : 0
	this.dom = document.getElementById ? 1 : 0

	if (this.ie || this.ns4 || this.dom) {
		this.id			 = id
		this.dir		 = dir
		this.orientation = dir == "left" || dir == "right" ? "h" : "v"
		this.dirType	 = dir == "right" || dir == "down" ? "-" : "+"
		this.dim		 = this.orientation == "h" ? width : height
		this.hideTimer	 = false
		this.aniTimer	 = false
		this.open		 = false
		this.over		 = false
		this.startTime	 = 0

		this.gRef = "ypSlideOutMenu_"+id
		eval(this.gRef+"=this")

		ypSlideOutMenu.Registry[id] = this

		if (document.all){
			mWidth = document.body.clientWidth;
		} else if (document.layers){
			mWidth = window.innerWidth;
		} else if (document.getElementById){
			mWidth = window.innerWidth;
		}
		currentLeft = left;
		newLeft = parseInt(siteWidth/2) - currentLeft;
		newLeft = parseInt(mWidth/2) - newLeft;

		if (mWidth >= siteWidth){
				left = newLeft;
		} else{}

		newleft = left + "px";

		var d = document
		d.write('<style type="text/css">')
		d.write('#' + this.id + 'Container { visibility:hidden; ')
		d.write('z-index:65; ')
		d.write('left:' + newleft +'; ')
		d.write('top:' + top + 'px; ')
		d.write('overflow:hidden; }')
		d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; ')
		d.write('width:' + width + 'px; ')
		d.write('height:' + height + 'px; ')
		d.write('clip:rect(0px, ' + width + 'px, ' + height + 'px, 0px); ')
		d.write('}')
		d.write('</style>')

		this.load()
	}
}

function resetMenus(){
	resetCart();
}

function resetCart(){
	if (document.getElementById('cartContainer')){
		newLeft2 = document.getElementById('miniCart').offsetLeft;
		document.getElementById('cartContainer').style.left = newLeft2+"px";
	}
}

ypSlideOutMenu.prototype.load = function() {
	var d = document
	var lyrId1 = this.id + "Container"
	var lyrId2 = this.id + "Content"
	var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
	if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
	var temp

	if (!obj1 || !obj2) {
		window.setTimeout(this.gRef + ".load()", 100)
	}
	else {
		this.container	= obj1
		this.menu		= obj2
		this.style		= this.ns4 ? this.menu : this.menu.style
		this.homePos	= eval("0" + this.dirType + this.dim)
		this.outPos		= 0
		this.accelConst	= (this.outPos - this.homePos) / ypSlideOutMenu.aniLen / ypSlideOutMenu.aniLen

		if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);

		this.endSlide()
	}
}

ypSlideOutMenu.showMenu = function(id){
	var reg = ypSlideOutMenu.Registry
	var obj = ypSlideOutMenu.Registry[id]

	if (obj.container) {
		obj.over = true

		if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }

		if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
	}
}

ypSlideOutMenu.hideMenu = function(id){
	var obj = ypSlideOutMenu.Registry[id]
		if (obj.container) {
			if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
			obj.hideTimer = window.setTimeout("ypSlideOutMenu.hide('" + id + "')", ypSlideOutMenu.hideDelay);
		}
}

ypSlideOutMenu.hide = function(id){
	var obj = ypSlideOutMenu.Registry[id]
	obj.over = false

	if (obj.hideTimer) window.clearTimeout(obj.hideTimer)

	obj.hideTimer = 0

	if (obj.open && !obj.aniTimer) obj.startSlide(false)
}

ypSlideOutMenu.prototype.startSlide = function(open) {
	this[open ? "onactivate" : "ondeactivate"]()
	this.open = open
	if (open) this.setVisibility(true)
	this.startTime = (new Date()).getTime()
	this.aniTimer = window.setInterval(this.gRef + ".slide()", ypSlideOutMenu.minCPUResolution)
}

ypSlideOutMenu.prototype.slide = function() {
	var elapsed = (new Date()).getTime() - this.startTime
	if (elapsed > ypSlideOutMenu.aniLen) this.endSlide()
	else {
		var d = Math.round(Math.pow(ypSlideOutMenu.aniLen-elapsed, 2) * this.accelConst)
		if (this.open && this.dirType == "-")		d = -d
		else if (this.open && this.dirType == "+")	d = -d
		else if (!this.open && this.dirType == "-")	d = -this.dim + d
		else										d = this.dim + d

		this.moveTo(d)
	}
}

ypSlideOutMenu.prototype.endSlide = function() {
	this.aniTimer = window.clearTimeout(this.aniTimer)
	this.moveTo(this.open ? this.outPos : this.homePos)
	if (!this.open) this.setVisibility(false)
	if ((this.open && !this.over) || (!this.open && this.over)) {
		this.startSlide(this.over)
	}
	if ((!this.open) && (this.id == 'cart')){
		changeObjectProperty('cartCrumbs', 'backgroundColor', 'transparent');
		rollover(9, 0);
		var ua = navigator.userAgent.toLowerCase();
		if ((ua.indexOf("msie") != -1) && (parseFloat(navigator.appVersion.split("MSIE")[1]) < 7) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)){
			changeObjectProperty('size','visibility','visible');
			changeObjectProperty('sizelist','visibility','visible');
		}
	}
}

ypSlideOutMenu.prototype.setVisibility = function(bShow) {
	var s = this.ns4 ? this.container : this.container.style
	s.visibility = bShow ? "visible" : "hidden"
}
ypSlideOutMenu.prototype.moveTo = function(p) {
	this.style[this.orientation == "h" ? "left" : "top"] = this.ns4 ? p : (p) + "px"
}
ypSlideOutMenu.prototype.getPos = function(c) {
	return parseInt(this.style[c])
}


ypSlideOutMenu.prototype.onactivate	= function() { }
ypSlideOutMenu.prototype.ondeactivate	= function() { }

function showWrap(){
	changeObjectProperty('wrapper','visibility','visible');
	changeObjectProperty('contentcontainer','display','block');
	changeObjectProperty('gencntnr','visibility','visible');
	resetCart();
}


var xmlDoc = null;
var addItem = false;
function miniCart(){
	if (xmlDoc == null){
		makeRequest('/webapp/wcs/stores/servlet/MiniOrderItemDisplay');
	} else {
		makeCart();
	}
}

function makeRequest(url, type) {
    var http_request = false;
	var getstr = "?";
	getstr += "storeId="+globalStoreId+"&";
	getstr += "langId="+-1+"&";
	getstr += "catalogId="+globalCatalogId+"&";
	getstr += "orderId=.";

    if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) {
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        return false;
    }
    getstr = url + getstr;
    http_request.onreadystatechange = function() { getContents(http_request, type); };
    http_request.open('Get', getstr, true);
    http_request.send(null);
}

function getContents(http_request, type) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
        	xmlDoc = http_request.responseXML;
        	makeCart(type);
        } else {
        }
    } else {
    }
}

function makeCart(type){
	if (addItem){
		type = 'add';
	}
	
	var numItems = xmlDoc.getElementsByTagName('number')[0];
	var qItems = xmlDoc.getElementsByTagName('quantity')[0];
	var numGifts = xmlDoc.getElementsByTagName('gift')[0];
	if (numItems){
		if (numItems.childNodes[0].nodeValue > 0){
	    	var total = xmlDoc.getElementsByTagName('total')[0];
	    	var store = xmlDoc.getElementsByTagName('store')[0];
	    	var catalogid = xmlDoc.getElementsByTagName('catalogid')[0];
	    	var langid = xmlDoc.getElementsByTagName('langid')[0];
			var chtml = "<table cellpadding=0 cellspacing=0 class=\"minitext\" id=\"miniStyle\">";
			if(type == 'add'){
				addItem = true;
				var num = (numItems.childNodes[0].nodeValue) - 1;
				var name = (xmlDoc.getElementsByTagName('name')[num]).childNodes[0].nodeValue; 
				var price = (xmlDoc.getElementsByTagName('price')[num]).childNodes[0].nodeValue; 
				var color = (xmlDoc.getElementsByTagName('color')[num]).childNodes[0].nodeValue; 
				var size = (xmlDoc.getElementsByTagName('size')[num]).childNodes[0].nodeValue; 
				var col = (xmlDoc.getElementsByTagName('collection')[num]).childNodes[0].nodeValue; 
				var seq = (xmlDoc.getElementsByTagName('sequence')[num]).childNodes[0].nodeValue; 
				var q = (xmlDoc.getElementsByTagName('qty')[num]).childNodes[0].nodeValue; 
				var backdate = (xmlDoc.getElementsByTagName('backdate')[num]).childNodes[0].nodeValue; 
				
				today = new Date();
				month = today.getMonth() +1;
				day = today.getDate();
				if(month <10){ 
					month = "0"+month;
				}
				if(day<10){
					day = "0"+day;
				}
				now = today.getFullYear() +""+ month +""+ day;
				backordered = false;
				backStr="";
				
				if (typeof currItemBackordered != "undefined" || typeof xCurrItemBackordered != "undefined"){
					if(currItemBackordered == true || xCurrItemBackordered == 'true'){	//currItem is type boolean while xCurrItem is a string
						if(backdate == ''){
							backdate =  0;
						}
						if(backdate<=now){
							backStr = ' <br/><br/><font class="backorder">This item is Backordered</font>';
							backordered = true;
						}else{
							shipStr = backdate.substring(4,6) + "/" + backdate.substring(6,8) + "/" + backdate.substring(2,4)
							backStr = ' <br/><br/><font class="backorder">Expected to ship '+shipStr+'</font>';
							backordered = true;
						}
							
					}
				}
				var colorSeq;
				if (seq == 'none'){
					colorSeq = "01";
				} else if (seq < 10) {
					colorSeq = "0"+seq;
				} else {
					colorSeq = seq;
				}
				colorSeq = colorSeq.substring(0,2);

				if (color == 'none'){
					color = '';
				}
				if ((size == 'none') || (size == 'ONE SIZE')){
					size = '';
				}
				var catentry = (xmlDoc.getElementsByTagName('catentry')[num]).childNodes[0].nodeValue;
				chtml += '<tr><td colspan="2" align="center"><b>THIS ITEM HAS BEEN <br/>ADDED TO YOUR BAG';
				if(backordered == true){
					chtml += backStr;
				}
				
				chtml += '</td></tr><tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
				chtml += '<tr><td colspan="2" bgcolor="#999999"><img src="/anf/images/clear.gif" width="1" height="1"/></td></tr>';
				chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
				chtml += '<tr><td width="68"><img src="/anf/onlinestore/collection/'+col+'_'+colorSeq+'_m.jpg" width="65"/></td><td width="143" valign="top"><b>'+name+'</b><br/>';
				if(color != ''){
					chtml += '<i>'+color+'</i><br/>';
				}
				if(size != ''){
					chtml += size+'<br/>';
				}
				if(q > 1){
					chtml += 'Quantity: '+q;
				}
				chtml += '<div style="margin-top:10px;color:#999999;">'+price+'<div></td></tr>';
				chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
				chtml += '<tr><td colspan="2" bgcolor="#999999"><img src="/anf/images/clear.gif" width="1" height="1"/></td></tr>';
				if(numItems.childNodes[0].nodeValue > 15){
					chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
					chtml += '<tr><td colspan="2" class="fullCart" align="center">You may continue adding items to your bag. However, online customers may purchase a maximum of 15 items, per visit.</td></tr>';
				}
			}else if(type == 'egcadd'){
				var num = (numItems.childNodes[0].nodeValue) - 1;
				var name = (xmlDoc.getElementsByTagName('name')[num]).childNodes[0].nodeValue; 
				var price = (xmlDoc.getElementsByTagName('price')[num]).childNodes[0].nodeValue; 
				if(((xmlDoc.getElementsByTagName('egcreceiver')[num]).childNodes[0].nodeValue != null) & ((xmlDoc.getElementsByTagName('egcreceiver')[num]).childNodes[0].nodeValue != '')){
					var rsd = (xmlDoc.getElementsByTagName('requestedshipdate')[num]).childNodes[0].nodeValue; 
					var receiver = (xmlDoc.getElementsByTagName('egcreceiver')[num]).childNodes[0].nodeValue; 
				}		
				chtml += '<tr><td colspan="2" align="center"><b>THIS ITEM HAS BEEN <br/>ADDED TO YOUR BAG';
				chtml += '</td></tr><tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
				chtml += '<tr><td colspan="2" bgcolor="#999999"><img src="/anf/images/clear.gif" width="1" height="1"/></td></tr>';
				chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
				chtml += '<tr><td width="68"><img src="/anf/onlinestore/collection/EGIFTCARD_01_m.jpg" width="65"/></td><td width="143" valign="top"><b>'+name+'</b><br/>';
				chtml += '<div style="margin-top:10px;color:#999999;">'+price+'<div></td></tr>';
					if(receiver != null && receiver != ''){
						chtml += '<tr><td colspan="2" align="left"><br/>Send On: '+rsd+'</td></tr>';
					}
			}else {
				if(numItems.childNodes[0].nodeValue > 15){
					chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
					chtml += '<tr><td colspan="2" class="fullCart" align="center">You may continue adding items to your bag. However, online customers may purchase a maximum of 15 items, per visit.</td></tr>';
				}
				for (loop = 0; loop < (numItems.childNodes[0].nodeValue); loop++) { 
					var name = (xmlDoc.getElementsByTagName('name')[loop]).childNodes[0].nodeValue; 
					var price = (xmlDoc.getElementsByTagName('price')[loop]).childNodes[0].nodeValue; 
					var color = (xmlDoc.getElementsByTagName('color')[loop]).childNodes[0].nodeValue; 
					var size = (xmlDoc.getElementsByTagName('size')[loop]).childNodes[0].nodeValue; 
					var sku = (xmlDoc.getElementsByTagName('sku')[loop]).childNodes[0].nodeValue; 
					var q = (xmlDoc.getElementsByTagName('qty')[loop]).childNodes[0].nodeValue; 
					var rsd = (xmlDoc.getElementsByTagName('requestedshipdate')[loop]).childNodes[0];  
					
					if (color == 'none'){
						color = '';
					}
					if ((size == 'none') || (size == 'ONE SIZE')){
						size = '';
					} else {
						size = ' - '+size;
					}
					var catentry = (xmlDoc.getElementsByTagName('catentry')[loop]).childNodes[0].nodeValue; 
					if((sku == 99999024) || (sku == 99999014)){
						chtml += '<tr><td width="150"><b>'+name+'</b><br/>'+color+size+'</td><td valign="top" align="right">'+price+'</td></tr>';
					} else if((sku == 88888025) || (sku == 88888050) || (sku == 88888100) || (sku == 88888200)){
						chtml += '<tr><td width="150"><b><a class="orderItem" href="/webapp/wcs/stores/servlet/GiftCardDisplay?storeId='+store.childNodes[0].nodeValue+'&langId='+langid.childNodes[0].nodeValue+'&catalogId='+catalogid.childNodes[0].nodeValue+'&cm_ven=minicart&cm_cat=product&cm_pla='+name+'&cm_ite='+catentry+'">'+name+'</a></b><br/>'
						if(q > 1){
							chtml += 'Quantity: '+q;
						}
						chtml += color+size+'</td><td valign="top" align="right">'+price+'</td></tr>';
						
					}else if((sku == 88889025) || (sku == 88889050) || (sku == 88889075) || (sku == 88889100) || (sku == 88889150) || (sku == 88889200) || (sku == 88889250) || (sku == 88889300) || (sku == 88889350) || (sku == 88889400) || (sku == 88889450) || (sku == 88889500)){
						chtml += '<tr><td width="150"><b><a class="orderItem" href="/webapp/wcs/stores/servlet/EGCDisplay?storeId='+store.childNodes[0].nodeValue+'&langId='+langid.childNodes[0].nodeValue+'&catalogId='+catalogid.childNodes[0].nodeValue+'">'+name+'</a></b><br/>'+rsd.nodeValue+'<br/>';
						chtml += '</td><td valign="top" align="right">'+price+'</td></tr>';

					}else{
						chtml += '<tr><td width="150"><b><a class="orderItem" href="/webapp/wcs/stores/servlet/ProductDisplay?storeId='+store.childNodes[0].nodeValue+'&langId='+langid.childNodes[0].nodeValue+'&catalogId='+catalogid.childNodes[0].nodeValue+'&productId='+catentry+'&colorString='+color+'&cm_ven=minicart&cm_cat=product&cm_pla='+name+'&cm_ite='+catentry+'">'+name+'</a></b><br/>'+color+size+'</td><td valign="top" align="right">'+price+'</td></tr>';
					}
					chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="13"/></td></tr>';
				}
			
				chtml += '<tr><td colspan="2" bgcolor="#999999"><img src="/anf/images/clear.gif" width="1" height="1"/></td></tr>';
				chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="15"/></td></tr>';
				chtml += '<tr><td align="right" colspan="2"><b>Subtotal</b><span style="margin-left:10px;">'+total.childNodes[0].nodeValue+'</span></b></td></tr>';
			}
			chtml += '<tr><td colspan="2"><img src="/anf/images/clear.gif" width="1" height="10"/></td></tr>';
			chtml += '<tr><td valign="middle"></td><td align="right"><a href="/webapp/wcs/stores/servlet/OrderItemDisplay?langId=-1&storeId=' + globalStoreId + '&catalogId=' + globalCatalogId + '&orderId=.&cm_ven=minicart&cm_cat=checkout&cm_pla=checkout&cm_ite=checkout"><img src="/anf/onlinestore/common/btn_viewbag_on.gif" alt="Checkout"/></a></td></tr>';
			
			chtml += "</table>"
			
			setContent('cartlist',chtml)
			
			showCart();
			if(type == 'add' || type =='egcadd'){
				setTimeout("hideAdd()", 5000);
				var cartCookie = readCookie('myCart');
				var shipMode = '';

				var prods = qItems.childNodes[0].nodeValue - numGifts.childNodes[0].nodeValue
				var cartCookie = prods + ',' + total.childNodes[0].nodeValue;
				cartCookie = cartCookie.replace(/&nbsp;/g,' ');
				cartCookie = cartCookie.replace(/&pound;/g,'\u00A3');
				createCookie('myCart',cartCookie,''); 
				setCartNum(cartCookie);
			}
		}
	}
}

function encodeCharEntities(s){
	if(!s){ return false; }
	var LT = new RegExp("<", "g"), GT = new RegExp(">", "g"), AMP = new RegExp("&", "g"), TAB = new RegExp("\t", "g");  
	return s.replace(AMP,"&amp;").replace(LT, "&lt;").replace(GT, "&gt;").replace(TAB, "    ");  
}

function hideAdd(){
	if (addItem){
		ypSlideOutMenu.hideMenu('cart');
		addItem = false;
	}
}

function hideCart(){
	addItem = false;
	ypSlideOutMenu.hideMenu('cart');
	
}

function showCart(){
	ypSlideOutMenu.showMenu('cart');
	changeObjectProperty('cartCrumbs', 'backgroundColor', '#B1B1B1');
	var ua = navigator.userAgent.toLowerCase();
	if ((ua.indexOf("msie") != -1) && (parseFloat(navigator.appVersion.split("MSIE")[1]) < 7) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)){
		changeObjectProperty('size','visibility','hidden');
		changeObjectProperty('sizelist','visibility','hidden');
	}
}

function setContent(id,content){
	if (document.all){
		document.all[id].innerHTML = content;
	} else if (document.layers){
		document.layers[id].innerHTML = content;
	} else if (document.getElementById){
		document.getElementById(id).innerHTML = content;
	}
}

function limitChars(fe, num){
		fe.value = fe.value.slice(0, num);
}

function selectOption(s,m){
	if(!s){ return; }
	for (var i=0; i<s.length; i++){
		if (s.options[i].value == m){
			s.options[i].selected = true;
			break;
		}
	}
}

function IsEmailValid(eml){    
    var test = eml;
    var lAt = test.indexOf("@")
    var lDot = test.lastIndexOf(".")
    //Checks over 5: x@x.x
    if ( test.length <5 || lAt <= 0 || lAt >= lDot - 1 || lDot >= test.length) {                
        return false;
    }else{
    	if(filter(test)){
    		return true;
        }else{
        	return false;
        }
    }
}
function filter(address){		
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(address);
}

function ajaxCall(url, params, cb, m, rt, as) {
	this.url = url
	this.parameters = params
	this.callback = cb
	this.method = m ? m : 'get'
	this.responseType = rt ? rt : 'text/xml'
	this.async = as ? as : true
	this.response = null
}

ajaxCall.prototype.parseForm = function(form){
	var formObj = null;
	if(typeof(form) == 'string'){
		if(document.forms[form]) formObj = document.forms[form]
		else if(document.getElementById(form)) formObj = document.getElementById(form)
	}else if (typeof(form) == 'object') formObj = form

	if(!formObj) return
}

ajaxCall.prototype.makeRequest = function(){
	var urlString = this.url;
	if(this.parameters){
		urlString += '?'
		for(p in this.parameters) urlString += p + '=' + this.parameters[p] + '&';
	}
	if (window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) 
			http_request.overrideMimeType(this.responseType);
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) return false;
	var ajaxObj = this;
	http_request.onreadystatechange = function() {ajaxObj.getContents(http_request)};
	http_request.open(this.method, urlString, this.async);
	http_request.send('');
}

ajaxCall.prototype.getContents = function(http_request){
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
        	this.response = http_request.responseText;
        	this.callback(http_request)       	
        } else {
        }
    } else {
    }
}


function addEvent(elm, evType, fn, useCapture){
//x-browser event handling function written by Scott Andrew
	if(elm.addEventListener){
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}else if(elm.attachEvent){
			var r = elm.attachEvent('on' + evType, fn);
			//EventCache.add(elm, evType, fn);
			return r;
	}else{
			elm['on' + evType] = fn;
	}
}

function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

function getIEVersion()
{
  var rv = -1; // Return value assumes failure
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

var contactUsType = null
function contactUsLink(p){
	if(p) contactUsType = p
	var params = {
			"storeId" : globalStoreId,
			"catalogId" : globalCatalogId,
			"langId" : -1,
			"type" : p ? p : 'def'
	}
	var cu = new ajaxCall('/anf/lifestyles/html/contactus.html', params, contactUsCB, null, 'text/plain', null);
	cu.makeRequest();
}

function contactUsCB(http_request){
	getFadeUpDiv('cu', http_request.responseText);
	contactForm.init(contactUsType);
}

function contactUsSubmit(){
	if(!IsEmailValid(document.forms.ContactUsForm.fromEmail.value)){
		document.getElementById('cuError').style.color = '#681414';
		document.getElementById('cuError').innerHTML = 'Please enter a valid e-mail address';
	}else if(document.forms.ContactUsForm.bodyEmail.value.length > 250){
		document.getElementById('cuError').style.color = '#681414';
		document.getElementById('cuError').innerHTML = 'Please limit comments to 250 characters';
	}else if((document.forms.ContactUsForm.bodyEmail.value.trim()).length == 0){
		document.getElementById('cuError').style.color = '#681414';
		document.getElementById('cuError').innerHTML = 'Please provide a comment';
	}else{
		document.getElementById('cuError').innerHTML = '&nbsp;'
		document.getElementById('cuError').visibility = 'hidden'
		params = {
			'storeId' : globalStoreId,
			'subjectEmail' : document.forms.ContactUsForm.subjectEmail.value.replace(/&/g, '%26'),
			'subSubjectEmail' : document.forms.ContactUsForm.subSubjectEmail.value.replace(/&/g, '%26'),
			'ordNum' : document.forms.ContactUsForm.ordNum.value,
			'GCNum' : document.forms.ContactUsForm.GCNum.value,
			'fromName' : document.forms.ContactUsForm.fromName.value,
			'fromEmail' : document.forms.ContactUsForm.fromEmail.value,
			'bodyEmail' : encodeURIComponent(document.forms.ContactUsForm.bodyEmail.value)
		}
		var cuSub = new ajaxCall('/webapp/wcs/stores/servlet/ContactUsForm', params, cuSubCB, 'post', null, null);
		cmCreatePageviewTag("CONTACT US FADE UP","13000");
		cuSub.makeRequest();
	}
}

function cuSubCB(http_request){
	document.forms.ContactUsForm.style.visibility = 'hidden';
	document.getElementById('response').innerHTML = 'Thanks! We got it!';
}

contactForm = {
	questionType: '',
	init: function(type){
		contactForm.questionType = type;
		contactForm.initCategoryArray();
		contactForm.populate();
		var catSelect = document.forms.ContactUsForm.subjectEmail;
		var subSelect = document.forms.ContactUsForm.subSubjectEmail;
		addEvent(catSelect, 'change', contactForm.getSelected);
		addEvent(subSelect, 'change', contactForm.populateFields);
	},
	categoryArray:[],
	category: function(text, value, subcats){
		this.optText = text;
		this.optValue = value;
		this.optSubCats = contactForm.getSubCats(subcats);
	},
	subCategory: function (text, value){
		this.optText = text;
		this.optValue = value;
	},
	initCategoryArray: function(){
		contactForm.categoryArray[0] = new contactForm.category('Select One','Select One','');
		contactForm.categoryArray[1] = new contactForm.category('General Questions','General','general');
		contactForm.categoryArray[2] = new contactForm.category('A&F Stores','A&F Stores','stores');
		contactForm.categoryArray[3] = new contactForm.category('Online Orders','abercrombie.com','site');
		contactForm.categoryArray[4] = new contactForm.category('A&F Merchandise','A&F Merchandise','merchandise');
		contactForm.categoryArray[5] = new contactForm.category('Technical','Technical','');
	},
	getSubCats: function(category){
		var subCats = new Array();
		if(category == 'general'){
			subCats[0] = new contactForm.subCategory('A&F Credit Card','A&F Credit Card');			
			subCats[1] = new contactForm.subCategory('Your Store Experience','Store Experience');
			subCats[2] = new contactForm.subCategory('Your Online Experience','Online Experience');
			subCats[3] = new contactForm.subCategory('Modeling','Modeling');
			subCats[4] = new contactForm.subCategory('Investor Relations','Investor Relations');
			subCats[5] = new contactForm.subCategory('Careers','Careers');
			subCats[6] = new contactForm.subCategory('General','General');
		} else if(category == 'stores'){
			subCats[0] = new contactForm.subCategory('Locations/New Stores','Locations/New Stores');
			subCats[1] = new contactForm.subCategory('Your Store Experience','Store Experience');
			subCats[2] = new contactForm.subCategory('Careers','Careers');
			subCats[3] = new contactForm.subCategory('A&F Gift Card','A&F Gift Card');
			subCats[4] = new contactForm.subCategory('Billing Inquiry','Billing Inquiry');
			subCats[5] = new contactForm.subCategory('Returns/Exchanges','Returns/Exchanges');
		} else if(category == 'site'){
			subCats[0] = new contactForm.subCategory('Order Status','Order Status');
			subCats[1] = new contactForm.subCategory('Returns/Exchanges','Returns/Exchanges');
			subCats[2] = new contactForm.subCategory('Billing Inquiry','Billing Inquiry');
			subCats[3] = new contactForm.subCategory('Backorder','Backorder');
			subCats[4] = new contactForm.subCategory('A&F Gift Card','A&F Gift Card');
			subCats[5] = new contactForm.subCategory('Your Online Experience','Your Online Experience');
		} else if (category == 'merchandise') {
			subCats[0] = new contactForm.subCategory('Product Questions','Product Questions');
			subCats[1] = new contactForm.subCategory('Sizing','Sizing');
			subCats[2] = new contactForm.subCategory('A&F Quality','A&F Quality');
		}
		return subCats;
	},
	populate: function(){
		document.forms.ContactUsForm.storeId.value = globalStoreId;
		for (i=0; i < contactForm.categoryArray.length; i++) {
			document.forms.ContactUsForm.subjectEmail[i] = new Option(contactForm.categoryArray[i].optText, contactForm.categoryArray[i].optText);
		}//close cat loop
		if(contactForm.questionType == 'technical'){
			document.forms.ContactUsForm.subjectEmail.selectedIndex = 5;
		}else if (contactForm.questionType == 'product'){
			document.forms.ContactUsForm.subjectEmail.selectedIndex = 4;
		}else if (contactForm.questionType == 'general'){
			document.forms.ContactUsForm.subjectEmail.selectedIndex = 1;
		}else{
			document.forms.ContactUsForm.subjectEmail.selectedIndex = 0;
		}
		contactForm.populateSub(document.forms.ContactUsForm.subjectEmail.selectedIndex);
	},
	populateSub: function(selected){
		document.forms.ContactUsForm.subSubjectEmail.length = 0;
		if (contactForm.categoryArray[selected].optSubCats.length > 0){
			for(i = 0; i < contactForm.categoryArray[selected].optSubCats.length; i++){
				document.forms.ContactUsForm.subSubjectEmail.options[i] = new Option(contactForm.categoryArray[selected].optSubCats[i].optText, contactForm.categoryArray[selected].optSubCats[i].optValue);
			}
			document.getElementById('subCatSpan').style.display = 'inline';
			document.getElementById('fadeUpHolder').style.height = '450px';
			} else {
			document.getElementById('subCatSpan').style.display = 'none';
		}
		contactForm.populateFields()
	},
	getSelected: function(e){
		var select = window.event ? window.event.srcElement : e ? e.target : null;
		if(!select)return;
		if(document.forms.ContactUsForm.subjectEmail.selectedIndex == 3){
			document.getElementById('ordNumSpan').style.display = 'inline';
			document.getElementById('fadeUpHolder').style.height = '460px';
		}else{
			document.getElementById('ordNumSpan').style.display = 'none';
		}
		contactForm.populateSub(select.selectedIndex);
	},
	
	populateFields: function(){
		if(((document.forms.ContactUsForm.subjectEmail.selectedIndex == 3 && document.forms.ContactUsForm.subSubjectEmail.selectedIndex == 4) || (document.forms.ContactUsForm.subjectEmail.selectedIndex == 2 && document.forms.ContactUsForm.subSubjectEmail.selectedIndex == 3))){
			document.getElementById('GCNumSpan').style.display = 'inline';
			document.getElementById('fadeUpHolder').style.height = '495px';
		}else{
			document.getElementById('GCNumSpan').style.display = 'none';
		}
	}
}

function joinEmailLink(){
	var params = {
			"storeId" : globalStoreId,
			"catalogId" : globalCatalogId,
			"langId" : -1
	}
	var ml = new ajaxCall('/anf/lifestyles/html/mailingList.html', params, joinEmailCB, null, 'text/plain', null);
	ml.makeRequest()
}

function joinEmailCB(httpRequest){
	getFadeUpDiv('je', http_request.responseText);
	if(nvp_get('email') != 'noval') document.forms.MailingList.email.value = nvp_get('email')
}

function goToKids(){
	var html = '<div id="fadeCtn"><div id="fadeUpBorder">'
	html +=	'		<div id="fadeUpDiv" style="margin:0; padding:0;">'
	html +=	'			<a href="javascript:closeFadeUp();" id="fadeClose"><img src="/anf/lifestyles/art/close_popup.gif" /></a>'
	if(readCookie('myStore') == '11306'){
		html += '			<img src="/anf/lifestyles/art/kidsprompt_ca.gif" id="kidsPromptImg" usemap="#gtkMap" />'
	}else{
		html += '			<img src="/anf/lifestyles/art/kidsprompt.gif" id="kidsPromptImg" usemap="#gtkMap" />'
	}
	html += '			<map name="gtkMap"><area shape="rect" coords="46,155,224,176" href="javascript:closeFadeUp(); MM_openBrWindow(\'http://www.abercrombiekids.com/kids/index.html?cm_ven=redirect&cm_cat=topnav&cm_pla=kids&cm_ite=kids_site\',\'\',\'\')"/></map>'
	html += '		</div>'
	html += '	</div></div>'
	getFadeUpDiv('gtk', html);
}


function validateMlInput(page){
	var cbFn = mlSubmitCB
	var responseDiv = 'response'
	var f = document.forms.MailingList
	if(page == 'home'){
		cbFn = mlHomeSubmitCB
		responseDiv = 'responseHome'
		f = document.forms.MailingListHome 
	}
	var emailValue = f.email.value
	if (!IsEmailValid(emailValue)){
		document.getElementById(responseDiv).innerHTML = "<b>Please enter a valid e-mail address</b>";
		if (page == 'fadeUp') document.getElementById(responseDiv).style.color = '#681414';
	}else {
		var params = {
			'aid' : f.aid.value,
			'sub' : f.sub.value,
			'unsub' : f.unsub.value,
			'resub' : f.resub.value,
			'a' : f.a.value,
			'storeId' : f.storeId.value,
			'catalogId' : f.catalogId.value,
			'languageId' : f.languageId.value,
			'URL' : f.URL.value,
			'email' : f.email.value
		}
		var mlSubmit = new ajaxCall('/webapp/wcs/stores/servlet/MailSubscription', params, cbFn, 'post', null, null);
		mlSubmit.makeRequest();
	}
}

function mlHomeSubmitCB(http_request){
	var xml = http_request.responseXML;
	var status = xml.getElementsByTagName('mail_status')[0].firstChild.nodeValue;
	var msg = xml.getElementsByTagName('response')[0].firstChild.nodeValue;
	document.getElementById('responseHome').innerHTML = msg;
	document.forms.MailingListHome.email.value = '';
}

function mlSubmitCB(http_request){
	var xml = http_request.responseXML;
	var status = xml.getElementsByTagName('mail_status')[0].firstChild.nodeValue;
	var msg = xml.getElementsByTagName('response')[0].firstChild.nodeValue;
	document.getElementById('response').style.color = '#681414';
	document.getElementById('response').innerHTML = msg;
	document.getElementById('fadeUpHolder').style.height = '199px';
	document.forms.MailingList.email.value = '';
}

var rmvdOs = new Array();
function getFadeUpDiv(l, content){
	if(!content) return;
	var fadeUpHolder = document.createElement('div')
	fadeUpHolder.id = 'fadeUpHolder'
	fadeUpHolder.style.display = 'none'
	fadeUpHolder.style.width = '279px';
	if(getIEVersion() > -1){
		fadeUpHolder.style.height = l == 'cu' ? '379px' : l == 'je' ? '174px' : l == 'eaf' ? '278px' : l == 'gtk' ? '208px' : '209px' ;
	}
	fadeUpHolder.innerHTML = content
	document.getElementsByTagName('body')[0].appendChild(fadeUpHolder)
	var editMode = document.getElementById('editMode') ? document.getElementById('editMode') : null
	if(!editMode){
		var editMode = document.createElement('div')
		editMode.id = 'editMode'
		editMode.style.display = 'none'
		document.getElementsByTagName('body')[0].appendChild(editMode);
	}
	var isMac = navigator.userAgent.toLowerCase().indexOf('mac') > -1 ? true : false
	var objectEmbed = (document.getElementsByTagName('object').length > 0 || document.getElementsByTagName('embed').length > 0) ? true : false
	if(isMac && objectEmbed){
		var oes = document.getElementsByTagName('object').length == 0 && document.getElementsByTagName('embed').length > 0 ? document.getElementsByTagName('embed') : document.getElementsByTagName('object');
		for(i = 0; i < oes.length; i++){
			rmvdOs[i] = {'parent' : oes[i].parentNode, 'child' : oes[i]} 
			oes[i].parentNode.removeChild(oes[i])
		}
	}
	fadeThisDiv('fadeUpHolder');
}



function getFadeUpSCDiv(l, content){
	if(!content) return;
	var fadeUpHolder = document.createElement('div')
	fadeUpHolder.id = 'fadeUpHolder'
	fadeUpHolder.style.display = 'none'
	fadeUpHolder.style.width = '442px';
	fadeUpHolder.innerHTML = content
	if(getIEVersion() > -1){
		fadeUpHolder.style.height = l == 'cu' ? '377px' : l == 'eaf' ? '287px' : '174px';
	}
	document.getElementsByTagName('body')[0].appendChild(fadeUpHolder)
	var editMode = document.getElementById('editMode') ? document.getElementById('editMode') : null
	if(!editMode){
		var editMode = document.createElement('div')
		editMode.id = 'editMode'
		editMode.style.display = 'none'
		document.getElementsByTagName('body')[0].appendChild(editMode);
	}
	var isMac = navigator.userAgent.toLowerCase().indexOf('mac') > -1 ? true : false
	var objectEmbed = (document.getElementsByTagName('object').length > 0 || document.getElementsByTagName('embed').length > 0) ? true : false
	if(isMac && objectEmbed){
		var oes = document.getElementsByTagName('object').length == 0 && document.getElementsByTagName('embed').length > 0 ? document.getElementsByTagName('embed') : document.getElementsByTagName('object');
		for(i = 0; i < oes.length; i++){
			rmvdOs[i] = {'parent' : oes[i].parentNode, 'child' : oes[i]} 
			oes[i].parentNode.removeChild(oes[i])
		}
	}
	fadeThisDiv('fadeUpHolder');
}






function closeFadeUp(){
	fadeThisDiv('fadeUpHolder')
	changeObjectVisibility('size','visible')
	changeObjectVisibility('sizelist','visible')
	setTimeout("document.getElementsByTagName('body')[0].removeChild(document.getElementById('fadeUpHolder'))", 500)
	if(rmvdOs.length > 0){
		for(i = 0; i < rmvdOs.length; i++)rmvdOs[i].parent.appendChild(rmvdOs[i].child);
	}
}

var myEffects = {
  fade: function(elid) {
	var opacs = ["0",".1",".2",".3",".4",".5",".6",".7",".8",".9","1"];
	var opacs2 = ["0",".1",".2",".3",".4",".5",".6"];
	if (document.getElementById(elid).style.display == 'none'){
		if(elid == 'editMode'){
			document.getElementById(elid).style.opacity = '0';
			document.getElementById(elid).style.filter = 'alpha(opacity=0)';
			document.getElementById(elid).style.display = 'block';
			for (var i = 0; i < 7; i++){
				setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs2[i]+'";', i * 40);
				setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs2[i] * 100)+')";', i * 40);
			}
		} else {
			document.getElementById(elid).style.opacity = '0';
			document.getElementById(elid).style.filter = 'alpha(opacity=0)';
			document.getElementById(elid).style.display = 'block';
			for (var i = 0; i < 11; i++){
				setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40);
				setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs[i] * 100)+')";', i * 40);
			}
		}
	}else{
		if(elid == 'editMode'){
			opacs2.reverse();
			for (var i = 0; i < 7; i++) {
		    	setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs2[i]+'";', i * 40);
		    	setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs2[i] * 100)+')";', i * 40);
			}
			setTimeout('document.getElementById(\''+elid+'\').style.display = "none";', i * 40);
		} else{
			opacs.reverse();
			for (var i = 0; i < 11; i++) {
		    	setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 40);
		    	setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs[i] * 100)+')";', i * 40);
			}
			setTimeout('document.getElementById(\''+elid+'\').style.display = "none";', i * 40);
		}
	}
   }
}

function fadeThisDiv(divname){
	var floatThisDiv = false;
	if ($(divname).style.display == 'none'){
		var height1 = document.body.offsetHeight;
		var height2 = document.documentElement.clientHeight;
		if(height1 > height2){
			var nHeight = height1+"px";
		}else{
			var nHeight = height2+"px";
		}
		
		var ctnTop = 175;
		var nLeft = $('wrapper').offsetLeft+"px";
		var nLeft2 = (document.getElementById('headerCtn').offsetLeft + 250)+"px";
		var nWidth = $('wrapper').offsetWidth+"px";
		var nTop = ctnTop + "px";
		var divObj = $(divname);
		var wrapObj = $('wrapper');
		
		changeObjectProperty('editMode', 'left', nLeft);
		changeObjectProperty('editMode', 'height', nHeight);
		changeObjectProperty('editMode', 'width', nWidth);
		changeObjectProperty(divname, 'left', nLeft2);
		changeObjectProperty(divname, 'top', nTop);
		
		if (divObj.childNodes[0].id != 'cover' && divname != "splashMovie") {
			var ieMat=document.createElement('iframe');
			ieMat.src="/anf/onlinestore/html/blank.html";
			ieMat.scrolling="no";
			ieMat.frameBorder="0";
			ieMat.id="cover";
			ieMat.style.background = 'none';
			ieMat.style.width=getStyleObject(divname).width;
			ieMat.style.height=getStyleObject(divname).height;
			ieMat.style.zIndex="-1";
			divObj.insertBefore(ieMat, divObj.childNodes[0]);
		}
		floatThisDiv = true;
		cmCreatePageviewTag("FADE UP: "+divname,"13000");
	}
	if(divname != "splashMovie"){
		myEffects.fade('editMode');
	}
	myEffects.fade(divname);
	
	if (floatThisDiv && divname != "splashMovie"){
		JSFX_FloatTopDiv(divname);
	}
}

function getCookieVal(offset) {
     var endstr = document.cookie.indexOf (";", offset);
     if (endstr == -1)
         endstr = document.cookie.length;
     return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
     var j = i + alen;
     if (document.cookie.substring(i, j) == arg)
       return getCookieVal (j);
     i = document.cookie.indexOf(" ", i) + 1;
     if (i == 0) break;
   }
   return null;
}

function DeleteCookie(name,path,domain) {
   if (GetCookie(name)) {
  	 document.cookie = name + '=' +
       ((path) ? '; path=' + path : '') +
       ((domain) ? '; domain=' + domain : '') +
       '; expires=Thu, 01-Jan-70 00:00:01 GMT';
   }
}

function acctLogoff(){
	DeleteCookie('afstatus','/', + serverHostname);
	window.location = '/webapp/wcs/stores/servlet/Logoff?storeId=' + globalStoreId + '&langId=-1&URL=/anf/lifestyles/html/homepage.html';
}

var verticalpos="fromtop"

function JSFX_FloatTopDiv(thediv)
{
	var startX = document.getElementById('wrapper').offsetLeft + 125;
	startY = 130;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){
			this.style.top=y + "px";;
		};
		el.x = document.getElementById('wrapper').offsetLeft + 125;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : document.documentElement.scrollTop + document.documentElement.clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function()
	{
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : document.documentElement.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight : document.documentElement.scrollTop + document.documentElement.clientHeight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml(thediv);
	stayTopLeft();
}

