function isNotNull(val){
	if(val == null || val == undefined || (!val) ){
		return false;
	}
	return true;
}
function create_request_string(theform)
{
	var reqStr;
	if(theform.action.indexOf("?")>=0){
		reqStr = theform.action+"&";
	}else{
		reqStr = theform.action+"?";
	}
	for(i=0; i < theform.elements.length; i++)
	{
	isformObject = false;
	
	switch (theform.elements[i].tagName)
	{
	case "INPUT":
	
		switch (theform.elements[i].type)
		{
		case "text":
		case "hidden":
			var tempValue = theform.elements[i].value;
			if(isNotNull(tempValue)){
				try{
					base64 = theform.elements[i].attributes['base64'].nodeValue;
					if(base64!=null&&base64!=undefined){
						tempValue = Base64.encode(tempValue);
						reqStr += "base64="+ theform.elements[i].name+"&";
					}
				}catch(err){
					
				}
				reqStr += theform.elements[i].name + "=" + encodeURIComponent(tempValue);
				isformObject = true;
			}
		break;
		
		case "checkbox":
		if (theform.elements[i].checked)
		{
			reqStr += theform.elements[i].name + "=" + theform.elements[i].value;
			isformObject = true;
		}
		
		break;
		
		case "radio":
		if (theform.elements[i].checked)
		{
			reqStr += theform.elements[i].name + "=" + theform.elements[i].value;
			isformObject = true;
		}
		}
	break;
	
	case "TEXTAREA":
		var tempValue = theform.elements[i].value;
		if(isNotNull(tempValue)){
			reqStr += theform.elements[i].name + "=" + encodeURIComponent();
			isformObject = true;
		}
	break;
	
	case "SELECT":
		var sel = theform.elements[i];
		reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;
		isformObject = true;
	break;
	}
	
	if ((isformObject) && ((i+1)!= theform.elements.length))
	{
		
		reqStr += "&";
	}
	
	}
	if(reqStr.lastIndexOf('&')==reqStr.length-1){
		reqStr = reqStr.substring(0,reqStr.length-1);
	}
	return reqStr;
} 

function buildQueryStr(theform){
	reqStr = create_request_string(theform);
	
	window.location=reqStr;
	
	return false;
}