function loadHTML(source,id){
	
	$.ajax({
		  url: source,
		  cache: false,
		  success: function(html){
		    $(id).html(html);
		  }
		});
	
}

/**
 * 重置表单.
 * @param fromId
 */
function resetForm(fromId){
	$(fromId).each(function(){ 
		this.reset();  
	}); 
}

//function resetForm(fromId){
//	
//	$(fromId+ ' :input')
//    .not(':button, :submit, :reset, :hidden')
//    .val('')
//    .removeAttr('checked')
//    .removeAttr('selected');
//}

/**
 * 清空文本框内容.
 */
function resetInput(){
	  for (var i=0; i<arguments.length; i++) {
		  $(arguments[i]).val('');
		  //$(arguments[i]).html('');
	  }
}

/**
 * 验证文件后缀
 * @param obj
 * @param filter
 */
function checkFileType(obj,filter){

    var file = obj.value.match(/[^\/\\]+$/gi)[0];
    var rx = new RegExp('\\.(' + (filter?filter:'') + ')$','gi');
    if(filter&&file&&!file.match(rx)){
    	
    	msgAlert(i18n['msg_dc_wrongFile'],'error');
    	
    	obj.value='';
    }
}

/**
 * 判断空值并返回.
 * @param value
 * @returns
 */
function $vl(vl) {
	if(vl==null || vl=='' || vl=='null' || vl=='undefined'){
		return '';
	}else{
		return vl;
	}
}
