var sizelist=" ,Youth,Youth Extra Small,Youth Small,Youth Medium,Youth Large,Youth Extra Large,Youth Extra Extra Large,XXXS,XXX-Small,XXS,XX-Small,Extra Small,XS,X-Small,Women's Extra Small,S,Small,Women's Small,M,Medium,Women's Medium,L,Large,Women's Large,XL,Women's Extra Large,X-Large,Extra Large,Extra Extra Large,Women's Extra Extra Large,XXL,XX-Large,Extra Extra Extra Large,XXXL,XXX-Large,XXXXL,8,10-12,14-16,18-20,Adult, ";

function double_sort(a1,b1,a2,b2){
	var intval = 1; //intval is the value to be returned.  It starts at 1 and is only changed if a is NOT greater than b.
	var regexp = /[0-9]/;
	//If a1 equals b1 then look at a2 & b2.  Otherwise look at a1&b1.
	if(a1==b1){
		//a1=b1, so look at a2<>b2
		//SECOND TERM SORT:
		// jat - if there are numbers in the sort attribute, use float-sort or else use the string sorting guide
		if(regexp.test(a2) || regexp.test(b2)){
			intval=float_sort(a2,b2);
		}else{
			intval=	string_sort(a2,b2);
		}
	}else{
		//a1&b1 are different, if b1>a1 then make intval=-1.
		//FIRST TERM SORT:3
		// jat - if there are numbers in the sort attribute, use float-sort or else use the sizechart sorting guide
		if(regexp.test(a1) || regexp.test(b1)){
			intval=float_sort(a1,b1);
		}else{
			intval=sizechart_sort(a1,b1);
		}
	}
	return intval;
}

function UUSort(a,b){return double_sort(a.attr_value1,b.attr_value1,a.attr_value2,b.attr_value2);}
