$(document).ready(function() {
// Cufon.replace('body', { fontFamily: 'Berling Roman' });
var bildknappid = 0;
$('#fleruppdateringar').click(function() {
$('#fleruppdateringar').hide('slow');
$('#flernyheter').show('slow');
return false;
});
$('#mindreuppdateringar').click(function() {
$('#fleruppdateringar').show('slow');
$('#flernyheter').hide('slow');
return false;
});
$('.bildknappar').click(function() {
id = $(this).attr("id");
bildknapp_klick(id);
});
$('.videoknappar').click(function() {
id = $(this).attr("id");
videoknapp_klick(id);
});
$('.kund').tooltip({
delay: 0,
showURL: false,
prevId: 'prevBtnt_test',
nextId: 'nextBtn_test',
bodyHandler: function() {
return $("
").attr("src", this.rev);
}
});
$('.kund').hover(function () {
$(this).css({'font-weight' : 'bold'});
}, function () {
$(this).css({'font-weight' : 'normal'});
});
$('.kund_utanbild').hover(function () {
$(this).css({'font-weight' : 'bold'});
}, function () {
$(this).css({'font-weight' : 'normal'});
});
$(".radio").click(function() {
$(this).find('input').attr("checked", true);
$(".radio").removeClass("radioactive");
$(this).addClass("radioactive");
});
});
function bildknapp_klick(id) {
lid = id.replace("slider_", "");
if ($("#"+id).attr('src') != '/bilder/btn_foto_a.gif') {
$("#"+id).attr('src', '/bilder/btn_foto_a.gif');
$('#v'+ lid).hide('slow');
$("#" + id + "c").show('slow');
$("#" + id +"b").easySlider({
auto: false,
continuous: true
});
} else {
$("#"+id).attr('src', '/bilder/btn_foto.gif');
$("#" + id + "c").hide('slow');
}
$('#bildknapp_'+ lid).attr('src', '/bilder/btn_video.gif');
}
function videoknapp_klick(id) {
lid = id.replace("bildknapp_", "");
if ($("#"+id).attr('src') != '/bilder/btn_video_a.gif') {
$("#"+id).attr('src', '/bilder/btn_video_a.gif');
$('#v' + lid).show('slow');
$('#slider_'+ lid+'c').hide('slow');
$("#" + id +"b").easySlider({
auto: false,
continuous: true
});
} else {
$("#"+id).attr('src', '/bilder/btn_video.gif');
$('#v' + lid).hide('slow');
}
$('#slider_'+ lid).attr('src', '/bilder/btn_foto.gif');
}
function kontaktbild(id) {
if ($('#bild'+ id ).attr('src') != '/bilder/btn_foto_a.gif') {
$('#bild'+ id ).attr('src', '/bilder/btn_foto_a.gif');
$('#p'+ id ).show('slow');
} else {
$('#bild'+ id ).attr('src', '/bilder/btn_foto.gif');
$('#p'+ id ).hide('slow');
}
}
/**function showbrodtext(id) {
document.getElementById('nyheter_brodtext').innerHTML = document.getElementById(id).innerHTML;
$('#nyheter_brodtext').show('slow');
}**/
function showbrodtextKund(id, ob) {
$('.kund').removeClass('kundactive');
$(ob).addClass('kundactive');
document.getElementById('kund_brodtext').innerHTML = document.getElementById(id).innerHTML;
$('#kund_brodtext').show('slow');
}
function showbrodtextTjanster(id, ob) {
$('.tjanster').removeClass('kundactive');
$(ob).addClass('kundactive');
document.getElementById('tjanster_brodtext').innerHTML = document.getElementById(id).innerHTML;
$('#tjanster_brodtext').show('slow');
}
function showbrodtextTjansterfirst(id, ob) {
$(ob).addClass('kundactive');
document.getElementById('tjanster_brodtext').innerHTML = document.getElementById(id).innerHTML;
$('#tjanster_brodtext').show('slow');
}
(function($){
$.fn.extend({
customStyle : function(options) {
if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
return this.each(function() {
var currentSelected = $(this).find(':selected');
$(this).after(''+currentSelected.text()+'').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
var selectBoxSpan = $(this).next();
var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));
var selectBoxSpanInner = selectBoxSpan.find(':first-child');
selectBoxSpan.css({display:'inline-block'});
selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
//var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
var selectBoxHeight = parseInt(20);
$(this).height(selectBoxHeight).change(function(){
selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed');
});
});
}
}
});
})(jQuery);
$(function(){
$('select').customStyle();
});