1var sizecontainer; 2 3(function($) { 4$.fn.getHiddenDimensions = function(includeMargin) { 5 var $item = this, 6 props = { position: 'absolute', visibility: 'hidden', display: 'block' }, 7 dim = { width:0, height:0, innerWidth: 0, innerHeight: 0,outerWidth: 0,outerHeight: 0 }, 8 $hiddenParents = $item.parents().andSelf().not(':visible'), 9 includeMargin = (includeMargin == null)? false : includeMargin; 10 11 var oldProps = []; 12 $hiddenParents.each(function() { 13 var old = {}; 14 15 for ( var name in props ) { 16 old[ name ] = this.style[ name ]; 17 this.style[ name ] = props[ name ]; 18 } 19 20 oldProps.push(old); 21 }); 22 23 dim.width = $item.width(); 24 dim.outerWidth = $item.outerWidth(includeMargin); 25 dim.innerWidth = $item.innerWidth(); 26 dim.height = $item.height(); 27 dim.innerHeight = $item.innerHeight(); 28 dim.outerHeight = $item.outerHeight(includeMargin); 29 30 $hiddenParents.each(function(i) { 31 var old = oldProps[i]; 32 for ( var name in props ) { 33 this.style[ name ] = old[ name ]; 34 } 35 }); 36 37 return dim; 38} 39}(jQuery)); 40 41function sizePhoto(pos) { 42 closeenlargephoto(); 43 if($("#slideshow").attr("fullscreen") == 1) { 44 var photospacing = 32; 45 } else { 46 var photospacing = 0; 47 } 48 49 $("#photo-"+pos).imagesLoaded(function() { 50 51 52 if($("#slideshow").attr("fullscreen") == 1) { 53 add_margin = add_margin_full; 54 headerheight = $("#ssheader").height(); 55 if($("#slideshow").attr("scrollthumbs") == "1" && thumbnails == 0) { 56 sth = $("#thumbscroller").height() + add_margin_full + photospacing; 57 } else { 58 sth = 0; 59 } 60 61 } else { 62 add_margin = add_margin_page; 63 sth = 0; 64 headerheight = 0; 65 } 66 add_margin = add_margin + photospacing; 67 if($("#slideshow").attr("fullscreen") !== "1") { 68 sizecontainer = 1; 69 } else { 70 sizecontainer = 0; 71 } 72 if($("#slideshow").attr("fullscreen") == 0) { 73 if(first_landscape_width > 0 && use_first_lanscape_height == 1) { 74 sizecontainer = 0; 75 if((first_landscape_width + Math.abs(add_margin)) > $("#slideshow").width()) { 76 wwp = $("#slideshow").width() / (first_landscape_width + Math.abs(add_margin)); 77 wh = (first_landscape_height * wwp) + Math.abs(add_margin); 78 } else { 79 wh = first_landscape_height; 80 81 } 82 $("#slideshow").css("height",wh + (add_margin / 2) +"px"); 83 } else { 84 wh = $(window).height(); 85 } 86 } else { 87 wh = $(window).height(); 88 } 89 90 91 // $("#photo-"+pos).css({"left":"0px", "top":"0px", "margin":"0 0 0 0"}); 92 // Removed this line to fix the bug in Firefox slideshow. Hopefully doesn't mess something else up. 93 94 95 96 97 dim = $("#photo-"+pos).getHiddenDimensions(); 98 //alert(dim.width); 99 ww = Math.abs($("#photo-"+pos).attr("ww")); 100 hh = Math.abs($("#photo-"+pos).attr("hh")); 101 sth = Math.abs(sth); 102 103 if(ww <=1) { 104 ww = dim.width; 105 $("#photo-"+pos).attr("ww",ww) 106 } 107 if(hh <=1) { 108 hh = dim.height; 109 $("#photo-"+pos).attr("hh",hh) 110 } 111 112 113 if((ww + add_margin) > $("#photo-"+pos+"-container").parent().width() || (hh + (add_margin*2) + sth) + 20 > (wh - sth)) { 114 nwn = Math.abs(ww) + Math.abs(add_margin); 115 wp = $("#photo-"+pos+"-container").parent().width() / nwn; 116 hp = wh / (Math.abs(hh) + sth + headerheight + (add_margin * 4)); 117 118 119 // $("#log").show().html(hp+" > "+wp+" add: "+add_margin+" | " ); 120 121 if(hp > wp) { 122 123 124 $("#photo-"+pos).css({"width":($("#photo-"+pos+"-container").parent().width() - add_margin)+"px", 125 "height":hh * wp 126 }); 127 nw = ($("#photo-"+pos+"-container").parent().width() - add_margin); 128 nwp = nw / Math.abs(ww); 129 nh = Math.abs(hh) * nwp; 130 } else { 131 132 133 nw = nwn * hp; 134 nh = Math.abs(hh) * hp; 135 left = ($("#photo-"+pos+"-container").parent().width() -(nw)) / 2; 136 if($("#ssheader").css("display") == "block") { 137 mh = $("#ssheader").height(); 138 } else { 139 mh = 0; 140 } 141 $("#photo-"+pos).css({"height":(wh - add_margin - mh - sth)+"px", 142 "width":"auto", 143 "left":left+"px" 144 }); 145 // $("#log").show(); 146 // $("#log").html(wh+" - "+add_margin+" - "+mh+" - "+sth+" - "+photospacing); 147 148 nh = wh - add_margin - mh - sth; 149 nhp = nh / Math.abs(hh); 150 nw = Math.abs(ww) * nhp; 151 } 152 153 } else { 154 155 // alert($("#photo-"+pos+"-container").parent().width()+" - "+ww); 156 if($("#photo-"+pos).width() < ww) { 157 $("#photo-"+pos).css({"width":ww+"px","height":"auto"}); 158 } 159 left = ($("#photo-"+pos+"-container").parent().width() - Math.abs(ww)) / 2; 160 $("#photo-"+pos).css({"left":left+"px"}); 161 nw = ww; 162 nh = hh; 163 164 } 165 166 if($("#slideshow").attr("fullscreen") == "1") { 167 168 if(nh < ($("#slideshowcontainer").height() + sth + add_margin)) { 169 mt = ($("#slideshowcontainer").height() - headerheight - nh); 170 if(mt < 0) { 171 mt = 0; 172 } 173 new_top = headerheight + (mt / 2) - (sth / 2) ; 174 $("#photo-"+pos).css({"top":new_top +"px"}); 175 } else { 176 $("#photo-"+pos).css({"top":"0px"}); 177 } 178 left = ($("#photo-"+pos+"-container").parent().width() - Math.abs(nw)) / 2 - 4; 179 180 // $("#log").show(); 181 // $("#log").append($("#photo-"+pos+"-container").parent().width()+" - "+Math.abs(nw)+"<br>"); 182 183 $("#photo-"+pos).css({"left":left+"px"}); 184 185 } 186 }); 187} 188 189 function placeNav(pos) {
190 if(disablecontrols !== 1) { 191 if($("body").width() <= 800) { 192 $("#controls").hide(); 193 } else { 194 195 $("#controls").css({"width":"600px", "margin-left":"-300px", "position":"fixed", "left":"50%", "top":"45%", "z-index":"30", "text-align":"center", "height":$("#ssPause").height() * 2, "z-index":"60"}); 196 } 197 198 p = $("#slideshow").position(); 199 if(first_landscape_height > 0) { 200 ch = first_landscape_height; 201 if( Math.abs(first_landscape_width) > Math.abs($("#slideshow").width())) { 202 ch = first_landscape_height * ($("#slideshow").width() / first_landscape_width); 203 } 204 } else { 205 ch = $("#photo-"+pos).outerHeight(); 206 } 207 208 ch = Math.abs(ch); 209 h = ch / 2 + p.top - ( $("#ssPrevPhoto").height() / 2); 210 nextleft = $("#slideshow").width() + p.left - $("#ssNextPhoto").width(); 211 212 $("#ssPrevPhoto").css({"position":"absolute", "left":p.left+"px", "top":h, "z-index":"30"}); 213 $("#ssNextPhoto").css({"position":"absolute", "left":nextleft+"px", "top":h, "z-index":"30"}); 214 w = $("#slideshow").width(); 215 pp = ($("#slideshow").width() / 2)+ p.left - (w / 4); 216 if($("body").width() <= 800) { 217 $("#controls").hide(); 218 } else { 219 $("#controls").css({"width":w/2+"px", "position":"absolute","zoom":"1","margin-left":"0", "left":pp+"px", "top":h, "z-index":"30", "text-align":"center", "height":$("#ssPause").height() * 2, "z-index":"30"}); 220 } 221 if(thumbnails !== 1) { 222 223 if($("body").width() <= 800) { 224 $("#controls").hide(); 225 } else { 226 $("#controls").fadeIn(100); 227 } 228 } 229 if($("#slideshow").attr("curphoto") > 1) { 230 $("#ssPrevPhoto").fadeIn(100); 231 } 232 if($("#slideshow").attr("curphoto") < totalphotos) { 233 $("#ssNextPhoto").fadeIn(100); 234 } 235 236 if($("#slideshow").attr("fullscreen") == 1) { 237 238 $("#ssPrevPhoto").css({"position":"fixed","top":"45%", "z-index":"30", "left":"0px"}); 239 $("#ssNextPhoto").css({"position":"fixed", "top":"45%", "z-index":"30", "left":$("#slideshow").width() - $("#ssNextPhoto").width() - 16+"px"}); 240 $("#controls").css({"position":"fixed", "top":"45%", "z-index":"30"}); 241 } 242 243 } 244 if($("#photoproductsnexttophoto").css('display') == "none") { 245 sscloseright = 0; 246 } else { 247 sscloseright = $("#photoproductsnexttophoto").css('width'); 248 } 249 $("#ssClose").css({"top":$("#ssheader").height()+"px","right":sscloseright}); 250 251 } 252 253function sizeContainer() { 254 if($("#slideshow").attr("fullscreen") == 1) { 255 add_margin = add_margin_full; 256 } else { 257 add_margin = add_margin_page; 258 } 259 if($("#slideshow").attr("fullscreen") !== "1") { 260 if(sizecontainer == "1") { 261 $("#slideshow").animate({"height":Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).height()) + add_margin +"px"}, 200); 262 } 263 264 } 265} 266 267 268function enableenlargephoto() { 269 if(disable_enlarge !== "1") { 270 $(".enlarge").bind( "click", function() { 271 enlargephoto(); 272 }); 273 } else { 274 $(".enlarge").removeClass("zoomCur"); 275 } 276} 277 278function enlargephoto() { 279 if(truetablet !== "1") { 280 if($("#photo-"+$("#slideshow").attr("curphoto")).attr("ww") > $("#photo-"+$("#slideshow").attr("curphoto")).width()) { 281 fixbackground(); 282 $("#enlargephoto").html('<img src="'+$("#photo-"+$("#slideshow").attr("curphoto")).attr("src")+'">'); 283 nleft = $("#photo-"+$("#slideshow").attr("curphoto")).offset().left; 284 285 $("#enlargephoto").css({"margin-left":"0", "left":nleft+"px", "top":$("#photo-"+$("#slideshow").attr("curphoto")).offset().top+"px"}); 286 $("#enlargephoto img").css({"width":$("#photo-"+$("#slideshow").attr("curphoto")).width()+"px","height":$("#photo-"+$("#slideshow").attr("curphoto")).height()+"px"}); 287 288 $("#enlargephoto").show(); 289 t = ($(window).height() - $("#photo-"+$("#slideshow").attr("curphoto")).attr("hh")) / 2; 290 if(t < 0) { 291 t = 0; 292 } 293 if($("#photoproductsnexttophoto").css("display")!=="none") { 294 prodlistwidth = $("#photoproductsnexttophoto").width(); 295 } else { 296 prodlistwidth = 0; 297 } 298 a = $("#photo-"+$("#slideshow").attr("curphoto")).attr("ww") / 2; 299 b = prodlistwidth / 2; 300 eleft = a + b;
301 $("#enlargephoto").animate({"top": t+"px", "left":"50%", "margin-left":"-"+eleft+"px"}, 200, function() { 302 if($("#enlargephoto").offset().left < 0) { 303 $("#enlargephoto").animate({"left":"0", "margin-left":"0"}, 100); 304 } 305 }); 306 $("#enlargephoto img").animate({"width":$("#photo-"+$("#slideshow").attr("curphoto")).attr("ww")+"px","height":$("#photo-"+$("#slideshow").attr("curphoto")).attr("hh")+"px"}, 200); 307 $("#enlargephoto").unbind( "click" ); 308 $("#enlargephoto").bind( "click", function() { 309 closeenlargephoto(); 310 }); 311 disablerightclick(); 312 } 313 } 314} 315 316function closeenlargephoto() { 317 if($("#enlargephoto").html()!=="") { 318 nleft = $("#photo-"+$("#slideshow").attr("curphoto")).offset().left; 319 320 $("#enlargephoto").animate({"margin-left":"0", "left":nleft+"px", "top":$("#photo-"+$("#slideshow").attr("curphoto")).offset().top+"px"}, 200); 321 $("#enlargephoto img").animate({"width":$("#photo-"+$("#slideshow").attr("curphoto")).width()+"px","height":$("#photo-"+$("#slideshow").attr("curphoto")).height()+"px"}, 200, function() { 322 $("#enlargephoto").html(""); 323 $("#enlargephoto").hide(); 324 if($("#vinfo").attr("view-photo-fixed") == "0") { 325 unfixbackground(); 326 } 327 328 }); 329 330 $("#enlargephoto").unbind( "click" ); 331 $( "#enlargephoto" ).bind( "click", function() { 332 enlargephoto(); 333 }); 334 } 335} 336 337 338 339function navSlidesArrows(n) { 340 curphoto = $("#slideshow").attr("curphoto"); 341 if(n == "next") { 342 pos = Math.abs(curphoto) + 1; 343 if(pos == totalphotos && loop == 0) { 344 stopSlideshow(); 345 } 346 if(pos > totalphotos && loop == 1 && $("#slideshow").attr("sson") == 1) { 347 pos = 1; 348 } 349 } 350 if(n == "prev") { 351 pos = Math.abs(curphoto) - 1; 352 if(pos < 1) { 353 return false; 354 } 355 } 356 357 key = $("#photo-"+(pos)).attr("pkey"); 358 359 window.location.href="#"+key; 360 361} 362 363 364 function navSlides(n,stop) { 365 366 if(thumbnails == 1) { 367 navthumbnails(n,stop); 368 } else { 369 navslideshow(n,stop); 370 } 371 372 } 373 374function navslideshow(n,stop) { 375 if(stop == "1") { 376 stopSlideshow(); 377 } 378 379 if(sytiststore == 1) { 380 removeFilterPhoto(); 381 } 382 if($("#slideshow").attr("disablenav") !== "1") { ; 383 384 $("#slideshow").attr("disablenav","1"); 385 curphoto = $("#slideshow").attr("curphoto"); 386 if(n == "start") { 387 pos = 1; 388 } 389 390 if(n == "next") { 391 pos = Math.abs(curphoto) + 1; 392 if(pos == totalphotos && loop == 0) { 393 stopSlideshow(); 394 } 395 if(pos > totalphotos && loop == 1 && $("#slideshow").attr("sson") == 1) { 396 pos = 1; 397 } 398 } 399 if(n == "prev") { 400 pos = Math.abs(curphoto) - 1; 401 if(pos < 1) { 402 return false; 403 } 404 } 405 406 if(n !=="prev" && n!=="next" && n!=="start") { 407 pos = Math.abs(n); 408 src = $("#photo-"+(pos )).attr("src"); 409 if (typeof src === "undefined") { 410 $("#photo-"+(pos)).attr("src", $("#photo-"+(pos)).attr("thissrc")); 411 } 412 413 } 414 if(curphoto != pos) { 415 stillload = setTimeout("slideshowloading()",500); 416 if(disablecontrols !== 1) { 417 418 if(pos >= totalphotos) { 419 $("#ssNextPhoto").hide(); 420 } else { 421 $("#ssNextPhoto").show(); 422 } 423 if(pos <= 1) { 424 $("#ssPrevPhoto").hide(); 425 } else { 426 $("#ssPrevPhoto").show(); 427 } 428 } 429 // alert(n+" "+curphoto+" - photo-"+pos+" width"+$("#photo-"+pos).attr("src")); 430 431 if($("#slideshow").attr("fullscreen") == 1) { 432 $("#photo-"+pos).removeClass("photo").addClass("photofull"); 433 } else { 434 $("#photo-"+pos).removeClass("photofull").addClass("photo"); 435 } 436 437 $("#th-"+curphoto).removeClass("thumbon"); 438 $("#th-"+pos).addClass("thumbon"); 439 440 441 $("#photo-"+pos).imagesLoaded(function() { 442 sizePhoto(pos); 443 slideshowdoneloading(); 444 if(sytiststore == 1) { 445 if($("#photo-"+pos).attr("fav") == "1") { 446 $(".photo-fav").removeClass("icon-heart-empty").addClass("icon-heart"); 447 } else { 448 $(".photo-fav").removeClass("icon-heart").addClass("icon-heart-empty"); 449 } 450 if($("#photo-"+pos).attr("compare") == "1") { 451 $(".checked").show(); 452 } else { 453 $(".checked").hide(); 454 } 455 456 if(Math.abs($("#photo-"+$("#slideshow").attr("curphoto")).attr("pl")) > 0 && $("#vinfo").attr("prodplace")=="0") { 457 $("#buy-photo").show(); 458 } else { 459 $("#buy-photo").hide(); 460 } 461 if(Math.abs($("#photo-"+pos).attr("pkgs")) > 0) { 462 $("#buy-packages").show(); 463 } else { 464 $("#buy-packages").hide(); 465 } 466 467 if(Math.abs($("#photo-"+pos).attr("share")) > 0) { 468 $("#shareoptions").show(); 469 } else { 470 $("#shareoptions").hide(); 471 } 472 473 if(Math.abs($("#photo-"+pos).attr("fd")) > 0) { 474 $("#free-photo").show(); 475 } else { 476 $("#free-photo").hide(); 477 } 478 479 $("#phototopcount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 480 $("#photofilename").html($("#photo-"+pos).attr("org")); 481 $("#photopagelink").html('<a href="'+$("#photo-"+pos).attr("pagelink")+'">'+$("#photo-"+pos).attr("pagetitle")+'</a>'); 482 483 } 484 485 486 if (typeof stillload!=="undefined") { 487 clearInterval(stillload); 488 } 489 490 491 $("#photocount").html(""+pos+"/"+totalphotos+""); 492 if($("#slideshow").attr("sson") == "1"){ 493 $("#photo-"+pos+"-container").fadeIn(sstransition, function() { 494 495 $("#slideshow").attr("disablenav","0"); 496 if(thumbnails == 1) { 497 // $('#styledthumb-'+pos).scrollView(); 498 } 499 if($("#slideshow").attr("fullscreen") == 1) { 500 if($("#photo-"+pos).attr("ww") > $("#photo-"+pos).width()) { 501 $("#photo-"+pos).addClass("zoomCur"); 502 } else { 503 $("#photo-"+pos).removeClass("zoomCur"); 504 } 505 if($("#vinfo").attr("proofing") == "1") { 506 $.get(tempfolder+"/sy-inc/store/store_photos_menu.php?date_id="+$("#vinfo").attr("did")+"&view="+$("#vinfo").attr("view")+"&need-login="+$("#vinfo").attr("need-login")+"&pic="+$("#photo-"+pos).attr("pkey"), function(data) { 507 $("#ssheader").html(data); 508 $("#phototopcount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 509 $("#photofilename").html($("#photo-"+pos).attr("org")); 510 $("#photopagelink").html('<a href="'+$("#photo-"+pos).attr("pagelink")+'">'+$("#photo-"+pos).attr("pagetitle")+'</a>'); 511 512 });
513 } 514 515 if($("#vinfo").attr("viewing-store-photo-prod") == "1") { 516 storeproductnexttophoto(pos); 517 } else if($("#vinfo").attr("view_package") == "1") { 518 packagenexttophoto(pos); 519 } else { 520 productsnexttophoto(pos); 521 } 522 } 523 }); 524 $("#photo-"+curphoto+"-container").fadeOut(sstransition); 525 } else { 526 527 $("#photo-"+pos+"-container").fadeIn(10, function() { 528 529 $("#slideshow").attr("disablenav","0"); 530 if(thumbnails == 1) { 531 // $('#styledthumb-'+pos).scrollView(); 532 } 533 534 if($("#slideshow").attr("fullscreen") == 1) { 535 536 537 if($("#photo-"+pos).attr("ww") > $("#photo-"+pos).width()) { 538 $("#photo-"+pos).addClass("zoomCur"); 539 } else { 540 $("#photo-"+pos).removeClass("zoomCur"); 541 } 542 if($("#vinfo").attr("proofing") == "1") { 543 $.get(tempfolder+"/sy-inc/store/store_photos_menu.php?date_id="+$("#vinfo").attr("did")+"&view="+$("#vinfo").attr("view")+"&need-login="+$("#vinfo").attr("need-login")+"&pic="+$("#photo-"+pos).attr("pkey"), function(data) { 544 $("#ssheader").html(data); 545 $("#phototopcount").html(""+$("#photo-"+pos).attr("pos")+"/"+totalphotos+""); 546 $("#photofilename").html($("#photo-"+pos).attr("org")); 547 $("#photopagelink").html('<a href="'+$("#photo-"+pos).attr("pagelink")+'">'+$("#photo-"+pos).attr("pagetitle")+'</a>'); 548 });
549 } 550 if($("#slideshow").attr("disablenav") !== "1" && $("#slideshow").attr("fullscreen") == 1) { 551 if($("#vinfo").attr("viewing-store-photo-prod") == "1") { 552 storeproductnexttophoto(pos); 553 } else if($("#vinfo").attr("view_package") == "1") { 554 packagenexttophoto(pos); 555 } else { 556 productsnexttophoto(pos); 557 } 558 } 559 } 560 }); 561 $("#photo-"+curphoto+"-container").fadeOut(10); 562 } 563 if($("#slideshow").attr("sson") == "1"){ 564 SSslideshowtimer = window.setTimeout("navSlides('next')",ssspeed); 565 } 566 567 setTimeout(function() { 568 getSSCaption("photo-"+pos); 569 }, 100); 570 $("#photo-"+(pos + 1)).attr("src", $("#photo-"+(pos + 1)).attr("thissrc")); 571 if(pos > 0) { 572 // alert(src); 573 src = $("#photo-"+(pos - 1)).attr("src"); 574 if (typeof src === "undefined") { 575 // alert($("#photo-"+(pos)).attr("thissrc")); 576 $("#photo-"+(pos - 1)).attr("src", $("#photo-"+(pos - 1)).attr("thissrc")); 577 } 578 } 579 $("#slideshow").attr("curphoto",pos); 580 if($("#vinfo").attr("has_package_one") == 1 && $("#vinfo").attr("has_package") == "1") { 581 // showPackageOne(); 582 } 583 584 if(thumbnails !== 1) { 585 sizeContainer(); 586 } 587 588 }); 589 } 590 } 591} 592 593 594function productsnexttophoto(pos) { 595 596 //alert($("#vinfo").attr("need-login")); 597 if($("#vinfo").attr("prodplacedefault") == "1" && $("#photo-"+pos).attr("pl") > 0 && $("#vinfo").attr("need-login")!=="1") { 598 pic = $("#photo-"+pos).attr("pkey"); 599 date_id = $("#photo-"+pos).attr("did"); 600 sub_id = $("#vinfo").attr("sub_id"); 601 if($("#vinfo").attr("view") == "favorites") { 602 sub_id = $("#photo-"+pos).attr("subid"); 603 } 604 group_id = $("#vinfo").attr("group-id"); 605 606 headerheight = Math.abs($("#ssheader").height()) + 12; 607 608 fixbackground(); 609 $("#vinfo").attr("view-photo-fixed","1"); 610 $.get(tempfolder+"/sy-inc/store/store_photos_buy_v2_list_products.php?pid="+pic+"&date_id="+date_id+"&mobile="+ismobile+"&sub_id="+sub_id+"&color_id="+$("#filter").attr("color_id")+"&withphoto=1&group_id="+$("#vinfo").attr("group-id")+"&kid="+$("#vinfo").attr("kid")+"&keyWord="+$("#vinfo").attr("keyWord")+"&view="+$("#vinfo").attr("view")+"&from_time="+$("#vinfo").attr("from_time")+"&search_date="+$("#vinfo").attr("search_date")+"&passcode="+$("#vinfo").attr("passcode")+"&search_length="+$("#vinfo").attr("search_length"), function(data) { 611 $("#slideshow").attr("disablenav","0"); 612 // $("#log").show().append("enable "); 613 // alert("Enabled!! : "+$("#slideshow").attr("disablenav")); 614 615 photo = document.location.hash; 616 photo = photo.replace("#",""); 617 p = photo.split("="); 618 if(p[0] == "photo" || p[0] == "gti") { 619 // $("#log").append("hash: "+ document.location.hash+" "); 620 621 $("#vinfo").attr("view_package", "0"); 622 $("#vinfo").attr("viewing_prods", "1"); 623 if($("#photoproductsnexttophoto").css('display') == "none") { 624 sscloseright = 0; 625 } else { 626 sscloseright = $("#photoproductsnexttophoto").css('width'); 627 } 628 $("#ssClose").css({"top":$("#ssheader").height()+"px","right":sscloseright}); 629 $("#vinfo").attr("viewing-store-photo-prod","0"); 630 $("#photoproductsnexttophoto .inner").empty().append(data); 631 if($("#vinfo").attr("prodplace") == "1") { 632 $("#slideshow").addClass("photowithproducts"); 633 $("#ssheader").addClass("ssheaderwithproducts"); 634 $("#photopackagetab").hide(); 635 $("#singlephotopackagetab").hide(); 636 $("#photoproductsnexttophoto").fadeIn(200, function() { 637 if($("#slideshow").attr("fullscreen") !== "1") { 638 closeFullScreen(); 639 } 640 $("#slideshow").attr("disablenav","0"); 641 placeNav($("#slideshow").attr("curphoto")); 642 sizePhoto($("#slideshow").attr("curphoto")); 643 setTimeout(function() { 644 getSSCaption("photo-"+$("#slideshow").attr("curphoto")); 645 }, 50); 646 647 648 }); 649 $("#photoproductsnexttophotobg").fadeIn(200); 650 } 651 } 652 }); 653 } else { 654 $("#slideshow").removeClass("photowithproducts"); 655 $("#ssheader").removeClass("ssheaderwithproducts"); 656 $("#photoproductsnexttophoto").fadeOut(200); 657 $("#photoproductsnexttophotobg").fadeOut(200); 658 placeNav($("#slideshow").attr("curphoto")); 659 sizePhoto($("#slideshow").attr("curphoto")); 660 661 } 662} 663 664 665 666function packageopen(pic,date_id,from_thumb) { 667 fixbackground(); 668 if(from_thumb) { 669 $("#vinfo").attr("package_from_thumb",from_thumb); 670 $("#vinfo").attr("package_thumb_photo",pic); 671 } 672 $("#buybackground").fadeIn(50,function() { 673 if(isslideshow == true) { 674 stopSlideshow(); 675 } 676 fixbackground(); 677 window.scrollTo(0,0); 678 loading(); 679 if(!pic) { 680 if($("#vinfo").attr("package_thumb_photo")!="") { 681 pic = $("#vinfo").attr("package_thumb_photo"); 682 } else { 683 pic = $("#photo-"+$("#slideshow").attr("curphoto")).attr("pkey"); 684 } 685 } 686 if(!date_id) { 687 date_id = $("#photo-"+$("#slideshow").attr("curphoto")).attr("did"); 688 if(typeof date_id === "undefined") { 689 date_id = $("#vinfo").attr("did"); 690 } 691 } 692 sub_id = $("#vinfo").attr("sub_id"); 693 $("#photoprods").css({"top":50+"px"}); 694 headerheight = Math.abs($("#ssheader").height()) + 12; 695 696 fixbackground(); 697 $("#vinfo").attr("view-photo-fixed","1"); 698 699 $.get(tempfolder+"/sy-inc/store/store_package_photo.php?pid="+pic+"&date_id="+date_id+"&withphoto=1&sub_id="+sub_id+"&view="+$("#vinfo").attr("view")+"&package_id="+$("#vinfo").attr("package-id")+"&color_id="+$("#filter").attr("color_id")+"&istablet=1", function(data) { 700 $("#photoprodsinner").html(data); 701 $("#photoprods").slideDown(200, function() { 702 window.scrollTo(0,0); 703 setTimeout(packagepriewmini,200);
704 705 706 $(".packagepreviewphoto").attr('src',$("#photo-"+$("#slideshow").attr("curphoto")).attr("mini")); 707 if($("body").width() <= 800) { 708 $("#closebuyphototab").show(); 709 } else { 710 $("#closebuyphoto").show(); 711 } 712 sizeBuyPhoto(); 713 loadingdone(); 714 715 $('html').click(function() { 716 closebuyphoto(); 717 }); 718 719 $('#photoprods').click(function(event){ 720 event.stopPropagation(); 721 }); 722 723 }); 724 }); 725 }); 726} 727 728function packagepriewmini() { 729 $(".packagepreviewphoto").attr('src',$("#photo-"+$("#slideshow").attr("curphoto")).attr("mini")); 730} 731 732function packagenexttophoto(pos) { 733 if($("#vinfo").attr("prodplacedefault") == "1" || $("#vinfo").attr("view_package_only") == "1") { 734 735 pic = $("#photo-"+pos).attr("pkey"); 736 date_id = $("#photo-"+pos).attr("did"); 737 sub_id = $("#vinfo").attr("sub_id"); 738 headerheight = Math.abs($("#ssheader").height()) + 12; 739 740 fixbackground(); 741 $("#vinfo").attr("view-photo-fixed","1"); 742 743 $.get(tempfolder+"/sy-inc/store/store_package_photo.php?pid="+pic+"&date_id="+date_id+"&withphoto=1&sub_id="+sub_id+"&view="+$("#vinfo").attr("view")+"&package_id="+$("#vinfo").attr("package-id")+"&color_id="+$("#filter").attr("color_id")+"&istablet="+istablet, function(data) { 744 $("#vinfo").attr("view_package", "1"); 745 $("#vinfo").attr("viewing_prods", "1"); 746 $("#photoproductsnexttophoto .inner").html(data); 747 // $("#photoprodsinner").empty().append(data); 748 setTimeout(packagepriewmini,200); 749 750 if($("#vinfo").attr("prodplace") == "1" || $("#vinfo").attr("view_package_only") == "1") { 751 $(".packagepreviewphoto").attr('src',$("#photo-"+$("#slideshow").attr("curphoto")).attr("mini")); 752 753 if($("body").width() > 800) { 754 sizePhoto($("#slideshow").attr("curphoto")); 755 756 $("#slideshow").addClass("photowithproducts"); 757 $("#ssheader").addClass("ssheaderwithproducts"); 758 $("#photopackagetab").hide(); 759 $("#singlephotopackagetab").hide(); 760 if($("#photoproductsnexttophoto").css('display') == "none") { 761 sscloseright = 0; 762 } else { 763 sscloseright = $("#photoproductsnexttophoto").css('width'); 764 } 765 $("#ssClose").css({"top":$("#ssheader").height()+"px","right":sscloseright}); 766 $("#vinfo").attr("viewing-store-photo-prod","0"); 767 768 if($("#photoproductsnexttophoto").css("display")=="none") { 769 $("#photoproductsnexttophoto").fadeIn(400); 770 $("#photoproductsnexttophotobg").fadeIn(400); 771 placeNav($("#slideshow").attr("curphoto")); 772 } 773 } 774 } 775 }); 776 } else { 777 $("#slideshow").removeClass("photowithproducts"); 778 $("#ssheader").removeClass("ssheaderwithproducts"); 779 } 780} 781function storeproductnexttophoto(pos,cart_id,pic,date_id) { 782 //if($("#vinfo").attr("prodplacedefault") == "1" || $("#vinfo").attr("view_package_only") == "1") { 783 784 if(!pic) { 785 pic = $("#photo-"+pos).attr("pkey"); 786 } 787 if(!date_id) { 788 date_id = $("#photo-"+pos).attr("did"); 789 } 790 791 sub_id = $("#vinfo").attr("sub_id"); 792 headerheight = Math.abs($("#ssheader").height()) + 12; 793 if(!cart_id) { 794 cart_id = $("#vinfo").attr("product-photo-id"); 795 } else { 796 $("#vinfo").attr("product-photo-id",cart_id) 797 } 798 if($("body").width() <= lppw || istablet == true) { 799 istablet = 1; 800 } 801 fixbackground(); 802 $("#vinfo").attr("view-photo-fixed","1"); 803 804 $.get(tempfolder+"/sy-inc/store/store_product_photo.php?pid="+pic+"&date_id="+date_id+"&withphoto=1&sub_id="+sub_id+"&cart_id="+cart_id+"&color_id="+$("#filter").attr("color_id")+"&istablet="+istablet, function(data) { 805 $("#vinfo").attr("view_package", "1"); 806 807 $("#vinfo").attr("viewing_prods", "1"); 808 $("#photoproductsnexttophoto .inner").empty().append(data); 809 $("#photoprodsinner").empty().append(data); 810 setTimeout(packagepriewmini,200); 811 812 if($("#vinfo").attr("prodplace") == "1" || $("#vinfo").attr("view_package_only") == "1") { 813 $(".packagepreviewphoto").attr('src',$("#photo-"+$("#slideshow").attr("curphoto")).attr("mini")); 814 $("#vinfo").attr("viewing-store-photo-prod","1"); 815 setTimeout(packagepriewmini,500); 816 817 if($("body").width() > 800) { 818 $("#slideshow").addClass("photowithproducts"); 819 $("#ssheader").addClass("ssheaderwithproducts"); 820 $("#photopackagetab").hide(); 821 $("#singlephotopackagetab").hide(); 822 if($("#photoproductsnexttophoto").css('display') == "none") { 823 sscloseright = 0; 824 } else { 825 sscloseright = $("#photoproductsnexttophoto").css('width'); 826 } 827 $("#ssClose").css({"top":$("#ssheader").height()+"px","right":sscloseright}); 828 829 if($("#photoproductsnexttophoto").css("display")=="none") { 830 $("#photoproductsnexttophoto").fadeIn(400); 831 $("#photoproductsnexttophotobg").fadeIn(400); 832 placeNav($("#slideshow").attr("curphoto")); 833 } 834 } 835 } 836 }); 837// } else { 838 // $("#slideshow").removeClass("photowithproducts"); 839 // $("#ssheader").removeClass("ssheaderwithproducts"); 840// } 841} 842 843 844 845function storephotoopen(cart_id,from_thumb,pic,date_id) { 846 fixbackground(); 847 if(from_thumb) { 848 $("#vinfo").attr("package_from_thumb",from_thumb); 849 $("#vinfo").attr("package_thumb_photo",pic); 850 } 851 $("#buybackground").fadeIn(50,function() { 852 if(isslideshow == true) { 853 stopSlideshow(); 854 } 855 fixbackground(); 856 window.scrollTo(0,0); 857 loading(); 858 if(!pic) { 859 if($("#vinfo").attr("package_thumb_photo")!="") { 860 pic = $("#vinfo").attr("package_thumb_photo"); 861 } else { 862 pic = $("#photo-"+$("#slideshow").attr("curphoto")).attr("pkey"); 863 } 864 } 865 if(!date_id) { 866 date_id = $("#photo-"+$("#slideshow").attr("curphoto")).attr("did"); 867 if(typeof date_id === "undefined") { 868 date_id = $("#vinfo").attr("did"); 869 } 870 } 871 sub_id = $("#vinfo").attr("sub_id"); 872 $("#photoprods").css({"top":50+"px"}); 873 headerheight = Math.abs($("#ssheader").height()) + 12; 874 875 fixbackground(); 876 $("#vinfo").attr("view-photo-fixed","1"); 877 878 $.get(tempfolder+"/sy-inc/store/store_product_photo.php?pid="+pic+"&date_id="+date_id+"&withphoto=1&sub_id="+sub_id+"&cart_id="+cart_id+"&color_id="+$("#filter").attr("color_id")+"&istablet="+istablet, function(data) { 879 $("#photoprodsinner").html(data); 880 $("#photoprods").slideDown(200, function() { 881 window.scrollTo(0,0); 882 setTimeout(packagepriewmini,200);
883 if($("body").width() <= 800) { 884 $("#closebuyphototab").show(); 885 } else { 886 $("#closebuyphoto").show(); 887 } 888 sizeBuyPhoto(); 889 loadingdone(); 890 891 $('html').click(function() { 892 closebuyphoto(); 893 }); 894 895 $('#photoprods').click(function(event){ 896 event.stopPropagation(); 897 }); 898 899 }); 900 }); 901 }); 902} 903 904function getSSCaption(id) { 905 if($("#slideshow").attr("fullscreen") == 1) { 906 add_margin = add_margin_full; 907 } else { 908 add_margin = add_margin_page; 909 } 910 911 if(thumbnails == 1 && id == "photo-1") { 912 913 } else { 914 add = ($("#"+id).outerWidth() - $("#"+id).width()) / 2; 915 var ml = $("#"+id).css("left"); 916 if(ml) { 917 ml= ml.replace("px", ""); 918 ml = Math.abs(ml) + (add_margin / 2); 919 } 920 if($("#slideshow").attr("fullscreen") == 1) { 921 922 // photobottom = $("#"+id).css("bottom"); 923 cpos = $("#"+id).position(); 924 925 926 // photobottom= photobottom.replace("px", ""); 927 photobottom = "-"+cpos.top; 928 // $("#log").show().html(photobottom+" id: "+id+" pos: "+cpos.top); 929 930 photobottom = -Math.abs(photobottom) + Math.abs(add_margin); 931 $("#"+id).parent().children().children(".photocaptioncontainer").css({"width":$("#"+id).width()+"px","margin":"auto", "left"
931:ml, "bottom":photobottom, "position":"absolute"}); 932 } else { 933 $("#"+id).parent().children().children(".photocaptioncontainer").css({"width":$("#"+id).width()+"px","margin":"auto", "left":ml, "bottom":(add_margin / 2) + 4+"px", "position":"absolute"}); 934 } 935 $("#"+id).parent().children().children(".photocaptioncontainer").fadeIn(200); 936 } 937} 938 939function arrowNavSS() { 940 document.onkeydown = function(evt) { 941 evt = evt || window.event; 942 if($("#vinfo").attr("disablearrow")!=="1") { 943 switch (evt.keyCode) { 944 case 39: 945 if($("#ssNextPhoto").css("display")!=="none") { 946 navSlides('next',"1"); 947 } 948 break; 949 case 37: 950 if($("#ssPrevPhoto").css("display")!=="none") { 951 navSlides('prev',"1"); 952 } 953 break; 954 case 27: 955 closeFullScreen(); 956 break; 957 case 80: 958 // toggleSpaceBar(); 959 break; 960 } 961 } 962 }; 963} 964function startSlideshow() { 965 $("#slideshow").attr("sson","1"); 966 if($("#slideshow").attr("curphoto") == totalphotos) { 967 navSlides('start','0'); 968 } else { 969 navSlides('next','0'); 970 } 971 $("#ssPlay").hide(); 972 $("#ssPause").show(); 973} 974 975function stopSlideshow() { 976 $("#slideshow").attr("sson","0"); 977 window.clearInterval(SSslideshowtimer); 978 $("#ssPlay").show(); 979 $("#ssPause").hide(); 980} 981 982function fullScreenThumbScroller() { 983 $("#thumbscroller").removeClass("thumbscrollerpage").addClass("thumbscrollerfullscreen"); 984 var oScrollbar = $('#scrollbar1'); 985 oScrollbar.tinyscrollbar({ axis: 'x'}); 986 oScrollbar.tinyscrollbar_update(); 987 988 sw= $("#scrollbar1").width(); 989 sbl = $("#scrollbar1").position().left; 990 cw = $("#overview").width(); 991 tp = $("#th-"+$("#slideshow").attr("curphoto")).position().left; 992 tpo = $("#th-"+$("#slideshow").attr("curphoto")).offset().left; 993 place = 0; 994 if(tpo > (sw + Math.abs(sbl))) { 995 place = tp; 996 } 997 if(tpo < Math.abs(sbl)) { 998 if((Math.abs(tp) - (Math.abs(sw))) + $("#th-"+$("#slideshow").attr("curphoto")).width() < 0) { 999 st = 0; 1000 } else { 1001 st = (Math.abs(tp) - (Math.abs(sw))) + $("#th-"+$("#slideshow").attr("curphoto")).width(); 1002 } 1003 place = st; 1004 } 1005 var oScrollbar = $('#scrollbar1'); 1006 oScrollbar.tinyscrollbar({ axis: 'x'}); 1007 oScrollbar.tinyscrollbar_update(place); 1008 //$("#thumbscroller").show(); 1009} 1010 1011function closeFullScreenThumbScroller() { 1012 $("#thumbscroller").removeClass("thumbscrollerfullscreen").addClass("thumbscrollerpage"); 1013 var oScrollbar = $('#scrollbar1'); 1014 oScrollbar.tinyscrollbar({ axis: 'x'}); 1015 oScrollbar.tinyscrollbar_update(); 1016 place = 0; 1017 sw= $("#scrollbar1").width(); 1018 sbl = $("#scrollbar1").position().left; 1019 cw = $("#overview").width(); 1020 tp = $("#th-"+$("#slideshow").attr("curphoto")).position().left; 1021 tpo = $("#th-"+$("#slideshow").attr("curphoto")).offset().left; 1022 if(tpo > (sw + Math.abs(sbl))) { 1023 place = tp; 1024 } 1025 if(tpo < Math.abs(sbl)) { 1026 if((Math.abs(tp) - (Math.abs(sw))) + $("#th-"+$("#slideshow").attr("curphoto")).width() < 0) { 1027 st = 0; 1028 } else { 1029 st = (Math.abs(tp) - (Math.abs(sw))) + $("#th-"+$("#slideshow").attr("curphoto")).width(); 1030 } 1031 place = st; 1032 } 1033 var oScrollbar = $('#scrollbar1'); 1034 oScrollbar.tinyscrollbar({ axis: 'x'}); 1035 oScrollbar.tinyscrollbar_update(place); 1036// $("#thumbscroller").css("visibility", "visible"); 1037 if(thumbnails == 1) { 1038 $("#thumbscroller").hide(); 1039 } 1040 1041} 1042 1043 1044function closepackagetab() { 1045 $("#photopackagetab").hide(); 1046} 1047function checkforpackages() { 1048 if($("#vinfo").attr("has_package") > 0 && $("#vinfo").attr("has_package_one")<=0) { 1049 headerheight = Math.abs($("#ssheader").height()) + 12; 1050 $("#photopackagetab").css({"top":headerheight+"px"}); 1051 if($("body").width() <= lppw || itablet == true) { 1052 1053 $("#photopackagetab").fadeIn(100, function() { 1054 $("#ssClose").css({"top":$("#ssheader").height()+"px"}); 1055 }); 1056 } 1057 } 1058 if($("#vinfo").attr("has_package") > 1){ 1059 headerheight = Math.abs($("#ssheader").height()) + 12; 1060 $("#photopackagetab").css({"top":headerheight+"px"}); 1061 if($("body").width() <= lppw || itablet == true) { 1062 $("#photopackagetab").fadeIn(100); 1063 } 1064 } 1065} 1066function closepackagetabone() { 1067 $("#singlephotopackagetab").hide(); 1068} 1069function checkforpackagesone() { 1070 if($("#vinfo").attr("has_package_one") == 1 && $("#vinfo").attr("has_package") == "1") { 1071 // headerheight = Math.abs($("#ssheader").height()) + 12; 1072 // $("#singlephotopackagetab").css({"top":headerheight+"px"}); 1073 if($("body").width() <= 800 || $("#vinfo").attr("prodplace")=="0") { 1074 1075 $("#singlephotopackagetab").fadeIn(100, function() { 1076 $("#ssClose").css({"top":$("#ssheader").height()+"px"}); 1077 }); 1078 } 1079 showPackageOne(); 1080 } 1081} 1082 1083 1084 1085 1086 1087function slideshowloading() { 1088 if($("#slideshow").attr("fullscreen") == 1) { 1089 $("#sscontainerloading").css({"width":"100%", "height":"100%", "postion":"fixed" , "top":"0", "left"
1089:"0"}); 1090 1091 } else { 1092 h = $("#photo-"+$("#slideshow").attr("curphoto")).height(); 1093 w = $("#photo-"+$("#slideshow").attr("curphoto")).width(); 1094 $("#sscontainerloading").css({"width":w+"px", "height":h+"px", "z-index":"2"}); 1095 } 1096 $("#sscontainerloading").fadeIn(200); 1097} 1098function slideshowdoneloading() { 1099 $("#sscontainerloading").hide(); 1100} 1101 1102showthumbsscroller = function() { 1103 var nh = $("#scrollbar1").height() + 4; 1104 $("#thumbscrollerinner").animate({opacity:"1", height:nh+"px", zIndex: "1", overflow: "visible"}, 100); 1105 $('#thumbscrollerclick').unbind('click', showthumbsscroller); 1106 $('#thumbscrollerclick').bind('click', hidethumbsscroller); 1107 $("#navarrowthumbs").attr("src","/sy-graphics/icons/nav_down.png"); 1108} 1109 1110hidethumbsscroller = function() { 1111 $("#thumbscrollerinner").animate({opacity:"0", height:"0px", zIndex: "0", overflow: "hidden"}, 100); 1112 $('#thumbscrollerclick').unbind('click', hidethumbsscroller); 1113 $('#thumbscrollerclick').bind('click', showthumbsscroller); 1114 $("#navarrowthumbs").attr("src","/sy-graphics/icons/nav_up.png"); 1115} 1116function playSSAudio(aud,totalplayers,track,type) { 1117 var audioID = document.getElementById('ssAudio'); 1118 if (audioID.paused) 1119 $("#ssAudioPlay").hide(); 1120 $("#ssAudioPause").show(); 1121 audioID.play(); 1122 } 1123 1124 function pauseSSAudio(aud,totalplayers) { 1125 var audioID = document.getElementById('ssAudio'); 1126 audioID.pause(); 1127 $("#ssAudioPlay").show(); 1128 $("#ssAudioPause").hide(); 1129 } 1130 1131 1132 function fadeVolOut(newPercent){ 1133 if(document.getElementById('ssAudio')) { 1134 if(newPercent > 0){ 1135 document.getElementById('ssAudio').volume = newPercent; 1136 // setVolume(newPercent); 1137 setTimeout('fadeVolOut(' + (newPercent - .05) + ');',50); 1138 } 1139 } 1140 }
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.