//*** This code copyright Gavin Kistner and Refinery, Inc. | gavin@refinery.com | http://www.refinery.com/
//*** Reuse permitted provided the previous line is included

/**********************************************************************************
* Forms which use method="GET" cannot pass values in the querystring of the action.
* (e.g. action="process.asp?foo=foo")
* Including this library will cause any form with method="get" and a query string
* in the action to automatically turn any such values into hidden inputs instead.
**********************************************************************************/

AttachEvent(window,'load',function(){
	for (var i=0,fs=document.forms,len=fs.length;i<len;i++){
		var f=fs[i],qs,qsRE=/\?(.+)$/;
		if (f.method.toLowerCase()!='get' || !qsRE.test(f.action)) continue;
		for (var j=0,qs=RegExp.$1.split('&'),len2=qs.length;j<len2;j++){
			var keyVal=qs[j].split('=');
			var inp=f.appendChild(document.createElement('input'));
			inp.name=keyVal[0];
			inp.value=unescape(keyVal[1]);
			inp.style.display='none';
		}
		f.action=f.action.replace(qsRE,'');
		
	}
});

