/*
 * imagePopup - $ plugin for SiteWare image popups
 *
 * Copyright 2010 COMMUNITOR Internetservice GmbH
 *
 */
(function(a){a.imagePopup=function(b){a.imagePopup.init=function(){var e=a(this).metadata(),f,d=800,c=600;if(typeof e.src!="undefined"){if(a.isArray(e.src)){f=e.src[0];d=e.src[1];c=e.src[2]}else{f=e.src}a(this).attr("imagePopupLink",f);a(this).attr("imagePopupWidth",d);a(this).attr("imagePopupHeight",c);a(this).click(a.imagePopup.open)}};a.imagePopup.open=function(){var f={left:0,top:0},e=a(this).attr("imagePopupLink"),d=parseInt(a(this).attr("imagePopupWidth")),c=parseInt(a(this).attr("imagePopupHeight"));if(typeof window.outerWidth!=="undefined"){d+=window.outerWidth-document.body.clientWidth}if(typeof window.outerHeight!=="undefined"){c+=window.outerHeight-document.body.clientHeight}if(screen.availWidth){if(screen.availWidth<d){d=screen.availWidth}f.left=parseInt((screen.availWidth-d)/2)}if(screen.availHeight){if(screen.availHeight<c){c=screen.availHeight}f.top=parseInt((screen.availHeight-c)/2)}window.open(e,"imgwnd","width="+d+",height="+c+",left="+f.left+",top="+f.top+",resizable,scrollbars=yes");return false};a(document).ready(function(){a(b).each(a.imagePopup.init)})}})(jQuery);
