define(function(require){
	var $ = require('jquery');
	require('dialog')($);
	require('uriTemplate')($);
	require('../paymethod/generatorForEditting.js');
	require('../../../styles/cim/jquery-ui-1.8.14.custom.css');
		//返回按钮
		$("#returnButton").bind("click",function(){
			location.href=$("#indexUrl").val();
		});
		//resHistory审计历史
		$("#resHistory").bind("click",function(){
			var urlString=new $.Template($("#searchOrderBySegmentIndex").val());
			var urlParams={"segmentNo":$("#segmentNo").val(),
					      "personId":$("#personId").val()};
			var url=urlString.expand(urlParams);
			resHistory(url);
		});
		function resHistory(url){
			window.open(url,window);
		}
	//公司图片显示
	$("#companyImageHandlerShow").bind("click",companyImageFun);
	//公司价格链接显示图片
	function companyImageFun(){
		$("#imageDrag").removeAttr("style");
		$("#companyImage").dialog({title:i18n["JS.workOrder.companyPricePic"], height:420,width:330, 
			modal: false,closeOnEscape:true,overlay: { opacity: 0.5, background: 'black',overflow:'auto'},
			buttons:{
			'ReDo':function(){$("#imageDrag").removeAttr("style");},	
			'Zoom In':function(){
				$("#imageDrag").css({
				      width: function(index, value) {
				        return parseFloat(value) * 1.2;
				      }, 
				      height: function(index, value) {
				        return parseFloat(value) * 1.2;
				      }});
			},
			'Zoom Out':function(){
				$("#imageDrag").css({
				      width: function(index, value) {
				        return parseFloat(value) / 1.2;
				      }, 
				      height: function(index, value) {
				        return parseFloat(value) / 1.2;
				      }});
			},
			'Close':function(){$(this).dialog('close');}
			}}); 
	}
});