/* Font handling */
Cufon.replace('h1.tagline', {
	color: '#f5c636',
	fontWeight: 'bold',
	fontSize: '41px',
	fontFamily: 'DinBold'
});
  Cufon.replace('h3.title', {
	color: '#ffffff',
	fontWeight: 'bold',
	fontSize: '18px',
	fontFamily: 'DinBold'
});
Cufon.replace('.startPageForm h3.title', {
    color: '#ffffff',
    fontWeight: 'bold',
    fontSize: '16px',
    fontFamily: 'DinBold'
});
Cufon.replace('h3.stitle', {
	color: '#ffffff',
	fontWeight: 'bold',
	fontSize: '16px',
	fontFamily: 'DinBold'
});
 Cufon.replace('#header h2.arrow-line', {
	color: '#f5c636',
	fontWeight: 'bold',
	fontSize: '16px',
	fontFamily: 'DInMed'
});
Cufon.replace('h3.bluetitle', {
	color: '#275fa8',
	fontWeight: 'normal',
	fontSize: '19px',
	fontFamily: 'DinBold'
});
Cufon.replace('h3.bluetitle-ret', {
	color: '#275fa8',	
	fontWeight: 'normal',
	fontSize: '19px',
	fontFamily: 'DinBold'
});
Cufon.replace('#header h2.arrow-line span', {
	color: '#ffffff',
	fontWeight: 'bold',
	fontSize: '16px',
	fontFamily: 'DInMed'
});
Cufon.replace('.bod-tab .heading', {
	color: '#f5c636',
	fontWeight: 'normal',
	fontSize: '18px',
	fontFamily: 'DInReg'
});
Cufon.replace('.bod-tab2 .heading', {
	color: '#f5c636',
	fontWeight: 'normal',
	fontSize: '18px',
	fontFamily: 'DInReg'
});
Cufon.replace('#header .shadow-title', {
	color: '#000000',
	fontWeight: 'normal',
	fontSize: '18px',
	fontFamily: 'DInReg'
});
	Cufon.replace('#header .shadow-titleret', {
	color: '#000000',
	fontWeight: 'normal',
	fontSize: '18px',
	fontFamily: 'DInReg'
});

/* FAQ accordion */
$(function(){
	$("#accordion").accordion({
	    autoHeight: false,
	    header: "h3"
	});
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
});

/* Reciept */
function openRecieptWindow(url) {
    var width = 400;
    var height = 600;
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    params += ', directories=no';
    params += ', location=no';
    params += ', menubar=no';
    params += ', resizable=no';
    params += ', scrollbars=no';
    params += ', status=no';
    params += ', toolbar=no';
    newwin = window.open(url, 'recieptWindow', params);
    if (window.focus) {
        newwin.focus()
    }
    return false;
}

/* Slideshow */
function slideSwitch() {
    var $active = $('#slideshow img.active');
    if ($active.length == 0)
        $active = $('#slideshow img:last');

    var $next = ($active.next().length) ? $active.next() : $('#slideshow img#first');

    $active.addClass('last-active');
    $next.css({ opacity: 0.0 }).addClass('active').animate({ opacity: 1.0 }, 1000, function() {
        $active.removeClass('active last-active');
    });
}

$(function() {
    setInterval("slideSwitch()", 7000);
});

