var makeCellPhoneInstanceCount=0;
function makeCellPhone(mcp_video,mcp_text,mcp_type,mcp_loc) {
	var instance=makeCellPhoneInstanceCount++;
	if ((mcp_loc == null) || (mcp_loc == '')) mcp_loc="0px";
	var cellPhoneStyle="position:relative;clear:right;float:right;width:231px;height:226px;";
	if (mcp_type == 'left') {
		cellPhoneStyle="position:absolute;width:231px;height:226px;left:0px;top:"+mcp_loc+";";
	}
	var newHTML="<div id='CellPhoneContainer"+instance+"' style='"+cellPhoneStyle+"'>";
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
	var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
	if (isIE && isWin && !isOpera) {
		newHTML += "<object"
		        +  " width='230'"
				+  " height='226'"
				+  " codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'"
		        +  " classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>"
				+  "<param value='http://www.rsmmcgladrey.com/call_me_flash_animation_files/cell_phone_videoZ.swf?videoFile="
				+  mcp_video + "&bt=" + mcp_text + "'"
				+  " name='movie'>"
				+  "<param value='high' name='quality'>"
				+  "<param value='always' name='allowScriptAccess'>"
				+  "<param value='transparent' name='wmode'>"
				+  "</object>";
	} else {
		newHTML += "<embed"
				+  " width='230'"
				+  " height='226'"
				+  " pluginspage='http://www.macromedia.com/go/getflashplayer'"
				+  " type='application/x-shockwave-flash'"
				+  " allowscriptaccess='always'"
				+  " quality='high'"
				+  " wmode='transparent'"
				+  " loop='false'"
				+  " play='true'"
				+  " name='detectiontest'"
				+  " src='http://www.rsmmcgladrey.com/call_me_flash_animation_files/cell_phone_videoZ.swf?videoFile="
				+  mcp_video + "&bt=" + mcp_text.replace(" ","_") + "'>"
				+  "</embed>";
	}
	/*
	newHTML += "<script type='text/javascript'><!--\n"
			+  "   function switchLayer(direction) {\n"
            +  "      if (direction == 0) {\n"
			+  "         document.getElementById('CellPhoneContainer"+instance+"').style.zIndex = 101;\n"
			+  "      } else {\n"
			+  "         document.getElementById('CellPhoneContainer"+instance+"').style.zIndex = 0;\n"
			+  "      }\n"
			+  "   }\n"
			+  "// --></script>\n";
	*/		
    newHTML += "<object"
			+  " height='100'"
			+  " width='100'"
			+  " codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0'"
			+  " classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>"
			+  " <param name='name' value='detectiontest' />"
			+  " <param name='src' />"
			+  " <param name='wmode' value='transparent' />"
			+  "<embed"
			+  " height='100'"
			+  " width='100'"
			+  " wmode='transparent'"
			+  " name='detectiontest'"
			+  " type='application/x-shockwave-flash'>"
			+  "</embed>"
			+  "</object>"
			+  "</div>";
	
	document.write(newHTML);
}
