
/* - kssinline.js - */
// http://www.advanced-software.de/portal_javascripts/kssinline.js?original=1
function corePopupShow(dom_node_id,anchor){if(!anchor)
anchor='screen';var popup=document.getElementById('kssinline-popup');if(anchor=='node'){var node=document.getElementById(dom_node_id);var posX=corePopupFindPosX(node);var posY=corePopupFindPosY(node);popup.style.left=posX+'px';popup.style.top=posY+node.offsetHeight+1+'px'}
popup.className='kssinline-popup-visible';jq('div.kssinline-wrapper form').each(ploneFormTabbing.initializeForm);if(!jq("form div.error :input:first").focus().length)
jq("form.enableAutoFocus :input:not(.formTabs):visible:first").focus();if(anchor=='node'){var width=coreGetWindowWidth();var height=coreGetWindowHeight();if((posX+popup.clientWidth)>width){posX=width-popup.clientWidth-50;popup.style.left=posX+'px'}}
else{jq('#kssinline-popup').vCenter()}}
function corePopupHide(dom_node_id){var popup=document.getElementById('kssinline-popup');popup.className='kssinline-popup-hidden';document.getElementById('kssinline-popup-messages').innerHTML='';document.getElementById('kssinline-popup-content').innerHTML='';jq('#visual-portal-wrapper').fadeTo('fast',1.0)}
function corePopupFindPosX(obj){var curleft=0;if(obj.offsetParent)
while(1){curleft+=obj.offsetLeft;if(!obj.offsetParent)
break;obj=obj.offsetParent}
else if(obj.x)
curleft+=obj.x;return curleft}
function corePopupFindPosY(obj){var curtop=0;if(obj.offsetParent)
while(1){curtop+=obj.offsetTop;if(!obj.offsetParent)
break;obj=obj.offsetParent}
else if(obj.y)
curtop+=obj.y;return curtop}
function _coreGetWindowDimensions(type){var myHeight=0;var myWidth=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight} else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight} else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight}
if(type=='height')
return myHeight;else
return myWidth}
function coreGetWindowWidth(){return _coreGetWindowDimensions('width')}
function coreGetWindowHeight(){return _coreGetWindowDimensions('height')}(function($){$.fn.vCenter=function(options){var pos={sTop: function(){return window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop},wHeight: function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight},sLeft: function(){return window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft},wWidth: function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body.clientWidth}};return this.each(function(index){if(index==0){var $this=$(this);var elHeight=$this.height();var elWidth=$this.width();var elTop=pos.sTop()+(pos.wHeight()/ 2) - (elHeight / 2);var elLeft=pos.sLeft()+(pos.wWidth()/ 2) - (elWidth / 2);if(elTop<10)
elTop=10;$this.css({position:'absolute',marginTop:'0',top:elTop,left:elLeft})}})}})(jQuery);

