var templatename = '_TEMPLATE'; function Top() { window.scroll(0,0); } function Goto(href) { window.location.href = href; } function CreateBookmarkLink(url,title) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } if (window.external) { window.external.AddFavorite( url, title); } if ((window.opera) && (window.print)) { return true; } } function IsValidObject(objToTest) { if (objToTest == null || objToTest == undefined) { return false; } return true; } function SubmitForm(formname) { var form = document.getElementById(formname); if (IsValidObject(form)) { form.submit(); } } function ShowOrderDetails(oid) { var visibility =document.getElementById('secOrderDetails'+oid).style.visibility; xajax_ShowOrderDetails(visibility,oid); } $(document).ready(function(){ $('img[id*="preview"]').noContext(); $('img[id*="show"]').noContext(); $('img[id*="thumb"]').noContext(); $("#thumbBox").noContext(); $('div[id*="secOrderDetails"]').each(function() { $(this).hide(); }); $('a[id*="orderlnk"]').toggle(function(){ var orderid = $(this).attr('id'); var oid = orderid.replace("orderlnk", ""); if ($("#secOrderDetails"+oid).is(":hidden")) { $("#secOrderDetails"+oid).slideDown('slow'); } else { $("#secOrderDetails"+oid).slideUp('slow'); } },function(){ var orderid = $(this).attr('id'); var oid = orderid.replace("orderlnk", ""); if ($("#secOrderDetails"+oid).is(":visible")) { $("#secOrderDetails"+oid).slideUp('slow'); } else { $("#secOrderDetails"+oid).slideDown('slow'); } }); $("#sizetablelnk").css("cursor","pointer"); $("#sizetablelnk").toggle(function(){ $(this).html("[ » ]"); $("#sizetable").hide('slow'); },function(){ $(this).html("[ « ]"); $("#sizetable").show('fast'); }); $('img[id*="preview"]').each(function(){ var max_width = 160; var width = $(this).width(); var height = $(this).height(); if (width > max_width) { var ratio = (height / width ); var new_width = max_width; var new_height = (new_width * ratio); //alert(new_width); $(this).height(new_height).width(new_width); } }); $('img[id*="preview"]').load(function(){ var max_width = 160; var width = $(this).width(); var height = $(this).height(); if (width > max_width) { var ratio = (height / width ); var new_width = max_width; var new_height = (new_width * ratio); //alert(new_width); $(this).height(new_height).width(new_width); } }); $('img[id*="show"]').each(function(){ var max_width = 230; var width = $(this).width(); var height = $(this).height(); if (width > max_width) { var ratio = (height / width ); var new_width = max_width; var new_height = (new_width * ratio); //alert(new_width); $(this).height(new_height).width(new_width); } }); $('img[id*="show"]').load(function(){ var max_width = 230; var width = $(this).width(); var height = $(this).height(); if (width > max_width) { var ratio = (height / width ); var new_width = max_width; var new_height = (new_width * ratio); //alert(new_width); $(this).height(new_height).width(new_width); } }); $('img[id*="thumb"]').click(function(){ var imgfilename = $(this).attr('src'); $('#imgcontainer').empty(); $('#imgcontainer').append(''); $('#imgcontainer').hide(); $('#imgcontainer').fadeIn("slow"); var title = $(this).attr('title'); var aprev = $('a[class="aprev"]'); aprev.attr("href",title); aprev.attr("id",title); }); $('img[id="goTop"]').click(function() { $(window).scrollTo( {top:'0px', left:'0px'}, 800 ); }); $('td[id="mainpanel"]').click(function() { document.location = "./"; }); }); function ShowPDF(pdffilename) { window.open(pdffilename, "", "width=800px, height=600px, resizable"); } function checkEnter(e){ var characterCode; if(e && e.which){ //if which property of event object is supported (NN4) e = e characterCode = e.which //character code is contained in NN4's which property } else{ e = event characterCode = e.keyCode //character code is contained in IE's keyCode property } if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key) return false } else{ return true } } function getElementsByClassName(cn){ var arr = new Array(); var els = document.getElementsByTagName("*"); var exp= new RegExp("^(.* )?"+cn+"( .*)?$", "g"); for (var i = 0; i < els.length; i++ ){ if (exp.test(els[i].className)){ arr.push(els[i]); } } return arr; } function ShowPicture(imgthumbfilename,imgfilename) { var picprev = document.getElementById('imgshow'); var aprev = getElementsByClassName('aprev'); picprev.src = imgthumbfilename; aprev[0].href = imgfilename; aprev[0].id = imgfilename; } function ShowCriteria(criteria) { document.getElementById('secCriteria').innerHTML = criteria; } function Goto(url) { document.location.href=url; } var thumbnailviewer={ enableTitle: false, //Should "title" attribute of link be used as description? enableAnimation: true, //Enable fading animation? definefooter: '
Zamknij
', //Define HTML for footer interface defineLoading: 'Moment...', //Define HTML for "loading" div /////////////No need to edit beyond here///////////////////////// scrollbarwidth: 16, opacitystring: 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1', targetlinks:[], //Array to hold links with rel="thumbnail" createthumbBox:function(){ //write out HTML for Image Thumbnail Viewer plus loading div document.write('
'+this.definefooter+'
') document.write('
'+this.defineLoading+'
') this.thumbBox=document.getElementById("thumbBox") this.thumbImage=document.getElementById("thumbImage") //Reference div that holds the shown image this.thumbLoading=document.getElementById("thumbLoading") //Reference "loading" div that will be shown while image is fetched this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes }, centerDiv:function(divobj){ //Centers a div element on the page var ie=document.all && !window.opera var dom=document.getElementById var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight //Full scroll height of document var objwidth=divobj.offsetWidth //width of div element var objheight=divobj.offsetHeight //height of div element var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px" //Vertical position of div element: Either centered, or if element height larger than viewpoint height, 10px from top of viewpoint divobj.style.left=docwidth/2-objwidth/2+"px" //Center div element horizontally divobj.style.top=Math.floor(parseInt(topposition))+"px" divobj.style.visibility="visible" }, showthumbBox:function(){ //Show ThumbBox div this.centerDiv(this.thumbBox) if (this.enableAnimation){ //If fading animation enabled this.currentopacity=0.1 //Starting opacity value this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20) } }, loadimage:function(link){ //Load image function that gets attached to each link on the page with rel="thumbnail" if (this.thumbBox.style.visibility=="visible") //if thumbox is visible on the page already this.closeit() //Hide it first (not doing so causes triggers some positioning bug in Firefox var imageHTML='' //Construct HTML for shown image if (this.enableTitle && link.getAttribute("title")) //Use title attr of the link as description? imageHTML+='
'+link.getAttribute("title") this.centerDiv(this.thumbLoading) //Center and display "loading" div while we set up the image to be shown this.thumbImage.innerHTML=imageHTML //Populate thumbImage div with shown image's HTML (while still hidden) this.featureImage=this.thumbImage.getElementsByTagName("img")[0] //Reference shown image itself this.featureImage.onload=function(){ //When target image has completely loaded thumbnailviewer.thumbLoading.style.visibility="hidden" //Hide "loading" div thumbnailviewer.showthumbBox() //Display "thumbbox" div to the world! } if (document.all && !window.createPopup) //Target IE5.0 browsers only. Address IE image cache not firing onload bug: panoramio.com/blog/onload-event/ this.featureImage.src=link.getAttribute("href") this.featureImage.onerror=function(){ //If an error has occurred while loading the image to show thumbnailviewer.thumbLoading.style.visibility="hidden" //Hide "loading" div, game over } }, setimgopacity:function(value){ //Sets the opacity of "thumbimage" div per the passed in value setting (0 to 1 and in between) var targetobject=this.featureImage if (targetobject.filters && targetobject.filters[0]){ //IE syntax if (typeof targetobject.filters[0].opacity=="number") //IE6 targetobject.filters[0].opacity=value*100 else //IE 5.5 targetobject.style.filter="alpha(opacity="+value*100+")" } else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax targetobject.style.MozOpacity=value else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax targetobject.style.opacity=value else //Non of the above, stop opacity animation this.stopanimation() }, opacityanimation:function(){ //Gradually increase opacity function this.setimgopacity(this.currentopacity) this.currentopacity+=0.1 if (this.currentopacity>1) this.stopanimation() }, stopanimation:function(){ if (typeof this.opacitytimer!="undefined") clearInterval(this.opacitytimer) }, closeit:function(){ //Close "thumbbox" div function this.stopanimation() this.thumbBox.style.visibility="hidden" this.thumbImage.innerHTML="" this.thumbBox.style.left="-2000px" this.thumbBox.style.top="-2000px" }, cleanup:function(){ //Clean up routine on page unload this.thumbLoading=null if (this.featureImage) this.featureImage.onload=null this.featureImage=null this.thumbImage=null for (var i=0; i