/**
 * Refreshes/sorts category game list depending on the list box id 
 */
function category_refresh( val )
{
	try
	{
		var loc = new String( document.location );
		
		if ( loc.indexOf('/sort') > 0 )
		{
			if ( loc.indexOf('/sort/rate/') > 0 )
				url = loc.replace( '/sort/rate/', '/sort/' + val.value +'/');
			else
				if ( loc.indexOf('/sort/plays/') > 0 )
					url = loc.replace( '/sort/plays/', '/sort/' + val.value +'/');
				else
					url = loc.replace( '/sort/new/', '/sort/' + val.value +'/');
		}
		else
			url = loc + 'sort/' + val.value + "/";
		urlsplit = url.split("/");
		urlsplit[5] = 1;
		url = urlsplit.join("/");
		document.location = url;
	}
	catch( e ) { }
}

function preview_picture( name, type, picture_type )
{
	self.document.name = name;
	self.document.type = type;
	self.document.picture_type = picture_type;

	window.open("/themes/default/admin/admin_preview_picture.html", "newwindow","width=450,height=380,resizable=0");
//	document.location = "theme/default/admin/admin_preview_picture.html?name=" + name + "&type=" + type + "&picture_type=" + picture_type;
}