	//
	// FieldBuffer - Class for form-buffering, value-restoration and file-field resetting.
	//
	// Author: Christopher Bergren (Anjuna Moon)
	// Created: Stockholm Sweden, July 25th, 2005
	// License: Freeware (Please keep credits intact as a sign of good-will)
	//
	// METHODS:
	// BufferForm(FormObject)
	//		Buffers values from all input-elements except File and Button
	// RestoreForm(FormObject)
	//		Restores the buffered data to corresponding elements 
	// ClearFileFields(FormObject)
	//		Performs a Reset-operation that only affects File-elements
	//
	function FieldBuffer() {
		FieldBuffer.prototype.BufferForm=fnBufferForm;
		FieldBuffer.prototype.RestoreForm=fnRestoreForm;
		FieldBuffer.prototype.ClearFileFields=fnClearFileFields
		arrEls=new Array;		
		hshEls={};
		function fnBufferForm(oFrm) {
			oEls=oFrm.elements;
			for (i=0;i<oEls.length;i++) {
				arrEls[i]=new Element(oEls[i]);
			}
		}
		function fnRestoreForm(oFrm) {
			for (i=0;i<arrEls.length;i++) {
				oEl=arrEls[i];
				if (oEl.BufferThis)
					oEl.SetValue();
			}
		}
		function fnClearFileFields(oFrm) {
			this.BufferForm(oFrm);
			oFrm.reset();
			this.RestoreForm(oFrm);
		}
		function Element(oEl) {
			Element.prototype.SetValue=fnSetValue;
			this.Type=oEl.type;
			this.ObjRef=oEl;
			this.Required=false;
			this.CommonName='';
			switch(this.Type) {
				case 'select-one':
					this.Value=oEl.selectedIndex;
					this.BufferThis=true;
					break;
				case 'checkbox':
				case 'radio':
					this.Value=oEl.checked;
					this.BufferThis=true;
					break;
				case 'textarea':
				case 'text':
				case 'password':
				case 'hidden':
					this.Value=oEl.value;
					this.BufferThis=true;
					break;
				default:
					this.BufferThis=false;
			}
			function fnSetValue() {
				switch(this.Type) {
					case 'select-one':
						this.ObjRef.selectedIndex=this.Value;
						break;
					case 'checkbox':
					case 'radio':
						this.ObjRef.checked=this.Value;
						break;
					case 'textarea':
					case 'text':
					case 'password':
					case 'hidden':
						this.ObjRef.value=this.Value;
						break;
				}
			}
		}
	}


var oBuffer=new FieldBuffer(); // for reset the file field
// please refer this link if u have oupt :: http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001136.html
function  checkBrowsefield(e,fileObj,formObj,oBuffer){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable
	
	if(e && e.which){ //if which property of event object is supported (NN4)
	e = e
	characterCode = e.which //character code is contained in NN4's which property
	}
	else{
	e = event
	characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	for(i = 48 ; i <= 57 ; i++){ //  48 - 57 : 0 -7 
		if(characterCode == i){ 
			alert("Please use browse button");
			oBuffer.ClearFileFields(formObj);
			return false;
		}	
	}				
	for(i = 65 ; i <= 90 ; i++){ // 65 - 90 : a - z  A - Z, 48 - 57 : 0 -7 
		if(characterCode == i){ 
			alert("Please use browse button");
			oBuffer.ClearFileFields(formObj);
			return false;
		}	
	}
	for(i = 96 ; i <= 111 ; i++){ // Keys on the numeric keypad
		if(characterCode == i){ 
			alert("Please use browse button");
			oBuffer.ClearFileFields(formObj);
			return false;
		}	
	}			
	for(i = 186 ; i <= 192 ; i++){ // special charectors
		if(characterCode == i){ 
			alert("Please use browse button");
			oBuffer.ClearFileFields(formObj);
			return false;
		}	
	}		
	for(i = 219 ; i <= 222 ; i++){ // special charectors
		if(characterCode == i){ 
			alert("Please use browse button");
			oBuffer.ClearFileFields(formObj);
			return false;
		}	
	}		
} 

