var margin_top=40var margin_right=40var margin_bottom=40var margin_left=40var slide_timeoutvar slide_timeout_notificationfunction s_image(a){obj_body=document.getElementsByTagName('body').item(0)rel_attr=new String(a.getAttribute('rel'))val=rel_attr.replace('splash|','')if(val !='splash'&&s_groups[val].length>0){current_group=valcurrent_position=in_array(s_groups[val],a.getAttribute('href'))}if(!document.getElementById('s_screen')){obj_s_screen=document.createElement('a')obj_s_screen.setAttribute('id','s_screen')obj_s_screen.setAttribute('title','Close the splash')array_page_size=getPageSize()obj_s_screen.style.width='100%'obj_s_screen.style.height=array_page_size[1]+'px'obj_s_screen.onclick=function(){s_bye();return false;}obj_body.appendChild(obj_s_screen)obj_content=document.createElement('div')obj_content.setAttribute('id','image_content')obj_content.style.width='400px'obj_content.style.height='400px'obj_content.className='ajax-loading'obj_body.appendChild(obj_content)array_page_scroll=getPageScroll()array_page_size=getPageSize()obj_content.style.top=array_page_scroll[1]+margin_top+'px'obj_content.style.left=array_page_size[0]/2-(parseInt(obj_content.style.width)/2)+'px'}else{obj_s_screen=document.getElementById('s_screen')obj_content=document.getElementById('image_content')obj_content.removeChild(document.getElementById('s_img'))obj_content.className='ajax-loading'}if(document.getElementById('s_previous')){obj_content.removeChild(document.getElementById('s_previous'))obj_content.removeChild(document.getElementById('s_next'))if(document.getElementById('s_notification')){obj_content.removeChild(document.getElementById('s_notification'));}what=(is_sliding)? 's_pause' : 's_play'obj_content.removeChild(document.getElementById(what))}ini_image(a)}function ini_image(a){img=new Image()img.src=a.hrefif(!img.complete){img.onload=function(){image_display(a)}}else{image_display(a)}}function image_display(a){obj_body=document.getElementsByTagName('body').item(0)obj_content=document.getElementById('image_content')obj_image=document.createElement('img')obj_image.setAttribute('id','s_img')obj_image.onclick=function(){s_bye();return false;}obj_content.appendChild(obj_image)obj_content.style.width=img.width+'px'obj_content.style.height=img.height+'px'array_page_scroll=getPageScroll()array_page_size=getPageSize()obj_content.style.top=array_page_scroll[1]+margin_top+'px'obj_content.style.left=array_page_size[0]/2-(parseInt(img.width)/2)+'px'obj_s_screen=document.getElementById('s_screen')obj_content=document.getElementById('image_content')obj_content.className=''obj_image.setAttribute('src',a.href)obj_image.style.display='block'array_page_size=getPageSize()total_width=margin_left+parseInt(obj_content.style.width)+margin_rightif(total_width>array_page_size[0]){obj_s_screen.style.width=total_width+'px';obj_content.style.left=margin_left+'px';}total_height=margin_top+parseInt(obj_content.style.top)+parseInt(obj_image.height)+margin_bottomif(total_height>array_page_size[1]){obj_s_screen.style.height=total_height+'px';}ini_nav(a)}function ini_nav(a){clearTimeout(slide_timeout)obj_content=document.getElementById('image_content')}function s_bye(){clearTimeout(slide_timeout)clearTimeout(slide_timeout_notification)is_sliding=falseobj_body=document.getElementsByTagName('body').item(0)obj_body.removeChild(document.getElementById('s_screen'))obj_body.removeChild(document.getElementById('image_content'))}function ini_s_images(){s_groups=new Array()s_as=new Array()as=document.getElementsByTagName('a')for(i=0;i<as.length;i++){a=as[i]rel_attr=new String(a.getAttribute('rel'))if(rel_attr.match('splash')){a.onclick=function(){s_image(this);return false;}val=rel_attr.replace('splash|','')if(val !='splash'){if(!s_groups[val] || typeof s_groups[val] !='object'){array=new Array()}else{array=s_groups[val]}if(a.getAttribute('href')){array[array.length]=a.getAttribute('href')s_groups[val]=arrays_as[a.getAttribute('href')]=a}}}}document.onkeydown=key_check}function getPageScroll(){var yScrollif(self.pageYOffset){yScroll=self.pageYOffset}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop}else if(document.body){yScroll=document.body.scrollTop}arrayPageScroll=new Array('',yScroll)return arrayPageScroll}function getPageSize(){var xScroll,yScrollif(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidthyScroll=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidthyScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidthyScroll=document.body.offsetHeight}var windowWidth,windowHeightif(self.innerHeight){windowWidth=self.innerWidthwindowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidthwindowHeight=document.documentElement.clientHeight}else if(document.body){windowWidth=document.body.clientWidthwindowHeight=document.body.clientHeight}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=windowWidth}else{pageWidth=xScroll}arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)return arrayPageSize}function addEvent(obj,evType,fn,useCapture){if(obj.addEventListener){obj.addEventListener(evType,fn,useCapture)return true}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn)return r}else{alert("Handler could not be attached")}}function in_array(ar,val){if(ar.length==0){return-1;}for(i=0;i<ar.length;i++){if(ar[i]==val){return i;}}return-1}addEvent(window,'load',ini_s_images)
