// JavaScript Document

$(document).ready(function(){
	if ( $("#quick-scan-order-form-step-2").length ){
//*
		//Hide order number input when user does not have one
		if ( $("input[name='orderNumberNo']:checked").val() == 'n' ){
			$("#orderNumber-container").hide();
		}
		
//		var stdText = 'Fill in your order number here';
/*
		$("#orderNumber").focus(
			function(){
				$("#orderNumber").removeClass('input-empty');
				if ($("#orderNumber").val() == stdText ) $("#orderNumber").val('');
			}
		);
		$("#orderNumber").blur(
			function(){
				if ( $("#orderNumber").val() == '' ) $("#orderNumber").val(stdText).addClass('input-empty');
			}
		);
//*/
//*		
		$("input[name='orderNumberNo']").click(function(){
			if ( $("input[name='orderNumberNo']:checked").val() == 'n' ){
				$("#orderNumber-container").hide();
			}else{
				$("#orderNumber-container").show();
			}
		});
	}//if ( $("#quick-scan-order-form-step-1").length )
//*/
	
	if ( $(".quickscan-detail").length ){
		$("#show_fullscan").click(function(){
			//Change the link to an internal link
			$(this).attr("href", "#fullscan");
			//Show the full scan
			if ( $("#fullscan").is(":hidden") ) $("#fullscan").show();
		});
	}//if ( $(".quickscan-detail").length ){
	
	if ( $("#quick-scan-order-form-step-2").length ){
		//Hide VAT-box for non-VAT countries
		if ( !$("#country option:selected").hasClass("VAT") ){
			$("#VAT-container").hide();
		}
		
		//Show or hide VAT-box on country choice
		$("#country").change(function(){
			if ( $("#country option:selected").hasClass("VAT") ){
				$("#VAT-container").show();
			}else{
				$("#VAT-container").hide();
			}
		});
	}//if ( $(".quickscan-detail").length )
	
});


