JEXTFN['COMMON'] = function() {

	JEXTHTML = $('html').html();

	$.jxinclude('//at.alicdn.com/t/font_1712931_b3yol8y67bq.css', $('[class*="icon-"]').size());

	$.jxinclude(jextpath + 'web/mcss/mcss.js', !$.isEmptyObject(McssData));

	$.jxinclude(jextpath + 'web/mcss/hover.js', JEXTHTML.search(/ hover-[a-z]+/i) > 0);

	$.jxinclude(jextpath + 'web/ljz.js', $('[data-src]').size());

	$.jxinclude(jextpath + 'web/mine-scroll.js', $('[mine-scroll]').size());

	$.jxinclude(jextpath + 'web/radio-checkbox/select-all.js', $('[select-all]').size());

	$.jxinclude(jextpath + 'web/radio-checkbox/index.js', $('label input[type=checkbox], label input[type=radio]').size());

	$.jxinclude(jextpath + 'web/ace/index.js', $('[ace][html], [ace][css], [ace][js]').size());

	$.jxinclude(jextpath + 'web/download.js', $('[download]').size());

	$.jxinclude(jextpath + 'web/WebCrawler.js', $('[crawler]').size());

	$.jxinclude(jextpath + 'web/int.js', $('input[int], input[float]').size());

	$.jxinclude(jextpath + 'web/tab.js', $('[tab]').size());

	$.jxinclude(jextpath + 'web/wow.js', $('[wow]').size());

	// 分页样式
	if($('[turn-page]').size()){
		var i = parseInt($('[turn-page]').attr('turn-page')) % 1;
		$.jxinclude(jextpath + 'turn-page/' + i + '.css', 1);
	}

	$.jxinclude(jextpath + 'web/code/drag.js', $('[drag-code]').size());

	$.jxinclude(jextpath + 'web/color/jscolor.js', $('input.color').size());

	// 地址3级联动 
	/*
	    <div address>
	        <select name='Country' class='fl'>{$ads['Country']}</select>
	        <select name='City' class='fl'>{$ads['City']}</select>
	        <select name='State' class='fl in'>{$ads['State']}</select>
	    </div>
	*/
	jx('[address]').each(function(){
		var e = $(this);
		var v = {
		    province: e.find('select:eq(0)').html(),
		    city: e.find('select:eq(1)').html(),
		    district: e.find('select:eq(2)').html()
		}
		if (typeof(distpicker) != 'object' && window.AddressInc != 1){
			window.AddressInc = 1;
			$.include(jextpath + 'address-/distpicker.data.js', 1);
			$.include(jextpath + 'address-/distpicker.js', 1);
		}
		e.distpicker(v);
	});

	$.jxinclude(jextpath + 'web/picture/index.js', $('[picture]').size());

	$.jxinclude(jextpath + 'web/code/word.js', $('[word-code]').size());

	$.jxinclude(jextpath + 'web/star.js', $('[star-off-on]').size());

	$.jxinclude(jextpath + 'web/images.js', $('[images*="."]').size());

	$.jxinclude(jextpath + 'web/tips.js', $('[data-tips]').size() || $('[tips]').size() || $('.notes_icon').size());

	$.jxinclude(jextpath + 'web/mCustomScrollbar/index.js', $('[mcscroll]').size());

	$.jxinclude(jextpath + 'web/laydate/index.js', $('[laydate]').size());

	$.jxinclude(jextpath + 'web/dragsort/index.js', $('ul[dragsort]').size());

	$.jxinclude(jextpath + 'web/share.js', $('[jqshare]').size());

	// 复制
	// <div data-clipboard-text='复制内容'></div>
	if ($('[data-clipboard-text]:not([exec-datacopytext])').size()) {
		if (typeof(ClipboardJS) != 'function') {
			if (window.incClipboard != 1) $.include(jextpath+'org/clipboard.min.js');
			window.incClipboard=1;
		}else{
			var clipboard = new ClipboardJS(document.querySelectorAll('[data-clipboard-text]:not([exec-datacopytext])'));
			clipboard.on('success', function(e){
			    $.alert(jLang.global.copy_word,1);
			});
			clipboard.on('error', function(e) {
			    $.alert(jLang.global.copy_word_error, 1);
			});
			$('[data-clipboard-text]:not([exec-datacopytext])').attr('exec-datacopytext','');
		}
	}

	$.jxinclude(jextpath + 'web/progress.js', $('[progress]').size());

	$.jxinclude(jextpath + 'web/map/index.js', $('[map]').size());

	$.jxinclude(jextpath + 'web/swiper5/index.js', $('.container .wrapper').size());

	$.jxinclude(jextpath + 'web/ueditor/index.js', $('[ueditor], [MUeditor]').size());
	
	$.jxinclude(jextpath + 'web/number.js', $('[number]:not(input), [data-number]:not(input)').size());

	$.jxinclude(jextpath + 'web/ajaxpage.js', $('[ajax-href], [ajax-page], [ajax-append]').size());

	$.jxinclude(jextpath + 'web/canvas/index.js', JEXTHTML.search(/ canvas-[a-z]+/i) > 0);

	$.jxinclude(jextpath + 'web/shopping/cart.js', JEXTHTML.search(/ cart-[a-z\-]+[ =\/>]/i) > 0);
	$.jxinclude(jextpath + 'web/shopping/order.js', JEXTHTML.search(/ order-[a-z\-]+[ =\/>]/i) > 0);

	$.jxinclude(jextpath + 'web/echarts/index.js', $('[echarts]').size());
	
};



/*
 * 这是为了当前页记录
 * 
**/
var SelfTime = 3600;
var SelfHref = location.href || '/';
SelfHref = md5(SelfHref);
var SelfCookie = $.json($.cookie('SelfCookie')) || {};
if (!SelfCookie[SelfHref]) {
	SelfCookie = {};
	SelfCookie[SelfHref] = {};
	$.cookie('SelfCookie', '', SelfTime);
}


JEXTFN['JTOKEN'] = function(){
	JToken = JCode ^ $.cca()
}

// 强制竖屏
function DXorient(){
    if (window.orientation == 0 || window.orientation == 180) {
        $("body").attr("class", "portrait");
        orientation = 'portrait';
        return false;
    }
    else if (window.orientation == 90 || window.orientation == -90) {
        $("body").attr("class", "landscape");
        orientation = 'landscape';

        return false;
    }
}
DXorient();
$(window).on('orientationchange resize', function(e) {
	DXorient();
});

// 点击 a 标签的锚点效果
$(document).on('click', 'a[href*=#], area[href*=#]', function() {
	if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
		var $target = $(this.hash);
		$target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
		if ($target.length) {
			var targetOffset = $target.offset().top;
			$('html, body').animate({scrollTop: targetOffset}, 500);
			return false;
		}
	}
});