var $jQ = jQuery.noConflict();
/*slider*/
/*$jQ(function() {
			$jQ("div#makeMeScrollable").smoothDivScroll({ autoScroll: "onstart", 
                        autoScrollDirection: "backandforth",
                        autoScrollStep: 1,
                        autoScrollInterval: 15,
                        startAtElementId: "startAtMe",
                        visibleHotSpots: "always" });

		});

*/
$jQ(window).load(function() {
		$jQ("div#makeMeScrollable").smoothDivScroll({ 
			autoScroll: "onstart" , 
			autoScrollDirection: "backandforth", 
			autoScrollStep: 1, 
			autoScrollInterval: 15,	
			startAtElementId: "startAtMe", 
			visibleHotSpots: "always"
		});
	});
function zmiana(id,width,title,rozszezenie,h){
          var src_='/jpg/'+id+'.'+rozszezenie;
         if(rozszezenie=='swf'){
             var img='<embed  width="'+width+'"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+src_+'" play="true" loop="true" menu="true"></embed>';   
                document.getElementById('zdjecia_pow').innerHTML='<h3 id="title_gal"></h3>'+img;
          //document.getElementById('zdjecia_pow').appendChild(img);
          document.getElementById('title_gal').innerHTML=title;
         }else{
                var img =new Image();
                img.src=src_;
                img.width=width;
                img.border=1;
                
          document.getElementById('zdjecia_pow').innerHTML='<h3 id="title_gal"></h3>';
          document.getElementById('zdjecia_pow').appendChild(img);
          document.getElementById('title_gal').innerHTML=title;
          }

     }
     function show(id){
          var el,el2;
          var il=document.getElementById('il_g').value;
          il=parseInt(il)+1;
          document.getElementById('aktualna').value=id;
          for(var i=1; i<il;i++){
               el='pomo_gal'+i;
               el2='show_gal'+i;
               document.getElementById(el).style.display='none';
               document.getElementById(el2).style.fontSize='16px';
          }
          el='pomo_gal'+id;
          el2='show_gal'+id;
          document.getElementById(el2).style.fontSize='25px';
          document.getElementById(el).style.display='block';
          
          
     }
     function show2(id){
          var el,el2,akt,pomo_il;
          var il=document.getElementById('il_g').value;
          il=parseInt(il)+1;
          pomo_il=il-1;
          akt=parseInt(document.getElementById('aktualna').value);
          id=parseInt(id);
          if(id>0){
                if(akt==pomo_il)
                   return 0;
                else
                  akt++;                
          }else{
                if(akt==1)
                   return 0;
                else
                  akt--;
          }
          id=akt;
          document.getElementById('aktualna').value=id;
          for(var i=1; i<il;i++){
               el='pomo_gal'+i;
               el2='show_gal'+i;
               document.getElementById(el).style.display='none';
               document.getElementById(el2).style.fontSize='16px';
          }
          el='pomo_gal'+id;
          el2='show_gal'+id;
          document.getElementById(el2).style.fontSize='25px';
          document.getElementById(el).style.display='block';
          
          
     }
/*do menu gornego*/
	
	$jQ(document).ready(function () {

		//transitions
		//for more transition, goto http://gsgd.co.uk/sandbox/jquery/easing/
		var style = 'easeOutElastic';

		//Retrieve the selected item position and width
		var default_left = Math.round($jQ('#lava li.selected').offset().left - $jQ('#lava').offset().left);
		var default_width = $jQ('#lava li.selected').width();
		//Set the floating bar position and width
		$jQ('#box').css({left: default_left});
		$jQ('#box .head').css({width: default_width});

		//if mouseover the menu item
		$jQ('#lava li').hover(function () {
			
			//Get the position and width of the menu item
                        
			left = Math.round($jQ(this).offset().left - $jQ('#lava').offset().left);
			width = $jQ(this).width();
			
		$jQ('#debug').html(left);
			//Set the floating bar position, width and transition
			$jQ('#box').stop(false, true).animate({left: left},{duration:1000, easing: style});	
			$jQ('#box .head').stop(false, true).animate({width:width},{duration:1000, easing: style});
		
		//if user click on the menu
		}).click(function () {
			
			//reset the selected item
			$jQ('#lava li').removeClass('selected');	
			
			//select the current item
			$jQ(this).addClass('selected');
	
		});
		
		//If the mouse leave the menu, reset the floating bar to the selected item
		$jQ('#lava').mouseleave(function () {

			//Retrieve the selected item position and width
			default_left = Math.round($jQ('#lava li.selected').offset().left - $jQ('#lava').offset().left);
			default_width = $jQ('#lava li.selected').width();
			//Set the floating bar position, width and transition
			$jQ('#box').stop(false, true).animate({left: default_left},{duration:1000, easing: style});	
			$jQ('#box .head').stop(false, true).animate({width:default_width},{duration:1000, easing: style});		
			
		});
		
	});

