$(document).ready(function() {
			/*
			*   Examples - images
			*/

$("a.lightbox-2").fancybox({
				'centerOnScroll': false,
        'overlayOpacity': 0.8,
        'overlayColor': '#000',
        'titlePosition': 'inside',
        'titleShow' : true,
        'titleFormat'		: formatTitle,
        'speedIn': 500
			});


      $(".longpopis a").click(function () {
      //alert($(this).attr("href"));
    if($(this).attr("href") != "#"){
         if($(this).attr("href").match("zlato")){
        pageload = 'pageload.php?page='+this.href;
      
      $.fancybox({
				'centerOnScroll': false,
        'overlayOpacity': 0.8,
        'width'		: 680,
        'hideOnOverlayClick' : true,
        'overlayColor': '#000',
        'titlePosition': 'outside',
        'titleShow' : true,
        'href'			: 'pageload.php?page='+this.href,
        'speedIn': 500
			});
			 return false;
      }
      else{
        window.open(this.href, "nove", "width=700,height=500, resizable=yes, scrollbars=yes");
        return false;
      }
      }
      
      
     
      
    }).change();
    
    
    
    
          $(".lpopis a").click(function () {
      //alert($(this).attr("href"));
    if($(this).attr("href") != "#"){
         if($(this).attr("href").match("zlato")){
        pageload = 'pageload.php?page='+this.href;
      
      $.fancybox({
				'centerOnScroll': false,
        'overlayOpacity': 0.8,
        'width'		: 680,
        'hideOnOverlayClick' : true,
        'overlayColor': '#000',
        'titlePosition': 'outside',
        'titleShow' : true,
        'href'			: 'pageload.php?page='+this.href,
        'speedIn': 500
			});
			 return false;
      }
      else{
        window.open(this.href, "nove", "width=700,height=500, resizable=yes, scrollbars=yes");
        return false;
      }
      }
      
      
     
      
    }).change();
    
    
          $(".oplink").click(function () {
      

        
        pageload = 'pageload.php?page='+this.href;
      
      $.fancybox({
				'centerOnScroll': false,
        'overlayOpacity': 0.8,
        'width'		: 680,
        'hideOnOverlayClick' : true,
        'overlayColor': '#000',
        'titlePosition': 'outside',
        'titleShow' : true,
        'href'			: 'pageload.php?page='+this.href,
        'speedIn': 500
			});
			 return false;
     
      
      
      
     
      
    }).change();    
    
    
    
    
    
    
    
    
    
    
    
    
    
    $("#fbox a").click(function () {
    //  alert($(this).attr("href"));
      if($(this).attr("href") != "#"){
         if($(this).attr("href").match("zlato")){
      
      $.fancybox({
				'centerOnScroll': false,
        'overlayOpacity': 0.8,
        'width'		: 680,
        'hideOnOverlayClick' : true,
        'overlayColor': '#000',
        'titlePosition': 'outside',
        'titleShow' : true,
        'href'			: 'pageload.php?page='+this.href,
        'speedIn': 500
			});
			 return false;
      //return false;
      }
      else{
        window.open(this.href, "nove", "width=700,height=500, resizable=yes, scrollbars=yes");
        return false;
      }
      }
    }).change();

	
		
    $(".dostlink").mouseover(function () {
      $(".incartdost").hide();
      $("#"+($(this).attr("rel"))).fadeIn();
    }).change();
    
    
    $(".dostlink").mouseout(function () {
      t = ($(this).attr("rel"));
      setTimeout('hidedost(t)', 500)
    }).change();

		});


function hidedost(id){
  $("#"+id).fadeOut();
}
function formatTitle(title, currentArray, currentIndex, currentOpts) {
    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Obrázek ' + (currentIndex + 1) + ' z ' + currentArray.length + '</div>';
}

