function isFilterdataValid()
{
    var dim1fromStr = document.searchresult.dim1from.value;
    var dim1from = parseFloat(dim1fromStr, 10);
    var dim1toStr = document.searchresult.dim1to.value;
    var dim1to = parseFloat(dim1toStr, 10);

    var dim2fromStr = document.searchresult.dim2from.value;
    var dim2from = parseFloat(dim2fromStr, 10);
    var dim2toStr = document.searchresult.dim2to.value;
    var dim2to = parseFloat(dim2toStr, 10);

    if ((dim2fromStr != '' && isNaN(dim2from)) || (dim2toStr != '' && isNaN(dim2to)))
    {
	alert('Please correct your input for width.');
	return false;
    }

    if ((dim1fromStr != '' && isNaN(dim1from)) || (dim1toStr != '' && isNaN(dim1to)))
    {
	alert('Please correct your input for thickness.');
	return false;
    }

    if (dim2to < dim2from)
    {
    	alert('\'Width from\' is greater than \'Width to\'. The values will be swapped.');
    	var dummy = document.searchresult.dim2from.value;
 	document.searchresult.dim2from.value = document.searchresult.dim2to.value;
 	document.searchresult.dim2to.value = dummy;
    }

    if (dim1to < dim1from)
    {
    	alert('\'Thickness from\' is greater than \'Thickness to\'. The values will be swapped.');
    	var dummy = document.searchresult.dim1from.value;
 	document.searchresult.dim1from.value = document.searchresult.dim1to.value;
 	document.searchresult.dim1to.value = dummy;
    }

    return true;
}

