(function(a){a.extend({add2cart:function(d,e){var b=a(d);d=a("#"+e);var c=a("#addshadow");c.length==0?a("body").prepend('<div id="addshadow" style="display:none; background:white url('+b.attr("src")+') no-repeat center center; border:solid 2px #D0D0D0; position: static; top: 0px; z-index: 100000;">&nbsp;</div>'):c.css({background:"white url("+b.attr("src")+") no-repeat center center"});c=a("#addshadow");c.width(b.css("width")).height(b.css("height")).css("top",b.offset().top).css("left",b.offset().left).css("opacity",
0.8).show(300);c.css("position","absolute");c.animate({width:d.innerWidth(),height:d.innerHeight(),top:d.offset().top,left:d.offset().left},{duration:1E3}).animate({opacity:0},{duration:100,complete:function(){a("#"+b.attr("id")+"_shadow").css("display","none");c.hide()}})}})})(jQuery);

(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
{if(string.match(_escapeable))
{return'"'+string.replace(_escapeable,function(a)
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);function UrlParam(a){var b=window.location.search.substring(1).split("&");for(var d in b){var e=b[d].split("=");if(e[0]==a)return e[1]}return""}
function atb(a,b,d){d&&$.add2cart(d,"nakupnykosik");$.post("/st/nakupny-kosik.ashx",$.toJSON({Id:a,Pocet:b}),function(e){e=$.evalJSON(e);var c=0;c="";c=e.JePrazdny?"0":formatNumber(e.Cena).replace(".",",");if(c.indexOf(",")==-1)c+=",-";$("#nkcena").html(c+" &euro;");c=e.JePrazdny?"V\u00e1\u0161 n\u00e1kupn\u00ed ko\u0161\u00edk je pr\u00e1zdny.":e.PosledneTovary;$("#nkpolozky").html(c);NK()})}
function OnValid(a,b){if(typeof a.type!="undefined")if(a.type.toLowerCase()=="select-one"){$(a).parent().parent().css({color:b?"#df6145":"#505050"});$(a).toggleClass("err-sel",b);return!b}$(a).toggleClass("err",b).parent().parent().css({color:b?"#df6145":"#505050"});return!b}function optionClear(a){$(a).get(0).length=0;return a}function optionValue(a,b){a=$(a).get(0);for(var d=0;d<a.length;d++)if(a[d].value==b){a[d].selected=true;return a}return a}
function optionCreate(a,b,d,e){if(typeof a!="undefined"){var c=document.createElement("OPTION");c.text=b;c.value=d;if(e){c.style.background="#F0F0F0";c.style.fontWeight="bold"}$(a).get(0).options.add(c);return a}}function optionsCreate(a,b,d){for(var e in a){var c=a[e];optionCreate(b,c.Nazov,c.Id,c.Id==-1)}if(d){a=$(b).get(0);a.disabled=a.length==0}return b}function optionsCopy(a,b){optionClear(b);a=$(a).get(0);for(var d=0;d<a.length;d++){var e=a[d];optionCreate(b,e.text,e.value)}}
function formEach(a,b,d){for(var e=false,c=$(a).toArray()[0],f=[],g=0;g<c.elements.length;g++)if(a=c[g])!a||typeof a=="undefined"||typeof a!="object"||b(a,f)||(e=true);typeof d!="undefined"&&f.length>0&&d(f);return!e}function formErr(a,b,d){typeof a=="undefined"||!b||(a[a.length]=d)}function formCheckValid(a){$("input[class*='err'],select[class*='err-sel']",a).each(function(){OnValid(this,true)})}
function createPostBack(a){var b=document.createElement("INPUT");b.setAttribute("name","_postback");b.setAttribute("value","1");b.setAttribute("type","HIDDEN");a.appendChild(b);return a}function isChecked(a){return $(a).attr("checked")}function _TS(a){var b=new Date;b=b.getMilliseconds()+""+b.getSeconds()+""+b.getMinutes()+""+b.getHours();return typeof a=="undefined"?b:a+"?"+b}function _R(a){window.location.href=a}function _JD(a){return encodeURIComponent($.isPlainObject(a)?$.toJSON(a):a)}
function _JV(a){return true}function formatNumber(a){if(typeof a=="undefined")return"";a=a.toString().replace(/\./ig,",");var b=a.lastIndexOf(","),d=b>-1?a.substring(b,a.length):"",e=a.indexOf("-")>-1;if(b!=-1)a=a.substring(e?1:0,b);else if(e)a=a.substring(e?1:0,a.length);b="";for(var c=0;c<a.length;c++)b=a.substring(a.length-1-c,a.length-c)+(c%3==0?" ":"")+b;v=(e?"-":"")+jQuery.trim(b)+jQuery.trim(d);c=v.indexOf(",");if(c>0&&v.substring(c,c+3).length==2)v+="0";return v}
function check_email(a){return RegExp("^[a-zA-Z0-9-_.]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$").test(a)}function ToMailing(){var a=$("#newsletter");if(check_email(a.val())){$("#newsletter").removeClass("err");$.post(_TS("/st/mailing.ashx"),a.val(),function(b){var d=$("#newsletter-result");d.show().html("V\u00e1\u0161 e-mail bol \u00faspe\u0161ne pridan\u00fd do odberu noviniek.");a.val("@");setTimeout(function(){d.hide()},8E3)})}else $("#newsletter").addClass("err")}
function Search(){var a=$("#q").val();if(a.length<=0)$("#q").addClass("err");else{$("#q").removeClass("err");var b=document.createElement("FORM");b.setAttribute("action","/vyhladavanie/");b.setAttribute("method","GET");var d=document.createElement("INPUT");d.setAttribute("name","q");d.setAttribute("value",a);b.appendChild(d);document.body.appendChild(b);b.submit()}}
function JSready(){$("span[lang='ach']").each(function(){var a=$(this).html();a=a.replace(/xYx/ig,"@").replace(/yXy/ig,".");$(this).html('<a href="mailto:'+a+'" class="blue">'+a+"</a>")})}function flashPlay(a,b,d,e,c){var f=document.createElement("embed");f.setAttribute("width",d);f.setAttribute("height",e);f.setAttribute("menu","false");f.setAttribute("quality","high");f.setAttribute("src",a);c&&f.setAttribute("wmode","transparent");document.getElementById(b).appendChild(f)}var old,oldt;
function P(){$("#IdZnacka").change(function(){var a=$(this).get(0);a=a[a.selectedIndex].value;var b=UrlParam("s"),d=UrlParam("p"),e=UrlParam("q"),c="";if(b!="")c=c+(c!=""?"&":"")+"s="+b;if(d!="")c=c+(c!=""?"&":"")+"p=1";if(a!="")c=c+(c!=""?"&":"")+"z="+a;if(e!="")c=c+(c!=""?"&":"")+"q="+e;window.location.href="?"+c});$(".obrazok").mouseenter(function(){I(this,true)});$("#reklama").length>0&&flashPlay("http://static.najnaradie.sk/sd/adv/reklama01.swf","reklama",500,95,true)}
function A(a,b){atb(a,1,$("img",$(b).parent().parent()))}function I(a,b){a=$(".tool",$(a).parent());if(b){old!=a&&I(old,false);a.show();old=a;clearTimeout(oldt);oldt=setTimeout(function(){I(old,false);old=null},6E3)}else a.hide()};

