$(document).ready(function() {
	$('a.thickbox').nyroModal();
	$('#francisco,#mundus,#concours,#vinalies,#vinitaly,#chall,#jarovin,#valtice,#litomerice,#litomerice,#vinex,#salon,#juvenale,#vino,#vinoforum,#ljubljana,#londyn,#makro,#obal2007').css("width","600px").parent(".text").parent(".article").hide();
  $("a[rel='external']").attr({target: "_blank"});
	$("#menu a[rel='external']").wrap("<span class='external'></span>");
	
	
  $('.noJSblockPhotoDownload').addClass('blockPhotoDownload');
  $('.blockPhotoDownload').removeClass('noJSblockPhotoDownload');
  
  $('.blockPhotoDownload').hide();
  $('.blockPhotoDownload').fadeTo(1, 0.0);
  $('.showDownloadBlock').click(function(){
    $('.blockPhotoDownload').hide();
    $('#block'+$(this).attr("id")).show();
    $('.blockPhotoDownload').fadeTo(200, 0.0);    
    $('#block'+$(this).attr("id")).fadeTo(200, 0.9);   
    return false;
  });
  
  $('.blockPhotoDownload').click(function(){
    
    $('.blockPhotoDownload').hide();
    $('.blockPhotoDownload').fadeTo(200, 0);
  });

  $('#cards .close').click(function(){
	  $('#cards').slideUp();
  });


});



jQuery.fn.highlight=function(b){function a(e,j){var l=0;if(e.nodeType==3){var k=e.data.toUpperCase().indexOf(j);if(k>=0){var h=document.createElement("span");h.className="highlight";var f=e.splitText(k);var c=f.splitText(j.length);var d=f.cloneNode(true);h.appendChild(d);f.parentNode.replaceChild(h,f);l=1}}else{if(e.nodeType==1&&e.childNodes&&!/(script|style)/i.test(e.tagName)){for(var g=0;g<e.childNodes.length;++g){g+=a(e.childNodes[g],j)}}}return l}return this.each(function(){a(this,b.toUpperCase())})};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;with(this.parentNode){replaceChild(this.firstChild,this);normalize()}}).end()};
