var MiniBrowser = (function(){
	var Callback = {
			onComplete: function(){},
			Data: {}
		},		
		Ax = $('<object classid="CLSID:B8232861-0E05-4179-8C6A-ED2B54FFDFCD" style="display:none;"></object>').appendTo(document.body)[0];
		
	Ax.attachEvent('OnComplete', function(url, content, cookie){
		setTimeout(function(){
			Callback.Data = {
				url: url,
				cookie: cookie,
				content: content
			};
		}, 0);
	});
	
	Ax.attachEvent('OnComplete2', function(Dom){
		setTimeout(function(){
			if(js_type(Callback.onComplete) == 'Function'){
				Callback.Data.Win = Dom;
				Callback.onComplete(Callback.Data);
			};
		}, 0);
	});
	
	return {
		openWindow: function(url, cb){
			Callback.onComplete = cb;
			Ax.Show(true);
			Ax.Navagate(url);
		},
		postWindow: function(url, params, cb){
			Callback.onComplete = cb;
			Ax.Show(true);
			Ax.Post(url, params);
		},
		navigate: function(Arg){
			Arg = $.extend({
				url: '',
				params: '_=' + new Date().getTime(),
				type: 'get',
				hide: false//保留
			}, Arg);
			
			Callback.onComplete = Arg.callback;
			Ax.Show(!Arg.hide);
			if(Arg.type.toLowerCase() == 'post'){
				Ax.Post(Arg.url, Arg.params);
			}else{
				Ax.Navagate(Arg.url);
			}
		},
		hide: function(){
			Ax.Show(false);
		},
		getCookie: function(){
			Ax.Show(false);
			return Ax.cookie;
		}
	}
})();