<!--
//prepend all Image sources with this globalization variable Q.03.13.06
var ImageServerVar='';
//alert(testing);
window.top.name="preview";

function CatchEmptySearch() {
	var search = document.AEsearchForm.query.value;
	var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.% ";
	var temp = "";
	var invalidflag = 0;
	if (search == "") {
		alert('Please enter your search criteria\nthen click the GO button.');
		document.AEsearchForm.query.focus();
		return false;
	}
	else if (search.substring(0,1) == " ") {
		alert('Please remove any leading spaces\nfrom your search criteria and try again.');
		document.AEsearchForm.query.focus();
		return false;
	}
	else if (search == "-" || search == "%" || search == ".") {
		alert('Your search criteria is too general.\nPlease add to it and try again.');
		document.AEsearchForm.query.focus();
		return false;
	}
	else {
		for (var i=0; i < search.length; i++) {
			temp="" + search.substring(i,i+1);
			if (valid.indexOf(temp)=="-1") {
				invalidflag = 1;
				break;
			}
		}
		if (invalidflag==1) {
			alert("Your search criteria contains an invalid character(s).\nValid characters are numbers(0-9), letters(a-z), spaces, \".\", \"-\", and \"%\".\nPlease remove any invalid characters and try again.");
			document.AEsearchForm.query.focus();
			return false;
		}
		else {
			return true;
		}
	}
}

function ShowSizeChart(chart){
	var LeftPosition = (screen.width) ? (screen.width-602)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-580)/2 : 0;
	var page = 'http://www.ae.com/'+jsContextRoot+'/browse/sizechart/'+chart+'.jsp';
	var popup = window.open(page,"sizechart",'toolbar=0,top='+TopPosition+',left='+LeftPosition+',location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=602,height=580');
	popup.focus();
}

//Configurable Function for Popups
function ConfigurablePopup(url,w,h,winName,scroll,resiz,topPos,leftPos)
{
var popup = window.open(url,winName,'toolbar=0,top='+topPos+',left='+leftPos+',width='+w+',height='+h+',location=0,directories=0,status=0,menubar=0,scrollbars='+scroll+',resizable='+resiz);
popup.location=url;
popup.opener=self;
popup.focus();
}

//Generic Function for Popups
function popup(url,w,h)
{
var width = w;
var height = h;
var LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
var TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
var popupURL = url;
var popup = window.open(popupURL,"AEO",'toolbar=0,top='+TopPosition+',left='+LeftPosition+',width='+width+',height='+height+',location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
popup.location=popupURL;
popup.opener=self;
popup.focus();
}

/*******************************************************************************************
 * Function	: sitewide background images set to and from cookie
 * This function loads the page backgrounds, styles, and images via javascript cookie called styleCookie
 *******************************************************************************************/
function styleSet(sName, sValue){
	var sCookie = sName + "=" +encodeURIComponent(sValue)+ ";path=/"
	document.cookie=sCookie;
	}
	
function getCookie(sName){
	var sRE = "(?:;)?" +sName + "=([^;]*);?";
	var oRE = new RegExp(sRE)
		if(oRE.test(document.cookie)){
		return decodeURIComponent(RegExp["$1"]);
		}
	}		
function getColor(){

	var sName= getCookie('styleCookie');

		if (sName=="blue"){

			document.body.className="blue";

		} else if (sName=="silver"){

			document.body.className="silver";

		} else if (sName=="green"){

			document.body.className="green";

		} else {

			document.body.className="red";

		}

	}


window.onload=function(){
getColor();
}
//-->
