$(document).ready(function() 
{
	$('input[type="text"],[type="password"]').addClass("idleField");
	$('input[type="text"],[type="password"]').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
	});
	$('input[type="text"],[type="password"]').blur(function() {
		$(this).removeClass("focusField").addClass("idleField");
	});
});	

$(document).ready(function() 
{      
	// initialize tooltip normally    
	$("#demo img[title]").tooltip({         
		tip: '#demotip',          
		offset: [24, 2]              
		// add dynamic plugin      
	}).dynamic( 
	{              
		// customized configuration on bottom edge         
		bottom: 
		{             
			direction: 'down',              
			bounce: true         
		}     
	});      
});

$(document).ready(function() 
{      
	// initialize tooltip normally    
	$(".tooltip_small img[title]").tooltip({         
		tip: '#demotip',          
		offset: [24, 2]              
		// add dynamic plugin      
	}).dynamic( 
	{              
		// customized configuration on bottom edge         
		bottom: 
		{             
			direction: 'down',              
			bounce: true         
		}     
	});      
});

$(document).ready(function() 
{      
	// initialize tooltip normally    
	$(".tooltip img[title]").tooltip({         
		tip: '#tooltip_large',          
		position: "bottom right",
		offset: [-88, -17]              
		// add dynamic plugin      
	});      
});

$(document).ready(function() 
{      
	$("#searchForm").submit(function()
	{
		$('#clublistContainer').hide();
		$('#loadContainer').hide();
		$('#loadContainer_nopadding').hide();
		$('#load2Container').hide();		
		$('#cartContainer').hide();
		$('#faqContainer').hide();
		$('#productContainer').hide();
		$('#loader').show();	
	});
		
});

$(document).ready(function() 
{      
	$("#mailingForm").submit(function()
	{
		$('#loadContainer_nopadding').hide();
		$('#mailingContainer').hide();
		$('#loader').show();
	});
		
});

$(document).ready(function() 
{      
	$("#lostpassForm").submit(function()
	{
		$('#loadContainer_nopadding').hide();
		$('#loader').show();
	});
		
});

$(document).ready(function() 
{      
	$("#uploadForm").submit(function()
	{
		$('#imageContainer').hide();
		$('#loader').show();
	});
		
});

$(document).ready(function() 
{      
	$("#delItemForm").submit(function()
	{
		$('#loadContainer').hide();
		$('#loader').show();
	});
		
});

$(document).ready(function() 
{      
	$(".submitAmount").click(function()
	{
		$('#cartContainer').hide();
		$('#loader').show();
	});
		
});

$(document).ready(function() 
{      
	$(".faqLink").click(function()
	{
		$('#faqContainer').hide();
		$('#loader').show();
	});
		
});

$(document).ready(function() 
{      
	$("#submitOrderForm #submit").click(function()
	{
		$('#cartContainer').hide();
		$('#loader').show();	
	});
		
});

$(document).ready(function() 
{      
	$("#submitForm #submit").click(function()
	{
		$('#cartContainer').hide();
		$('#productContainer').hide();
		$('#loader').show();	
	});
		
});

$(document).ready(function() 
{      
	$(".button_back").click(function()
	{
		$('#cartContainer').hide();
		$('#loader').show();	
	});
		
});


$(document).ready(function() 
{      
	$("#registerForm #submit").click(function()
	{
		$('#loadContainer_nopadding').hide();
		$('#loader').show();	
	});
		
});

$(document).ready(function() 
{      
	$("#loginForm #submit").click(function()
	{
		$('#loadContainer_nopadding').hide();
		$('#loader').show();	
	});
		
});

$(document).ready(function() 
{      
	$("#processForm #submit").click(function()
	{
		$('#loadContainer').hide();
		$('#loader').show();	
	});
			
});

$(document).ready(function() 
{
	$(".inputWithImge").each(function(){
		$(this).add($(this).next()).wrapAll('<div class="imageInputWrapper"></div>');
	}); 
});


$(document).ready(function() 
{
	$("a[rel]").overlay({expose: '#666', effect: 'apple'});
});
				
function checkRadio()
{	
	if($("input[name='betaalmethode']:checked").val() == 'ideal')
	{
		//alert('test');
		$("#Issuerlist").css('visibility', 'visible');
	}
	
	if($("input[name='betaalmethode']:checked").val() == 'manual')
	{
		$("#Issuerlist").css('visibility', 'hidden');
	}
}

function fadeImages()
{
	$('#headerFade').innerfade({
		speed: 'slow',
 		timeout: 8000,
  		type: 'sequence',
   		containerheight: '80px'
  	});
}

function confirmSubmit()
{
	var agree = confirm("Geselecteerde orders verwijderen?");
	
	if (agree)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function limitText(limitField, limitCount, limitNum) 
{
	if (limitField.value.length > limitNum) 
	{
		limitField.value = limitField.value.substring(0, limitNum);
	} 
	else 
	{
		limitCount.value = limitNum - limitField.value.length;
	}
}

function goToURL(address) 
{ 
	window.location = address; 
}
