define(function(require){
	var $ = require('jquery');
	require('uriTemplate')($);
	require('dialog')($);
	require('datepicker')($);
	require('validation')($);
	require('grid')($);
	var IFA = require('util');
	require('../../../styles/cim/jquery-ui-1.8.14.custom.css');
	require('../../../styles/cim/cim-grid.css');
	$(function(){
		check();
		$("input").attr("disabled","disabled");
		$("#cancel").bind("click",cancel);
	});
	
	function check(){
		var allpro=$("#allpro :checkbox");
		var  checked=$("#checkedpro :checkbox");
		var discount = $("#hidediscount").val();
			if(discount==1){
				$("input[name=discount]").attr("checked","checked");
			}
		for(var i=0;i<allpro.length;i++){
			for(var j=0;j<checked.length;j++){
				if($(checked[j]).attr("value")==$(allpro[i]).attr("value")){
					$(allpro[i]).attr("checked","checked");
				}
			}
		}
	}
	
	function cancel(){
		var url = $("#cancelUrl").val();
		location.href=url;
	}
	
});