/* javascript by grafisoft.cz */
function JE_EMAIL(txt){var x = new RegExp('^[^@]+@([a-z,A-Z,0-9,_,-]+[.]{1})+[a-z,A-Z,0-9]{2,5}$'); if (x.exec(txt.toLowerCase())==null) return 0; else return 1;}
function show(id) {if (document.getElementById(id).style.display=='none') document.getElementById(id).style.display='block'; else document.getElementById(id).style.display='none';}
function showk(id,dir) {show('kategorie-'+id); if (document.getElementById('kimg'+id).src.indexOf('ts-r-plus.gif')>-1) document.getElementById('kimg'+id).src=dir+'/ts-r-minus.gif'; else document.getElementById('kimg'+id).src=dir+'/ts-r-plus.gif';}
function scrollit() {document.getElementById('message').style.top=document.body.scrollTop + top + 'px';}
function regnews() {if(JE_EMAIL(document.getElementById('enov').value)==0) {alert('pro registraci novinek musí být e-mail zadán ve správném formátu'); return false;} else {return true;}}
function myParseFloat(str){str=''+str+''; var value=str.match('[-]{0,1}(?:[1-9]+[0-9]*[,.]{0,1}[0-9]*)|(?:0[,.][0-9]*)'); if(value!=null && value.length>0){value[0]=value[0].replace(',','.'); value=parseFloat(value[0])*1; return value;}else{return 0;}}
function meziOblibene(url, title) {
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
alert('Váš prohlížeč bohužel tuto funkci nepodporuje.');
}
if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url, '');
return treu;
}
if( window.external ) { // IE Favorite
window.external.AddFavorite( url, title);
return true;
}
if(window.opera && window.print) { // Opera a Chrome Hotlist
alert('ahoj');
return true;
}
}
function pozadi(obj,obj2,akce)
{
var trida = 'bg-input-'+akce;
if (document.getElementById(obj2).value=='') document.getElementById(obj).className=trida;
}
$(function(){
var body=$('body');
var imageZoom=function(){
var obj=$(this);
var img=obj.find('.imageDiv img');
var href=obj.find('.imageDiv a').attr('href');
var offset=img.offset();
var zoom=$('
').addClass('zoomer');
var zoomHandler=$('').attr('href',href).addClass('zoom-handler').css({top:offset.top,left:offset.left});
var zoomImg=$('
').attr('src',img.attr('data-zoom300src'));
var zobj={zoomer:zoom,img:zoomImg};
var zoomIn=function()
{
// zobj.img.css({width:150,height:150,marginTop:75,marginLeft:75});
zobj.zoomer.show();
// zobj.img.stop(true,false).animate({width:300,height:300,marginTop:0,marginLeft:0});
};
var zoomOut=function()
{
// zobj.img.stop(true,false).animate({width:150,height:150,marginTop:75,marginLeft:75},{complete:function(){
zobj.zoomer.hide();
// }});
};
zoom.append(zoomImg).css({top:offset.top-80,left:offset.left-80});
body.append(zoom).append(zoomHandler);
zoomHandler.mouseenter(zoomIn);
zoomHandler.mouseleave(zoomOut);
};
$('.katalog-sobrazky').each(imageZoom);
});
// version = 2
var produktDetail={
data:{},
bind:{},
eventPodproduktChange:[],
callPriceChange:[],
imageArea:[],
imageAreaVlastnost:[],
skladADostupnost:[],
kombinaceVlastnosti:null,
selectedSvazanyParametrIndex:null,
formatPrice:function(price){
var pocet=myParseFloat(this.data.pocetDesetinnychMist);
if(pocet<0){
var orizni='1';
for(var i=0; i>pocet; i--){orizni+='0';}
orizni=myParseFloat(orizni);
return Math.round(price/orizni);
}else{
return price.toFixed(pocet);
}
return price;
},
setBind:function(data){
this.bind=data;
if(this.bind.poradiKontroly==undefined || this.bind.poradiKontroly==null){
this.bind.poradiKontroly=['svazane']; // defaultne se kontroluji jenom svazane parametry
}
if(this.bind.pocetDesetinnychMist!==null && this.bind.pocetDesetinnychMist!==undefined){this.data.pocetDesetinnychMist=this.bind.pocetDesetinnychMist;}
if(this.bind.nedostupnaKombinaceKod==null || this.bind.nedostupnaKombinaceKod==undefined) this.bind.nedostupnaKombinaceKod='-';
if(this.bind.nedostupnaSklad==null || this.bind.nedostupnaSklad==undefined) this.bind.nedostupnaSklad='-';
if(this.bind.nedostupnaDostupnost==null || this.bind.nedostupnaDostupnost==undefined) this.bind.nedostupnaDostupnost ='-';
if(this.bind.nedostupnaSkladADostupnost==null || this.bind.nedostupnaSkladADostupnost==undefined) this.bind.nedostupnaSkladADostupnost='-';
if(this.bind.vlasnostBezObrazkuMeniObrazekNaDefault==null) this.bind.vlasnostBezObrazkuMeniObrazekNaDefault=true;
},
setData:function(data){
this.data=data;
this.data.dph=(myParseFloat(this.data.dph)/100)+1;
if(this.bind.pocetDesetinnychMist!=null && this.bind.pocetDesetinnychMist!=undefined){this.data.pocetDesetinnychMist=this.bind.pocetDesetinnychMist;}
},
setImageArea:function(data){
this.imageArea[this.imageArea.length]=data;
},
setImageAreaVlastnost:function(data){
this.imageAreaVlastnost[this.imageAreaVlastnost.length]=data;
},
setKombinaceSkladADostupnost:function(data){
this.skladADostupnost[this.skladADostupnost.length]=data;
},
changeParametrImage:function(){
for(var i=0; i0)?{"cenaBez":cenaVybranehoPodproduktuBez,"cenaS":cenaVybranehoPodproduktuBez*this.data.dph,ID:vybranyPodprodukt.id,key:vybranyPodprodukt.key}:null),
"kombinaceVlastnosti":((this.data.volitelnyParametr.length>0)?{"cenaBez":kombinaceVlastnostiCenaBez,"cenaS":kombinaceVlastnostiCenaBez*this.data.dph}:null)
};
for(var i=0; i0){
for(var i=0; iProdukt ve zvolené kombinaci hodnot parametrů ';
for(var i=0; i';
}
}else{
var escapedName=this.data.productName;
escapedName=escapedName.replace(/&/g,'&');
escapedName=escapedName.replace(/"/g,'"');
escapedName=escapedName.replace(/>/g,'>');
escapedName=escapedName.replace(/0){
try{document.getElementById(this.bind.kosikNode).style.display='none';}catch(e){}
try{
var errorHTML='Chyba';
document.getElementById(this.bind.errorNode).innerHTML=errorHTML;
document.getElementById(this.bind.errorNode).style.display='block';
}catch(e){}
}else{
try{document.getElementById(this.bind.errorNode).style.display='none';}catch(e){}
try{document.getElementById(this.bind.kosikNode).style.display='block';}catch(e){}
}
}
this.handleEvent('podproduktChange');
}
}
var vlastnostiV2={
zakladniCenaBezDPH:0,
zakladniCenaSDPH:0,
targetBezDPH:null,
targetSDPH:null,
data:null,
set:function(zakladniCenaBezDPH,zakladniCenaSDPH,targetBezDPH,targetSDPH,data,productImage,productImageSizeX,productImageSizeY){
this.zakladniCenaBezDPH=zakladniCenaBezDPH;
this.zakladniCenaSDPH=zakladniCenaSDPH;
this.targetBezDPH=targetBezDPH;
this.targetSDPH=targetSDPH;
this.data=data;
this.productImage=productImage;
this.productImageSizeX=productImageSizeX;
this.productImageSizeY=productImageSizeY;
},
change:function(valueString){
var p=valueString.split('_');
for(var v=0; v0) {for (i=0; i0)
for (i=0; i0)
{
for (i=0; i