function ajax_form(divname,formname){
	var form = document.getElementById(formname);
	//ajax.setVar("myTextBox", form.mytext.value); // recomended method of setting data to be parsed.
	NF=0;
	for (var i=0;i<form.length;i++)
    {
     current = form.elements[i];
	 switch(current.type)
	 {
				case 'radio':
				   if (current.checked)
								   {
									  ajax.setVar(current.name, current.value);	
								   }
				break;	
	default:ajax.setVar(current.name, current.value);	 
	 }
    }
	ajax.requestFile = form.action;
	ajax.method = form.method;
	ajax.element = divname;
	ajax.elementres="RESULT_DIV";
	ajax.onLoadingStr="<p>Submitting Form..</p>";
	ajax.onLoadedStr="<p>Form Submitted</p>";
	ajax.onInteractiveStr="<p>3Loading Form...1</p>";
	ajax.onCompletionStr="<p>4Loading Form...1</p>";
	ajax.onErrorStr="<p>5Loading Form...1</p>";
	ajax.onFailStr="<p>6Loading Form...1</p>";
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	//ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
	return false;
}