/*  */
function load_signature_box(path, sval, mode, ditem, field, eri, fow, signsize){
	var w = '600', h = '250', whary = '';
	if ((signsize) && signsize.trim() != '' && signsize.indexOf('x') != -1) {
		whary = signsize.split('x');
		if (!isNaN(whary[0]) && (whary[0]).trim() != '') w = whary[0];
		if (!isNaN(whary[1]) && (whary[1]).trim() != '') h = whary[1];
	}
	var zmode = $('#SUB_MODE'+fow).val(),
		type = ($('#SUB_MODE'+fow).val() == $('#SUB_SUBPATH'+fow).val()) ? 'D' : 'S';
	var zdiv = '#detail_div_'+zmode+fow,zform = '#detail_form_'+zmode+fow,
		sdiv = '#sub_div_'+zmode+fow,sform = '#sub_form_'+zmode+fow;
	var sberis = $(sdiv+' #SUB_ERIPATH'+fow).val().split('/'),
		zeri = ($(zform+' #ERI').length > 0 && $(zform+' #ERI').val() != '') ? $(zform+' #ERI').val() : $(zform+' #TEMPERI').val(),
		maperi = ($(zform+' #HIDEFLOW_ERI').length > 0) ? $(zform+' #HIDEFLOW_ERI').val() : '';
	var meri = (mode == zmode) ? zeri : sberis[sberis.length-1];
	var url = path+'core/cw5e_signature.php?sid='+sval+'&parent='+EncodeURLutf8(path)+
			  '&zmode='+zmode+'&zeri='+zeri+'&mode='+mode+'&meri='+meri+'&eri='+eri+
			  '&ditem='+ditem+'&fdname='+field+'&feri='+maperi+'&fow='+fow+'&w='+w+
			  '&h='+h+'&act=view';
	load_popup_box(url, 'Signature Pad', 0, 0);
}