$(function(){
	$.include('scripts/', [
		'inc/function.js',
		'inc/jquery.pur5.md5.js',
		'inc/jquery.stringify.js',
		'inc/hmac-sha1.js',
		'inc/enc-base64.js',
		'inc/pur5.js',
		'inc/miniBrowser.js',
		'inc/pur5.deal.js',
		'paipai/pp.js',
		'paipai/pp.sp.js',
		'paipai/pp.app.js',
		'paipai/pp.api.js'
	], function(){
		var layout =  $('#layoutPPMonitor'),
			triggerBtn  = $('#menuPPJK'),
			modelPath = layout.attr('modelpath');
		
		$.include(modelPath + 'script/', 'pp.monitor.js', function(){
			PP.Monitor.init(layout);
		});
		
		triggerBtn.unbind('click').attr('onclick', '').click(function(){
			pur5.Pages.topMenuEvent(triggerBtn);
			
			if(!pur5.Cfg.pur5PassWordKey) {
				TradingPass.show(function(){
					pur5.Pages.setPur5PW2(true, function() {
						pur5.Pages.layoutTo(layout.attr('id'));
					});
				});
			} else {
				pur5.Pages.layoutTo(layout.attr('id'));
			}
		});
	});
});