<!--
function showBoschVideo(id_vario) {
    $.ajax({
        type: "GET",
        url: "../ajax/bosch-video.php",
        data: "id_vario="+id_vario,
        dataType: "json",
        success: function(data) {
            if (isNaN(data)) {
                $('#bosch-video iframe').attr({
                    "id": "cliplister_"+data.product,
                    "src": data.url
                });
                $('#bosch-video iframe').css({
                    "width": data.width+"px",
                    "height": data.height+"px"
                });
                $('#js_zalozka_7h1').show();
                $('#js_zalozka_7h2').parent().show();
                $('#js_zalozka_7h3').show();
                $('#bosch-video').show();
            }
        }
    });
}

function brand_check_all(url) {

    document.getElementById('catalog_form').submit();

}

function brand_check_one() {

    var brands = document.getElementsByName('brand[]');

    var form_string = '';
    var j = 0;
    for(var i = 0; i< brands.length; i++) {
        if(brands[i].value != 'all' && brands[i].checked != '') {
              if(j==0) { form_string = form_string+brands[i].value; j = 1; }
             else { form_string = form_string+'_'+brands[i].value; }
        }
    }


    form_act = document.getElementById('catalog_form').action;
    document.getElementById('catalog_form').action = form_act+'/'+form_string;

    document.getElementById('brand_all_checkbox').checked='';
    document.getElementById('catalog_form').submit();

}

function change_tab(tab,four) {

    if(four == 1) {
//        var tabs = ['js_zalozka_1','js_zalozka_2','js_zalozka_3','js_zalozka_4','js_zalozka_5'];
        var tabs = ['js_zalozka_1','js_zalozka_2','js_zalozka_4','js_zalozka_5','js_zalozka_6', 'js_zalozka_7'];
        if(tab == 'js_zalozka_4') {
            if(document.getElementById('accessories_div')) { document.getElementById('accessories_div').style.display = 'none'; }
        }
        else {
            if(document.getElementById('accessories_div')) { document.getElementById('accessories_div').style.display = ''; }
        }
        if(tab == 'js_zalozka_6') {
            if(document.getElementById('similars_div')) { document.getElementById('similars_div').style.display = 'none'; }
        }
        else {
            if(document.getElementById('similars_div')) { document.getElementById('similars_div').style.display = ''; }
        }

    }
    else {
        var tabs = ['js_zalozka_1','js_zalozka_2','js_zalozka_3','js_zalozka_4', 'js_zalozka_7'];
    }

    for(var i = 0; i< tabs.length; i++) {
        document.getElementById(tabs[i]).style.display='none';
        document.getElementById(tabs[i]+'h1').className='labels_1';
        document.getElementById(tabs[i]+'h2').className='labels_2';
        document.getElementById(tabs[i]+'h3').className='labels_3';
    }
    
    document.getElementById(tab).style.display='block';
    document.getElementById(tab+'h1').className='labels_1_on';
    document.getElementById(tab+'h2').className='labels_2_on';
    document.getElementById(tab+'h3').className='labels_3_on';
    
}

function display_note2(note,x,y) {

    document.getElementById(note).style.display='';

    document.getElementById(note).style.left=x+'px';
    document.getElementById(note).style.top=y+'px';


}

function hide_note2(note) {

    document.getElementById(note).style.display='none';

}

function check_email(email) {

		var at = "@";
		var dot = ".";
		var lat = email.indexOf(at);
		var lstr = email.length;
		var ldot = email.indexOf(dot);

		if (email.indexOf(at)==-1) {
		   return false;
		}

		if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr) {
		   return false;
		}

		if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr) {
		    return false;
		}

		 if (email.indexOf(at,(lat+1))!=-1) {
		    return false;
		 }

		 if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot) {
		    return false;
		 }

		 if (email.indexOf(dot,(lat+2))==-1) {
		    return false;
		 }
		
		 if (email.indexOf(" ")!=-1) {
		    return false;
		 }

	    validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
    	if (email.search(validRegExp) == -1) {
		   return false;
    	}

 		 return true;				
	}

function check_email_form(id) {

    var sender = document.getElementById('sender'+id).value;
    var email = document.getElementById('email'+id).value;
    var sender = document.getElementById('message'+id).value;

    if(check_email(email) == false) {
    	alert('Zadejte prosím email ve správném tvaru.');
    	return false;
    }
    
    if(sender == '' || message == '') {
    	alert('Musíte vyplnit všechny údaje.');
    	return false;
    }
    
    return true;

}

function check_register(type) {


    var email = document.getElementById('reg_email').value;

	var parts = email.split('.');
	var parts_count = parts.length;
	var end = parts[parts_count-1];
	var seynam_p = parts[parts_count-2].split('@');
	var seynam_p_count = seynam_p.length;
	var seynam = seynam_p[seynam_p_count-1];

	if(end == 'cy') {
		if(!confirm('Zadaný email má koncovku .cy - je adresa '+email+' skutečně správná?')) {
			return false;
		}
	}

	if(seynam == 'seynam') {
		if(!confirm('Je zadaný email '+email+' skutečně správný?')) {
			return false;
		}
	}


    if(type != 'basket') {

       var pass = document.getElementById('reg_password').value;

	   if(pass == '' || pass.length < 5) {
	       alert('Heslo musí obsahovat minimálně pět znaků.');
    	   return false;
    	}

    }

    return true;
}

function IsNumeric(sText) {

   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}

function check_lenght(word) {

	var word = document.getElementById('word').value;
    
    if(word.length < 3) {
        alert("Slovo musí obsahovat alespoň tři znaky.");
        return false;
    }
    var word1 = word.replace("/", "[slash]");
    var word2 = word1.replace(".", "[dot]");
    document.getElementById('search_form').action = '/vyhledavani/'+word2;
    return true;

}

function display_pass_form() {

    document.getElementById('pass_form').style.display='block';
    document.getElementById('login_form').style.display='none';
    document.getElementById('pass_note').style.display='none';

}

function check_empty() {

    if(confirm('Opravdu chcete vysypat obsah vašeho košíku?')) {
        document.getElementById('empty_form').submit();
    }

}

function check_numeric(elem) {

    var string = document.getElementById(elem).value;

    if(IsNumeric(string)) return true;
    else {
        alert('Zadejte prosím číselný údaj.');
        return false;
    }

}

function hide_basket_div() {

    document.getElementById('light').style.display='none';
    document.getElementById('fade').style.display='none';

}

function change_main_img(img,width,height,height_margin,full_width,full_height) {

	var main_img = document.getElementById('main_img');
	main_img.parentNode.href = '/img_product/img/'+img;
	main_img.parentNode.setAttribute('onclick','openWindow(this.href,'+full_width+','+full_height+'); return false');
	main_img.src = '/img_product/img350/'+img;
	main_img.width = width;
	main_img.height = height;
	main_img.style.margin = (height_margin)+"px 0px";
}

function openWindow(image,width,height) {
	open(image, '', 'left=20,top=20,toolbar=0,resizable=0,height=' + height + ', width=' + width);
}

function is_input_number(evt) {
	var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;
	return true;
}

var scrolling = null;
 
function scroll_up() {
    var d = document.getElementById('scroller');
 
    d.scrollTop = d.scrollTop - 5;
 
    scrolling = window.setTimeout(function() {
        scroll_up();
    }, 60);
}
 
function scroll_down() {
    var d = document.getElementById('scroller');
 
    d.scrollTop = d.scrollTop + 5;
 
    scrolling = window.setTimeout(function() {
        scroll_down();
    }, 60);
}
 
function stop_scroll() {
    window.clearTimeout(scrolling);
}

function check_nl_email() {

    var email = document.getElementById('email_newsletter').value;

	if(!check_email(email)) {
		alert('Zadal jste neplatný email.');
    	return false;
    }

	if (email.indexOf('ě') != -1 || email.indexOf('š') != -1 || email.indexOf('č') != -1 || email.indexOf('ř') != -1 || email.indexOf('ž') != -1 || email.indexOf('ý') != -1 || email.indexOf('á') != -1 || email.indexOf('í') != -1 || email.indexOf('é') != -1) {
		alert('Emailová adresa nesmí obsahovat diakritiku.');
		return false;
	}

	var parts = email.split('.');
	var parts_count = parts.length;
	var end = parts[parts_count-1];

	if(end == 'cy') {
		if(!confirm('Zadaný email má koncovku .cy - je adresa '+email+' skutečně správná?')) {
			return false;
		}
	}
	
	return true;

}

function refresh_payment(transport) {

    document.getElementById('pa_7').disabled=false;
    document.getElementById('pa_1').disabled=false;
    document.getElementById('od_1').style.color='#000000';
    document.getElementById('od_7').style.color='#000000';
    var last_price = document.getElementById('in_total_price').value;

    if(transport == 1) {
        document.getElementById('pa_7').disabled=true;
        document.getElementById('od_7').style.color='silver';
        document.getElementById('pa_1').checked='checked';
        if(last_price < 2499) {
        
        	last_price = (parseInt(last_price)+149)+'';

			last_price2 = last_price;
    	    if(last_price.length == 4) {
        		last_price2 = last_price[0]+' '+last_price[1]+last_price[2]+last_price[3];
	        }
    	    if(last_price.length == 5) {
        		last_price2 = last_price[0]+last_price[1]+' '+last_price[2]+last_price[3]+last_price[4];
	        }
    	    if(last_price.length == 6) {
        		last_price2 = last_price[0]+last_price[1]+last_price[2]+' '+last_price[3]+last_price[4]+last_price[5];
	        }

    	  	document.getElementById('price_step2').innerHTML = last_price2;
        }
    }

    if(transport == 3) {
        document.getElementById('pa_1').disabled=true;
        document.getElementById('od_1').style.color='silver';
        document.getElementById('pa_7').checked='checked';

		last_price2 = last_price;
        if(last_price.length == 4) {
        	last_price2 = last_price[0]+' '+last_price[1]+last_price[2]+last_price[3];
        }
    	if(last_price.length == 5) {
        	last_price2 = last_price[0]+last_price[1]+' '+last_price[2]+last_price[3]+last_price[4];
	    }
		if(last_price.length == 6) {
        	last_price2 = last_price[0]+last_price[1]+last_price[2]+' '+last_price[3]+last_price[4]+last_price[5];
	    }

      	document.getElementById('price_step2').innerHTML = last_price2;
    }

}

-->
