//js skript stranky  - hlavni nabídka



function hpf_tableRowsHightlight()
{
          $(".hp_coinTable .rows").hover(function()
               {
               $(this).addClass("rowHover");
               },
               function()
               {
               $(this).removeClass("rowHover");
               }
               );
          
                 
};

function hint_buble1()
{

$('#hp_action_offer').CreateBubblePopup({ 

										alwaysVisible: true,
										position : 'top',
										align	 : 'right',
										width: "300px",
										tail	 : { align: 'left' },										
										innerHtml: 'Zde je zobrazena aktuální akční nabídka, pokud chcete zobrazit detail mince, klikněte prosím na "detail" nebo na obrázek "plus" na řádku dané mince.',	
										innerHtmlStyle: {color:'#FFFFFF','text-align':'center'},										
										themeName: 	'all-grey',
										themePath: 	'images/jquerybubblepopup-theme',
                    mouseOver: 'show',	
                    mouseOut: 'show',								
                    afterShown: function(){
                                         setTimeout("$('#hp_action_offer').RemoveBubblePopup();",10000);
                                          }
});                                      
															
}



function show_shop_buble(id)
{

$('#bp'+id).CreateBubblePopup({ 

										alwaysVisible: true,
										position : 'right',
										align	 : 'right',
										width: "150px",
										tail	 : { align: 'left' },										
										innerHtml: 'Položka byla přidána do košíku!',	
										innerHtmlStyle: {color:'#FFFFFF','text-align':'center'},										
										themeName: 	'all-grey',
										themePath: 	'images/jquerybubblepopup-theme',
                    mouseOver: 'show',	
                    mouseOut: 'show',								
                    afterShown: function(){
                                         setTimeout("$('#bp"+id+"').RemoveBubblePopup();",1000);
                                          }
});                                      
															
}




function hp_loadActOffer()
{

alert("test");

};

function hpf_tableDetail(selector)
{

var setheight = '230px';

if ( $.browser.msie ) {
   if ( parseFloat($.browser.version) < 8 )
    {
    setheight = '250px'; 
    } 
    else
    {
    setheight = '230px';
    }; 
}


   var act_height =  $("#tcd"+selector).height(); 

   if ( act_height == 0 )
    {
   $("#tcdico"+selector).removeClass("tdcplus");
   $("#tcdico"+selector).addClass("tdcminus");    
   $("#tcd"+selector).css("display","block");
   $('#tcd'+selector).animate({
    height: setheight
    },500);         
    }
    else
    {
    
    $("#tcdico"+selector).removeClass("tdcminus");
    $("#tcdico"+selector).addClass("tdcplus");    
    $('#tcd'+selector).animate({
    height: '0px'
    },500, function() 
        {
        $("#tcd"+selector).css("display","none");

        }   );      
    };  
}

function hpf_toShopCard(id_item,prize_item)
{

      $.ajax({
        type: "POST",
        url: "special_pages/homepage/php_scripts/to_shopCard.php",
        cache: false,
        data: "id_item="+id_item+"&prize_item="+prize_item,
        success: function(result){
                                  if (result == 1)
                                    {
                                    refreshShopCard(true);
                                    }
                                    else
                                    {
                                    alert("Během ukládání položky do košíku došlo k chybě!");
                                    };

                                 }
      
      });
}

function hpf_load_SlideShow()
{
$(function() {
  intervalID = setInterval( "hpf_slideSwitch()", 10000 );
});
}

function hpf_slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment the 3 lines below to pull the images in random order    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');
        });                
}


