// BrowserAccessiblyEntityList configuration
var DefaultStorageConfig = {"type" : "cookieToSessionFallback", "urlPrefix" : "/proflo/", "expires" : 365, "formatType" : "dot_delimited"};
var GlobalStorageManager = new js.topcoder.web.entitylist.client.StorageManager(document.cookie, DefaultStorageConfig);

CustomerProductList = GlobalStorageManager.loadList("CustomerProductList");
CustomerCompareList = GlobalStorageManager.loadList("CustomerCompareList");

$(document).ready(function(){
	$('.quickcompare').quicklook({modalWidth:'250px',modalHeight:'240px', dataType:'inline', draggable:false, resizable:false, source:'#quickcompare-window', modalClass:'quickcompare-style', onbeforeload: synchQuickCompare});
	$('.email_page').quicklook({modalWidth:'400px',modalHeight:'475px', dataType:'inline', draggable:true, resizable:false, source:'#email_page_window', modalClass:'quickcompare-style'});
	$('.product-preview').quicklook({dataType:'html'});
	$('#product_info .product_image a').quicklook({modalWidth:'400px',modalHeight:'400px', dataType:'image', draggable:true, resizable:false});
	$('.product_image_inner a').quicklook({modalWidth:'400px',modalHeight:'400px', dataType:'image', draggable:true, resizable:false});
	$('#wrapper').click(
		function(event) {
			$('div.quicklook').remove();
			$('div.quickcompare-style').remove();
		}
	);
	$('p.product_compare input[@type=checkbox]').each(
		function() {
			if (CustomerCompareList.getItem(this.value)) {
				this.checked = true;
			}
		}
	);
	$('p.product_compare input[@type=checkbox]').click(
		function() {
			if (this.checked) {
				canAddToCompareList(this);
			}
		}
	);
});
