function get_random(n)
{
    var ranNum= Math.floor(Math.random()*n);
    return ranNum;
}
function get_flash_banner()
{
	var nameflash;
	var r;
	var type;
	r = get_random(6);
	//r=2;
	if(r == 0)
	{
		nameflash = "SFCS";
	}
	if(r == 1)
	{
		nameflash = "<IMG SRC=http://www.sf.in.th/images/banner/dq_banner728.jpg     BORDER=0  >";
		type = "jpg";
	}
if(r == 2)
	{
		nameflash = "true728";
	}
if(r == 3)
	{
		nameflash = "MPC2";
	}
if(r == 4)
	{
		nameflash = "cplus_728";
	}
if(r == 5)
	{
		nameflash = "cplus_728";
	}
//if(r == 3)
//	{
	//	nameflash = "Dcard_2_728";//truemoney728
	//}
	if(type == "jpg")
		printP(nameflash);
	else
		printF(nameflash)

}
function printF(nameflash)
{
//alert("__"+nameflash+"__");
		//print flash
		document.write('  <tr>');
		document.write('  <td>');
		document.write('<table width="748" height="103" border="0" cellpadding="0" cellspacing="0" bgcolor="#202217">');
		document.write('  <tr> ');
		document.write('    <td height="100" valign="middle"><div align="center">');
		document.write('        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="728" height="90">');
		document.write('          <param name="movie" value="http://www.sf.in.th/flash/banner_'+nameflash+'.swf">');
		document.write('          <param name="quality" value="high">');
		document.write('          <embed src="http://www.sf.in.th/flash/banner_'+nameflash+'.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="728" height="90"></embed></object>');
		document.write('      </div></td>');
		document.write('  </tr>');
		document.write('</table>');
		document.write('  </td>');
		document.write('  </tr>');	

}
function printP(namepic)
{

		//print flash
		document.write('  <tr>');
		document.write('  <td>');
		document.write('<table width="748" height="103" border="0" cellpadding="0" cellspacing="0" bgcolor="#202217">');
		document.write('  <tr> ');
		document.write('    <td height="100" valign="middle" align=center >');

		document.write(namepic);
		document.write('</td>');
		document.write('  </tr>');
		document.write('</table>');
		document.write('  </td>');
		document.write('  </tr>');	

}


document.write('	<tr>	');
document.write('	<td></td>	');
document.write('	</tr>	');
document.write('	</table></td>	');
document.write('	<td valign="top"><table width="760" border="0" cellspacing="0" cellpadding="0">	');
document.write('	<tr>	');
document.write('	<td>	');
document.write('  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="765" height="83">	');
document.write('  <param name="movie" value="http://www.sf.in.th/flash/menu_top8.swf">	');
document.write('  <param name="quality" value="high">	');
document.write('  <embed src="http://www.sf.in.th/flash/menu_top8.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="765" height="83"></embed></object>	');
document.write('	</td></tr>	');

document.write('	<tr>	');
document.write('	<td valign="top"><table width="760" border="0" cellspacing="0" cellpadding="0" valign=top >	');


document.write('	<tr>	');
document.write('	<td align=left  bgcolor="#454638"  >');

document.write('<table width="748" height="103" border="0" cellpadding="0" cellspacing="0"   >');
document.write('  <tr>');
document.write('    <td   ><img src="../images/spacer.gif" width=6 height=1 ></td><td  >');
document.write('<table width="748" height="103" border="0" cellpadding="0" cellspacing="0"   >');

//Start - Banner Flash
get_flash_banner();
//End - Banner Flash//document.write('    <td align="center" valign="middle" bgcolor="#202217"><A HREF="http://www.sf.in.th/news/News_Detail.aspx?cid=1&nid=231" target=_top ><img src="http://www.sf.in.th/images/banner/banner_refill728.jpg" width="728" height="90" border=0 ></A></td>');

document.write('</table>');
document.write(' </td></tr>');
document.write('  <tr>');
document.write('  <td colspan="2" height="3"></td>');
document.write(' </tr>');
document.write('</table>');
document.write('</td>	');
document.write('	</tr>	');



document.write('	<tr>	');
document.write('	<td valign=top ><table width="765" border="0" cellspacing="0" cellpadding="0" valign=top >	');
document.write('	<tr>	');
document.write('	<td width="670" valign="top"  bgcolor="#454638" >	');
