function selectArticle(prodCode, colorCode, colorName, sizeCode, sizeName, selectedImg, offImg)
{
	document.productOrder.productArticleNumber.value = "" + prodCode + colorCode + sizeCode;
	document.getElementById("productAttribute_1_display").innerHTML = colorName.replace("%20", " ");
	document.productOrder.productAttribute_1.value = colorName.replace("%20", " ");
	document.getElementById("productAttribute_2_display").innerHTML = sizeName.replace("%20", " ");
	document.productOrder.productAttribute_2.value = sizeName.replace("%20", " ");
	allArticles = document.productOrder.allArticles.value;
	arrArticles = allArticles.split(",");
	for(x = 0; x < arrArticles.length; x++)
	{
		document['artImg' + arrArticles[x]].src = offImg;
	}
	document['artImg' + colorCode + sizeCode].src = selectedImg;
	
	jQuery("#product_matrix td").removeClass("attr_label_selected");
	jQuery("#product_matrix td").addClass("attr_label");
	
	jQuery("#product_matrix #cell_1_" + colorCode).removeClass("attr_label");
	jQuery("#product_matrix #cell_2_" + sizeCode).removeClass("attr_label");
	jQuery("#product_matrix #cell_1_" + colorCode).addClass("attr_label_selected");
	jQuery("#product_matrix #cell_2_" + sizeCode).addClass("attr_label_selected");
}

function imgChange(articleName, imgSrc, imgSelected)
{
	if(!(document['artImg' + articleName].src == imgSelected)) document['artImg' + articleName].src = imgSrc;
}

function checkUserCountry(countryCode)
{
	jQuery(".packStationMessage").css("display", countryCode == "D" ? "inline" : "none");
	if(countryCode == "D") setDeliveryType();
	else showPackstationDataFields(false);
}

function setDeliveryType()
{
	showPackstationDataFields(jQuery("#selectDeliveryType_packstation").attr("checked"));
}

function showPackstationDataFields(bVal)
{
	jQuery("#delivery_address_info").css("display", bVal ? "none" : "inline");
	jQuery("#delivery_packstation_info").css("display", bVal ? "inline" : "none");
}

function handlePaymentTypeSelection()
{
	var bDisableFormElements = true;
	if(getRadioValue(document.userInfo.orderPaymentMethod) == "directdebit") bDisableFormElements = false;
	if(document.userInfo.orderBankName)				document.userInfo.orderBankName.disabled = bDisableFormElements;
	if(document.userInfo.orderBankCode)				document.userInfo.orderBankCode.disabled = bDisableFormElements;
	if(document.userInfo.orderBankAccountNumber)	document.userInfo.orderBankAccountNumber.disabled = bDisableFormElements;
}

function getRadioValue(obj)
{
	var x;
	for(x = 0; x < obj.length; x++)
	{
		if(obj[x].checked) return obj[x].value;
	}
}

function validate()
{
	if(document.userInfo.orderBankAccountName && getRadioValue(document.userInfo.orderPaymentMethod) == "directdebit") document.userInfo.orderBankAccountName.disabled = false;
	return true;
}

function disableSubmitButton(){
	//if(document.all) document.all.imageButton.src = blankImg;
	return true;
}