$package('itsm.tools');
/**  
 * @fileOverview 获取附件图标
 * @author Van
 * @version 1.0  
 */  
 /**  
 * @author Van  
 * @constructor 获取附件图标
 * @description 获取附件图标
 * @date 2011-05-19
 * @since version 1.0 
 */
itsm.tools.attachIcon=function(){
	
	
	return {
		
		
		getIcon:function(attName){
			
			var fileFix=attName.substring(attName.indexOf("."));
			var iconUrl="<img src='../images/attachicons/";
			
			if(fileFix==".rar"){
				iconUrl=iconUrl+"rar.gif'";
			}
			else if(fileFix==".zip"){
				iconUrl=iconUrl+"zip.gif'";
			}
			else if(fileFix==".gif"||fileFix==".jpg"||fileFix==".bmp"||fileFix==".png"){
				iconUrl=iconUrl+"image.gif'";
			}
			else if(fileFix==".doc"||fileFix==".docx"||fileFix==".xls"||fileFix==".ppt"||fileFix==".xlsx"){
				iconUrl=iconUrl+"msoffice.gif'";
			}
			else if(fileFix==".pdf"){
				iconUrl=iconUrl+"pdf.gif'";
			}
			else if(fileFix==".swf"){
				iconUrl=iconUrl+"flash.gif'";
			}
			else{
				iconUrl=iconUrl+"unknown.gif'";
			}
			
			iconUrl=iconUrl+" width='14px' height='14px' align='top'/>&nbsp;";
			
			return iconUrl;
			
		}
	};
}();


