
/* -- FILE: [lib/content/javascripts/old/standard.js]*/
// This is Nux s.r.o. standard library
NLoad=function(emailClass,loginId){this.emailClass=emailClass;this.loginId=loginId;this.loadEmails();this.focusLogin();return};NLoad.load=function(emailClass,loginId){var loader=function(){new NLoad(emailClass,loginId);};return $(window).ready(loader);};NLoad.prototype.loadEmails=function(){$("span."+this.emailClass).each(function(){var text=$(this).text();if($(this).attr("title"))var address=$(this).attr("title");else var address=text;address=address.replace('&#64;','@');address=address.replace('&#46;','.');$(this).html('<a href="mailto:'+address+'">'+text+'</a>')});return};NLoad.prototype.focusLogin=function(){var login=document.getElementById(this.loginId);if(login)login.focus();return};function openWindow(location){window.open(location);return false};
NController=function(instanceName){this.instanceName=instanceName};NController.prototype.email=function(coded,linkname,makeLink,sameAddress){var cipher='ZabcXYdeWVfUTghSiRQjklPmONnMoLpqKJrIHstGuFvEwDxCyBz1A234568790';var shift=coded.length;var link='';var ltr=null;for(var i=0;i<coded.length;i++){if(cipher.indexOf(coded.charAt(i))==-1){ltr=coded.charAt(i);link+=(ltr)}else{ltr=(cipher.indexOf(coded.charAt(i))-shift+cipher.length)%cipher.length;link+=(cipher.charAt(ltr))}}if(sameAddress)linkname=link;if(makeLink!==false)document.write('<a class="email" href="mailto:'+link+'">'+linkname+'</a>');else document.write(linkname);return};NController.prototype.flashEmbed=function(flashPath,width,height,bgColor,quality,menu,border,transparent,flashVars,loop){var embedVar="";loop=loop==null?"true":loop;transparent=transparent==null?"transparent":transparent;border=border==null?"false":border;quality=quality==null?"high":quality;embedVar='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+flashPath+'" /><param name="flashvars" value="'+flashVars+'" /><param name="quality" value="'+quality+'" /><param name="menu" value="'+menu+'" /><param name="loop" value="'+loop+'" /><param name="bgcolor" value="'+bgColor+'" /><param name="wmode" value="'+transparent+'" /><embed src="'+flashPath+'" flashvars="'+flashVars+'" quality="'+quality+'" menu="'+menu+'" loop="'+loop+'" bgcolor="'+bgColor+'" width="'+width+'" height="'+height+'" wmode="'+transparent+'" name="'+flashPath+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';document.write(embedVar)};NController.prototype.getOffset=function(what,id){var el=document.getElementById(id);var offset=0;do{switch(what){case"left":offset+=el.offsetLeft;break;case"top":offset+=el.offsetTop;break}el=el.offsetParent}while(el);return offset};NController.prototype.getLeft=function(id){return this.getOffset('left',id)};NController.prototype.getTop=function(id){return this.getOffset('top',id)};NController.prototype.getScrollLeft=function(){return document.documentElement.scrollLeft||window.pageXOffset||0};NController.prototype.getScrollTop=function(){if(document.documentElement.scrollTop)return document.documentElement.scrollTop;else if(window.pageYOffset)return window.pageYOffset;else return 0};NController.prototype.windowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||0};NController.prototype.windowHeight=function(){return window.innerHeight||document.documentElement.clientHeight||0};NController.prototype.windowScrollWidth=function(){return document.documentElement.scrollWidth};NController.prototype.windowScrollHeight=function(){return document.documentElement.scrollHeight};var controller=new NController("controller");var loader = new NLoad();NLoad.load("noJsEmail", "username");

// Textarea resizers
(function ($) {
    var textarea, staticOffset;
    var iLastMousePos = 0;
    var iMin = 32;
    var grip;
    $.fn.TextAreaResizer = function () {
        return this.each(function () {
            textarea = $(this).addClass('processed'), staticOffset = null;
            minHeight = window.parseInt($(textarea).css('min-height'));
            maxHeight = window.parseInt($(textarea).css('max-height'));

            if (minHeight != maxHeight && $(textarea).css('resize') != 'none')
            {
                $(textarea).css('resize', 'vertical');
                $(this).wrap('<div class="resizable-textarea"><span></span></div>');/*.parent().append($('<div class="grippie"></div>').bind("mousedown", {
                    el: this
                }, startDrag));*/
                grip = $('div.grippie', $(this).parent())[0];
                $(grip).css('width', $(textarea).width()+4);
            }
        })
    };

    function startDrag(e) {
        textarea = $(e.data.el);
        textarea.blur();
        iLastMousePos = mousePosition(e).y;
        staticOffset = textarea.height() - iLastMousePos;
        textarea.css('opacity', 0.25);
        $(document).mousemove(performDrag).mouseup(endDrag);
        return false
    }
    function performDrag(e) {
        var iThisMousePos = mousePosition(e).y;
        var iMousePos = staticOffset + iThisMousePos;
        if (iLastMousePos >= (iThisMousePos)) {
            iMousePos -= 5
        }
        iLastMousePos = iThisMousePos;
        iMousePos = Math.max(iMin, iMousePos);
        textarea.height(iMousePos + 'px');
        if (iMousePos < iMin) {
            endDrag(e)
        }
        return false
    }
    function endDrag(e) {
        $(document).unbind('mousemove', performDrag).unbind('mouseup', endDrag);
        textarea.css('opacity', 1);
        console.log('drop')
        textarea.focus();
        textarea = null;
        staticOffset = null;
        iLastMousePos = 0;
    }
    function mousePosition(e) {
        return {
            x: e.clientX + document.documentElement.scrollLeft,
            y: e.clientY + document.documentElement.scrollTop
        }
    }
})(jQuery);

$(document).ready(function() {
    $("textarea").TextAreaResizer();
});


/* -- FILE: [lib/content/javascripts/old/googlemap.js]*/
// Googlemap
var google=false;function wheelScrolled(event){if(jQuery.browser.mozilla)zoom=(event.detail<0?1:-1);else zoom=(window.event.wheelDelta>0?1:-1);if(MapLoader.prototype.actual){var map=eval(MapLoader.prototype.actual+".map");currentZoom=map.get_zoom();map.set_zoom(currentZoom+zoom)}};MapLoader=function(instance,divID,latitude,longitude,clientTitle,clientDescription,zoom){this.instance=instance;this.latitude=latitude;this.longitude=longitude;this.clientDescription=clientDescription;this.divID=divID;this.clientTitle=clientTitle;this.zoom=zoom;$(window).load(new Function(this.instance+".loadMap()"))};MapLoader.prototype.actual=false;MapLoader.prototype.initScrollWheelZoom=function(){$("#"+this.divID).mouseover(new Function("MapLoader.prototype.actual = '"+this.instance+"'"));var el=document.getElementById(this.divID);if(jQuery.browser.mozilla)el.addEventListener('DOMMouseScroll',wheelScrolled,false);else el.onmousewheel=wheelScrolled};MapLoader.prototype.loadMap=function(){if(document.getElementById(this.divID)&&google){if(this.zoom)var zoom=this.zoom;else var zoom=14;var mapLatlng=new google.maps.LatLng(this.latitude,this.longitude);var mapOptions={zoom:zoom,center:mapLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP};this.map=new google.maps.Map(document.getElementById(this.divID),mapOptions);var markerOptions={position:mapLatlng,map:this.map,title:this.clientTitle};var marker=new google.maps.Marker(markerOptions);var infoWindowOptions={content:"<b>"+this.clientTitle+"</b><br>"+this.clientDescription,position:mapLatlng};var infoWindow=new google.maps.InfoWindow(infoWindowOptions);infoWindow.open(this.map);google.maps.event.addListener(marker,'click',function(){infoWindow.open(this.map,marker)})}};


/* -- FILE: [javascripts/map-cz.js]*/
var gmap=new MapLoader("gmap","map",50.124413,14.46563,"Česká společnost pro mechaniku","Dolejškova 5, <br />182 00 Praha 8");
