$(
	function()
	{
		if ($("#capturevideo").length > 0 )
		{
			objPara = new Object();
			objPara.uID = $("#capturevideo").attr('tt');
			swfobject.embedSWF("images/swf/webcamCapture.swf","capturevideo",500,200,'9.0.0.0',objPara,objPara,objPara);
		}
	
		$("ul.cssMediaPreview li").each(
			function(i)
			{
				strPath = ($(this).children('input').val());
				
				if (strPath != "")
				{
					aryPath = strPath.split(";");
					switch (aryPath.length)
					{
						case 1:
							$(this).html("<img src='"+aryPath[0]+"' />");
							$(this).attr('f',aryPath[0]);
							$(this).click(
								function()
								{
									jsShowImage($(this).attr('f'));
								}
							);
						break;
						
						case 2:
							$(this).html("<img src='"+aryPath[0]+"' />");
							$(this).attr('f',"../../"+aryPath[1]);
							$(this).click(
								function()
								{
									jsShowVideo($(this).attr('f'));
								}
							);
						break;
					}
				}
			}
		);
	}
)
