annotate e2gallerypro/js/e2gallerypro.js @ 16:e902d48caadf judyates

added access.log and error.log
author Robert McIntyre <rlm@mit.edu>
date Tue, 22 Jun 2010 13:41:04 -0400
parents 2f433df9b961
children
rev   line source
rlm@9 1 var E2GalleryPro={version:"1.2"};
rlm@9 2 var openclose=true;
rlm@9 3 var slidesHidden=false;
rlm@9 4 var imagecontainer=$("images");
rlm@9 5 var busy=false;
rlm@9 6 var previousid="0";
rlm@9 7 var currentthumbpos=0;
rlm@9 8 var showInfoType="show";
rlm@9 9 var movedamount=0;
rlm@9 10 var imagenumber=Number(1);
rlm@9 11 var thumbnailNumberPos;
rlm@9 12 var thumbSizing;
rlm@9 13 var totalthumbsvisible=0;
rlm@9 14 var currentThumbSpot=1;
rlm@9 15 var thumbWidth=setThumbWidth;
rlm@9 16 var largeHtmlIsCreated;
rlm@9 17 var galleryHeight;
rlm@9 18 var showThumbs="hide";
rlm@9 19 var fsisopen="closed";
rlm@9 20 var animatingPop=false;
rlm@9 21 var moving=false;
rlm@9 22 var timer;
rlm@9 23 var playing=false;
rlm@9 24 var prevHidden=false;
rlm@9 25 var nextHidden=false;
rlm@9 26 var totalNumImages;
rlm@9 27 var totalNumQuicktime;
rlm@9 28 var totalNumMedia;
rlm@9 29 var closinggalleries=false;
rlm@9 30 var currentGallery=maingalleries[0]["gallerynum"];
rlm@9 31 var currentimage=0;
rlm@9 32 var lastimage=maingalleries[0]["end"];
rlm@9 33 var startImage=maingalleries[0]["start"];
rlm@9 34 var largeIsOpen=false;
rlm@9 35
rlm@9 36 function openforsale()
rlm@9 37 {
rlm@9 38 if(fsisopen=="open")
rlm@9 39 {
rlm@9 40 fsisopen="closed";
rlm@9 41 var b=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});
rlm@9 42 b.start({bottom:-277});
rlm@9 43 var a=new Fx.Morph("fsclose",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});
rlm@9 44 a.start({opacity:0})
rlm@9 45 }
rlm@9 46 else
rlm@9 47 {
rlm@9 48 fsisopen="open";
rlm@9 49 var b=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});
rlm@9 50 b.start({bottom:-100});
rlm@9 51 var a=new Fx.Morph("fsclose",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});
rlm@9 52 a.start({opacity:1})
rlm@9 53 }
rlm@9 54 }
rlm@9 55
rlm@9 56 function addImage(e)
rlm@9 57 {
rlm@9 58 currentimage=galleryimages[e]["imgid"];
rlm@9 59 filetype=galleryimages[e]["filetype"];
rlm@9 60 $("imgloader").empty();
rlm@9 61 $("infoloader").empty();
rlm@9 62 var f="";
rlm@9 63 if(galleryimages[e]["title"])
rlm@9 64 {
rlm@9 65 f+="<h2>"+galleryimages[e]["title"]+"</h2>";
rlm@9 66 if(galleryimages[e]["forsale"]==true)
rlm@9 67 {
rlm@9 68 f+='<div id="purchasebtn">'+purchaseprinttxt+"</div>"
rlm@9 69 }
rlm@9 70 }
rlm@9 71 if(galleryimages[e]["description"])
rlm@9 72 {
rlm@9 73 f+='<span class="description">'+galleryimages[e]["description"]+"</span>";
rlm@9 74 if(galleryimages[e]["forsale"]==true)
rlm@9 75 {
rlm@9 76 f+='<div id="purchasebtn">'+purchaseprinttxt+"</div>"
rlm@9 77 }
rlm@9 78 }
rlm@9 79 if(galleryimages[e]["copyright"])
rlm@9 80 {
rlm@9 81 f+='<div class="copyright"><strong>Copyright:</strong> '+galleryimages[e]["copyright"]+"</div>";
rlm@9 82 if(galleryimages[e]["forsale"]==true)
rlm@9 83 {
rlm@9 84 f+='<div id="purchasebtn">'+purchaseprinttxt+"</div>"
rlm@9 85 }
rlm@9 86 }
rlm@9 87 if(galleryimages[e]["author"])
rlm@9 88 {
rlm@9 89 f+='<div class="author"><strong>Author:</strong> '+galleryimages[e]["author"]+"</div>";
rlm@9 90 if(galleryimages[e]["forsale"]==true)
rlm@9 91 {
rlm@9 92 f+='<div id="purchasebtn">'+purchaseprinttxt+"</div>"
rlm@9 93 }
rlm@9 94 }
rlm@9 95
rlm@9 96 if(f=="")
rlm@9 97 {
rlm@9 98 f+="<h2>No Image Information Available</h2>";
rlm@9 99 if(galleryimages[e]["forsale"]==true)
rlm@9 100 {
rlm@9 101 f+='<div id="purchasebtn">'+purchaseprinttxt+"</div>"
rlm@9 102 }
rlm@9 103 }
rlm@9 104
rlm@9 105 $("infoloader").set("html",f);
rlm@9 106 var d=new Fx.Morph("infoloader",{duration:transitionspeed});
rlm@9 107 var b=new Fx.Morph("imgloader",{duration:transitionspeed,onComplete:function(){busy=false}});
rlm@9 108 var g=new Fx.Morph("imgloader",{duration:transitionspeed,onComplete:function()
rlm@9 109 {
rlm@9 110 if(filetype=="image")
rlm@9 111 {
rlm@9 112 var o="<img src='"+galleryimages[e]["path"]+galleryimages[e]["src"]+"' id='imgsrc' title='"+galleryimages[e]["title"]+"' />";
rlm@9 113 $("imgloader").set("html",o);
rlm@9 114 b.start({opacity:1})
rlm@9 115 }
rlm@9 116 if(filetype=="flv"||filetype=="mp4")
rlm@9 117 {
rlm@9 118 fileWidth=galleryimages[e]["width"]||flashdefaultWidth;
rlm@9 119 fileHeight=galleryimages[e]["height"]||flashdefaultHeight;
rlm@9 120 media=new Swiff(""+NBpath+"?videoURL="+galleryimages[e]["mediaURL"]+"&allowSmoothing=true&autoPlay="+autoplay+"&buffer=6&showTimecode="+showTimecode+"&loop=true&controlColour="+controllerColor+"&scaleIfFullScreen=true&showScalingButton=false",{id:"MediaboxSWF",width:mediaWidth,height:mediaHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 121 media.inject("imgloader");
rlm@9 122 b.start({opacity:1})
rlm@9 123 }
rlm@9 124 else
rlm@9 125 {
rlm@9 126 if(filetype=="mov")
rlm@9 127 {
rlm@9 128 var n='<object width="'+galleryimages[e]["width"]+'" height="'+galleryimages[e]["height"]+'" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="'+galleryimages[e]["mediaURL"]+'"><param name="autoplay" value="'+autoplay+'"><param name="controller" value="true"><embed src="'+galleryimages[e]["mediaURL"]+'" width="'+galleryimages[e]["width"]+'" height="'+galleryimages[e]["height"]+'" autoplay="'+autoplay+'" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';
rlm@9 129 $("imgloader").set("html",n);
rlm@9 130 b.start({opacity:1})
rlm@9 131 }else{
rlm@9 132 if(filetype=="swf")
rlm@9 133 {
rlm@9 134 fileWidth=galleryimages[e]["width"]||flashdefaultWidth;
rlm@9 135 fileHeight=galleryimages[e]["height"]||flashdefaultHeight;
rlm@9 136 media=new Swiff(galleryimages[e]["mediaURL"],{id:"e2gallerySWF",width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});media.inject("imgloader");
rlm@9 137 b.start({opacity:1})
rlm@9 138 }else{
rlm@9 139 if(filetype=="blip.tv")
rlm@9 140 {
rlm@9 141 fileWidth=galleryimages[e]["width"]||"640px";
rlm@9 142 fileHeight=galleryimages[e]["height"]||"390px";
rlm@9 143 media=new Swiff(galleryimages[e]["mediaURL"],{src:galleryimages[e]["mediaURL"],width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 144 media.inject("imgloader");
rlm@9 145 b.start({opacity:1})
rlm@9 146 }else{
rlm@9 147 if(filetype=="dailymotion")
rlm@9 148 {
rlm@9 149 fileWidth=galleryimages[e]["width"]||"480px";
rlm@9 150 fileHeight=galleryimages[e]["height"]||"381px";
rlm@9 151 media=new Swiff(galleryimages[e]["mediaURL"],{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 152 media.inject("imgloader");
rlm@9 153 b.start({opacity:1})
rlm@9 154 }else{
rlm@9 155 if(filetype=="flickr")
rlm@9 156 {
rlm@9 157 fileWidth=galleryimages[e]["width"]||"500px";
rlm@9 158 fileHeight=galleryimages[e]["height"]||"375px";
rlm@9 159 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 160 mediaId=mediaSplit[5];
rlm@9 161 media=new Swiff("http://www.flickr.com/apps/video/stewart.swf",{id:mediaId,classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:fileWidth,height:fileHeight,params:{flashvars:"photo_id="+mediaId+"&amp;show_info_box="+flInfo,wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 162 media.inject("imgloader");
rlm@9 163 b.start({opacity:1})
rlm@9 164 }else{
rlm@9 165 if(filetype=="google")
rlm@9 166 {
rlm@9 167 fileWidth=galleryimages[e]["width"]||"400px";
rlm@9 168 fileHeight=galleryimages[e]["height"]||"326px";
rlm@9 169 mediaSplit=galleryimages[e]["mediaURL"].split("=");
rlm@9 170 mediaId=mediaSplit[1];
rlm@9 171 media=new Swiff("http://video.google.com/googleplayer.swf?docId="+mediaId+"&autoplay="+autoplayNum,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 172 media.inject("imgloader");
rlm@9 173 b.start({opacity:1})
rlm@9 174 }else{
rlm@9 175 if(filetype=="metacafe")
rlm@9 176 {
rlm@9 177 fileWidth=galleryimages[e]["width"]||"400px";
rlm@9 178 fileHeight=galleryimages[e]["height"]||"345px";
rlm@9 179 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 180 mediaId=mediaSplit[4];
rlm@9 181 media=new Swiff("http://www.metacafe.com/fplayer/"+mediaId+"/.swf",{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 182 media.inject("imgloader");
rlm@9 183 b.start({opacity:1})
rlm@9 184 }else{
rlm@9 185 if(filetype=="myspace")
rlm@9 186 {
rlm@9 187 fileWidth=galleryimages[e]["width"]||"425px";
rlm@9 188 fileHeight=galleryimages[e]["height"]||"360px";
rlm@9 189 mediaSplit=galleryimages[e]["mediaURL"].split("=");
rlm@9 190 mediaId=mediaSplit[2];
rlm@9 191 media=new Swiff("http://lads.myspace.com/videos/vplayer.swf?m="+mediaId+"&v=2&type=video",{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 192 media.inject("imgloader");
rlm@9 193 b.start({opacity:1})
rlm@9 194 }else{
rlm@9 195 if(filetype=="revver")
rlm@9 196 {
rlm@9 197 fileWidth=galleryimages[e]["width"];
rlm@9 198 fileHeight=galleryimages[e]["height"];
rlm@9 199 mediaSplit=galleryimages[e]["mediaURL"].split("/");mediaId=mediaSplit[4];
rlm@9 200 media=new Swiff("http://flash.revver.com/player/1.0/player.swf?mediaId="+mediaId+"&affiliateId="+revverID+"&allowFullScreen="+revverFullscreen+"&backColor=#"+revverBack+"&frontColor=#"+revverFront+"&gradColor=#"+revverGrad+"&shareUrl=revver",{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 201 media.inject("imgloader");
rlm@9 202 b.start({opacity:1})
rlm@9 203 }else{
rlm@9 204 if(filetype=="rutube")
rlm@9 205 {
rlm@9 206 fileWidth=galleryimages[e]["width"]||"470px";
rlm@9 207 fileHeight=galleryimages[e]["height"]||"353px";
rlm@9 208 mediaSplit=galleryimages[e]["mediaURL"].split("=");
rlm@9 209 mediaId=mediaSplit[1];
rlm@9 210 media=new Swiff("http://video.rutube.ru/"+mediaId,{movie:"http://video.rutube.ru/"+mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 211 media.inject("imgloader");
rlm@9 212 b.start({opacity:1})
rlm@9 213 }else{
rlm@9 214 if(filetype=="seesmicm")
rlm@9 215 {
rlm@9 216 fileWidth=galleryimages[e]["width"]||"435px";
rlm@9 217 fileHeight=galleryimages[e]["height"]||"355px";
rlm@9 218 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 219 mediaId=mediaSplit[5];
rlm@9 220 media=new Swiff("http://seesmic.com/Standalone.swf?video="+mediaId,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 221 media.inject("imgloader");
rlm@9 222 b.start({opacity:1})
rlm@9 223 }else{
rlm@9 224 if(filetype=="tudou")
rlm@9 225 {
rlm@9 226 fileWidth=galleryimages[e]["width"]||"400px";
rlm@9 227 fileHeight=galleryimages[e]["height"]||"340px";
rlm@9 228 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 229 mediaId=mediaSplit[5];
rlm@9 230 media=new Swiff("http://www.tudou.com/v/"+mediaId,{width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 231 media.inject("imgloader");
rlm@9 232 b.start({opacity:1})
rlm@9 233 }else{
rlm@9 234 if(filetype=="youku")
rlm@9 235 {
rlm@9 236 fileWidth=galleryimages[e]["width"]||"480px";
rlm@9 237 fileHeight=galleryimages[e]["height"]||"400px";
rlm@9 238 mediaSplit=galleryimages[e]["mediaURL"].split("id_");
rlm@9 239 mediaId=mediaSplit[1];
rlm@9 240 media=new Swiff("http://player.youku.com/player.php/sid/"+mediaId+"=/v.swf",{width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 241 media.inject("imgloader");
rlm@9 242 b.start({opacity:1})
rlm@9 243 }else{
rlm@9 244 if(filetype=="youtube")
rlm@9 245 {
rlm@9 246 mediaSplit=galleryimages[e]["mediaURL"].split("v=");
rlm@9 247 mediaId=mediaSplit[1];
rlm@9 248 if(mediaId.match(/fmt=18/i))
rlm@9 249 {
rlm@9 250 mediaFmt="&ap=%2526fmt%3D18";
rlm@9 251 mediaWidth=galleryimages[e]["width"]||"560px";
rlm@9 252 mediaHeight=galleryimages[e]["height"]||"345px"
rlm@9 253 }else{
rlm@9 254 if(mediaId.match(/fmt=22/i))
rlm@9 255 {
rlm@9 256 mediaFmt="&ap=%2526fmt%3D22";
rlm@9 257 mediaWidth=galleryimages[e]["width"]||"640px";
rlm@9 258 mediaHeight=galleryimages[e]["height"]||"385px"
rlm@9 259 }else
rlm@9 260 {
rlm@9 261 mediaFmt=ytQuality;
rlm@9 262 mediaWidth=galleryimages[e]["width"]||"480px";
rlm@9 263 mediaHeight=galleryimages[e]["height"]||"295px"
rlm@9 264 }}
rlm@9 265 media=new Swiff("http://www.youtube.com/v/"+mediaId+"&autoplay="+autoplayNum+"&fs="+fullscreenNum+mediaFmt+"&color1=0x"+ytColor1+"&color2=0x"+ytColor2,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 266 media.inject("imgloader");
rlm@9 267 b.start({opacity:1})
rlm@9 268 }else{
rlm@9 269 if(filetype=="veoh")
rlm@9 270 {
rlm@9 271 fileWidth=galleryimages[e]["width"]||"410px";
rlm@9 272 fileHeight=galleryimages[e]["height"]||"341px";
rlm@9 273 mediaSplit=galleryimages[e]["mediaURL"].split("videos/");
rlm@9 274 mediaId=mediaSplit[1];
rlm@9 275 media=new Swiff("http://www.veoh.com/videodetails2.swf?permalinkId="+mediaId+"&player=videodetailsembedded&videoAutoPlay="+AutoplayNum,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 276 media.inject("imgloader");
rlm@9 277 b.start({opacity:1})
rlm@9 278 }else{
rlm@9 279 if(filetype=="viddler")
rlm@9 280 {
rlm@9 281 fileWidth=galleryimages[e]["width"]||"437px";
rlm@9 282 fileHeight=galleryimages[e]["height"]||"370px";
rlm@9 283 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 284 mediaId=mediaSplit[4];
rlm@9 285 media=new Swiff(galleryimages[e]["mediaURL"],{id:"viddler_"+mediaId,movie:galleryimages[e]["mediaURL"],classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen,id:"viddler_"+mediaId,movie:galleryimages[e]["mediaURL"]}});
rlm@9 286 media.inject("imgloader");
rlm@9 287 b.start({opacity:1})
rlm@9 288 }else{
rlm@9 289 if(filetype=="vimeo")
rlm@9 290 {
rlm@9 291 fileWidth=galleryimages[e]["width"]||"400px";
rlm@9 292 fileHeight=galleryimages[e]["height"]||"225px";
rlm@9 293 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 294 mediaId=mediaSplit[3];
rlm@9 295 media=new Swiff("http://www.vimeo.com/moogaloop.swf?clip_id="+mediaId+"&amp;server=www.vimeo.com&amp;fullscreen="+fullscreenNum+"&amp;show_title="+vmTitle+"&amp;show_byline="+vmByline+"&amp;show_portrait="+vmPortrait+"&amp;color="+vmColor,{id:mediaId,width:fileWidth,height:fileHeight,params:{wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 296 media.inject("imgloader");
rlm@9 297 b.start({opacity:1})
rlm@9 298 }else{
rlm@9 299 if(filetype=="12seconds")
rlm@9 300 {
rlm@9 301 fileWidth=galleryimages[e]["width"]||"430px";
rlm@9 302 fileHeight=galleryimages[e]["height"]||"360px";
rlm@9 303 mediaSplit=galleryimages[e]["mediaURL"].split("/");
rlm@9 304 mediaId=mediaSplit[5];
rlm@9 305 media=new Swiff("http://embed.12seconds.tv/players/remotePlayer.swf",{id:mediaId,width:fileWidth,height:fileHeight,params:{flashvars:"vid="+mediaId+"",wmode:"opaque",bgcolor:bgcolor,allowscriptaccess:scriptaccess,allowfullscreen:fullscreen}});
rlm@9 306 media.inject("imgloader");
rlm@9 307 b.start({opacity:1})
rlm@9 308 }}}}}}}}}}}}}}}}}}}
rlm@9 309
rlm@9 310
rlm@9 311 if(galleryimages[e]["forsale"]==true)
rlm@9 312 {
rlm@9 313 $("fsbox").empty();
rlm@9 314 var m=new Element("div",{id:"fsbutton"}).inject($("fsbox"),"top");
rlm@9 315 var h=new Element("div",{id:"fstop"}).inject($("fsbox"));
rlm@9 316 var k=new Element("div",{id:"forsale"}).inject($("fsbox"));
rlm@9 317 $("fsbutton").set("html",orderText+"<div id='fsclose'></div>");
rlm@9 318 if(galleryimages[e]["title"]==""||galleryimages[e]["title"]==null)
rlm@9 319 {
rlm@9 320 placeTitle=galleryimages[e]["src"]
rlm@9 321 }
rlm@9 322 else
rlm@9 323 {
rlm@12 324 placeTitle=galleryimages[e]["title"]
rlm@12 325 }
rlm@12 326 var j=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut,
rlm@12 327 onComplete:function(){
rlm@12 328 var p=galleryimages[e]["paytype"];
rlm@12 329 if(p=="paypal")
rlm@12 330 {
rlm@12 331 var robMac=galleryimages[e]["ButtonID"];
rlm@12 332
rlm@12 333 numOfPrices=galleryimages[e]["numOfPrices"];
rlm@12 334 paypalform="";
rlm@12 335 paypalform+='<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
rlm@12 336 paypalform+=' <input type="hidden" name="cmd" value="_s-xclick">';
rlm@12 337 paypalform+=' <input type="hidden" name="hosted_button_id" value="'+robMac+'">';
rlm@12 338 paypalform+=' <img src="'+thumbPath+galleryimages[e]["src"]+'" border="0" class="forsalethumb" align="left" />';
rlm@12 339 paypalform+=" <strong>Buy: "+placeTitle+"</strong><br />";
rlm@12 340 paypalform+=" "+purchaseOf+placeTitle+shipinginfoshort+"<br />";
rlm@12 341 paypalform+=" <table>";
rlm@12 342 paypalform+=' <tr><td><input type="hidden" name="on0" value="'+galleryimages[e]["src"]+" - "+paypalSelectText+'">'+galleryimages[e]["src"]+" -"+paypalSelectText+'</td></tr><tr><td><select name="os0">';for(i=1;i<=numOfPrices;i++){if(galleryimages[e]["pricecurrency"+i+""]=="&euro;"){pricingFormat=+""+galleryimages[e]["price"+i+""]+""+galleryimages[e]["pricecurrencysymbol"+i+""]}else{pricingFormat=galleryimages[e]["pricecurrencysymbol"+i+""]+""+galleryimages[e]["price"+i+""]}paypalform+='<option value="'+galleryimages[e]["pricesize"+i+""]+'">'+galleryimages[e]["pricesize"+i+""]+" "+pricingFormat+""}paypalform+=" </select> </td></tr>";paypalform+=" </table>";paypalform+=' <input type="hidden" name="currency_code" value="'+galleryimages[e]["pricecurrency"+i+""]+'">';paypalform+=' <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">';paypalform+=' <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">';paypalform+="</form>";$("forsale").set("html",paypalform)}if(p=="google"){numOfPrices=galleryimages[e]["numOfPrices"];googleform="";googleform+='<form action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/'+merchantId+'" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm">';googleform+='<img src="'+thumbPath+galleryimages[e]["src"]+'" border="0" class="forsalethumb" align="left" />';googleform+="<strong>Buy: "+placeTitle+"</strong>";googleform+="<br />";googleform+=purchaseOf+placeTitle+shipinginfoshort+"<br />";googleform+=selectSizes+": ";googleform+='<select name="item_selection_1">';for(i=1;i<=numOfPrices;i++){if(galleryimages[e]["pricecurrency"+i+""]=="&euro;"){pricingFormat=galleryimages[e]["price"+i+""]+" "+galleryimages[e]["pricecurrencysymbol"+i+""]}else{pricingFormat=galleryimages[e]["pricecurrencysymbol"+i+""]+""+galleryimages[e]["price"+i+""]}googleform+=' <option value="'+i+'">'+galleryimages[e]["pricesize"+i+""]+" - "+pricingFormat+"</option>"}googleform+="</select><br />";for(i=1;i<=numOfPrices;i++){googleform+='<input name="item_option_name_'+i+'" type="hidden" value="'+galleryimages[e]["pricesize"+i+""]+' Print"/>';googleform+='<input name="item_option_price_'+i+'" type="hidden" value="'+galleryimages[e]["price"+i+""]+'"/>';googleform+='<input name="item_option_description_'+i+'" type="hidden" value="'+galleryimages[e]["pricesize"+i+""]+" "+placeTitle+'"/>';googleform+='<input name="item_option_quantity_'+i+'" type="hidden" value="1"/>';googleform+='<input name="item_option_currency_'+i+'" type="hidden" value="'+galleryimages[e]["pricecurrency"+i+""]+'"/>'}googleform+='<input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id='+merchantId+'&amp;w=121&amp;h=44&amp;style=trans&amp;variant=text&amp;loc=en_US" type="image"/>';googleform+="</form><hr /><br />";$("forsale").set("html",googleform)}$("fsbutton").addEvent("click",function(){openforsale();var q=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});q.start({opacity:0})})}});j.start({opacity:1,bottom:-277});var l=new Fx.Morph("fsclose",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});l.start({opacity:0})}}});var c=new Fx.Morph(""+e+"",{duration:100,transition:Fx.Transitions.linear});c.start({"border-color":"#FFF","background-color":"#FFF",opacity:1});d.start({opacity:1});g.start({opacity:0});var a=new Fx.Morph("loading",{duration:200,onComplete:function(){}});a.start({opacity:0})}function setThumbClick(a){thumbPath=maingalleries[a]["thumbpath"];imagenumber=Number(1);$$(".thumbnail").addEvent("click",function(f){if(playing==true){slideshow()}if(!busy){if(filetype!="image"){$("imgloader").empty()}busy=true;var g=this.id;imagenumber=this.get("rel");imagenumber=Number(imagenumber);$("numOf").set("text",imagenumber+" of ").inject("photoNum","top");var b=Number(galleryimages[g]["imgid"]);loadimage(Number(g),Number(imagenumber));var d=new Fx.Morph(""+previousid+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});d.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});var c=new Fx.Morph(g,{duration:500,transition:Fx.Transitions.linear});c.start({"border-color":"#FFF","background-color":"#FFF",opacity:1});previousid=b}});$("next").addEvent("click",function(c){if(playing==true){slideshow()}if(!busy){busy=true;nextnum=Number(currentimage+1);imagenumber=Number(imagenumber+1);realNum=$(""+nextnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(nextnum,imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=imagenumber%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}currentimage=Number(galleryimages[nextnum]["imgid"]);previousid=currentimage}});$("previous").addEvent("click",function(c){if(playing==true){slideshow()}if(!busy){thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(imagenumber)%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("back")}previousnum=Number(currentimage-1);busy=true;imagenumber=Number(imagenumber-1);realNum=$(""+previousnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(""+previousnum+"",imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});currentimage=Number(galleryimages[previousnum]["imgid"]);previousid=currentimage}});$(window.document).addEvent("keydown",function(c){if(c.key=="right"&&currentimage!=lastimage){if(playing==true){slideshow()}if(!busy){busy=true;nextnum=Number(currentimage+1);imagenumber=Number(imagenumber+1);realNum=$(""+nextnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(nextnum,imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=imagenumber%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}currentimage=Number(galleryimages[nextnum]["imgid"]);previousid=currentimage}}if(c.key=="left"&&currentimage!=0){if(playing==true){slideshow()}if(!busy){thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(imagenumber)%maxThumbsVisible;if(imagenumber>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("back")}previousnum=Number(currentimage-1);busy=true;imagenumber=Number(imagenumber-1);realNum=$(""+previousnum+"").get("rel");$("numOf").set("text",realNum+" of ").inject("photoNum","top");loadimage(""+previousnum+"",imagenumber);var b=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});currentimage=Number(galleryimages[previousnum]["imgid"]);previousid=currentimage}}});$$(".thumbnail").addEvent("mouseenter",function(){myid=this.id;var d=galleryimages[myid]["filetype"];var c=new Fx.Morph("thumbnailPopUp",{duration:25,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("thumbnailPopUp").empty();if(d=="image"){var f=new Element("img",{src:thumbPath+galleryimages[myid]["src"],id:"thumbPop"}).inject($("thumbnailPopUp"))}else{var f=new Element("img",{src:galleryimages[myid]["src"],id:"thumbPop"}).inject($("thumbnailPopUp"))}myX=$("gallery").getCoordinates().width;myY=$("images").getCoordinates().height;myImgWidth=$("thumbPop").getCoordinates().width;myImgHeight=$("thumbPop").getCoordinates().height;myNewX=((myX/2)-(myImgWidth/2));myNewY=(myY-(myImgHeight/2))-(($("thumbnailPopUp").getCoordinates().height/2)+6);if(animatingPop!=true){animatingPop=true;var e=function(){$("thumbnailPopUp").setStyles({position:"absolute",top:(myNewY),left:myNewX,visibility:"hidden"});var g=new Fx.Morph("thumbnailPopUp",{duration:200,transition:Fx.Transitions.Expo.easeOut,onComplete:function(){animatingPop=false}});g.start({top:myNewY,left:myNewX,opacity:1})};e.delay(250)}}});c.start({opacity:0});if(myid!=currentimage){var b=new Fx.Morph(myid,{duration:100,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:1})}});$$(".thumbnail").addEvent("mouseleave",function(){myid=this.id;var c=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});c.start({opacity:0});if(myid!=currentimage){var b=new Fx.Morph(myid,{duration:50,transition:Fx.Transitions.Expo.easeInOut});b.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5})}})}function loadThumbs(l,b){var e=$("thumbnailwrap");thumbnailNumberPos=1;totalNumImages=0;totalNumMedia=0;totalNumQuicktime=0;$("thumbnailwrap").empty();startImage=maingalleries[l]["start"];endImage=maingalleries[l]["end"];thumbPath=maingalleries[l]["thumbpath"];lastimage=maingalleries[l]["end"];currentGallery=maingalleries[l]["gallerynum"];currentimage=Number(galleryimages[startImage]["imgid"]);previousid=Number(startImage);busy=false;for(i=startImage;i<=endImage;i++){filetype=galleryimages[i]["filetype"];if(totalthumbsvisible<$("thumbnails").getCoordinates().width-setThumbWidth){totalthumbsvisible+=setThumbWidth}thumbWidth+=setThumbWidth;e.setStyles({width:thumbWidth});var a=i;if(filetype=="image"){var c=new Element("div",{"class":"thumbnail",id:galleryimages[i]["imgid"],rel:thumbnailNumberPos});var f=new Element("img",{src:thumbPath+galleryimages[i]["src"],rel:" ","class":" controls",title:galleryimages[i]["title"]}).injectInside(c);totalNumImages++}if(filetype=="flv "||filetype=="mov"||filetype=="mp4"||filetype=="mp3 "||filetype=="aac"||filetype=="swf"||filetype=="blip"||filetype=="dailymotion"||filetype=="flickr"||filetype=="googlevideo"||filetype=="metacafe"||filetype=="myspacetv"||filetype=="revver"||filetype=="rutube"||filetype=="seesmic"||filetype=="tudou"||filetype=="youku"||filetype=="youtube"||filetype=="Veoh"||filetype=="viddler"||filetype=="vimeo"||filetype=="12seconds"){var c=new Element("div",{"class":"thumbnail",id:galleryimages[i]["imgid"],rel:thumbnailNumberPos});var f=new Element("img",{src:galleryimages[i]["src"],"class":" controls",title:galleryimages[i]["title"]}).injectInside(c);totalNumMedia++}if(totalNumMedia>1){flashCount=totalNumMedia+" Media Files | "}else{if(totalNumMedia==1){flashCount=totalNumMedia+" Media File | "}else{flashCount=""}}$("flashNum").set("html",flashCount);if(totalNumImages>1){imagecountHTML=totalNumImages+" Photos | "}else{if(totalNumImages==1){imagecountHTML=totalNumImages+" Photo | "}else{imagecountHTML=""}}$("photoNum").set("html",'<span id="numOf">1 of </span>'+imagecountHTML);c.injectInside($("thumbnailwrap"));thumbnailNumberPos++;$(""+i+"").setStyles({opacity:0});var g=new Fx.Morph(""+i+"",{duration:100,transition:Fx.Transitions.Expo.easeInOut,wait:true});if(i==0){g.start({opacity:1})}else{g.start({opacity:0.5})}if(i==endImage){thumbnailsviewable=Math.floor($("thumbnails").getCoordinates().width);if(thumbWidth>thumbnailsviewable){var d=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0,left:-40});var h=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0.75,right:0})}else{var d=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0,left:-40});var h=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0,right:-40})}if(b=="loadNew"){e.setStyles({left:0});currentthumbpos=0;loadimage(Number(startImage))}setThumbClick(l)}var j=$$(".controls");var k=new Tips(j,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(m){m.fade(1)},onHide:function(m){m.fade(0)}})}}function galleries(){var c=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});c.start({opacity:0});if(playing==true){slideshow()}var b=new Fx.Morph("galleries",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});var a=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});filetype=galleryimages[currentimage]["filetype"];galleryheight=$("gallery").getCoordinates().height;hiddenGalpas=(galleryheight-$("controls").getCoordinates().height);controlHeight=$("controls").getCoordinates().height;if(openclose==true){if(filetype!="image"){$("imgloader").setStyle("visibility","hidden")}b.start({bottom:[-galleryheight,controlHeight]});if(slidesHidden==true){showthumbbox()}openclose=false;a.start({opacity:0})}else{closinggalleries=true;b.start({bottom:-(hiddenGalpas-1)}).addEvent("onComplete",function(){if(closinggalleries==true){if(filetype!="image"){$("imgloader").setStyle("visibility","visible");closinggalleries=false}}});a.start({opacity:1});openclose=true}}function loadimage(f,d){fsisopen="closed";var h=new Fx.Morph("fsbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0,bottom:-305});if(f==startImage){$("previous").setStyles({visibility:"hidden"});prevHidden=true}else{$("previous").setStyles({visibility:"visible"});prevHidden=false}if(f==lastimage){$("next").setStyles({visibility:"hidden"});nextHidden=true}else{$("next").setStyles({visibility:"visible"});nextHidden=false}var g=$("images");var j=$("loading");var k=$("gallery");$("loading").setStyles({position:"absolute",opacity:0,left:(k.getCoordinates().width/2)-(j.getCoordinates().width/2),top:(g.getCoordinates().height/2)-(j.getCoordinates().height/2)});if(imagesloaded[f]!=f){imagesloaded[f]=f;var a=new Fx.Morph("infoloader",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});var b=new Fx.Morph("imgloader",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("imgloader").empty();filetype=galleryimages[f]["filetype"];if(filetype=="image"){new Asset.image(galleryimages[f]["path"]+galleryimages[f]["src"],{onload:function(){var l=new Fx.Morph("imagewrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});l.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}})}if(filetype=="flv "||filetype=="mov"||filetype=="mp4"||filetype=="mp3 "||filetype=="aac"||filetype=="swf"||filetype=="blip"||filetype=="dailymotion"||filetype=="flickr"||filetype=="googlevideo"||filetype=="metacafe"||filetype=="myspacetv"||filetype=="revver"||filetype=="rutube"||filetype=="seesmic"||filetype=="tudou"||filetype=="youku"||filetype=="youtube"||filetype=="Veoh"||filetype=="viddler"||filetype=="vimeo"||filetype=="12seconds"){if(playing==true){slideshow()}var e=new Fx.Morph("imagewrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});e.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}}});var c=new Fx.Morph("loading",{duration:200,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0});b.start({opacity:0});c.start({opacity:1})}else{var b=new Fx.Morph("imgloader",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("imgloader").empty();filetype=galleryimages[f]["filetype"];if(filetype=="image"){var e=new Fx.Morph("imagewrap",{duration:300,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});e.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}if(filetype=="flv "||filetype=="mov"||filetype=="mp4"||filetype=="mp3 "||filetype=="aac"||filetype=="swf"||filetype=="blip"||filetype=="dailymotion"||filetype=="flickr"||filetype=="googlevideo"||filetype=="metacafe"||filetype=="myspacetv"||filetype=="revver"||filetype=="rutube"||filetype=="seesmic"||filetype=="tudou"||filetype=="youku"||filetype=="youtube"||filetype=="Veoh"||filetype=="viddler"||filetype=="vimeo"||filetype=="12seconds"){if(playing==true){slideshow()}var e=new Fx.Morph("imagewrap",{duration:300,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){addImage(f)}});e.start({height:galleryimages[f]["height"],width:galleryimages[f]["width"],opacity:1,top:(((g.getCoordinates().height/2)-(galleryimages[f]["height"]/2))),left:(((g.getCoordinates().width/2)-(galleryimages[f]["width"]/2)))})}}});b.start({opacity:0})}}function nextprev(d,c){if(d=="previous"){var b=new Fx.Morph("previous",{duration:200,transition:Fx.Transitions.Expo.easeInOut});if(currentimage!=startImage){if(c=="enter"){b.start({opacity:1})}}if(c=="exit"&&currentimage!=startImage){b.start({opacity:0.5})}}if(d=="next"){var a=new Fx.Morph("next",{duration:200,transition:Fx.Transitions.Expo.easeInOut});if(currentimage!=lastimage){if(c=="enter"){a.start({opacity:1})}}if(c=="exit"&&currentimage!=lastimage){a.start({opacity:0.5})}}}function creategalleries(){var c=maingalleries.length-1;var b=function(d,j){var k=new Element("div",{"class":"gallery",id:"gallery"+d.gallerynum});var h=new Element("h3").set("html",d.name).injectInside(k);var e=new Element("img",{src:d.mainthumb+d.src,"class":"galleryimg",title:d.name,rel:d.description}).injectAfter(h);k.injectInside($("galleryset"));if(c==j){var g=$$(".galleryimg");var f=new Tips(g,{showDelay:100,hideDelay:100,offsets:{x:0,y:125},className:"tooltips",fixed:true,onShow:function(l){l.fade(1)},onHide:function(l){l.fade(0)}});$$(".gallery").addEvent("click",function(l){if(playing==true){slideshow()}var m=this.id;galleryID=""+m+"";galleries();galleryNum=Number(galleryID.slice(7));loadThumbs(galleryNum,"loadNew");movedamount=0})}};maingalleries.each(function(d,e){b(d,e)});var a=new Element("div",{"class":"clear"});a.inject($("galleryset"),"bottom")}function movethumbs(f){var e=$("thumbnails").getCoordinates().width-2;var g=setThumbWidth*(totalNumImages);var d=new Fx.Morph("thumbnailwrap",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});thisminusthat=g-e;if(f=="back"){if(!moving){moving=true;if(currentthumbpos!=0){move=(currentthumbpos+e);d.start({left:[currentthumbpos,move]}).addEvent("onComplete",function(){moving=false});currentthumbpos+=e;movedamount-=e}}}if(f=="more"){if(!moving){moving=true;move=(currentthumbpos-e);var c=new Fx.Morph("thumbgall",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({left:[currentthumbpos,move]}).addEvent("onComplete",function(){moving=false});currentthumbpos-=e;movedamount+=e}}thumbnailsviewable=$("thumbnails").getCoordinates().width;if(currentthumbpos==0){var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0,left:-40});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0.75,right:0})}else{if(movedamount<g-e){var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0.75,left:0});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0.75,right:0})}else{var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0.75,left:0});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0,right:-40})}}}function smallMessage(b,c,a){var d=new Fx.Morph("smallmessage",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});if(b=="show"){$("smallmessage").setStyles({opacity:0,bottom:-80,left:(($("images").getCoordinates().width/2)-(($("smallmessage").getCoordinates().width/2)))});$("smallmessage").set("text",c);d.start({bottom:(-80)+a,opacity:1})}if(b=="hide"){d.start({bottom:-80,opacity:0})}}function showInfo(a){var b=new Fx.Morph("imageinfo",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});if(showInfoType=="show"){showInfoType="hide";$("imageinfo").setStyles({"background-color":"#000",bottom:-300,width:"100%",opacity:0});b.start({bottom:(-300)+a,opacity:0.9})}else{if(showInfoType=="hide"){showInfoType="show";b.start({bottom:-300,opacity:0})}}}function loadLarge(){largeId=galleryimages[currentimage]["imgid"];var a=new Fx.Morph("lrgloader",{duration:transitionspeed});var c="<img src='"+galleryimages[largeId]["lrgpath"]+galleryimages[largeId]["src"]+"' id='imgsrc' title='"+galleryimages[largeId]["title"]+"' />";$("lrgloader").set("html",c);a.start({opacity:0.99999});var b=new Fx.Morph("closebtn",{duration:500,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:1})}function slideshow(){if(playing==false){$("slideshow").set("html",'<img src="'+designPath+'pause.png" alt="'+pauseText+'" title="'+pauseText+'" class="controls" border="0" align="absmiddle" />');playing=true;pp="play";var f=$$(".controls");var d=new Tips(f,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(h){h.fade(1)},onHide:function(h){h.fade(0)}});var g=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});g.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});if(currentimage!=lastimage){nextImage=currentimage+1;thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(nextImage+1)%maxThumbsVisible;if((nextImage+1)>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}}else{var e=new Fx.Morph("thumbnailwrap",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({left:[currentthumbpos,0]}).addEvent("onComplete",function(){moving=false});currentthumbpos=0;nextImage=startImage;if(currentthumbpos==0){var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0,left:-40});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0.75,right:0})}else{if(movedamount<thumbBoxWidth-moveamount){var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0.75,left:0});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0.75,right:0})}else{var b=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});b.start({opacity:0.75,left:0});var a=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:0,right:-40})}}}imagenumber=$(""+nextImage+"").get("rel");$("numOf").set("text",imagenumber+" of ").inject("photoNum","top");loadimage(nextImage)}else{c=$clear(timer);$("slideshow").set("html",'<img src="'+designPath+'play.png" alt="'+playText+'" title="'+playText+'" class="controls" border="0" align="absmiddle" />');playing=false;pp="pause";var f=$$(".controls");var d=new Tips(f,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(h){h.fade(1)},onHide:function(h){h.fade(0)}})}var c=function(){if(currentimage!=lastimage){nextImage=currentimage+1;thumbinview=$("thumbnails").getCoordinates().width;maxThumbsVisible=Math.floor(thumbinview/setThumbWidth);thumbsMod=(nextImage+1)%maxThumbsVisible;if((nextImage+1)>=maxThumbsVisible&&thumbsMod==1||maxThumbsVisible==1){movethumbs("more")}}if(currentimage!=lastimage&&pp=="play"){var k=new Fx.Morph(""+currentimage+"",{duration:500,transition:Fx.Transitions.Expo.easeInOut});k.start({"border-color":"#FFF","background-color":"#FFF",opacity:0.5});imagenumber=$(""+nextImage+"").get("rel");$("numOf").set("text",imagenumber+" of ").inject("photoNum","top");loadimage(nextImage)}else{c=$clear(timer);$("slideshow").set("html",'<img src="'+designPath+'play.png" alt="'+playText+'" title="'+playText+'" class="controls" border="0" align="absmiddle" />');playing=false;pp="pause";var j=$$(".controls");var h=new Tips(j,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(l){l.fade(1)},onHide:function(l){l.fade(0)}})}};timer=c.periodical(slideshowtime)}function showthumbbox(){if(openclose!=false){minusThumb=$("thumbbox").getCoordinates().height;minusControls=$("controls").getCoordinates().height;var b=new Fx.Morph("gallery",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});var a=new Fx.Morph("thumbbox",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});if(showThumbs=="show"){showThumbs="hide";a.start({opacity:1});b.start({height:galleryHeight});slidesHidden=false}else{if(showThumbs=="hide"){showThumbs="show";a.start({opacity:0});b.start({height:(galleryHeight)-(minusThumb)});slidesHidden=true}}}}var resizeTimeout;prepareResize=function(){$clear(resizeTimeout);resizeTimeout=realResize.delay(300)};function createBackDrop(){if(largeHtmlIsCreated==null||largeHtmlIsCreated==""){var d=new Element("div",{id:"largeimage"}).injectInside(document.body);var b=new Element("div",{id:"lrgwrap","class":"close"}).injectInside("largeimage");var f=new Element("div",{id:"closebtn","class":"close"}).injectInside("largeimage");var c=new Element("div",{id:"lrgloader"}).injectInside("lrgwrap");var d=new Element("div",{id:"backdrop","class":"close"}).injectInside(document.body);$("largeimage").set("opacity",0);$("closebtn").set("opacity",0);$("largeimage").setStyles({height:0,width:0,opacity:0,top:($("gallery").getCoordinates().height)-50,left:(window.getWidth()/2)});$("backdrop").set("opacity",0);$("backdrop").setStyles({height:0,width:0,opacity:0,top:($("gallery").getCoordinates().height/2)-50,left:(window.getWidth()/2)});$$(".close").addEvent("click",function(){largeIsOpen=false;$clear(resizeTimeout);var g=new Fx.Morph("closebtn",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("lrgloader").empty();var j=new Fx.Morph("lrgwrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var h=new Fx.Morph("largeimage",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var k=new Fx.Morph("backdrop",{duration:1000,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("backdrop").setStyles({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)})}});j.start({height:0,width:0,opacity:0});h.start({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)});k.start({opacity:0})}});g.start({opacity:0})});largeHtmlIsCreated=true}if(galleryimages[currentimage]["lrgheight"]&&galleryimages[currentimage]["lrgwidth"]){var a=new Fx.Morph("loading",{duration:200,transition:Fx.Transitions.Expo.easeInOut});a.start({opacity:1});$("backdrop").setStyles({opacity:0,height:window.getScrollHeight(),width:"100%",top:0,left:0});var e=new Fx.Morph("backdrop",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){largeIsOpen=true;new Asset.image(galleryimages[currentimage]["lrgpath"]+galleryimages[currentimage]["src"],{onload:function(){var j=new Fx.Morph("loading",{duration:200,transition:Fx.Transitions.Expo.easeInOut});var h=new Fx.Morph("lrgwrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var g=new Fx.Morph("largeimage",{duration:500,transition:Fx.Transitions.Expo.easeInOut});j.start({opacity:0});h.start({width:galleryimages[currentimage]["lrgwidth"],height:galleryimages[currentimage]["lrgheight"],opacity:1});g.start({width:galleryimages[currentimage]["lrgwidth"],height:galleryimages[currentimage]["lrgheight"],opacity:1,top:window.getScroll().y+20,left:((window.getWidth()/2)-(galleryimages[currentimage]["lrgwidth"]/2))}).addEvent("onComplete",function(){$("lrgloader").empty();var k=new Fx.Morph("lrgloader",{duration:500,transition:Fx.Transitions.Expo.easeInOut});k.start({opacity:0,width:galleryimages[currentimage]["lrgwidth"],height:galleryimages[currentimage]["lrgheight"],top:((($("largeimage").getCoordinates().height/2)-(galleryimages[currentimage]["lrgheight"]/2))),left:((($("largeimage").getCoordinates().width/2)-(galleryimages[currentimage]["lrgwidth"]/2)))}).addEvent("onComplete",function(){loadLarge()})})}})}});e.start({opacity:0.5});window.addEvent("resize",prepareResize);realResize=function(){var h=new Fx.Morph("backdrop",{duration:100,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){}});var g=new Fx.Morph("largeimage",{duration:100,transition:Fx.Transitions.Expo.easeInOut});h.start({opacity:0.5,height:window.getScrollHeight()});g.start({top:window.getScroll().y+20,left:((window.getWidth()/2)-(galleryimages[currentimage]["lrgwidth"]/2))})};$(window.document).addEvent("keydown",function(h){if(h.key=="esc"&&largeIsOpen==true){largeIsOpen=false;$clear(resizeTimeout);var g=new Fx.Morph("closebtn",{duration:500,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("lrgloader").empty();var k=new Fx.Morph("lrgwrap",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var j=new Fx.Morph("largeimage",{duration:500,transition:Fx.Transitions.Expo.easeInOut});var l=new Fx.Morph("backdrop",{duration:1000,transition:Fx.Transitions.Expo.easeInOut,onComplete:function(){$("backdrop").setStyles({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)})}});k.start({height:0,width:0,opacity:0});j.start({height:0,width:0,opacity:0,top:($("imagewrap").getCoordinates().height/2)+50,left:(window.getWidth()/2)});l.start({opacity:0})}});g.start({opacity:0})}})}}window.addEvent("domready",function(){$("slideshow").addEvent("click",function(){slideshow()});$("showthumbbox").addEvent("click",function(){showthumbbox()});$("showinfo").addEvent("click",function(){showInfo(135)});$("opengallery").addEvent("click",function(){galleries()});$("previous").addEvent("mouseenter",function(){nextprev("previous","enter");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});$("images").addEvent("mouseenter",function(){nextprev("previous","exit");nextprev("next","exit");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var f=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:0.75});var e=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})});$("controls").addEvent("mouseenter",function(){nextprev("previous","exit");nextprev("next","exit");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});$("previous").addEvent("mouseleave",function(){nextprev("previous","exit");nextprev("next","exit")});$("next").addEvent("mouseenter",function(){nextprev("next","enter");nextprev("previous","exit");var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});$("next").addEvent("mouseleave",function(){nextprev("next","exit");nextprev("previous","exit")});$("thumbleft").addEvent("mouseleave",function(){var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75});var d=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0.75})});$("thumbleft").addEvent("mouseenter",function(){var f=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:1});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var e=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})});$("thumbright").addEvent("mouseleave",function(){var d=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0.75})});$("thumbright").addEvent("mouseenter",function(){var f=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:1});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})});$("thumbleft").addEvent("click",function(){movethumbs("back")});$("thumbright").addEvent("click",function(){movethumbs("more")});$("thumbnailwrap").addEvent("mouseleave",function(){var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0})});var a=new Asset.image(designPath+"pause.png");galleryHeight=$("gallery").getCoordinates().height;$("imgloader").addEvent("click",function(){createBackDrop()});$("imgloader").addEvent("mouseenter",function(){if(galleryimages[currentimage]["lrgheight"]&&galleryimages[currentimage]["lrgwidth"]){smallMessage("show","Click Image to Enlarge",25)}});$("imgloader").addEvent("mouseleave",function(){if(galleryimages[currentimage]["lrgheight"]&&galleryimages[currentimage]["lrgwidth"]){smallMessage("hide")}if(currentimage!=0){var f=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:0.75});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75})}if(currentimage!=lastimage){var e=new Fx.Morph("thumbleft",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});e.start({opacity:0.75});var d=new Fx.Morph("thumbnailPopUp",{duration:50,transition:Fx.Transitions.Expo.easeInOut});d.start({opacity:0});var f=new Fx.Morph("thumbright",{duration:transitionspeed,transition:Fx.Transitions.Expo.easeInOut});f.start({opacity:0.75})}});$("fsbox").setStyles({left:($("gallery").getCoordinates().width/2)-($("fsbox").getCoordinates().width/2)});$("previous").set("opacity",0.5);$("next").set("opacity",0.5);creategalleries();loadThumbs(0,"loadNew");$("imagewrap").set("opacity",0);thumbSizing=$("1").getCoordinates().width;thumbRightMargin=$("1").getStyle("margin-right").toInt();thumbLeftMargin=$("1").getStyle("margin-left").toInt();setThumbWidth=Number(thumbSizing+thumbRightMargin+thumbLeftMargin);thumbWidth=Number(setThumbWidth);var c=$$(".controls");var b=new Tips(c,{showDelay:100,hideDelay:100,offsets:{x:8,y:8},title:"title",text:null,className:"minitooltips",fixed:false,onShow:function(d){d.fade(1)},onHide:function(d){d.fade(0)}});$(window.document).addEvent("keydown",function(d){if(d.key=="space"&&playing==true){slideshow()}if(d.key=="esc"&&playing==true){slideshow()}if(d.key=="esc"&&openclose==false){galleries()}})});