﻿// 自定义 alert
function myalert(msg) {
	$('#infoContent')
		.find('div.maginfo') 
			.html(msg)
	var a = '#TB_inline?height=150&width=350&KeepThis=true&inlineId=infoContent;' 
	tb_show('提示信息', a, "thickbox");
}
// 自定义 confirm
function myconfirm(msg,callback) {
	$('#confrimContent')
		.find('div.maginfo') 
			.html(msg)
			.end()
		 .find('button#btnDialogEnter')
			.click(function(){
				if(this.id == 'btnDialogEnter')
				(typeof callback == 'string') ?
				window.location.href = callback :
				callback();
				parent.tb_remove();
	});
	var a = '#TB_inline?height=150&width=350&KeepThis=true&inlineId=confrimContent;' 
	tb_show('警告信息', a, "thickbox");
}
// 自定义 链接型 confirm
function confirmLink(msg,callback) {
	$('#confrimContent')
		.find('div.maginfo') 
			.html(msg)
			.end()
		 .find('button#btnDialogEnter')
			.click(function(){
				if(this.id == 'btnDialogEnter')
				(typeof callback == 'string') ?
				$('ifrName').src = callback : callback();
				parent.tb_remove();
	});
	var a = '#TB_inline?height=150&width=350&KeepThis=true&inlineId=confrimContent;' 
	tb_show('警告信息', a, "thickbox");
}
// 自定义 提交表单型 confirm
function confrimSubmit(msg,fun){
	$('#confrimContent')
		.find('div.maginfo') 
			.html(msg)
			.end()
		 .find('button#btnDialogEnter')
			.click(function(){
				//fun.submit;
			});
	var a = '#TB_inline?height=150&width=350&KeepThis=true&inlineId=confrimContent;' 
	tb_show('警告信息', a, "thickbox");
} 
// 自定义弹出窗口
function popWin(msg,url,width,height){
	var a = url+'?KeepThis=true&TB_iframe=true&height='+height+'&width='+width;
	tb_show(msg, a, "thickbox");
} 
var popWinCallback=null;
// 自定义弹出窗口
function popWin2(msg,url,width,height,callback){
	url+=(url.indexOf('?')==-1)?'?':'&';
	var a =url+'KeepThis=true&TB_iframe=true&height='+height+'&width='+width;
	popWinCallback=callback;
	tb_show(msg, a, "thickbox");
}
//回调方法
function tb_remove2(state)
{
    tb_remove();
	if (popWinCallback!=null)
	{
		popWinCallback(state);
		popWinCallback=null;
	}
}