
$(document).ready(function(){

$("table.collection-table-v2 tbody tr").click(function(){
$(this).removeClass("hover-row");
window.location = $(this).children('td').children('a').attr('href')
});

$("table.collection-table-v2 tbody tr").hover(
function(){
$(this).addClass("hover-row");
},
function(){
    $(this).removeClass("hover-row");
}
);

$("table.collection-table-1 tbody tr").click(function(){
$(this).removeClass("hover-row");
window.location = $(this).children('td').children('a').attr('href')
});

$("table.collection-table-1 tbody tr").hover(
function(){
$(this).addClass("hover-row");
},
function(){
    $(this).removeClass("hover-row");
}
);

    // Thumbnails view
$("div.collection-thumbnail").click(function(){
    window.location = $(this).children('a').attr('href');
});

$("div.collection-thumbnail").hover(
function(){
    $(this).removeClass('collection-thumbnail');
    $(this).addClass("collection-thumbnail-selected");
},
function(){
    $(this).removeClass("collection-thumbnail-selected");
    $(this).addClass("collection-thumbnail");
}
);

// Karelia Upofloor highlight
$("td.product-thumb-item").click(function(){
window.location = $(this).children('div').children('a').attr('href')
});
$("td.product-thumb-item").hover(
function(){
    oldcolor = $(this).css('background-color');
    $(this).css('background-color', '#51A9E8');
    $(this).css('cursor', 'pointer');
},
function(){
    $(this).css('background-color', oldcolor);
    $(this).css('cursor', 'auto');
}
);

    // Linoleum hierarchy
$("div.linoleum-hierarchy div.object-type div.manufacturer, div.linoleum-hierarchy div.object-type div.collection").click(function(){
window.location = $(this).children('span').children('a').attr('href')
});

$("div.linoleum-hierarchy div.object-type div.manufacturer, div.linoleum-hierarchy div.object-type div.collection").hover(
function(){
    oldcolor = $(this).css('background-color');
    $(this).css('background-color', '#51A9E8');
    $(this).css('cursor', 'pointer');
},
function(){
    $(this).css('background-color', oldcolor);
    $(this).css('cursor', 'auto');
}
)

    // Covrolin hierarchy
$("div.covrolin-hierarchy div.object-type div.manufacturer, div.covroline-hierarchy div.object-type div.collection").click(function(){
window.location = $(this).children('span').children('a').attr('href')
});

$("div.covrolin-hierarchy div.object-type div.manufacturer, div.covroline-hierarchy div.object-type div.collection").hover(
function(){
    oldcolor = $(this).css('background-color');
    $(this).css('background-color', '#51A9E8');
    $(this).css('cursor', 'pointer');
},
function(){
    $(this).css('background-color', oldcolor);
    $(this).css('cursor', 'auto');
}
)
});

function showpic(file,w,h){
		window.open(file,'Image','width=' + w +',height='+ h +',scrollbars=no,toolbar=no,location=no,status=no,resizable=yes,screenX=120,screenY=100');
	}

function change_look(id, cls){
  document.getElementById(id).setAttribute('class', cls);
}

