$(function(){
	$('#phone').hide();
	$('#phoneDiv').show();
	
	$('#ideal').append('<span style="background:url(http://bouwjeeigencamsite.nl/v2/payment2/images/ideal.gif);"></span>');

	$('#credit').append('<span style="background:url(http://bouwjeeigencamsite.nl/v2/payment2/images/vas.gif);"></span>');

	$('#icons .link').hover(function(){
		$(this).find('span').css({'display':'none'});
	},function () {
        $(this).find('span').css({'display':'block'});
   	})
	
	$('.link').find('span').css({'margin-top':'10px','margin-left':'9px','width':'42px','height':'42px','display':'block'});
	
	$('.link').click(function(){
		var eId = $(this).attr('id');
		if(eId){
			if(eId=='credit' || eId=='ideal' || eId=='mrcash'){
				$('.link').hide(); 			//Hide all buttons
				$('.blockDiv').hide(); 		//Hide all blockdivs
				$('#phone').show();			//Only show phone icon
				$('#creditDiv').show(); 	//Show div for clicked button
			}else{
				$('.blockDiv').hide(); 		//Hide all blockdivs
				$('.link').show(); 			//Show other buttons
				$('#'+eId).hide(); 			//Hide clicked button
				$('#'+eId+'Div').show(); 	//Show div for clicked button
			}
		}
	});
	
	$('#selecttype').change(function(){
		if($(this).val()!=""){
			$('.contentDiv').hide();
			$('#'+$(this).val()+'Div').css({'clear':'both'}).show();
		}
	});
	
	$('#'+$('#selecttype').val()+'Div').show();	//Show fist value or last selected 
	
});
