// JavaScript Document


function createFlashPlayer(player, w, h, id, file){

// Check to see if the version meets the requirements for playback -- 
// hasReqestedVersion = false;
	if (hasReqestedVersion) {
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed
		
		file = "flashFile=" + file;
		
		if(staticImg == "homeNewsImg") document.write("<div id='video'>"); 
		
		AC_FL_RunContent(
				"src", player,
				"width", w,
				"height", h,
				"align", "left",
				"id", id,
				"quality", "high",
				"bgcolor", "B2B2B2",
				"name", "slideshow",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
				"pluginspage", "http://www.adobe.com/go/getflashplayer",
				"base", ".",
				"wmode", "transparent",
				"FlashVars", file
	);
	
	if(staticImg == "homeNewsImg") document.write("</div>"); 
	
	} else {  // flash is too old or we can't detect the plugin
		
		var alternateContent ;
		alternateContent = '<a href="http://www.adobe.com/go/getflash/" target="_blank">';
		
		switch(staticImg){
			case "fullImg":
				alternateContent +=  '<img src="/images/global/flash/fullImg.jpg" border="0" width="940" height="400" alt="Get Flash" /></a>';
				break;
			case "leftImg":
				alternateContent += '<img src="/images/global/flash/leftImg.jpg" border="0" width="230" height="374" alt="Get Flash" /></a>';
				break;
			case "homeImg":
				alternateContent += '<img src="/images/global/flash/homeImg.jpg" border="0" width="620" height="400" alt="Get Flash" /></a>';
				break;
			case "benefitsImg":
				alternateContent += '<img src="/images/global/flash/benefitsImg.jpg" border="0" width="675" height="405" alt="Get Flash" /></a>';
				break;
			case "productOverviewImg":
				alternateContent += '<img src="/images/global/flash/productOverviewImg.jpg" border="0" width="940" height="400" alt="Get Flash" /></a>';
				break;	
			case "homeNewsImg":
				alternateContent = '<a href="news/product/veneerwrapped%20UTA.aspx"><img src="images/home/homepage_news.jpg" width="300" height="120" alt="Product Spotlight" border="0"/></a>';
				break;
			default:
				alternateContent = '<p>'
					+ 'This content requires Adobe Flash Player. '
					+ '<a href="http://www.adobe.com/go/getflash/" target="_blank"><img alt="Get Flash" border="0" height="400" src="/images/global/flash/homeImg.jpg" width="620"/></a></p><br />';
				break;
			}	
		
		document.write(alternateContent);  // insert non-flash content	

	}
}


function createStreamingFlashPlayer(player, w, h, id, file, wmode, altContent){

// Check to see if the version meets the requirements for playback -- 
	//hasReqestedVersion = true;
	if (hasReqestedVersion) {
		// if we've detected an acceptable version
		// embed the Flash Content SWF when all tests are passed
config = "{'clip': {'url': '"+file+"', 'provider': 'rtmp'},'plugins': {'rtmp': {'url': 'flowplayer.rtmp-3.2.0.swf', 'netConnectionUrl': 'rtmp://216.54.215.98/NJLiving','objectEncoding': '0'}}}"

		AC_FL_RunContent(
				"src", player,
				"width", w,
				"height", h,
				"align", "center",
				"id", "locator",
				"quality", "high",
				"bgcolor", "000000",
				"name", "locator",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
				"pluginspage", "http://www.adobe.com/go/getflashplayer",
				"base", ".",
				"wmode", wmode,
				"FlashVars", 'config='+config,
				"allowFullScreen", "true",
 "class", "video-embed"
	);

	
	} else {  // flash is too old or we can't detect the plugin
		var alternateContent = 'You must enable flash to view the '+altContent+' video.'
		document.write(alternateContent);  // insert non-flash content
	}
}
