    
function product(attr1Label,attr1Value,attr2Label,attr2Value,listPrice,salePrice,attributeText,isSubsription){
	this.attr1Label = attr1Label;
	this.attr1Value = attr1Value;
	this.attr2Label = attr2Label;
	this.attr2Value = attr2Value;
	this.listPrice = listPrice;
	this.salePrice = salePrice;
	this.attributeText = attributeText;
	this.isSubscription = isSubscription;
    this.printProduct = printProduct;
	
	
	
}

function printProduct(){
  var str = '';
  str += this.attr1Label+': '+this.attr1Value+', '+this.attr2Label+': '+this.attr2Value;
  return str;

}




// if a<b return -1, if a>b return 1, else return 0
function productSort(a,b){
	
	var result;
	if(a.attr2Value != null){
	
		result = naturalSort(a.attr2Value,b.attr2Value);
		if(result != 0){
			return result;
		}
		
	}

	
	return naturalSort(a.attr1Value,b.attr1Value);
	
}

/*
 * Natural Sort algorithm for Javascript
 *  Version 0.2
 * Author: Jim Palmer (based on chunking idea from Dave Koelle)
 * Released under MIT license.
 */
function naturalSort (a, b) {
    // setup temp-scope variables for comparison evauluation
    var x = a.toString().toLowerCase() || '', y = b.toString().toLowerCase() || '',
        nC = String.fromCharCode(0),
        xN = x.replace(/([-]{0,1}[0-9.]{1,})/g, nC + '$1' + nC).split(nC),
        yN = y.replace(/([-]{0,1}[0-9.]{1,})/g, nC + '$1' + nC).split(nC),
        xD = (new Date(x)).getTime(), yD = (new Date(y)).getTime();
    // natural sorting of dates
    if ( xD && yD && xD < yD )
        return -1;
    else if ( xD && yD && xD > yD )
        return 1;
    // natural sorting through split numeric strings and default strings
    for ( var cLoc=0, numS = Math.max( xN.length, yN.length ); cLoc < numS; cLoc++ )
        if ( ( parseFloat( xN[cLoc] ) || xN[cLoc] ) < ( parseFloat( yN[cLoc] ) || yN[cLoc] ) )
            return -1;
        else if ( ( parseFloat( xN[cLoc] ) || xN[cLoc] ) > ( parseFloat( yN[cLoc] ) || yN[cLoc] ) )
            return 1;
    return 0;
}