﻿var isMobile = (navigator.appVersion.indexOf("obile") != -1)+1-1;
var isIE = (navigator.appName.indexOf("Microsoft") != -1 && navigator.appVersion.indexOf("Windows") > -1)+1-1;
var url = window.document.location.toString();
var title = document.title;
var flash = getFlash();
var tvid;

$(document).ready(function() {
	//if ($('.home')[0]) laadHome();
	styleSelectBox();
	$("#middlecolumn a[href$='jpg'], #middlecolumn a[href$='JPG'], #middlecolumn a[href$='png'], #middlecolumn a[href$='PNG']").colorbox({transition:"fade", maxWidth:"95%", maxHeight:"95%", opacity:"0.8", rel:"groep"}); // ColorBox werkt niet met jquery 1.4.3
	
	$("#middlecolumn .gal-Topstuk").colorbox({iframe: true, transition:"fade", width:"95%", height:"95%", opacity:"0.8", rel:"topstuk"});
	
	$("#middlecolumn .gal-Voor-Na").colorbox({iframe: true, transition:"fade", width:"800", height:"600", opacity:"0.8", rel:"topstuk"});
	
	$("#beeldbankfilters .facetlink").colorbox({iframe: true, transition:"none", width:"550px", height:"500px", opacity:"0.8"});

	$(".iniframe a").colorbox({iframe: true, transition:"fade", width:"95%", height:"95%", opacity:"0.8"});
	
	zetTt(); $('body').append('<div id="tt"></div>');

	$('ul li a[href$="rss"]').each(function(){
		$("head").append('<link rel="alternate" type="application/rss+xml" href="' + $(this).attr('href') + '" title="' + $(this).attr('title') + '"/>');
		$("#socialb_rss").attr('href',$(this).attr('href'));
	});


		if (!window.tijdbalk){
			if($.cookie('TEXT_SIZE')) {
				$('body').addClass($.cookie('TEXT_SIZE'));	
				$('#topmenulinks span').addClass($.cookie('TEXT_SIZE'));
				if ($.cookie('TEXT_SIZE') == 'medium') {
					$('#tekstgrootte').text("a-");
				}
			}
		}

		$('#tekstgrootte').click(function() {
			var OldtextSize = $('#topmenulinks span').attr('class');
			if (!OldtextSize || OldtextSize == 'small') {
				var textSize = 'medium';
				$(this).text("a-");
			} else {
				var textSize = 'small';
				$(this).text("a+");
			}
			
			$('body').removeClass('small medium').addClass(textSize);
			$('#topmenulinks span').removeClass('small medium').addClass(textSize);
			$.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
			return false;
			
		});	
		
		$('#zoekinsite_skin').change(function() { $('#formzoeken').attr('action', this.value)});		
		
		if ($('#uitgebreid').length) {
			$('#zoekblok').append('<a href="#" id="link_uitgebreid">Uitgebreid zoeken</a>');	    
  		}
		$("#link_uitgebreid").click(function() {	  
	  		$("#uitgebreid").toggle(
			function() {
				if ($('#link_uitgebreid').html() == 'Uitgebreid zoeken') {
					$('#link_uitgebreid').html('Eenvoudig zoeken');
				} else {
					$('#link_uitgebreid').html('Uitgebreid zoeken');
				}
			});
			return false;
		});		

		if ($('#imgslideshow img').size()  > 1){
			setInterval(function(){$('#imgslideshow a:first-child').fadeOut().next('a').fadeIn().end().appendTo('#imgslideshow');}, 5000);
		}	

		$('.orderform').submit(function(){winkelWindow($(this).attr('action')); return false;});
		
		$('#formzoeken').submit(function(){openCb($('#formzoeken').attr('action') + '?' + $('#formzoeken').serialize()); return false;});

		
		var overlayHeight = $(document).height();
		var overlayWidth = $(document).width();
		if (isMobile) {
			$('head').append('<style>#cboxOverlay{height:' + overlayHeight + 'px !important;width:' + overlayWidth + 'px !important;}</style>');
		}						  
});


function openCb(u){
	$.colorbox({open: true, href: u, iframe: true, transition:"none", width:"90%", height:"90%", opacity:"0.8"});
}

function zetTt(){
	$("#middlecolumn a[href$='jpg'] img, #middlecolumn a[href$='JPG'] img, #middlecolumn a[href*='topstuk?'] img, #rightcolumn img[alt], .expoblok img[alt!='']").mousemove(tt).attr('title','');
	//label op title
	$("#beeldbankthumbs a, #rightcolumn img[title][alt=''], #formzoeken").each(function() {$(this).data('title', $(this).attr('title')); $(this).attr('title', '');}).mousemove(tt);
	
}

//tooltip
function tt(e){
	if (!isMobile){
		var tit =  $(this).data('title'); //title
		if (!tit) tit = $(this).attr('alt'); //alt
		tit = tit.split('|')[0];
		$('#tt').html(tit).show().css('top', e.pageY + 'px').css('left', e.pageX + 'px');
		$(this).mouseout(function(e){$('#tt').hide();});

		var ttw =  $('#tt').width();
		if ((e.pageX + ttw + 10) > $(window).width()) { 
			$('#tt').css('marginLeft', '-' + ttw + 'px');
		} else {$('#tt').css('marginLeft','0px')}
	}
}

function laadHome() {
	styleSelectBox();
}


function laadDiv(sel, url){
		$(sel).load(url + ' ' + sel, zetTt);
}

function eId(id){return document.getElementById(id)}




//jquery skinned-select
function styleSelectBox() {
	/*$('.my-skinnable-select select').change(function(){location.href=this.value});*/
	
	$('.my-skinnable-select').each(
      function(i) {
		selectContainer = $(this);
		selectContainer.removeClass('my-skinnable-select');
		selectContainer.addClass('skinned-select');
		selectContainer.children().before('<div class="select-text">a</div>').each(
          function() {
            $(this).prev().text(this.options[this.selectedIndex].innerHTML)
          }
        );
			var parentTextObj = selectContainer.children().prev();
			selectContainer.children().click(function() {
          	parentTextObj.text(this.options[this.selectedIndex].innerHTML);
        })        
      }
    );
}

function polyLink(welke){
	welke = welke.toLowerCase();
	if (welke.indexOf('run_') == 0) {
		$(".iniframe a[href *= '" +  welke.replace('_', '=') + "']:first").each(function(){ $(this).trigger('click'); });
	} else {
		$("#rightcolumn a[href *= '/" +  welke.split('_')[0] + "']:first").each(function(){location = this.href});
	}
}

function winkelWindow(url){
	window.open(url, 'Webwinkel', 'height=600,width=800,top=' + (screen.availHeight - '600') / 2 + ',left=' + (screen.availWidth - '800') / 2 + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function topview(ind){
	if (flash) {document.getElementById('beeldbankbeeld').innerHTML = ''; document.getElementById('beeldbankbeeld').innerHTML = '<embed wmode="opaque" src="http://gam.pictura-dp.nl/components/com_memorixbeeld/assets/swf/topview.swf" flashvars="xmlpath=http%3A//gam.pictura-dp.nl/index.php%3Foption%3Dcom_memorixbeeld%26view%3Drecord%26format%3Dtopviewxml%26tstart%3D' + ind + '%26id%3D' + tvid + '" width="480" height="480" allowfullscreen="true" swliveconnect="true" AllowScriptAccess="always"></embed>';}
}

function topview_action(task, files, params) {
	switch (task) {
		case 'navigate':
			topview(params.imageIndex); break;
		default:
			break;
	}
}


function getFlash(){
	var nRequiredVersion = 8;
	if(isIE){
		document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n</script\> \n');
		if(window.hasFlash != null){ return window.hasFlash;};
	};
	if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
		var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
		var vr = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1)); if (vr < 4) vr += 10;	
		return vr >= nRequiredVersion;
	};
	return false;
}

function audio(mp3, id){alert(mp3);
		if (hasFlash()) {
			eId(id).innerHTML='<embed width="250" height="20" type="application/x-shockwave-flash" src="/grafiek/mediaplayer.swf?file=' + mp3 + '"></embed>';
		} else { 
			eId(id).innerHTML='<embed width="250" height="30" autostart="false" src="' + mp3 + '"></embed>';
		}
}


function setCookie(name, val, path){
   document.cookie = name + "="  + val + "; path=" + path;
}

function getCookie(name, defval) {
   var nameEQ = name + "="; var ca = document.cookie.split(';');
   for(var i=0;i < ca.length;i++) {
       var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length);
       if (c.indexOf(nameEQ) == 0) {
           ck = '' + c.substring(nameEQ.length,c.length); 
		   if (ck != '') { 
		   	return ck;
		   }
	   }
   }
   return defval;
}

function deleteCookie(name, path, domain ) {
if (getCookie(name, '')) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";

}



function fav(){
	if (isIE) {window.external.AddFavorite(url,title)} else {alert('Sleep het aangeklikte icoontje naar de bookmark-balk van uw browser!')}
}

function escape(str){return encodeURI(str)};

function sociaal(url2){
	 title = document.title;
	if (url2 != '') url = url2;
	var r = '';
	var favtit = "voeg toe aan favorieten"; if (!isIE) favtit = "sleep naar bookmarks";
	r += '<div id="alg">';
	r += '<a href="/rss" id="socialb_rss" title="abonneren op rss feed"></a>';	
	r += '<a href="mailto:?subject=' + escape(title) + '&amp;body=' + escape(url) + '" id="socialb_mail" title="doorsturen per e-mail"></a>';
	r += '<a href="' + url + '" onclick="fav(); return false;" id="socialb_fav" title="' + favtit + '"><span>' + title + '</span>&nbsp;&nbsp;&nbsp;&nbsp;</a>';
	r += '<a target="_blank" id="socialb_delicious" href="http://www.delicious.com/post?url=' + escape(url) + '&title=' + escape(title) + '" title="Delicious"></a>';
	r += '<a target="_blank" id="socialb_twitter" href="http://twitter.com/share?text=' + escape(title) + '&url=' + escape(url) + '" title="Twitter"></a>';			
	r += '<a target="_blank" id="socialb_hyves" href="http://www.hyves.nl/profilemanage/add/tips/?name=' + escape(title) + '&text=' + escape(url) + '&type=12" title="Hyves"></a>';		
	r += '<a target="_blank" id="socialb_googlebuzz" href="http://www.google.com/buzz/post?url=' + escape(url) + '" title="Google Buzz"></a>';
	r += '<a target="_blank" id="socialb_msnlive" href="http://favorites.live.com/quickAdd.aspx?url=' + escape(url) + '&title=' + escape(title) + '" title="Msn/Live Favorite"></a>';	
	r += '<a target="_blank" id="socialb_facebook" href="http://www.facebook.com/sharer.php?u=' + escape(url) + '&t=' + escape(title) + '" title="Facebook"></a>';	
	r += '</div>';
	document.write(r);
}

/*	jQuery.cookie */
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires='; expires='+date.toUTCString()}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};

// ColorBox v1.3.9 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
// c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(b,gb){var v="none",t="click",N="LoadedContent",d=false,x="resize.",o="y",u="auto",f=true,M="nofollow",q="on",n="x";function e(a,c){a=a?' id="'+k+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function p(a,b){b=b===n?m.width():m.height();return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function Q(c){c=b.isFunction(c)?c.call(h):c;return a.photo||c.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function cb(){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!==q)a[c]=a[c].call(h);a.rel=a.rel||h.rel||M;a.href=a.href||b(h).attr("href");a.title=a.title||h.title}function db(d){h=d;a=b.extend({},b(h).data(r));cb();if(a.rel!==M){i=b("."+H).filter(function(){return (b(this).data(r).rel||this.rel)===a.rel});g=i.index(h);if(g===-1){i=i.add(h);g=i.length-1}}else{i=b(h);g=0}if(!w){w=F=f;R=h;try{R.blur()}catch(e){}b.event.trigger(hb);a.onOpen&&a.onOpen.call(h);y.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":u}).show();a.w=p(a.initialWidth,n);a.h=p(a.initialHeight,o);c.position(0);S&&m.bind(x+O+" scroll."+O,function(){y.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll."+O)}T.add(I).add(J).add(z).add(U).hide();V.html(a.close).show();c.slideshow();c.load()}var eb={transition:"elastic",speed:300,width:d,initialWidth:"600",innerWidth:d,maxWidth:d,height:d,initialHeight:"450",innerHeight:d,maxHeight:d,scalePhotos:f,scrolling:f,inline:d,html:d,iframe:d,photo:d,href:d,title:d,rel:d,opacity:.9,preloading:f,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:d,loop:f,slideshow:d,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:d,onLoad:d,onComplete:d,onCleanup:d,onClosed:d,overlayClose:f,escKey:f,arrowKey:f},r="colorbox",k="cbox",hb=k+"_open",P=k+"_load",W=k+"_complete",X=k+"_cleanup",fb=k+"_closed",G=b.browser.msie&&!b.support.opacity,S=G&&b.browser.version<7,O=k+"_IE6",y,j,E,s,Y,Z,ab,bb,i,m,l,K,L,U,T,z,J,I,V,C,D,A,B,h,R,g,a,w,F,c,H=k+"Element";c=b.fn[r]=b[r]=function(c,d){var a=this;if(!a[0]&&a.selector)return a;c=c||{};if(d)c.onComplete=d;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=f}a.each(function(){b(this).data(r,b.extend({},b(this).data(r)||eb,c)).addClass(H)});c.open&&db(a[0]);return a};c.init=function(){var h="hover";m=b(gb);j=e().attr({id:r,"class":G?k+"IE":""});y=e("Overlay",S?"position:absolute":"").hide();E=e("Wrapper");s=e("Content").append(l=e(N,"width:0; height:0"),L=e("LoadingOverlay").add(e("LoadingGraphic")),U=e("Title"),T=e("Current"),J=e("Next"),I=e("Previous"),z=e("Slideshow"),V=e("Close"));E.append(e().append(e("TopLeft"),Y=e("TopCenter"),e("TopRight")),e().append(Z=e("MiddleLeft"),s,ab=e("MiddleRight")),e().append(e("BottomLeft"),bb=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});K=e(d,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(y,j.append(E,K));s.children().hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)}).addClass(h);C=Y.height()+bb.height()+s.outerHeight(f)-s.height();D=Z.width()+ab.width()+s.outerWidth(f)-s.width();A=l.outerHeight(f);B=l.outerWidth(f);j.css({"padding-bottom":C,"padding-right":D}).hide();J.click(c.next);I.click(c.prev);V.click(c.close);s.children().removeClass(h);b("."+H).live(t,function(a){if(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)return f;else{db(this);return d}});y.click(function(){a.overlayClose&&c.close()});b(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();c.close()}if(w&&a.arrowKey&&!F&&i[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();I.click()}else if(b.keyCode===39&&(g<i.length-1||a.loop)){b.preventDefault();J.click()}})};c.remove=function(){j.add(y).remove();b("."+H).die(t).removeData(r).removeClass(H)};c.position=function(f,b){function c(a){Y[0].style.width=bb[0].style.width=s[0].style.width=a.style.width;L[0].style.height=L[1].style.height=s[0].style.height=Z[0].style.height=ab[0].style.height=a.style.height}var e,h=Math.max(m.height()-a.h-A-C,0)/2+m.scrollTop(),g=Math.max(m.width()-a.w-B-D,0)/2+m.scrollLeft();e=j.width()===a.w+B&&j.height()===a.h+A?0:f;E[0].style.width=E[0].style.height="9999px";j.dequeue().animate({width:a.w+B,height:a.h+A,top:h,left:g},{duration:e,complete:function(){c(this);F=d;E[0].style.width=a.w+B+D+"px";E[0].style.height=a.h+A+C+"px";b&&b()},step:function(){c(this)}})};c.resize=function(b){if(w){b=b||{};if(b.width)a.w=p(b.width,n)-B-D;if(b.innerWidth)a.w=p(b.innerWidth,n);l.css({width:a.w});if(b.height)a.h=p(b.height,o)-A-C;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}l.css({height:a.h});c.position(a.transition===v?0:a.speed)}};c.prep=function(o){var d="hidden";function n(t){var o,q,s,n,d=i.length,e=a.loop;c.position(t,function(){function t(){G&&j[0].style.removeAttribute("filter")}if(w){G&&p&&l.fadeIn(100);a.iframe&&b("<iframe frameborder=0"+(a.scrolling?"":" scrolling='no'")+(G?" allowtransparency='true'":"")+"/>").attr({src:a.href,name:(new Date).getTime()}).appendTo(l);l.show();U.show().html(a.title);if(d>1){T.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,d)).show();J[e||g<d-1?"show":"hide"]().html(a.next);I[e||g?"show":"hide"]().html(a.previous);o=g?i[g-1]:i[d-1];s=g<d-1?i[g+1]:i[0];if(a.slideshow){z.show();g===d-1&&!e&&j.is("."+k+"Slideshow_on")&&z.click()}if(a.preloading){n=b(s).data(r).href||s.href;q=b(o).data(r).href||o.href;if(Q(n))b("<img/>")[0].src=n;if(Q(q))b("<img/>")[0].src=q}}L.hide();a.transition==="fade"?j.fadeTo(f,1,function(){t()}):t();m.bind(x+k,function(){c.position(0)});b.event.trigger(W);a.onComplete&&a.onComplete.call(h)}})}if(w){var p,f=a.transition===v?0:a.speed;m.unbind(x+k);l.remove();l=e(N).html(o);l.hide().appendTo(K.show()).css({width:function(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?u:d}).css({height:function(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);K.hide();b("#"+k+"Photo").css({cssFloat:v});S&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==d}).css({visibility:d}).one(X,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(f,0,function(){n(0)}):n(f)}};c.load=function(){var j,d,q,m=c.prep;F=f;h=i[g];a=b.extend({},b(h).data(r));cb();b.event.trigger(P);a.onLoad&&a.onLoad.call(h);a.h=a.height?p(a.height,o)-A-C:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,n)-B-D:a.innerWidth&&p(a.innerWidth,n);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,n)-B-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-A-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}j=a.href;L.show();if(a.inline){e("InlineTemp").hide().insertBefore(b(j)[0]).bind(P+" "+X,function(){b(this).replaceWith(l.children())});m(b(j))}else if(a.iframe)m(" ");else if(a.html)m(a.html);else if(Q(j)){d=new Image;d.onload=function(){var e;d.onload=null;d.id=k+"Photo";b(d).css({margin:u,border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){q=function(){d.height-=d.height*e;d.width-=d.width*e};if(a.mw&&d.width>a.mw){e=(d.width-a.mw)/d.width;q()}if(a.mh&&d.height>a.mh){e=(d.height-a.mh)/d.height;q()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";setTimeout(function(){m(d)},1);i[1]&&(g<i.length-1||a.loop)&&b(d).css({cursor:"pointer"}).click(c.next);if(G)d.style.msInterpolationMode="bicubic"};d.src=j}else e().appendTo(K).load(j,function(c,a,b){m(a==="error"?"Request unsuccessful: "+b.statusText:this)})};c.next=function(){if(!F){g=g<i.length-1?g+1:0;c.load()}};c.prev=function(){if(!F){g=g?g-1:i.length-1;c.load()}};c.slideshow=function(){function f(){z.text(a.slideshowStop).bind(W,function(){d=setTimeout(c.next,a.slideshowSpeed)}).bind(P,function(){clearTimeout(d)}).one(t,function(){e()});j.removeClass(b+"off").addClass(b+q)}var e,d,b=k+"Slideshow_";z.bind(fb,function(){z.unbind();clearTimeout(d);j.removeClass(b+"off "+b+q)});e=function(){clearTimeout(d);z.text(a.slideshowStart).unbind(W+" "+P).one(t,function(){f();d=setTimeout(c.next,a.slideshowSpeed)});j.removeClass(b+q).addClass(b+"off")};if(a.slideshow&&i[1])a.slideshowAuto?f():e()};c.close=function(){if(w){w=d;b.event.trigger(X);a.onCleanup&&a.onCleanup.call(h);m.unbind("."+k+" ."+O);y.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){j.find("iframe").attr("src","about:blank");l.remove();j.add(y).css({opacity:1,cursor:u}).hide();try{R.focus()}catch(c){}setTimeout(function(){b.event.trigger(fb);a.onClosed&&a.onClosed.call(h)},1)})}};c.element=function(){return b(h)};c.settings=eb;b(c.init)})(jQuery,this)
