function menuakce()
{
x = document.getElementById("menicko1").style.display="block";
}
function menuakce1()
{
x = document.getElementById("menicko1").style.display="none";
}

function cislaplus(myfield, e, plus)
{	var key; var keychar;
	if (window.event) key = window.event.keyCode;
	else if (e) key = e.which; else return true;
	keychar = String.fromCharCode(key);
	if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) return true;
	else if ((("0123456789"+plus).indexOf(keychar) > -1)) return true; else return false;
}

function checkMail(email)
{	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(email);
}

isDate = function(y, m, d)
{	if (typeof y == "string" && m instanceof RegExp && d)
	{	if(!m.test(y)) return 1;
		y = RegExp["$" + d.y], m = RegExp["$" + d.m], d = RegExp["$" + d.d];
	}
	d = Math.abs(d) || 0, m = Math.abs(m) || 0, y = Math.abs(y) || 0;
	return arguments.length != 3 ? 1 : d < 1 || d > 31 ? 2 : m < 1 || m > 12 ? 3 : /4|6|9|11/.test(m) && d == 31 ? 4        : m == 2 && (d > ((y = !(y % 4) && (y % 1e2) || !(y % 4e2)) ? 29 : 28)) ? 5 + !!y : 0;
};

function numberformat(n,DECIMAL_POINT,THOUSANDS_SEP)
{	n += '';
	x = n.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? DECIMAL_POINT + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + THOUSANDS_SEP + '$2');
	}
	return x1 + x2;
}

function IntoBasket(product_id, option_set_id)
{	product_quantity=Number(document.forms.frm_amount.product_quantity.value);
	if (product_quantity<=0) product_quantity=1;
	window.location.href='/scripts/intobasket.php?product_id='+product_id+'&option_set_id='+option_set_id+'&product_quantity='+product_quantity;
}



function RemoveItem(product_id, attribute_arr, accessory_product_id, A, metraz, i,konfigurator)
{	window.location.href='scripts/recount_basket.php?product_id='+product_id+'&attribute_arr='+attribute_arr+'&accessory_product_id='+accessory_product_id+'&A='+A+'&metraz='+metraz+'&i='+i+'&konfigurator='+ konfigurator;
}

function PutRating(product_id, product_rating_nr)
{	window.location.href='/scripts/put_rating.php?product_id='+product_id+'&product_rating_nr='+product_rating_nr;
}

function SbmtManForm(manufacturer_name_url, f)
{	f.action="/vyrobce/"+manufacturer_name_url;
	f.submit();
}
function RemoveVoucher(discount_voucher_id)
{	window.location.href='/scripts/recount_basket.php?A=RemoveVoucher&discount_voucher_id='+discount_voucher_id;
}


function kontroladotaz()
{
if (document.forms.kontakt.email.value == ""  || document.forms.napsatnam.dotazemail.value == "váš@mail.cz" || document.forms.napsatnam.dotazemail.value == "your@mail.cz")
    {document.forms.kontakt.email.focus();
     alert('Zadej email'); //Zadejte jmeno!
     return false;}
     
if (document.forms.kontakt.text.value == "")
    {document.forms.kontakt.text.focus();
     alert('Zadej text'); //Zadejte jmeno!
     return false;}
     
if (document.forms.kontakt.captchax.value == "")
    {document.forms.kontakt.captchax.focus();
     alert('Opište kód z obrázku'); //Zadejte jmeno!
     return false;}

}

function kontrolanapsat()
{
if (document.forms.napsatnam.dotazemail.value == "" || document.forms.napsatnam.dotazemail.value == "váš@mail.cz" || document.forms.napsatnam.dotazemail.value == "your@mail.cz")
    {document.forms.napsatnam.dotazemail.focus();
     alert('Zadej email'); //Zadejte jmeno!
     return false;}
     
if (document.forms.napsatnam.text.value == "")
    {document.forms.napsatnam.text.focus();
     alert('Zadej text'); //Zadejte jmeno!
     return false;}
     
if (document.forms.napsatnam.captcha.value == "")
    {document.forms.napsatnam.captcha.focus();
     alert('Opište kód z obrázku'); //Zadejte jmeno!
     return false;}

}

function kontroladoporucit()
{
if (document.forms.kontakt1.email.value == "")
    {document.forms.kontakt1.email.focus();
     alert('Zadej email'); //Zadejte jmeno!
     return false;}
     
if (document.forms.kontakt1.text.value == "")
    {document.forms.kontakt1.text.focus();
     alert('Zadej text'); //Zadejte jmeno!
     return false;}
     
if (document.forms.kontakt1.captchax.value == "")
    {document.forms.kontakt1.captchax.focus();
     alert('Opište kód z obrázku'); //Zadejte jmeno!
     return false;}

}

	
	function doporucit2 (id) {
	document.getElementById("doporucitp").style.display = "block";
	document.getElementById("dotazkp").style.display = "none";
  }
  
  function dotaz (id) {
	document.getElementById("dotazkp").style.display = "block";
  document.getElementById("doporucitp").style.display = "none";
  }
  
  function vypsat_flash(adresa,sirka,vyska,pozadi) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+sirka+'" height="'+vyska+'" id="flashik" align="middle"><param name="wmode" value="opaque"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/'+adresa+'"><param name="quality" value="high"><param name="bgcolor" value="'+pozadi+'">');
	document.write('<embed wmode="opaque" src="/'+adresa+'" quality="high" bgcolor="'+pozadi+'" width="'+sirka+'" height="'+vyska+'" name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('</object>');
  }

  function spam_email(vol1, vol2, vol3, vol4) {
  	var vol = vol4 + vol2 + vol3 + vol1; 
  	document.write("<a href=\"mailto:"+ vol +"\">" + vol + "</a>");
    }
