// *******EXTERNAL LINKS *******

$(document).ready(function(){
$('.external,.external a').click(function() {
window.open($(this).attr("href"),null);
return false;
})});

// ***** CATALOGUE IMAGES SELECTION *****


$(document).ready(function(){

setTimeout(function() { 
     
$("#mainImage img, .thumbBlock img").each(
 function(i){
 var parentHeight = $(this).parent().height();

   var thisMargin = (parentHeight - $(this).height()) / 2;

if (thisMargin > 0)
 $(this).css("margin-top",""+thisMargin +"px");


 });

 $("#mainImage img:eq(0)").fadeIn("fast");
 $(".thumbBlock img").fadeIn("fast");
    }, 500);





$(".prodBlock").hover(
      function () {
     
        $(this).children(".titleLine").css("background-color","#BE5819");
        $(this).children(".titleLine").css("color","#FFFFFF");



      }, 
      function () {
    
       $(this).children(".titleLine").css("background-color","#FFFFFF");
        $(this).children(".titleLine").css("color","#BE5819");

      }
    );




$("#extraImages div:not(visible)").click(function() {

$("#extraImages div").removeClass("selected");
$(this).addClass("selected");

var theIndex = $(this).prevAll("div").size();

$("#mainImage .selected").fadeOut("fast", function() {

   $("#mainImage img:eq("+theIndex+")").fadeIn("fast").addClass('selected');

}).removeClass('selected');

});

});
