var templatename = '_TEMPLATENAME';var slidertime = '3';
$(function() {
var wins = [".tblMarka",".tblKategoria",".tblRozmiar"];
for ( var i in wins )
{
win = wins[i];
if ($.cookie(win) == "show") { $(win).show(); }
else if ($.cookie(win) == "hide") { $(win).hide(); }
}
function format(prod) {
return "
" + prod.name;
}
$("#word").autocomplete('http://www.cenzi.pl', {
minChars: 3,
width: 400,
selectFirst: false,
max: 10,
scrollHeight: 400,
dataType: "json",
parse: function(data) {
return $.map(data, function(row) {
return {
data: row,
value: row.name,
result: row.name
}
});
},
formatItem: function(item) {
return format(item);
}
});
$('#smail').bt({
fill: 'darkred',
cssStyles: {color: 'white', fontWeight: 'bold', width: 'auto'},
positions: ['bottom']
});
$('#rebatecode').bt({
fill: 'darkred',
cssStyles: {color: 'white', fontWeight: 'bold', width: 'auto'}
});
});
function winroll(win)
{
if ($(win).is(":hidden")) $.cookie(win, 'show', { expires: 3 });
else $.cookie(win, 'hide', { expires: 3 });
$(win).slideToggle(700, "easeOutBounce");
}
/*
window.onscroll = scrollEvent;
function scrollEvent() {
st = document.body.scrollTop;
$('body').css("background-position-y", "-" + st + "px");
}
*/
function changeInputType(oldObject, oType) {
var newObject = document.createElement('input');
newObject.type = oType;
if(oldObject.size) newObject.size = oldObject.size;
if(oldObject.onkeypress) newObject.onkeypress = oldObject.onkeypress;
if(oldObject.value) newObject.value = oldObject.value;
if(oldObject.name) newObject.name = oldObject.name;
if(oldObject.id) newObject.id = oldObject.id;
if(oldObject.className) newObject.className = oldObject.className;
oldObject.parentNode.replaceChild(newObject,oldObject);
return newObject;
}
function Top()
{
window.scroll(0,0);
}
function Tip(what, text)
{
$(what).bt(text, { trigger: 'load', positions: ['bottom'], width: 400,
fill: 'darkred',
cssStyles: {color: 'white', fontWeight: 'bold', width: 'auto'},
showTip: function(box){ var $content = $('.bt-content', box).hide(); var $canvas = $('canvas', box).hide(); var origWidth = $canvas[0].width; var origHeight = $canvas[0].height; $(box).show();
$canvas.css({width: origWidth * .5, height: origHeight * .5, left: origWidth * .25, top: origHeight * .25, opacity: .1}).show().animate({width: origWidth, height: origHeight, left: 0, top: 0, opacity: 1}, 500, 'easeOutBounce',
function(){$content.show(); }
);},hideTip: function(box, callback){ $(box).animate({opacity: 0}, 500, callback); }, shrinkToFit: true, hoverIntentOpts: { interval: 0, timeout: 0 }});
$.scrollTo($(what), 500, {queue:true});
$(what).delay('500').queue(function() { $(this).btOn();});
}
function Tip2(what, info)
{
$(what).bt({ fill: 'darkred',
cssStyles: {color: 'white', fontWeight: 'bold', width: 'auto'},
contentSelector: "$('#cartinfo')", positions: ['bottom'], hoverIntentOpts: { interval: 0, timeout: 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(){
$('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*="thumb"]').mouseenter(function(){
var imgfilename = $(this).attr('title');
$('#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 );
});
$('.thumb').hover(function() {
});
});
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: '