/*
 * order.js
 */

$(document).ready(function(){

	var shoseki_name = $('#oderShosekiTbl .shosekiName');
	var shoseki_code = $('#oderShosekiTbl .shosekiCode');
	var shoseki_num = $('#oderShosekiTbl .shosekiNum');
	shoseki_name.each(function(){
		if($(this).val() != "書籍名") $(this).css("color","#333");
  });
	shoseki_code.each(function(){
		if($(this).val() != "ISBNコード") $(this).css("color","#333");
  });
	shoseki_num.each(function(){
		if($(this).val() != "数量") $(this).css("color","#333");
  });

	shoseki_name.focus(function(){
		if($(this).val() == "書籍名") { $(this).val(""); $(this).css("color","#333"); }
	});
	shoseki_code.focus(function(){
		if($(this).val() == "ISBNコード") { $(this).val(""); $(this).css("color","#333"); }
	});
	shoseki_num.focus(function(){
		if($(this).val() == "数量") { $(this).val(""); $(this).css("color","#333"); }
	});


	var form = $('#orderForm');
	form.submit(function(){
		var name = $('#orderForm .shosekiName');
		var code = $('#orderForm .shosekiCode');
		var num = $('#orderForm .shosekiNum');
		name.each(function(){
			if($(this).val() == "書籍名") $(this).val("");
	  });
		code.each(function(){
			if($(this).val() == "ISBNコード") $(this).val("");
	  });
		num.each(function(){
			if($(this).val() == "数量") $(this).val("");
	  });
	});


});


