imgBBB=new Image();
imgBBB.src="https://www.jmctrading.cz/grafika/BBB.jpg";
imgBBBover=new Image();
imgBBBover.src="https://www.jmctrading.cz/grafika/BBB-over.jpg";
imgfelt=new Image();
imgfelt.src="https://www.jmctrading.cz/grafika/felt.jpg";
imgfeltover=new Image();
imgfeltover.src="https://www.jmctrading.cz/grafika/felt-over.jpg";
imgEchowell=new Image();
imgEchowell.src="https://www.jmctrading.cz/grafika/Echowell.jpg";
imgEchowellover=new Image();
imgEchowellover.src="https://www.jmctrading.cz/grafika/Echowell-over.jpg";
function mouseover(a)
{
switch (a)
{
case "BBB" : document.images[a].src = imgBBBover.src; break;
case "felt" : document.images[a].src = imgfeltover.src; break;
case "Echowell" : document.images[a].src = imgEchowellover.src; break;
}
}
function mouseout(a)
{
switch (a)
{
case "BBB" : document.images[a].src = imgBBB.src; break;
case "felt" : document.images[a].src = imgfelt.src; break;
case "Echowell" : document.images[a].src = imgEchowell.src; break;
}
}
function Okno(url, winName, width, height)
{
window.open(url, winName, 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,width=' + width +',height=' + height);
}
function Okno2(url, winName, width, height)
{
window.open(url, winName, 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,width=' + width +',height=' + height);
}
function submitForm(ourform) {
ourform.submit();
}
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
var offsetfrommouse=[15,25]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var defaultimageheight = 40; // maximum image size.
var defaultimagewidth = 40; // maximum image size.
var timer;
function gettrailobj(){
if (document.getElementById)
return document.getElementById("preview_div").style
}
function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("preview_div")
}
function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function hidetrail(){
gettrailobj().display= "none";
document.onmousemove=""
gettrailobj().left="-500px"
clearTimeout(timer);
}
function showtrail(imagename,title,width,height){
i = imagename
t = title
w = width
h = height
timer = setTimeout("show('"+i+"',t,w,h);",200);
}
function show(imagename,title,width,height){
var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse[0]
var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)
if( (navigator.userAgent.indexOf("Konqueror")==-1 || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
( width == 0 ) ? width = defaultimagewidth: '';
( height == 0 ) ? height = defaultimageheight: '';
width+=30
height+=55
defaultimageheight = height
defaultimagewidth = width
document.onmousemove=followmouse;
newHTML = '
Probíhá načítání obrázku...
';
newHTML = newHTML + '
' + ' '+title + '
'
newHTML = newHTML + '
';
newHTML = newHTML + '
';
if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
newHTML = newHTML+'';
}
gettrailobjnostyle().innerHTML = newHTML;
gettrailobj().display="block";
}
}
function followmouse(e){
var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]
var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)
if (typeof e != "undefined"){
if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
} else {
xcoord += e.pageX;
}
if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
} else {
ycoord += e.pageY;
}
} else if (typeof window.event != "undefined"){
if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
} else {
xcoord += truebody().scrollLeft+event.clientX
}
if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
} else {
ycoord += truebody().scrollTop + event.clientY;
}
}
gettrailobj().left=xcoord+"px"
gettrailobj().top=ycoord+"px"
}
var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
}
function remove_loading() {
this.clearInterval(t_id);
var targelem = document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
var t_id = setInterval(animate,60);
}
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
var offsetfrommouse2=[15,25]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration2=0; //duration in seconds image should remain visible. 0 for always.
var defaultimageheight2 = 0; // maximum image size.
var defaultimagewidth2 = 0; // maximum image size.
var timer2;
function gettrailobj2(){
if (document.getElementById)
return document.getElementById("text_onmouse_div").style
}
function gettrailobjnostyle2(){
if (document.getElementById)
return document.getElementById("text_onmouse_div")
}
function truebody2(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function hide_onmouse_text(){
gettrailobj2().display= "none";
document.onmousemove=""
gettrailobj2().left="-500px"
clearTimeout(timer2);
}
function show_onmouse_text(imagename,title,width,height){
i2 = imagename
t2 = title
w2 = width
h2 = height
timer2 = setTimeout("show_text('"+i2+"',t2,w2,h2);",200);
}
function show_text(imagename,title,width,height){
var docwidth=document.all? truebody2().scrollLeft+truebody2().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse2[0]
var docheight=document.all? Math.min(truebody2().scrollHeight, truebody2().clientHeight) : Math.min(window.innerHeight)
if( (navigator.userAgent.indexOf("Konqueror")==-1 || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
( width == 0 ) ? width = defaultimagewidth2: '';
( height == 0 ) ? height = defaultimageheight2: '';
defaultimageheight2 = height
defaultimagewidth2 = width
document.onmousemove=followmouse2;
if(height==0)
{
vyska = '';
}
else
{
vyska = 'height:'+height+'px';
}
newHTML = '';
newHTML = newHTML + '
' + ' '+title + '
'
newHTML = newHTML + '
' + imagename + '
';
newHTML = newHTML + '
';
if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
//newHTML = newHTML+'';
}
gettrailobjnostyle2().innerHTML = newHTML;
gettrailobj2().display="block";
}
}
function followmouse2(e){
var xcoord=offsetfrommouse2[0]
var ycoord=offsetfrommouse2[1]
var docwidth=document.all? truebody2().scrollLeft+truebody2().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.min(truebody2().scrollHeight, truebody2().clientHeight) : Math.min(window.innerHeight)
if (typeof e != "undefined"){
if (docwidth - e.pageX < defaultimagewidth2 + 2*offsetfrommouse2[0]){
xcoord = e.pageX - xcoord - defaultimagewidth2; // Move to the left side of the cursor
} else {
xcoord += e.pageX;
}
if (docheight - e.pageY < defaultimageheight2 + 2*offsetfrommouse2[1]){
ycoord += e.pageY - Math.max(0,(2*offsetfrommouse2[1] + defaultimageheight2 + e.pageY - docheight - truebody2().scrollTop));
} else {
ycoord += e.pageY;
}
} else if (typeof window.event != "undefined"){
if (docwidth - event.clientX < defaultimagewidth2 + 2*offsetfrommouse2[0]){
xcoord = event.clientX + truebody2().scrollLeft - xcoord - defaultimagewidth2; // Move to the left side of the cursor
} else {
xcoord += truebody2().scrollLeft+event.clientX
}
if (docheight - event.clientY < (defaultimageheight2 + 2*offsetfrommouse2[1])){
ycoord += event.clientY + truebody2().scrollTop - Math.max(0,(2*offsetfrommouse2[1] + defaultimageheight2 + event.clientY - docheight));
} else {
ycoord += truebody2().scrollTop + event.clientY;
}
}
gettrailobj2().left=xcoord+"px"
gettrailobj2().top=ycoord+"px"
}
var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
}
function show_menu(id, id_li)
{
if(document.getElementById(id).style.display == "block")
{
var trida=document.getElementById(id_li).className;
document.getElementById(id).style.display="none";
trida=trida.replace(/ li_open/, "");
trida=trida.replace(/ li_open/, "");
trida=trida.replace(/ li_aktivni_open/, "");
trida=trida.replace(/ li_aktivni/, "");
document.getElementById(id_li).className=trida;
}
else
{
document.getElementById(id).style.display="block";
document.getElementById(id_li).className+=" li_open";
}
}
// JavaScript Document
function switch_img(id, varianta, ean, id_skupiny) {
var http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (eror) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {zprac(http_request, id);};
http_request.open('GET', 'ajax.php?action=switch_img_vypis&id=' + id + '&varianta=' + varianta + '&ean=' + ean + '&id_skupiny=' + id_skupiny, true);
http_request.send(null);
}
function zprac(http_request, id) {
if ( (http_request.readyState == 4)||(http_request.readyState == 0)) {
if(http_request.status == 200)
{
document.getElementById(id).firstElementChild.innerHTML = http_request.responseText;
}
else
{
document.getElementById(id).firstElementChild.innerHTML = '';
}
}
}
$(document).ready(function() {
$('.hide_show_VOC').on('click', function () {
hide_show_nakupni_cena($('.VOC'), $(this), 1);
});
hide_show_nakupni_cena($('.VOC'), $('.hide_show_VOC'), 0);
});
/**
* @param element
* @param click_element
* @param set 0 = ctu hodnotu, 1 = nastavuju hodnotu
*/
hide_show_nakupni_cena = function(element, click_element, set) {
if(!set) set = 0;
$.ajax({
url: '/ajax_hide_show_nakupni_cena.php?set='+set,
type: 'get',
success: function(result) {
if(result == 1) { // hide
element.hide();
click_element.removeClass('show').addClass('hide');
}
else { // show
element.show();
click_element.removeClass('hide').addClass('show');
}
}
});
};
function skupina_popisek()
{
var vyska=document.getElementById('skupina-popisek').offsetHeight;
if(vyska>180)
{
var cely_text='... celý text';
var skupina_popisek=document.getElementById('skupina-popisek').innerHTML;
skupina_popisek=skupina_popisek.replace('', '');
document.getElementById('skupina-popisek').style.height='180px';
document.getElementById('skupina-popisek').style.overflow='hidden';
document.getElementById('skupina-popisek').className='skupina-popisek-short';
document.getElementById('skupina-popisek').innerHTML=skupina_popisek+'';
document.getElementById('skupina-popisek-more').innerHTML=''+cely_text+'';
}
}
function show_full_popisek(vyska)
{
var skryt_text='skrýt text';
var skupina_popisek=document.getElementById('skupina-popisek').innerHTML;
skupina_popisek=skupina_popisek.replace('', '');
document.getElementById('skupina-popisek').innerHTML=skupina_popisek;
document.getElementById('skupina-popisek').style.height=vyska+'px';
document.getElementById('skupina-popisek').className='';
document.getElementById('skupina-popisek-more').innerHTML=''+skryt_text+'';
}
function show_short_popisek(vyska, vyska2)
{
var cely_text='... celý text';
var skupina_popisek=document.getElementById('skupina-popisek').innerHTML;
skupina_popisek=skupina_popisek.replace('', '');
document.getElementById('skupina-popisek').style.height=vyska+'px';
document.getElementById('skupina-popisek').style.overflow='hidden';
document.getElementById('skupina-popisek').className='skupina-popisek-short';
document.getElementById('skupina-popisek').innerHTML=skupina_popisek+'';
document.getElementById('skupina-popisek-more').innerHTML=''+cely_text+'';
}
$(document).on('click', '.basket_form_up',function() {
var currentVal = parseInt($(this).parents(".js_up_down").find('input.input_ks').val());
if (!isNaN(currentVal)) {
$(this).parents(".js_up_down").find('input.input_ks').val(currentVal + 1);
} else {
$(this).parents(".js_up_down").find('input.input_ks').val(1);
}
});
$(document).on('click', '.basket_form_down',function() {
var currentVal = parseInt($(this).parents(".js_up_down").find('input.input_ks').val());
if (!isNaN(currentVal) && currentVal > 1) {
$(this).parents(".js_up_down").find('input.input_ks').val(currentVal - 1);
} else {
$(this).parents(".js_up_down").find('input.input_ks').val(1);
}
});