function Popup(){this.openPopUp=openPopUp;var newwindow;function openPopUp(bean,title){newwindow=window.open(bean,title,'dependent=no, menubar=no, toolbar=no, scrollbars=yes, width=950, height=540');if(window.focus){newwindow.focus();}}}
function getBannerLink(sAttribute,iFirstDelim){return sAttribute.substring(0,iFirstDelim);}
function getBannerWidth(sAttribute,iFirstDelim,iLastDelim){return sAttribute.substring(iFirstDelim+1,iLastDelim);}
function getBannerHeight(sAttribute,iLastDelim){return sAttribute.substring(iLastDelim+1,sAttribute.length);}
function getBannerTag(sAttribute){var iFirstDelim=sAttribute.indexOf("^");var iLastDelim=sAttribute.lastIndexOf("^");var sLink=getBannerLink(sAttribute,iFirstDelim);var sWidth=getBannerWidth(sAttribute,iFirstDelim,iLastDelim);var sHeight=getBannerHeight(sAttribute,iLastDelim);return getBannerTag_Frame(sLink,sWidth,sHeight);}
function getBannerTag_Frame(sLink,sWidth,sHeight){return"<"+"iframe frameborder='0' width='"+sWidth+"px' height='"+sHeight+"px'  allowtransparency='true' scrolling='no' src='"+sLink+"'> </iframe>";}
function getBannnerTag_Object(sLink,sWidth,sHeight){return"<noframes> <object border='0' width='"+sWidth+"px;' height='"+sHeight+"px;'  allowtransparency='true' scroll='no' data='"+sLink+"'> </object> </noframes>";}
function doShowBanners(){doShowTopBanner();doShowRightBanners()}
function doShowTopBanner(){doShowBannerProper('idTopBanner','idTopBannerContent');}
function doShowRightBanners(){var oNextBanner=null;do{var oNextBanner=doShowBannerProper('idRightBanner','idRightBannerContent');}while(null!=oNextBanner);}
function doShowBannerProper(idMain,idSub){var oBanner=document.getElementById(idMain);var oBannerContent=document.getElementById(idSub);if(null!=oBanner){oBanner.innerHTML=getBannerTag(oBannerContent.innerHTML);oBanner.id=idMain+"_done";oBannerContent.id=idSub+"_done";}
return oBanner;}
function Search(){this.clearSearchField=clearSearchField;this.resetSearchField=resetSearchField;this.openPopUp=openPopUp;this.checkCounter=checkCounter;var ctr=0;function clearSearchField(){ctr=1;var searchField=document.getElementById('searchString');if(trim(searchField.value)=='Search Microscopy Today'){searchField.value='';}}
function resetSearchField(){var searchField=document.getElementById('searchString');if(searchField.value==null||trim(searchField.value)==''){searchField.value='Search Microscopy Today';ctr=0;}}
function checkCounter(){if(ctr!=1){document.getElementById('searchString').value='';return false;}else{return true;}}
function openPopUp(bean,title){window.open(bean,title,'dependent=no, menubar=no, toolbar=no, scrollbars=yes, width=950, height=540');return false;}
function trim(s)
{while(s.substring(0,1)==' ')
{s=s.substring(1,s.length);}
while(s.substring(s.length-1,s.length)==' ')
{s=s.substring(0,s.length-1);}
return s;}}
