
function random( min, max )
{
	if( isNaN( min ) ) min = 0;
	if( isNaN( max ) ) max = 1;
	
	return Math.round( min + Math.random() * ( max - min ) );
}

function generate_password( count )
{
	if( isNaN( count ) ) count = 8;

	var_password = "";
	
	for( i = 0; i < count; i++ )
	{
		var_password += String.fromCharCode( random( 0, 2 ) ? random( 0x41, 0x5A ) + 0x20 * random( 0, 1 ) : random( 0x30, 0x39 ) );
	}
	
	return var_password;
}

function livescore_match_details()
{
	window.open( "", "livescore_match_details", "top=0,left=0,width=400,height=44,menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=yes" );
}

function window_open( width, height, scrollbars )
{
	window.open( "", "window_open", "top=0,left=0,width="+width+",height="+height+",menubar=no,status=no,location=no,toolbar=no,scrollbars="+scrollbars+",resizable=no" );
}

function myshop_book( id )
{
	if( ! id ) return;
	
	var form = document.getElementById( 'myshop_cart' );
	form.id.value = id;
	form.submit();
}
