//Instead of pressing submit findcategory is run when user clicks a category

function findcategory(list)
{
  	var allcategories = document.listcategoriesform.listthecategories.options[listcategoriesform.listthecategories.selectedIndex].value;
	if(list.options[list.selectedIndex].value != "")
	{
		if(allcategories != 0)
	   {
			document.listcategoriesform.action = 'index.php?list=search&category=selected';
		}
	}
	document.listcategoriesform.submit();
	return true;
}

function changeaction()
{
  	var allcategories = document.listcategoriesform.listthecategories.options[listcategoriesform.listthecategories.selectedIndex].value;
	if(allcategories == 0)
	{
      document.listcategoriesform.action = 'index.php';
		return true;
	}

}

function changemobileaction()
{
  	var allcategories = document.listmobilecategoriesform.listthecategories.options[listmobilecategoriesform.listthecategories.selectedIndex].value;
	alert(allccategories);
	if(allcategories == 0)
	{
      document.listmobilecategoriesform.action = 'index.php?games=mobile';
		return true;
	}

}

function findmobilecategory(list)
{
  	var allcategories = document.listmobilecategoriesform.listthecategories.options[listmobilecategoriesform.listthecategories.selectedIndex].value;
	alert(allccategories);
	if(list.options[list.selectedIndex].value != "")
	{
		if(allcategories != 0)
	   {
			document.listmobilecategoriesform.action = 'index.php?games=mobile&list=search&category=selected';
		}
	}
	document.listmobilecategoriesform.submit();
	return true;
}

function testalert()
{
alert("test");
}

