// JavaScript Document

function brs_add_window(url) {
	h = 130;
	w = 250;
	window.open('http://' + location.hostname + '/'+url, 'brs_add_window', 'height='+h+',width='+w+',toolbar=1,scrollbars=1,resizable=1,location=1');
	return false;
}
	
function brs_product_photo(productid) {
	h = 550;
	w = 420;
	window.open('http://' + location.hostname + '/productphoto/'+ productid, 'brs_product_photo', 'height='+h+',width='+w+',toolbar=1,scrollbars=1,resizable=1,location=1');
	return false;
}
	
function brs_add_window2(url) {
	h = 130;
	w = 250;
	if (document.addform.colour.options[document.addform.colour.selectedIndex].value == 0) {
		alert('You must select both a size and colour.');
		return false;
	} else if (document.addform.size.options[document.addform.size.selectedIndex].value == 0) {
		alert('You must select both a size and colour.');
		return false;
	} else {
		window.open('http://' + location.hostname + '/' + url + '/' + document.addform.colour.options[document.addform.colour.selectedIndex].value + '/' + document.addform.size.options[document.addform.size.selectedIndex].value, 'brs_add_window', 'height='+h+',width='+w+',toolbar=1,scrollbars=1,resizable=1,location=1');
	}
	return false;
}
	
function close_and_go(page) {
	if (navigator.userAgent.indexOf("Opera")==-1) {
		window.opener.document.location.href = page;
	} else {
		opener.document.location.href = page;
	}
	window.close();
}
	
function checkAll(cName) {
	for (i=0,n=document.wishlist.elements.length;i<n;i++)
	if (document.wishlist.elements[i].className.indexOf(cName) !=-1)
	if (document.wishlist.elements[i].checked == true) {
		document.wishlist.elements[i].checked = false;
	} else {
		document.wishlist.elements[i].checked = true;
	}
}