


		
	function emptySearch(searchfield) 
	{
		if (searchfield.value == "Keyword Search"  || searchfield.value == "Mot-clé") 
			{
				searchfield.value = "";
			}
	}
	

	function CheckInputValue(searchform)
	{
		if (noSearch(searchform))
		{	return true;	}
		else
		{	return false;	}
	}

	function noSearch(searchform)
	{
	// Return false if keyword field is blank as well as all other fields
	if (searchform.keyword.value == "" || searchform.keyword.value == "Keyword Search" || searchform.keyword.value == "Mot-clé" ) 
		{
		searchform.keyword.value = "";
		alert(searchform.FillOne.value);
		searchform.keyword.focus();
		return false;
		}
	else
		{
		return true;
		}
	}

function isAllRight()
{
	//document.search.CatID.value = document.search.SubCategory.value;
	if ((noAdvancedSearch()) && (isPrice()) && (isPrice2()))
	{	return true;	}
	else
	{	return false;	}
}

function noAdvancedSearch()
{
 // Return false if keyword field is blank as well as all other fields
 if (document.search.Keyword.value == "" && document.search.Manufacturer.value == "" 
    && document.search.PartNumber.value == "" && document.search.MinPrice.value == "" 
    && document.search.MaxPrice.value == "" && document.search.FSSKU.value == "")
    {
    if (document.search.Director !=null) 
	{ 
		if (document.search.Director.value != "") 
		{
			return true;
		}
	}
    if (document.search.SongTitle !=null) 
	{ 
		if (document.search.SongTitle.value != "") 
		{
			return true;
		}
	}
	alert(document.search.FillOne.value);
	return false;
	}
 else
{
return true;
}
}
function isPrice()
 {
 var str = document.search.MinPrice.value;
 // Return false if price fields contain text
 if (str != "")
 {
 // Return false if not characters,$,comma,period
 for (var i = 0; i < str.length; i++)
{
var ch = str.substring(i, i + 1);
if ((ch < "0" || "9" < ch) && ch != '.' && ch != '$' && ch != ',' && ch != ' ')
 {
 alert(document.search.NoLetters.value);
 document.search.MinPrice.select();
 document.search.MinPrice.focus();
 return false;
 }
}
 }
 return true;
}
function isPrice2()
 {
 var str = document.search.MaxPrice.value;
 // Return false if price fields contain text
 if (str != "")
 {
 // Return false if text
 for (var i = 0; i < str.length; i++)
{
var ch = str.substring(i, i + 1);
if ((ch < "0" || "9" < ch) && ch != '.' && ch != '$' && ch != ',' && ch != ' ')
 {
 alert(document.search.NoLetters.value);
 document.search.MaxPrice.select();
 document.search.MaxPrice.focus();
 return false;
 }
}
 }
 return true;
}


function Refresh2(a)
{	
	/*only pass the values that are constant for all departments becuase they are always visible and the customer can change
	/ them if they want. Don't pass dept specific fields (Director/Label, MfgPartNumber/Actor/Artist, SongTitle/Studio, 
	/ TitleExactPhrase) because when the fields aren't visible the values can't be removed and are always part of the next 
	/ search and can cause the search to find no results*/
	var index = document.search.Category.selectedIndex;
	var value = document.search.Category.options[index].value;
	var subcat = document.search.SubCategory.options[document.search.SubCategory.selectedIndex].value;
	var query = 'Keyword='+escape(document.search.Keyword.value)+'&Manufacturer='+escape(document.search.Manufacturer.value);
	query = query + '&MinPrice='+escape(document.search.MinPrice.value) + '&MaxPrice=' + escape(document.search.MaxPrice.value);
	query = query + '&FSSKu='+escape(document.search.FSSKU.value) + '&MatchExactPhrase=' + escape(document.search.MatchExactPhrase.value);
	query = query + '&KeywordSearchType=' + escape(document.search.KeywordSearchType.value);
	query = query + '&SubCategory=' + escape(subcat);
	query = query + '&catid=' + escape(value);
	
	return query;
}