// ==UserScript==
// @name Convert POST to GET in forms
// @author Shoust 
// @namespace http://opera.oslocity.org/shoust/ 
// @version 1.0
// @description  Converts all forms to method="get" so the resulting
//			URL is able to be copied.
// @ujs:category general: enhancements
// @ujs:published 2005-08-26 15:06
// @ujs:modified 2005-09-19 09:19
// @ujs:documentation http://userjs.org/scripts/general/enhancements/convert-post-to-get 
// @ujs:download http://userjs.org/scripts/download/general/enhancements/convert-post-to-get.js
// ==/UserScript==


/* 
 * This script is granted to the Public Domain.
 * Some parts copied with permission from Jesse Ruderman:
 * http://www.squarefree.com/bookmarklets/forms.html
 */

document.addEventListener("load",function() {
	var x, i;
	x = document.getElementsByTagName ("form");
	for (i = 0; i < x.length; ++i) {
		x[i].oldmethod = x[i].method;
		if( x[i].encoding == 'multipart\/form-data' ) {
			x[i].method = "get";
		}
	}
	document.addEventListener("dblclick",function() {
		var x, i;
		x = document.getElementsByTagName ("form");
		for (i = 0; i < x.length; ++i) x[i].method = x[i].oldmethod;
	}, false);
}, false);
