﻿///Voor intellisense:
/// <reference Path="~/jQuery/jquery-1.3.js" />


$(document).ready(function() {
    initButtons();
});
function initButtons() {

    $('.linksDiv').each(function(i) {
        var imgUrl = $(this).children('.hiddenImage').val();
        $(this).css('background-image', 'url(' + imgUrl + ')');
        $(this).css('background-repeat', 'no-repeat');
        $(this).css('text-align', 'center');
        $(this).css('cursor', 'pointer');
    });
    $('.linksDiv').mouseover(function() { $(this).css('background-image', 'url(' + $(this).children('.hiddenImageHover').val() + ')'); });
    $('.linksDiv').mouseout(function() { $(this).css('background-image', 'url(' + $(this).children('.hiddenImage').val() + ')'); });
    $('.linksDiv').click(function() {
        var url = $(this).children('.bitLinkButton123').attr('href');
        var target = $(this).children('.bitLinkButton123').attr('target');
        if (url.indexOf('javascript:', 0) > 0) {
            var functionName = url.replace('javascript:');
            eval(functionName);
        }
        if (target == '_blanc') {
            window.open(url, 'newwindow');
        }
        else {
            location.href = $(this).children('.bitLinkButton123').attr('href');
        }


    });
}
