
// MMSN template
// Copyright exorbyte GmbH, 2008. All rights reserved.
function redirect(event, data, formatted) {
	if (data.URL != "") {
		location.assign(data.URL);
	} else {
		jQuery(searchFieldPath).parents("form").submit();
	}
}

function secondColNone(row) {
	return "<span class='col1'>" + row.SN_value + "</span>";
}

function secondColType(row) {
	var inHtml = row.SN_value;
	if (row.SN_type.substring(0,4) == "cat_") {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>";
	} else {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>" +
			"<span class='col2'>" + row.Type + "</span>";
	}

	return inHtml;
}

function secondColCat(row) {
	var inHtml = row.SN_value;
	if (row.SN_type.substring(0,4) == "cat_") {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>";
	} else {
		var cat = "";
		if (row.Type == "article") {
			cat = $.trim(row.Category.split(categoryDelimiter)[0]);
		}
		inHtml = "<span class='col1'>" + row.SN_value + "</span>"
			+ "<span class='col2'>" + cat + "</span>";
	}

	return inHtml;
}

function secondColPrice(row) {
	var inHtml = row.SN_value;
	if (row.SN_type.substring(0,4) == "cat_") {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>";
	} else {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>" +
			"<span class='col2'>" + row.Price + "</span>";
	}

	return inHtml;
}

function secondColBrand(row) {
	var inHtml = row.SN_value;
	if (row.SN_type.substring(0,4) == "cat_") {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>";
	} else {
		inHtml = "<span class='col1'>" + row.SN_value + "</span>"
			+ "<span class='col2'>(" + row.Brand + ")</span>";
	}

	return inHtml;
}
