show#record#=function(#primarykey#,name,bookmark){
	addtab('#record#_'+#primarykey#,name,'show#record#&#primarykey#='+#primarykey#,null,null,{bookmark:bookmark});	
}

_inline_lookup#record#=function(d){
	var soundex='';
	if (d.soundex) soundex='&soundex=1';
	
	if (d.timer) clearTimeout(d.timer);
	d.timer=setTimeout(function(){
		ajxpgn('#record#list',document.appsettings.codepage+'?cmd=slv_#fviewindex#&mode=embed&key='+encodeHTML(d.value)+soundex);
	},300
	);	
}


add#record#=function(gskey){

	var suffix='new';
#iterator-fieldlist-getrecordjs#
	
	var valid=1;
	var offender=null;
	
	//delete the excessive validate rules
#iterator-fieldlist-validate#
	//add more validation rules
	
	if (!valid) {
		if (offender&&offender.focus) offender.focus();
		return;
	}

#iterator-fieldlist-realvalues#	
	var params=[];
#iterator-fieldlist-parampush#
	
	reloadtab('#record#_new','','add#record#',function(req){
		var #primarykey#=req.getResponseHeader('newrecid');		
		reloadview('#viewindex#','#record#list');
	},params.join('&'),null,gskey);
	
}

update#record#=function(#primarykey#,gskey){
	var suffix=#primarykey#;
#iterator-fieldlist-getrecordjs#
	
	var valid=1;
	var offender=null;
	
	//delete the excessive validate rules
#iterator-fieldlist-validate#
	//add more validation rules
	
	if (!valid) {
		if (offender&&offender.focus) offender.focus();
		return;
	}
	
#iterator-fieldlist-realvalues#	
	var params=[];
#iterator-fieldlist-parampush#
	
	reloadtab('#record#_'+#primarykey#,'','update#record#&#primarykey#='+#primarykey#,function(){
		reloadview('#viewindex#','#record#list');
		flashstatus(document.dict['statusflash_updated']+o#dispfield#.value,5000);
	},params.join('&'),null,gskey);
	
}


del#record#=function(#primarykey#,gskey){
	if (!sconfirm(document.dict['confirm_#record#_delete'])) return;
	
	reloadtab('#record#_'+#primarykey#,null,'del#record#&#primarykey#='+#primarykey#,function(){
		closetab('#record#_'+#primarykey#);
		reloadview('#viewindex#','#record#list');
	},null,null,gskey);
}