// JavaScript Documentvar AjaxObj;
AjaxObj = function(){
	this.Ajax = "";
	this.SetObject = function(){
		if(navigator.appName.indexOf("Explorer") != -1){
			 try{
				AjaxObj = new ActiveXObject("Msxml2.XMLHTTP"); 
				}
			catch(e){
				try{
					AjaxObj = new ActiveXObject("Microsoft.XMLHTTP"); 
					}
				catch(E){ 
					AjaxObj = false; 
					} 
				}	  
			 if(!AjaxObj && typeof XMLHttpRequest!='undefined'){ 
				AjaxObj = new XMLHttpRequest(); 
				}
			this.Ajax = AjaxObj; 
			}
		else{
			var xmlhttp=false;
			try{
				// Creacion del objeto AJAX para navegadores no IE
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
			catch(e){
				try{
					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
					}
				catch(E){
					xmlhttp=false; 
					}
				}
			if(!xmlhttp && typeof XMLHttpRequest!="undefined"){
				xmlhttp=new XMLHttpRequest();
				}
			this.Ajax = xmlhttp;
			}
		}
	this.SendGet = function(Action){
		this.Ajax.open("GET",Action,true);
		this.Ajax.send(null);
		}
	this.SendPost = function(QueryString,Action){
		this.Ajax.open("POST",Action,true);
		this.Ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		this.Ajax.send(QueryString);
		}
	this.SendForm = function(FormID,Action){
		
			var i = 0;
			var QueryString = "";
			var Temp = document.getElementById(FormID).getElementsByTagName("input");
			for(i=0;i<Temp.length;i++){
				QueryString+= Temp[i].id+"="+Temp[i].value+"&";
				}
			Temp = document.getElementById(FormID).getElementsByTagName("select");
			for(i=0;i<Temp.length;i++){
				QueryString+= Temp[i].id+"="+Temp[i].value+"&";
				}
			Temp = document.getElementById(FormID).getElementsByTagName("textarea");
			for(i=0;i<Temp.length;i++){
				QueryString+= Temp[i].id+"="+Temp[i].value+"&";
				}
			this.SendPost(QueryString,Action);
			
		}
	}
var Ajax = new AjaxObj();
Ajax.SetObject();
function SubmitForm(FormID){
	document.getElementById(FormID).submit();
	}
