﻿<!--

function goSearchTryckta(theForm)
{
	searchType=theForm.search_type.value;
	searchVal1=theForm.search_this.value;

	searchVal1 = searchVal1.replace("&","");
	
	if(searchVal1 != '')
	{
		if(searchVal1.length < 3)
		{
			alert('Din sökning måste bestå av minst 3 tecken');
		}
		else
		{
			if(searchType == 'all')
				window.location = "search.php?str=" + searchVal1;
			else if(searchType == 'forfattare')
				window.location = "search_forfattare.php?str=" + searchVal1;
			else if(searchType == 'bocker')
				window.location = "search_bocker.php?str=" + searchVal1;
			else if(searchType == 'inlasta')
				window.location = "search_inlasta.php?str=" + searchVal1;
			else if(searchType == 'ovrigt')
				window.location = "search_teknik.php?str=" + searchVal1;
		}
	}
}

/*
function goSearchTryckta(theForm)
{
	searchType=theForm.search_type.value;
	searchVal1=theForm.search_this.value;

	if((searchType == "all" || searchType == "titel" || searchType == "forfattare") && searchVal1 != '')
	{
		if(searchVal1.length < 3)
		{
			alert('Din sökning måste bestå av minst 3 tecken');
		}
		else
		{
			window.location = "search.php?"+searchType+"=" + searchVal1 + "&p=0";
		}
	}

	if( searchType == "isbn10"  && searchVal1 !='' )
	{
		if(searchVal1.length < 4)
		{
			alert('Din sökning måste bestå av minst 4 tecken');
		}
		else
		{	
			//window.location = "artikel.php?" + searchType + "=" + searchVal1;
			window.location = "search.php?" + searchType + "=" + searchVal1 + "&p=0";
		}
	}	
	
	if( searchType == "artnr" && searchVal1 !='' )
	{
		if(searchVal1.length < 7)
		{
			alert('Din sökning måste bestå av minst 7 tecken');
		}
		else
		{	
			//window.location = "artikel.php?" + searchType + "=" + searchVal1;
			window.location = "search.php?" + searchType + "=" + searchVal1 + "&p=0";
		}
	}		
}
*/

-->
