function formFocus(theForm, theCurrent, theDesired) {
	if (theForm.value == theCurrent) {
		theForm.value = theDesired;
	}
}

function runShow(j) {
	Effect.Fade(theSlides[i], { duration:1, from:1.0, to:0.0 });
	theControls[i].removeClassName('selected');
	isNaN(j) ? i++ : i = j
	if (i == theSlides.length) i = 0; 
	Effect.Appear(theSlides[i], { duration:1, from:0.0, to:1.0 });
	theControls[i].addClassName('selected');
	theDesc.update(theSlides[i].firstDescendant().alt);
}

function changeAttribute(url, element, attribute) {
	document.location = url + 'search.asp?att=' + attribute + '&att' + attribute + '=' + element.options[element.selectedIndex].value;
}

function toggleShipping() {
	if($('strSameShippingAsBilling').checked==true) {
		$('shippingdetails').hide();
		$('shipping-details').removeClassName('box-right'); 
		$('shipping-details').removeClassName('box-middle'); 
		$('shipping-details').addClassName('box-right'); 
	} else {
		$('shippingdetails').show();
		$('shipping-details').removeClassName('box-right'); 
		$('shipping-details').removeClassName('box-middle'); 
		$('shipping-details').addClassName('box-middle'); 
	}
}

function open_window(fileName, windowName, windowWidth, windowHeight, scrollbars, resizable) {
	window.open(fileName, windowName, 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=' + scrollbars + ', resizable=' + resizable + ', left=' + centre(windowWidth, screen.availWidth) + ', top=' + centre(windowHeight, screen.availHeight) + ', width=' + windowWidth + ', height=' + windowHeight);
}

function centre(size,area) {
	return (area/2)-(size/2);
}
