
if (typeof(V1_GenericIncluded) == "undefined")
	alert("POSTBACK.JS \ngeneric.js must be included first");

function _V1_ModifyPostBack ()
{
	if(typeof(__doPostBack) == 'function' && __doPostBack.toString().indexOf('V1_FireEvent') == -1)
	{
		var code = __doPostBack.toString();
		var oldCode = code.substring( code.indexOf('{') +1, code.lastIndexOf('}') );
		var rxOldSubmit = /([a-zA-Z0-9_]+)\.submit/;
		var newSubmit = "V1_FireEvent($1,'submit');$&";
		var newCode = oldCode.replace(rxOldSubmit, newSubmit);
		__doPostBack = new Function( 'eventTarget', 'eventArgument', newCode );
	}
}

_V1_ModifyPostBack();
