PageSourceSearch

https://www.na-mic.org/css/e2_gallery/e2photo2.js

js na-mic.org collected 2026-10-02 04:11:59 UTC 7,209 bytes, 221 lines download raw bytes

1// JavaScript Document
2function initGallery ( tempgallery, count, first_id, startwidth, startheight ) {
3
4  document.body.setAttribute("onkeydown","KeyDown(event);");
5  imggallery = tempgallery;
6  if (preloadimg=="yes"){
7    for (x=0; x<imggallery.length; x++){
8      var myimage=new Image()
9      myimage.src=imggallery[x][0]
10    }
11  }
12  thumbnailnum = imggallery.length;
13  current_imgid = first_id;
14  currentwidth=startwidth;
15  currentheight=startheight;    
16  width=imggallery[0][9];
17  height=imggallery[0][10];
18  if(330*(width/height)>490)
19    {
20    cwidth=490;
21    }
22  else
23    {
24    cwidth=330*(width/height);
25    }
26var setloadersize = new Fx.Styles('main_image_wrapper',{duration:transspeed,onComplete: function(){loadfirstimage(currentwidth,currentheight)}});
27     var fademe = new Fx.Style('iptc_info','opacity', {duration:transspeed });
28    fademe.set(1,0);
29
30    setloadersize.start({
31      'width':[330,cwidth],
32      'height':[399,330]      
33    });
34
35}
36
37
38window.addEvent('domready', function() {
39initGallery( tempgallery, tempgallery.length, tempgallery[0][8], tempgallery[0][1], tempgallery[0][2], 0 );
40});
41
42
43
44
45function KeyDown(e)
46{
47  if (!e) e=window.event;
48  var selectName;
49  switch(e.keyCode)
50  {
51  case 37:
52    // Key left.
53    previmage(current_imgid);
54    break;
55  case 39:
56    // Key right.
57    nextimage(current_imgid);
58    break;
59  }
60}
61
62
63function getstarted(width, height, loadarea, imgindex, img_id, current_imgid)
64{
65  var height_custom='';
66  var width_custom='';
67  if(330*(width/height)>490)
68    {
69    width=490;
70    }
71  else
72    {
73    width=330*(width/height);
74    }
75  height=330;
76  minheight=document.getElementById('left_text').offsetHeight;
77  checknext(img_id);
78  if(current_imgid!=img_id){
79    if(firstimagestart==1){
80      currentwidth=firstimagewidth;
81      currentheight=firstimageheight;
82      firstimagestart=0;
83    }
84    if(nextorprev==1){
85      currentwidth=cwidth;
86      currentheight=cheight;
87      nextorprev=0;
88    }
89
90    modifyimage(loadarea, imgindex, img_id);
91    //var resizeDivHeight = new Fx.Styles('main_image_wrapper',{duration:transspeed, onComplete: function(){modifyimage(loadarea, imgindex, img_id);currentheight=height;currentwidth=width;} });
92    //var fader = new Fx.Style('imgloader','opacity', {duration:fadespeed, onComplete: function(){  resizeDivHeight.start({'height': [330,330],'width': [currentwidth,width]});} });
93    //fader.start(1,0);
94    var fadeiptc = new Fx.Style('iptc_btn','opacity', {duration:transspeed });
95    fadeiptc.set(0);
96    var titlefade = new Fx.Style('imgtitle','opacity', {duration:transspeed });
97    titlefade.set(0);
98    fadeout=0
99
100      var fademe = new Fx.Style('iptc_info','opacity', {duration:transspeed });
101      fademe.set(1,0);;
102  }
103}
104
105
106function loadfirstimage(currentwidth,currentheight){
107
108  var fadefirst = new Fx.Style('imgloader','opacity', {duration:fadespeed });
109  fadefirst.set(0);
110  var firsttitlefade = new Fx.Style('imgtitle','opacity', {duration:transspeed });
111  firsttitlefade.set(0);
112  function setfirstimage(){
113    var height_custom='';
114    var width_custom='';
115    if(330*(tempgallery[0][9]/tempgallery[0][10])>490)
116      {
117      tmp=tempgallery[0][10]*(490/tempgallery[0][9]);
118      tmp=200-tmp/2;
119      width_custom='width=490 style="position:relative;top:'+tmp+'px;';
120      }
121    else
122      {
123      width_custom='height=330';
124      }
125    var newHTML = "<img src='"+tempgallery[0][0]+"' "+height_custom+" "+width_custom+" style=\"cursor:pointer;\"  />";
126    //var newHTML = "<img src='"+tempgallery[0][0]+"' "+height_custom+" "+width_custom+" style=\"cursor:pointer;\" onclick=\"javascript:fullres(current_imgid);\" />";
127    $('imgloader').setHTML(newHTML);
128
129    var firsttitle=document.getElementById('imgtitle');
130    
131    var strChUserAgent = navigator.userAgent;
132     var intSplitStart = strChUserAgent.indexOf("(",0);
133     var intSplitEnd = strChUserAgent.indexOf(")",0);
134     var strChStart = strChUserAgent.substring(0,intSplitStart);
135     var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
136     var strChEnd = strChUserAgent.substring(strChEnd);
137    
138     if(strChMid.indexOf("MSIE") == -1)
139      {
140       var main_image_wrapper=document.getElementById('main_image_wrapper');
141    main_image_wrapper.setAttribute('onclick','javascript:fullres('+current_imgid+')'); 
142      }
143    firsttitle.innerHTML="<strong>"+tempgallery[0][4]+"</strong> "+tempgallery[0][7];
144    fadefirst.start(0,1);
145    //firsttitlefade.start(0,1);
146    currentheight=imggallery[0][2];
147    currentwidth=imggallery[0][1];
148  }
149  new Asset.image(imggallery[0][0], {onload: setfirstimage});
150  /*firstimageload.onload=function(){
151    alert("image loaded");
152    var firstimg=document.getElementById('imgloader');
153    firstimg.innerHTML=returnimgcode(imggallery[0]);
154    var firsttitle=document.getElementById('imgtitle');
155    firsttitle.innerHTML="<strong>"+tempgallery[0][4]+"</strong> "+tempgallery[0][7];
156    fadefirst.start(0,1);
157    firsttitlefade.start(0,1);
158    currentheight=imggallery[0][2];
159    currentwidth=imggallery[0][1];
160  }*/
161}
162
163var fullrest_allowed=true;
164function nextimage(current_imgid){
165  
166  fullrest_allowed=false;
167  newimgid = Number(current_imgid)+1;
168  if(imggallery[newimgid]==undefined)
169    {
170    return false;
171    }
172  newwidth =imggallery[newimgid][1]
173  newheight =imggallery[newimgid][2]
174  newimgindex =imggallery[newimgid][8]
175  newimgid = imggallery[newimgid][8]
176  cwidth=imggallery[current_imgid][1]
177  cheight=imggallery[current_imgid][2]
178  checknext(newimgid);
179  nextorprev=1;
180  height=Number(newheight);
181  getstarted(Number(newwidth), height, 'imgloader',Number(newimgindex) ,Number(newimgid) , Number(current_imgid), Number(cwidth), Number(cheight))
182  loadinfo();
183}
184
185var current_imgid_global=0;
186
187function fullres(current_imgid){
188  current_imgid_global=current_imgid;
189  setTimeout("fullres2()",100);
190}
191
192function fullres2()
193  {
194  if (fullrest_allowed) 
195    {
196    window.open(imggallery[current_imgid_global][11], '_blank', config = 'height=600, width=800, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
197    //window.open(imggallery[current_imgid_global][11], '_blank', config = 'height=' + imggallery[current_imgid_global][10] + ',  width=' + imggallery[current_imgid_global][9] + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
198    }
199  fullrest_allowed=true;
200  }
201
202function previmage(current_imgid){
203  
204  fullrest_allowed=false;
205  newimgid = Number(current_imgid)-1;
206  if(imggallery[newimgid]==undefined)
207    {
208    return false;
209    }
210  newwidth =imggallery[newimgid][1]
211  newheight =imggallery[newimgid][2]
212  newimgindex =imggallery[newimgid][8]
213  newimgid = imggallery[newimgid][8]
214  cwidth=imggallery[current_imgid][1]
215  cheight=imggallery[current_imgid][2]
216  checknext(newimgid);
217  nextorprev=1;
218  getstarted(Number(newwidth), Number(newheight), 'imgloader',Number(newimgindex) ,Number(newimgid) , Number(current_imgid), Number(cwidth), Number(cheight))
219}
220
221

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.