/**
 * papaya utils for jQuery
 * lightbox
 *
 * @copyright 2002-2007 by papaya Software GmbH - All rights reserved.
 * @link http://www.papaya-cms.com/
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, version 2
 *
 * You can redistribute and/or modify this script under the terms of the GNU General Public
 * License (GPL) version 2, provided that the copyright and license notes, including these
 * lines, remain unmodified. papaya is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.
 *
 * @package papaya
 * @author Michael van Engelshoven <engelshoven@papaya-cms.com>
 * @version $Id$
 */

jQuery.papayaUtils={getSize:function(jDomElem){try{jDomElem=jDomElem.get(0);}
catch(e){}
var top=0;var left=0;var width=0;var height=0;var iwidth=0;var iheight=0;if(jDomElem&&jDomElem.nodeName.toLowerCase()!='body'){top=jDomElem.scrollTop;left=jDomElem.scrollLeft;width=jDomElem.scrollWidth;height=jDomElem.scrollHeight;}else{if(document.documentElement){top=document.documentElement.scrollTop;left=document.documentElement.scrollLeft;width=document.documentElement.scrollWidth;height=document.documentElement.scrollHeight;}else if(document.body){top=document.body.scrollTop;left=document.body.scrollLeft;width=document.body.scrollWidth;height=document.body.scrollHeight;}
iwidth=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;iheight=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;}
return{top:top,left:left,width:width,height:height,iwidth:iwidth,iheight:iheight};},bgIframe:function(jDomElem,settings){jDomElem=jQuery(jDomElem);if(jQuery.browser.msie&&/6.0/.test(navigator.userAgent)){settings=jQuery.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},settings);var prop=function(n){return n&&n.constructor==Number?n+'px':n;};var html='<div class="bgiframe" frameborder="0" tabindex="-1" src="'+settings.src+'"'+'style="display:block; position:absolute; z-index:-1;'+
(settings.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(settings.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(settings.top))+';\n'+'left:'+(settings.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(settings.left))+';\n'+'width:'+(settings.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(settings.width))+';\n'+'height:'+(settings.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(settings.height))+';\n'+'"/>';return jDomElem.each(function(){if($('> iframe.bgiframe',this).length===0){this.insertBefore(document.createElement(html),this.firstChild);}});}
return jDomElem;}};