var popupDiv=null;var iframe=null;var blockingDiv=null;var scrollTop=0;var div_width=0;var div_height=0;var center='true';function showWarningDiv(divId){popupDiv=document.getElementById(divId);iframe=document.getElementById('iframeElement');blockingDiv=document.getElementById('blockDiv');if(popupDiv){popupDiv.style['display']='block';if(iframe){iframe.style['display']='block';iframe.style['width']=(popupDiv.clientWidth-10)+'px';iframe.style['height']=(popupDiv.clientHeight-10)+'px';}window.onresize=moveBlockDiv;if(center=='true'){window.onscroll=moveBlockDiv;}var midX=(getXYCoord()[0]+getScrollXY()[0])/2-(div_width/2);var midY=(getXYCoord()[1])/2+getScrollXY()[1]-(div_height/2);movePopupDiv(popupDiv,midX,midY);}}function hideWarningDiv(){if(document.getElementById('previewImage')){document.getElementById('previewImage').src='images/square-loader.gif';}iframe=document.getElementById('iframeElement');blockingDiv=document.getElementById('blockDiv');if(popupDiv){popupDiv.style['display']='none';}if(iframe){iframe.style['display']='none';}if(blockingDiv){blockingDiv.style['display']='none';}window.onresize='';window.onscroll='';}function moveBlockDiv(){var midX=(getXYCoord()[0]+getScrollXY()[0])/2-(div_width/2);var midY=(getXYCoord()[1])/2+getScrollXY()[1]-(div_height/2);movePopupDiv(popupDiv,midX,midY);}function movePopupDiv(popupDiv,x,y){if(y<0){y=0;}if(popupDiv){popupDiv.style['top']=y+'px';popupDiv.style['left']=x+'px';if(iframe){iframe.style['top']=(y+5)+'px';iframe.style['left']=(x+5)+'px';}}}function getXYCoord(){var myWidth=0;var myHeight=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;}return[myWidth,myHeight];}function getScrollXY(){var scrOfX=0;var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}return[scrOfX,scrOfY];}function preview(imageUrl,imageLayout,imageAuthor,imageId){var height=document.documentElement.clientHeight;if(height<550){center='false';window.onscroll='';}else{center='true';}var previewDiv=document.getElementById('previewPanel');var imageDiv=document.getElementById('middleDiv');if(imageLayout=='SQUARE'){previewDiv.style['width']='530px';previewDiv.style['height']='560px';imageDiv.style['height']='502px';imageDiv.style['width']='502px';div_width=530;div_height=560;}else if(imageLayout=='LANDSCAPE'){previewDiv.style['width']='730px';previewDiv.style['height']='560px';imageDiv.style['height']='502px';imageDiv.style['width']='702px';div_width=730;div_height=560;}else if(imageLayout=='PORTRAIT'){var screenHeight=screen.height;if(screenHeight<=800){previewDiv.style['height']='560px';imageDiv.style['height']='500px';imageDiv.style['width']='500px';div_height=560;}else{previewDiv.style['height']='760px';imageDiv.style['height']='702px';imageDiv.style['width']='502px';div_height=760;}div_width=530;previewDiv.style['width']='530px';}var previewImage=document.getElementById('previewImage');previewImage.src=imageUrl;var authorLink=document.getElementById('authorLink');authorLink.href='/browse.seam?artist='+imageAuthor;var customizeLink=document.getElementById('customizeLink');customizeLink.href='/customize.seam?picid='+imageId;showWarningDiv('previewPanel');}function showCopyright(){div_width=350;div_height=160;showWarningDiv('copyrightPanel');}function showWarning(){div_width=250;div_height=100;showWarningDiv('warningPanel');}function changeStyle(style,element){var browser=navigator.appName;if(style=='mouse-over'){element.style.border="2px solid #4961b9";}else if(style=='mouse-out'){element.style.border="2px solid #f9ebae";}}