var login = function(){art.dialog.open('http://passport.7192.com/sync/login/d/qingjian',{id:'tlogin',title:'\u5feb\u901f\u767b\u5f55',width:470,height:310,resize:false});},register = function(){ art.dialog.open('http://passport.7192.com/sync/reg/d/qingjian?from=qingjian',{id:'treg',title:'\u5feb\u901f\u6ce8\u518c',width:464,height:376,resize:false});};var closeDialog = function(id){ art.dialog.list[id].close(); },tips = function(msg){ art.dialog.tips(msg); },aalert = function(msg){art.dialog.alert(msg);};
var clearWin = function(){ var list = art.dialog.list; for (var i in list) { list[i].close(); } }
function show_area(url,tit,width,mark,height){
	var fwd = window.location.href;
	if(url.indexOf('?')== -1){ url+='?_t='+Math.random(); }else{ url+='&_t='+Math.random(); }
	url+='&forward='+fwd;
	if(mark==1){
		var op = { title: tit, width: width };
		if(typeof(height)!='undefined'){ op['height'] = height; }
		art.dialog.open(url, op);
	}else{
		art.dialog.open(url, {title: tit,'width': width,
			ok: function () {
				var iframe = this.iframe.contentWindow;
				if (!iframe.document.body) { alert('iframe还没加载完毕呢') ;return false;};
				var form = iframe.form_sub();
				return false;
			}, okVal:'提交', cancel: true
		});
	}
};
function removeIframe(id){ $('#'+id).hide(); $('#'+id).find('iframe').attr('src','about:blank'); }
function show_mb(uid){ var if_src='http://m.web.7192.com/m'+uid; $('#cont_iframe').attr('src',if_src); centerAndShow('my_mb_iframe'); }
function show_mbs(link){ $('#cont_iframe').attr('src',link); centerAndShow('my_mb_iframe'); }
function centerAndShow(e){
	var o = $('#'+e),m=$('#mask');
	m.css('opacity','0.5').css('height',$(document.body).height()+'px').css('width',$(document.body).width()+'px').show();
	m.unbind();
	m.click(function(){  hh(e); removeIframe(e); });
	o.css({
		position:'absolute', zIndex : 9999,
		left: ($(window).width() - o.outerWidth())/2,
		top: ($(window).height() - o.outerHeight())/2 + $(window).scrollTop()
	}).show();
}

function hh(o){ $('#mask').removeAttr('onclick'); $('#'+o).hide(); $('#mask').hide(); }
function setPos(){ var o = $('#toutou'); o.css({ 'left':($(window).width()-o.outerWidth())/2+'px', 'top':($(window).height()-o.outerHeight())/2+$(window).scrollTop()+'px' }).show(); }
function loadPage(k,p){ $.get('/s/ei_search.php?kw='+encodeURIComponent(k)+'&page='+p,function(r){ eval('var r='+r+';'); var pages = r.pages, data = r.data; $('#pages').html(pages); $('#datalist').html(data); setPos(); }); }
function dosearch(){ var k = $('#kwd').val(); k = $.trim(k); if(k==''){ art.dialog.alert("请输入新郎或者新娘姓名搜索！"); return false; }else{ loadPage(k,1); } }
function loadMoreCmt(e,id){ var page = parseInt($(e).attr('page'), 10); page = page+1; $(e).attr('page', page); $.get('/s/geteiccmt.php?page='+page,function(r){ if(r=='none'){ art.dialog.tips('没有更多了'); }else{ $(r).appendTo('#'+id); } });}
function open_eic_A(){ art.dialog.tips('您还没有登录哦！');  setTimeout(function(){ show_area('http://passport.7192.com/sync/login/d/qingjian','登录通行证',470,1,310); },500); }
function show_all_my_eic(){art.dialog({title:'我的请柬',content:$('#all_my_eic_html').html(),id : 'myeics',padding:'10px',cancel:true});}

function addinfo(id){var htmlstr=$('#wrap_ems').html();$('#wrap_ems').html('');art.dialog({id:'addinfoalog',title : '完善请柬资料',	content : htmlstr,'height':'240px','padding' : '5px 5px',close:function(){$('#wrap_ems').html(htmlstr);}});$('#qjid').val(id);art.dialog.list['myeics'].close();}
function selCity(e){$.getJSON('/s/ga.php?id='+e, function(data){var o = document.getElementById('c');o.options.length = 0;$.each(data,function(i,a){o.options.add(new Option(a.name,a.areaid));});});}