function post2get(formId)
{
	var uri = '';
	var form_obj = document.getElementById(formId);
	//alert(form_obj.action);return false;
	for(i=0; i < form_obj.elements.length; i++ ){
		var key = form_obj.elements[i].name;
		var value = form_obj.elements[i].value;
		var type = form_obj.elements[i].type;
		
		if ('submit' == type || 'button' == type){
			continue
		}
		
		if ('radio' == type || 'checkbox' == type){
				if (!form_obj.elements[i].checked){
					continue;
				}
		}
		
		if ('' != value){
			if (uri.length > 1 ){
				uri += '&';
			}

			var value = encodeUri(value);
			
			uri += key+'='+value;
		}
	}
	
	var base_uri = '';
	if ('' == form_obj.action){
		base_uri += window.location.protocol
		base_uri += '//'+window.location.host;
		if (window.location.port){
			base_uri += ':'+window.location.port;
		}
		// controller action
		base_uri += window.location.pathname;
	}else{
		base_uri = form_obj.action;
	}
	
	if (uri == ''){
		window.open(base_uri, '_self');
	}else{
		window.open(base_uri+'?'+uri, '_self');
	}
	
	return false;
}

function encodeUri(str){
	if(encodeURIComponent){
		return encodeURIComponent(str);
	}else{
		return encodeURI(str);
	}
}

function decodeUri(str){
	if(decodeURIComponent ){
		return decodeURIComponent(str);
	}else{
		return decodeURI(str);
	}
}

function clearHeadMsg(div_id){
	var div = document.getElementById(div_id);
	if (null == div){
		return;
	}
	
	if ('' == div.innerHTML){
		return;
	}else{
		div.style.display='none';
	}
}




