$(document).ready(function() {

	$('img[@src$=.png]').ifixpng();
	
	$('.knop_hover').hover(function(){
		if($(this).children('img').length > 0) {
			newsrc = $(this).children('img').attr('src').replace(/.png/i,'_over.png')
			$(this).children('img').attr({src:''});
			$(this).children('img').attr({src:newsrc});
		}
	}, function(){
		if($(this).children('img').length > 0) {
			newsrc = $(this).children('img').attr('src').replace(/_over.png/i,'.png')
			$(this).children('img').attr({src:''});
			$(this).children('img').attr({src:newsrc});
		}
	});
	
		
	
	$('.variantopener').bind("click", function(e){
		if ($('#variantselect' + $(this).attr('artikel')).css('display') == 'none') {
			$('#variantopener' + $(this).attr('artikel') + ' div').css('background-image','url(/images/indicator.gif)');
			$('#variantselect' + $(this).attr('artikel')).load('/ajax/select_winkelvariant.asp?id=' + $(this).attr('artikel'));
		}
		$('.variantselect').hide();
		
    });	

	
	$('.wwvenster').bind("click", function(e){
		if ($('#variant' + $(this).attr('artikel')).html() != '') {
			$('#wwvensteraantal').val('1');
			$('#wwvenstervariantid').html($('#variant' + $(this).attr('artikel')).html())
			$('#wwvensterkop').html($('#artikelkop'+ $(this).attr('artikel')).html())
			$('#wwvenstervariant').html($('#variantopener'+ $(this).attr('artikel') + ' div').html())
			new $.nyroModalManual({
				bgColor: '#000000',
				minHeight: 100,
				url: '#winkelwagentje_venster'
			});
		}
		else {
			blinkField($('#variantopener' + $(this).attr('artikel') + ' div'));
		}
    });
	
	$(".integer").numeric();
	
	
	$("input").focus(function () {
		if($(this).attr('type') == 'text') {
			$(this).css({border:'1px solid #0099CC'});
			$(this).select();
		}
    });

	$("input").blur(function () {
		if($(this).attr('type') == 'text') {
			$(this).css({border:'1px solid #CCCCCC'});
		}
    });
		
	$('input[type=checkbox],input[type=radio]').prettyCheckboxes();


});