
function dialog(url,param,name,x,y){var newWin=window.open(url+param,name,'scrollbars=yes,menubar=no,status=no,toolbar=no,width='+x+',height='+y+', resizable=yes')
newWin.focus();}
function statusbar(text){window.status=text;return true;}
function view_picture(link_elmt)
{if(link_elmt.href!=""){dialog(link_elmt.href,'','Visualisation','600px','300px');}
return link_elmt.href;}
function viewPicture(input_elmt_id,path)
{input_elmt=document.getElementById(input_elmt_id);if((input_elmt!=undefined)&&(input_elmt.value!="")){var url=input_elmt.value;if(url.substr(0,4)=='http'){dialog(url,'','Visualisation','600px','300px');}else{dialog(path+'/'+input_elmt.value,'','Visualisation','600px','300px');}}else{alert('Please select first a document.');}
return path+input_elmt.value;}
function popup_color_picker(elementID)
{var width=400;var height=300;window.open('../color_picker.aspx?element='+elementID,'cp','resizable=no, location=no, width='+width+', height='+height+', menubar=no, status=yes, scrollbars=no, menubar=no');}
function toggleActivity()
{var activityElement=document.getElementById('status_activity');if(activityElement.className=='active'){activityElement.className='inactive';}else{activityElement.className='active';}}
function togglePane(panel,panelId)
{var paneElement=document.getElementById(panelId);if(paneElement)
{if(paneElement.className=='show')
{paneElement.className='hidden';panel.className='folded';}
else
{paneElement.className='show';panel.className='unfolded';}}}
function $E(domId)
{return document.getElementById(domId);}
function toggleLeftSidebar(handleId,paneId)
{var handleElement=$(handleId);if(!handleElement){return;}
if(handleElement.hasClassName('show')){$E('lsidebar').style.left='-195px';$E('contents').style.left='5px';}else{$E('lsidebar').style.left='0px';$E('contents').style.left='200px';}
handleElement.toggleClassName('show');}
var modalBg=null;function showModal(domId)
{var arrayPageScroll=document.viewport.getScrollOffsets();var viewPortDims=document.viewport.getDimensions();var offsetTop=arrayPageScroll[1]+(document.viewport.getHeight()/10)-100;var offsetLeft=arrayPageScroll[0];var wrapperElmt=$E(domId);var wrapperElmtDims=Element.getDimensions(wrapperElmt);wrapperElmt.style.position='absolute';wrapperElmt.style.zIndex=20000;wrapperElmt.style.display='block';wrapperElmt.style.top=((viewPortDims['height']-wrapperElmtDims['height'])/2)+offsetTop+'px';wrapperElmt.style.left=((document.viewport.getWidth()-wrapperElmtDims['width'])/2)+'px';var body=document.getElementsByTagName('body')[0];var bodyDims=Element.getDimensions(body);Element.insert(body,{'top':wrapperElmt});if(modalBg===null){body.insert({'top':"<div id='modal_bg' class='modal_bg'></div>"});modalBg=true;}
$('modal_bg').show();$('modal_bg').style.width=document.viewport.getWidth()+'px';$('modal_bg').style.height=viewPortDims['height']+'px';Event.observe('modal_bg','click',function(){closeModal(domId)});$$('select','object','embed').each(function(node){node.style.visibility='hidden'});}
function closeModal(domId)
{$$('select','object','embed').each(function(node){node.style.visibility='visible'});$('modal_bg').hide();var wrapperElmt=$E(domId);wrapperElmt.hide();}
