/* 
	This JS adds to the URL the checkbox selection
	used for product comparison.
	The call to the function must be added to paging links,
	in order to update the clipboard.
	It is used in Category Paging and in ProductTypePaging
		
*/

function addSelectionCheckBoxToURL(link) {
	myform = document.getElementById('compare');
	for (i = 0 ; i< myform.elements.length; i++) {
		if (myform.elements[i].name == 'ProductRefID') {
			if (myform.elements[i].checked) {
			    if (link.href.indexOf('?') == -1) {
			    	link.href = link.href + '?';
			    } else {
			    	link.href = link.href + '&';
			    }
				link.href = link.href + 'ProductRefID=' + myform.elements[i].value;
			}
		}
	}  	
}  