<!--
function addSenToEventHandle(EHObj,insSen){
	var preSen;
	if (EHObj!=null){
		preSen=EHObj.toString();
	}else {
		preSen="";
	}
	var reg=/^(function +[\w|\$|\.]+ *\([\w|\$|\,|\.]*\) *\{)([\W|\w]*)(\})$/;
	var preBody=preSen.replace(reg,"$2");
	var newFunObj=new Function(preBody+insSen);
	return newFunObj;
}

//图片按比例缩放
var flag=false;
function DrawImage(ImgD, width, height){
	var image=new Image();
	var iwidth = width; //定义允许图片宽度，当宽度大于这个值时等比例缩小
	var iheight = height; //定义允许图片高度，当宽度大于这个值时等比例缩小
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= iwidth/iheight){
			if(image.width>iwidth){
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}

			//ImgD.alt=image.width+"×"+image.height;
		}
		else{
			if(image.height>iheight){
				ImgD.height=iheight;
				ImgD.width=(image.width*iheight)/image.height;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
			//ImgD.alt=image.width+"×"+image.height;
		}
	}
}

function shinyvOpenPlay(height, width, name) {
	window.open(mosConfig_live_site+"/javascript/play.html?width="+width+"&height="+height+"&name="+escape(name),null,"height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no");
}

function showFlash(flashURL,flashWIDTH,flashHEIGHT){
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>'); 
document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">'); 
document.writeln ('<PARAM NAME=wmode VALUE=transparent>'); 
document.writeln ('<PARAM NAME=loop VALUE=true>'); 
document.writeln ('<PARAM NAME=quality VALUE=high>'); 
document.writeln ('<PARAM NAME=allowFullScreen VALUE=true>'); 
document.writeln ('<EMBED src="'+flashURL+'"  allowFullScreen="true" loop=true wmode=opaque quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'); 
document.writeln ('</OBJECT>');}

//得到文件类型
function getFileExtension(filePath) { //v1.0
	fileName = ((filePath.indexOf('/') > -1) ? filePath.substring(filePath.lastIndexOf('/')+1,filePath.length) : filePath.substring(filePath.lastIndexOf('\\')+1,filePath.length));
	return fileName.substring(fileName.lastIndexOf('.')+1,fileName.length);
}
//检查上传文件
function checkFileUpload(form,extensions) { //v1.0
	document.MM_returnValue = true;
	if (extensions && extensions != '') {
		for (var i = 0; i<form.elements.length; i++) {
			field = form.elements[i];
			if (field.type.toUpperCase() != 'FILE') continue;
/*			if (field.value == '') {
				alert('文件框中必须保证已经有文件被选中!');
				document.MM_returnValue = false;field.focus();break;
			}*/
			if (extensions.toUpperCase().indexOf(getFileExtension(field.value).toUpperCase()) == -1) {
				alert('这种文件类型不允许上传!.\n只有以下类型的文件才被允许上传: ' + extensions + '.\n请选择别的文件并重新上传.');
				document.MM_returnValue = false;field.focus();break;
			}
		}
	}
}
-->