function openwin(url, name) {
	if (!name) name = 'buhv_popup';
	win = window.open(url, name,'toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=375');
	return void(0);
}



var fontsized = '';

/* ========== COVER POPUP ========== */
function coverpopup()
{
	var src = $('.product_detail_left .product_cover .product_cover_1 img').attr('src');
	if (src)
	{
		$.post('../coverpopup.php',{src:src},function(data)
		{
			if (data == 'NEIN')
			{
				alert('Das gewünschte Cover existiert leider nicht in dieser Größe');
			}
			else
			{
				$('body').append('<div id="overlay">&nbsp;</div>\n<div id="coverpopup"><a id="closepopup" href="javascript:closecoverpopup();">Ansicht schließen</a></div>');
				$('#coverpopup').prepend(data);
				$('#coverpopup').css('left','50%');
				$('#coverpopup').css('margin-left','-'+$('#coverpopup').width()/2+'px');
				$('#overlay').attr('style','opacity:0.75;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)";filter: alpha(opacity=75);');
				$('#coverpopup').fadeIn();
				$('#overlay').fadeIn();
				$('#overlay').width($('body').width()+'px');
				$('#overlay').height($('body').height()+20+'px');
			}
		});
	}	
}

function closecoverpopup()
{
	$('#coverpopup').fadeOut();
	$('#overlay').fadeOut();
	setTimeout("$('#overlay').remove();",'500')
	setTimeout("$('#coverpopup').remove();",'500')
}

/* ========== FONTSIZER ========== */

function fontsize()
{
	fontsized = $.cookie('fontsized');
	if (fontsized == null)
	{
		fontsized = 'false';
	}
	if (fontsized == 'false')
	{
		$('#content').css({'font-size':'14px','line-height':'16px'});
		fontsized = 'true';
	}
	else
	{
		$('#content').css({'font-size':'12px','line-height':'14px'});
		fontsized = 'false';
	}
	$.cookie('fontsized', fontsized, { path: '/', expires: 1 });
}


$(document).ready(function(){
	
	/* ========== ENTFERNE COVER, FALLS LEER ========== */
	$('.product_cover').each( function()
	{
		if ($(this).find('.product_cover_1').html() == '')
		{
			$(this).find('table').remove();
		}
	});	


/* ========== FONTSIZER ========== */
	fontsized = $.cookie('fontsized');
	if (fontsized == null)
	{
		fontsized = 'false';
	}
	if (fontsized == 'true')
	{
		$('#content h2').css({'font-size':'14px','line-height':'16px'});
		$('#content p').css({'font-size':'14px','line-height':'16px'});
		$('.product_more a span').css({'font-size':'12px','line-height':'14px'});
		$('#topnavi ul li a').css({'font-size':'12px','line-height':'14px'});
		$('.product_detail_right .product_info').css({'font-size':'14px','line-height':'16px'});
		$('.product_info_container').css({'font-size':'13px','line-height':'16px'});
	}
				
});



