$(document).ready(function() {

    var colheight = 0;
    $(".sameheightHome").each(function(){
        if ($(this).height()>colheight) colheight=$(this).height();
    }).css({height:colheight});

    var colheight2 = 0;
    $(".sameheightblok").each(function(){
        if ($(this).height()>colheight2) colheight2=$(this).height();
    }).css({height:colheight2});
    
    var colheight4 = 0;
    $(".sameheightblok2").each(function(){
        if ($(this).height()>colheight4) colheight4=$(this).height();
    }).css({height:colheight4});
    
    var colheight6 = 0;
    $(".sameheightblok3").each(function(){
        if ($(this).height()>colheight6) colheight6=$(this).height();
    }).css({height:colheight6});
    
    var colheight5 = 0;
    $(".sameheightblokli").each(function(){
        if ($(this).height()>colheight5) colheight5=$(this).height();
    }).css({height:colheight5});
    
    var colheight7 = 0;
    $(".sameheightli0").each(function(){
        if ($(this).height()>colheight7) colheight7=$(this).height();
    }).css({height:colheight7});
    
    var colheight8 = 0;
    $(".sameheightli1").each(function(){
        if ($(this).height()>colheight8) colheight8=$(this).height();
    }).css({height:colheight8});    
    
    var colheight9 = 0;
    $(".sameheightli2").each(function(){
        if ($(this).height()>colheight9) colheight9=$(this).height();
    }).css({height:colheight9});    
    
    var colheight10 = 0;
    $(".sameheightli3").each(function(){
        if ($(this).height()>colheight10) colheight10=$(this).height();
    }).css({height:colheight10});    
    
    var colheight11 = 0;
    $(".sameheightli4").each(function(){
        if ($(this).height()>colheight11) colheight11=$(this).height();
    }).css({height:colheight11});        
    
    var colheight12 = 0;
    $(".sameheightli5").each(function(){
        if ($(this).height()>colheight12) colheight12=$(this).height();
    }).css({height:colheight12});    
    
    var colheight13 = 0;
    $(".sameheightli6").each(function(){
        if ($(this).height()>colheight13) colheight13=$(this).height();
    }).css({height:colheight13});    
    
    var colheight14 = 0;
    $(".sameheightli7").each(function(){
        if ($(this).height()>colheight14) colheight14=$(this).height();
    }).css({height:colheight14});    
    
    var colheight15 = 0;
    $(".sameheightli8").each(function(){
        if ($(this).height()>colheight15) colheight15=$(this).height();
    }).css({height:colheight15});    
    
    var colheight16 = 0;
    $(".sameheightli9").each(function(){
        if ($(this).height()>colheight16) colheight16=$(this).height();
    }).css({height:colheight16});
    
    var colheight3 = 0;
    $(".sameheightH2").each(function(){
        if ($(this).height()>colheight3) colheight3=$(this).height();
    }).css({height:colheight3});

    $("a.kleurvariatie:first").css("border", "1px solid #000000");
    $("#color").html($("a.kleurvariatie:first").attr("id"));
    $("a.kleurvariatie").click(function(e) {
        //e.preventDefault();
        src = $("img", this).attr("src");
        src = src.replace("thumb", "big");
        $("img#selectedfoto").attr("src", src);
        
        $("input#kleurid").val($(this).attr("id"));
        $("a.kleurvariatie").css("border", "1px solid #B3B3B3");
        $(this).css("border", "1px solid #000000");
        $("#color").html($(this).attr("id"));
    });
    
    $(".megadropcol:last-child").addClass("last");

});

function loadPhotos(){
    var images = document.getElementsByTagName("img");
    for(var index = 0; index <= images.length; index++){
        if(images[index] && images[index].name && images[index].name!="" && images[index].name.toString().substr(0,11) == "/userfiles/"){
            images[index].src = images[index].name;
        }
    }
}
function sameHeight(className){
    var colheight = 0;
    $(className).each(function(){
        if ($(this).height()>colheight) colheight=$(this).height();
    }).css({
        height:colheight
    });
}
