// JavaScript Document

$(document).ready(function() {

// Align to right border of selected menuitem
if($('.menu-act').length > 0) {
  var off = $('.menu-act').offset();
  var br = $('.menu-act').width();
  var leftD = br+off.left-20;
  $('li.itemodd').css('width',leftD);
  $('li.itemeven').css('margin-left',leftD);
  $('ul.chgallery-list li').show();
//  $("ul.chgallery-list li:eq(0)").show("fast", function () {
    /* use callee so don't have to name the function */
//    $(this).next("li").show("fast", arguments.callee);
// });
}

if($('.contenttable').length > 0) {
    var pic = $('div.csc-textpic-imagewrap img').width();
    $('div.csc-textpic-text').css('margin-left',leftD);
    $('div.csc-textpic-imagewrap').css('margin-left',leftD-pic);
    $('div.csc-textpic-imagewrap').css('margin-bottom','-10px');
}


// Mousover - Indexbilder
$('.item img').mouseover(function() {
var path = $(this).attr('src');
var newpath = $(this).parent().parent().children('div.title').html();
$(this).parent().parent().children('div.title').html(path);
$(this).attr('src',newpath);
});

$('.item img').mouseout(function() {
var path = $(this).attr('src');
var newpath = $(this).parent().parent().children('div.title').html();
$(this).parent().parent().children('div.title').html(path);
$(this).attr('src',newpath);
});

$('.item img').click(function() {
var path = $(this).attr('src');
var newpath = $(this).parent().parent().children('div.title').html();
$(this).parent().parent().children('div.title').html(path);
$(this).attr('src',newpath);
});

$('a').focus(function() { 
$(this).blur();
});

$('a img').attr('title',' ');

});

