function writeProductMain(swfFile,cat)
{
	switch (swfFile){
		
		case 0:
		//alert('LESS THAN FLASH 6.0.65');
		window.location = "../upgrade.aspx";
		break;
		
		case 1:
		//alert('LESS THAN REQUIRED BUT >= 6.0.65');
		var MMPlayerType = (IE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = window.location;
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;
	
		var objtag = "";
		objtag += '<object style="float:left;height:750px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="645" id="productline" align="middle">';
		objtag += '<param name="allowScriptAccess" value="always" />\n';
		objtag += '<param name="movie" value="../expressInstall.swf" />';
		objtag += '<param name="quality" value="high" />\n';
		objtag += '<param name="FlashVars" value="xmlPath=/xml/&rootPath=/swf/rice/&MMredirectURL='+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'">';
		objtag += '<param name="bgcolor" value="#e4881b" />';
		objtag += '<embed src="../expressInstall.swf" style="height:750px" flashvars="xmlPath=/xml/&rootPath=/swf/rice/&MMredirectURL='+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'"  quality="high" width="645" name="productline" id="productlinee" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		objtag += '</object>\n';
		
		document.getElementById('prod_menu').innerHTML = objtag;
		
		break;
		
		case 2:
		//alert('SUCCESS!');
		document.write('<object style="float:left;" width="730" height="1241" menu="false" align="left" salign="lt" scale="noscale" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="productline" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="../swf/rice/productline_fullpage.swf" />');
		
		document.write('<param name="menu" value="false" />');
		document.write('<param name="width" value="725" />');
		document.write('<param name="height" value="1241" />');
		document.write('<param name="background" value="transparent" />');
		document.write('<param name="align" value="left" />');
		document.write('<param name="salign" value="lt" />');
		document.write('<param name="scale" value="noscale" />');
		
		document.write('<param name="quality" value="high" />');
		document.write('<param name="flashVars" value="xmlPath=/xml/&rootPath=/swf/rice/&categoryid='+ cat + '" />');
		document.write('<embed src="../swf/rice/productline_fullpage.swf" background="transparent" style="float:left;" menu="false" salign="lt" scale="noscale" align="left" height="1241" width="725"  flashVars="xmlPath=/xml/&rootPath=/swf/rice/&categoryid='+ cat + '" quality="high" name="productline" id="productlinee" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
		break;
				

		
		case 3:
		//alert('SUCCESS!');
		document.write('<object style="float:left;" width="730" height="1241" menu="false" align="left" salign="lt" scale="noscale" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="productline" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="../swf/rice/productline_fullpage.swf" />');
		
		document.write('<param name="menu" value="false" />');	
		document.write('<param name="width" value="730" />');	
		document.write('<param name="height" value="1241" />');	
		document.write('<param name="align" value="left" />');		
		document.write('<param name="salign" value="lt" />');		
		document.write('<param name="scale" value="noscale" />');					
		
		document.write('<param name="quality" value="high" />');
		document.write('<param name="flashVars" value="xmlPath=/xml/&rootPath=/swf/rice/&categoryid='+ cat + '" />');
		document.write('<embed src="../swf/rice/productline_fullpage.swf" style="float:left;" menu="false" salign="lt" scale="noscale" align="left" height="1241" width="730"  flashVars="xmlPath=/xml/&rootPath=/swf/rice/&categoryid='+ cat + '" quality="high" name="productline" id="productlinee" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
		break;
		
		default:
		break;
	}

}

var ranonce = false

function callWriteProductMain()
{

	// writeProductMain(beginFlashDetection(), catid);
	
	if (!ranonce)
	{
		writeProductMain(beginFlashDetection(), catid);
		ranonce = true;
		clearTimeout (maininterval);
	}
	
}
