/**
* 根据服务器端传回的格式化多媒体资源字符串，返回多媒体数组
* 传入格式：[cms4j:multi]服务器上下文;多媒体路径[/cms4j:multi]@
* 返回格式: [[serverContext,URL],[serverContext,URL]]
*/
function getMultiArray(multiStr){
	var multiArray = [];
	var a = multiStr.split("@");
	for(var i = 0 ;i<a.length;i++){
		multiArray[i] = getMultiInfoArray(a[i]);
	}	
	
	return multiArray;
}


/**
* 根据服务器端传回的格式化多媒体资源字符串，返回<object>HTML代码
* 传入格式：[cms4j:multi]服务器上下文;多媒体路径[/cms4j:multi]@
* 
*/
function getMultiCode(multiStr){
	var multiArray = getMultiArray(multiStr);
	var html = "";
	
	for(var i = 0; i < multiArray.length; i++){
		
		html = html+ "<p>&nbsp;</p><p style='text-align:center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='320' height='260'><param name='movie' value='" +multiArray[i][0]+"/templet/default/images/defFlvplayer.swf'><param name='quality' value='high'><param name='flashvars' value='file=" +multiArray[i][1]+"'><param name='flashvars' value='image=" +multiArray[i][0]+"/templet/default/images/defPreview.jpg'><embed src='" +multiArray[i][0]+"/templet/default/images/defFlvplayer.swf' width='320' height='260' allowscriptaccess='always' allowfullscreen='true' flashvars='image="+multiArray[i][0]+"/templet/default/images/defPreview.jpg&file="+multiArray[i][1]+"'/></object></p>";

	}
	
	return html;
	
}


/**
* 根据服务器端传回的格式化多媒体资源字符串，返回多媒体信息数组
* 传入格式: [cms4j:multi]服务器上下文;多媒体资源路径[/cms4j:multi]
* 返回格式: ["服务器上下文","多媒体路径"]
*/
function getMultiInfoArray(multiStr){
	var startIndex = multiStr.indexOf("[cms4j:multi]");
	var endIndex = multiStr.indexOf("[/cms4j:multi]");
	var t = multiStr.substring(startIndex + "[cms4j:multi]".length, endIndex);
	var t2 = t.split(";");
	
	return t2;
}