        
			//** ready page is in bottom of this file

			function showUnderline(no)
			{
				if(placedUnderlineNo != no)
					$('#' + underlineLabel + '_' + no).attr({"class" : "underline"});		
			}

			function hideUnderline(no)
			{
				if(placedUnderlineNo != no)
					$('#' + underlineLabel + '_' + no).attr({"class" : ""});		
			}

			function placeUnderline(no)
			{
				var len = 10;
				var lab = "";

				for(var i = 0; i < len; i++)
				{
					lab = '#' + underlineLabel + '_' + i;					
					if($(lab).length > 0 )
					{
						if(i == no)
						{
							$(lab).css({"visibility" : "visible"});
							placedUnderlineNo = no;
						}
						else
							$(lab).css({"visibility" : "hidden"});
					}

				}
			}

			function searchDummy(obj, text)
			{
				obj.value = text;				
			}

			function onEveryAjax()
			{
			}

			function trim(stringToTrim) 
			{
				return stringToTrim.replace(/^\s+|\s+$/g,"");
			}

			function ltrim(stringToTrim) 
			{
				return stringToTrim.replace(/^\s+/,"");
			}

			function rtrim(stringToTrim) 
			{
				return stringToTrim.replace(/\s+$/,"");
			}

			function searchDummy(obj, text)
			{			
				if(ltrim(rtrim(obj.value)) == '' )
					obj.value = text;

				if(trim(rtrim(obj.value)) == text)
					obj.value = '';								
			}






		function fixme()
        {
           $('#closeBoxI').ifixpng();
        }
        function fixImg(id)
        {
           $('#' + id).ifixpng();
        }

        function sifrHeaders()
        {
                //_typeface_j.typefaceInit();
                
                //$.sifr({path:'./js/jq/fonts/', width: 600, height: 30, flashvars: { w: 600, h: 30}   });

                //$('h1,h2,h3,h4,h5').sifr({font:'1979'});

        }

        function pageLoad()
        {

                //$("#menu1").corner("round 8px").parent().css('padding', '4px').corner("round 10px");
                //Rounded("div#menu1","#377CB1","#9BD1FA");
                
                //** fix all png's transparency
                //$('img[@src$=.png]').ifixpng();

                $('#png1').ifixpng();
                $('#png2').ifixpng();
                $('#png3').ifixpng();

                $('#ZoomClose').ifixpng();
                
                onEveryAjax();

        };

        function onEveryAjax()
        {
                 sifrHeaders();
                 $('img[@src$=.png]').ifixpng();
                 $('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth: 16});

        }
        
        function changeCursor(element)
        {
                if(element.style.cursor == 'pointer' || element.style.cursor == 'hand')
                {
                     element.style.cursor = 'default';
                }
                else
                     element.setAttribute("class", "cursor");
        };


        function clickMe(h)
        {
                document.location.href = h;
        };

        function preloadMe(id, loader)
        {
                var element = document.getElementById(id);

                $('#' + id).fadeOut(400);
        };
        
        function disableSelection(t)
        {
                 //var t = document.getElementById(target);

/*                  if (typeof t.onselectstart!="undefined") //IE
        	    t.onselectstart=function(){return false}
                 else if (typeof t.style.MozUserSelect!="undefined") //Firefox
                    t.style.MozUserSelect="none"
                 else //All other route (ie: Opera)
        	    t.onmousedown=function(){return false}
                  t.style.cursor = "default" */
        }
        
        function switchImages(id1, id2)
        {
                 var e1 = document.getElementById(id1);
                 var e2 = document.getElementById(id2);
                 
                 
                 if(e1.style.visibility == 'hidden')
                 {
                    e1.style.visibility = 'visible';
                    e2.style.visibility = 'hidden';
                 }
                 else
                 {
                    e1.style.visibility = 'hidden';
                    e2.style.visibility = 'visible';
                 }
        }
        
        function GoogleMapInitialize(html) 
        { 
        	var isMapa = document.getElementById("map_canvas");
        	if(isMapa == null){
        		return '';
        	}
        	else
        	{
        	    var map = new GMap2(document.getElementById("map_canvas"));
        		var point = new GLatLng(50.072211,19.928053);
        	    map.setCenter(point, 16); 
        	    map.enableDragging();
        	    map.addControl(new GSmallMapControl)
        	    var mymarker = new GMarker(point);

        	    GEvent.addListener(mymarker, "click", function() {  
        	    	mymarker.openInfoWindowHtml(html)});	
        	    
        	    map.addOverlay(mymarker);
        	    
        	    mymarker.openInfoWindowHtml(html);	  
        	}
        }
        
        function sm(l, d1, d2)
        {
             s1 = 'ma';
             s2 = 'il';
             s3  = 'to:';

             location.href = s1 + s2 + s3+ l + String.fromCharCode(64) + d1 + '.' + d2;
             
             return s1 + s2 + s3+ l + String.fromCharCode(64) + d1 + '.' + d2;
        };
        
		function readyPage()
		{
    	    var html = '<div style="width: 200px; height: 30px;">' +
    	    '<div style="float: left; width: 60px;"><img src="../../../i-logo-matmar.png" alt="MATMAR COMINDEX sp. z o.o." /></div>' +
			'<div style="float: right; width: 120px;">' + 
			'<div style="color: black; font-size: 10px;">* ul. Kościelna 3<br />* 30-034 Kraków<br />* tel. 012 294 54 78<br />* fax 012 294 54 77</div>' +
			'</div>' +
		
			'</div>';  

			GoogleMapInitialize(html);
			
			$("body").attr("scroll", "no"); 
		    //$("img[rel]").overlay({effect: 'apple'});

        	$("#loadpage").fadeOut(2000);

				$(".fadeHover").hover
				(					    		
				        function() 
						        { 
									$(".container").hide().fadeIn("fast"); 
									
							    }, 
						        function() { } 	
				);


		    if (document.all) 
			{
		        $("#menu0 li").hoverClass("sfHover");
		    }

		    //** scroll to
            var $p1 = $('.scrollMe');
			if($p1 != "")
			{

				$('a.scrollToElement').bind(
					'click',
					function()
					{
						var targetElementSelectorString = $(this).attr('rel');
						$p1[0].scrollTo(targetElementSelectorString);
						return false;
					}
				);
			}

			$.fn.hoverClass = function(c) {
			    return this.each(function(){
			        $(this).hover( 
			            function() { $(this).addClass(c);  },
			            function() { $(this).removeClass(c); }
			        );
			    });
			};
		}
		
		function footPage(baseUrl)
		{
			// cufon
			 Cufon.replace('h2, span.fadeHover, div#SideHeader, .resultTitle, h3, h5', 
				{
					textShadow: '2px 2px rgba(0, 0, 0, 0.4)'
				});

			 Cufon.replace('a.menuItem', 
				{
				 	textShadow: '1px 1px rgba(0, 0, 0, 0.4)',
					hover: true

				});
							 
			//END: cufon
			
			     $('#moreFl').flash
                               (
                                       { src: baseUrl + '/i-more.swf',
                                         width: 90,
                                         height: 70,
                                         wmode: 'transparent' },
                                       { version: 8 }
                               );
			
				$('#galleryLoader').flash
				(
				        { src: baseUrl + '/i-loader.swf',
				          width: 24,
				          height: 24,
				          wmode: 'transparent' },
				        { version: 8 }
				);

				if($("#thumbs").length > 0 && $("#galleryConf").length > 0)
				{
						
					$.tools.overlay.plugins.gallery.conf.autohide = false;
					$.tools.overlay.plugins.gallery.conf.preload = false;
					$.tools.overlay.plugins.gallery.conf.activeClass = null;
					
					//** image gallery
				    $("#thumbs a").overlay({ 
				        expose: '#002000',
				        target: '#galleryConf',
					    top: '12%' 
				     
				    }).gallery({speed: 100}); 

				}

				if($("#newsletter").length > 0 && $("#newsTip").length > 0)
				{
					//** tooltip
				    var api = $("#newsletter").tooltip({ 
				        tip: '#newsTip', 
				        effect: 'fade', 
				        fadeOutSpeed: 100, 
				        predelay: 50, 
				        delay: 40000, 
				        position: "bottom right", 
				        offset: [231, 30], 
				        api : true 
				    }); 
				
           }			
		}

        
        

        
        


