
	function valida_capcha(e,form){
		var str_post= "type=valida_cap&str="+e.value
		var ajax=nuevoAjax();
		ajax.open("POST", "captcha.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				if (ajax.responseText == '1'){
					document.getElementById(form).submit();
				}
				else {
					alert("El código de validación introducido no es correcto.");
					e.focus();
				}
			}
		}	
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajax.send(str_post);
		delete ajax;
	}
	
	function nuevoAjax(){
		var xmlhttp=false;
		 try {
			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();
		}
		return xmlhttp;
	}


/******************************************************************************/


/* funcion muestro texto en status bar */
function showStatus(sMsg) {
		window.status = sMsg ;
		return true ;
}

/*Funcion para mostrar pop-ups --> sin scroll*/
function getPage(thePage,wt,ht){
		leftPos= (screen.width-wt)/2
		topPos = (screen.height-ht)/2
		newWin1 = window.open(thePage,'bWin','toolbar=no, directories=no, resizable=no, scrollbars=no, menubar=no, location=no, status=yes, left='+leftPos+',top='+topPos+',width='+wt+',height='+ht)
}
function getScrollPage(thePage,wt,ht){
		leftPos= (screen.width-wt)/2
		topPos = (screen.height-ht)/2
		newWin1 = window.open(thePage,'bWin','toolbar=no, directories=no, resizable=no, scrollbars=Yes, menubar=no, location=no, status=yes, left='+leftPos+',top='+topPos+',width='+wt+',height='+ht)
}
/*funcion muestro tablas trs o tds sin reload*/
function toggle(target){
	obj=(document.all) ? document.all[target] : document.getElementById(target);
     	obj.style.display=(obj.style.display=='none') ? 'inline' : 'none';
 }
function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}
 /*TOOL TIP */
	/*************************************************************************
	  This code is from Dynamic Web Coding at http://www.dyn-web.com/
	  Copyright 2003 by Sharon Paine 
	  See Terms of Use at http://www.dyn-web.com/bus/terms.html
	  regarding conditions under which you may use this code.
	  This notice must be retained in the code as is!
	*************************************************************************/
	
	// leave in page for way to customize layout of tooltip 
	// and avoid errors if onmouseovers/outs before page completely loaded
	function doTooltip(e, msg) {
	  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
	  Tooltip.show(e, msg);
	}
	
	function hideTip() {
	  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
	  Tooltip.hide();
	}
		
	// preload images that will be displayed in tooltip  
	// put images to preload in this array
	var preload_list = new Array("dot-com-btn.gif", "sm-duck.gif");
	var path_to_images = "images/";
	
	if (document.images) {
		var image_list = new Array();
		for (var preload_counter=0; preload_counter<preload_list.length; preload_counter++) {
	  	image_list[preload_counter] = new Image(); 
			image_list[preload_counter].src = path_to_images + preload_list[preload_counter];	
	  }
	}
	  
	// variables for tooltip content 
	var tipRich = '<div class="tp1">This text is in a div with it\'s own class for different style specifications than the tooltip. </div>';
	var tipImg = '<div style="text-align:center"><img src="/images/dot-com-btn.gif" width="176" height="30" alt="" border="0"></div>';
	var tipImgTxt = '<img src="/images/sm-duck.gif" width="90" height="44" alt="" border="0"><div class="tp2">Images and text can go together in a tooltip.</div>';
	var tipTerms = "If you plan to use our code, please follow our terms. Thank you.";
	
function getScrollPage(thePage,wt,ht){
		leftPos= (screen.width-wt)/2
		topPos = (screen.height-ht)/2
		newWin1 = window.open(thePage,'bWin','toolbar=no, directories=no, resizable=no, scrollbars=Yes, menubar=no, location=no, status=yes, left='+leftPos+',top='+topPos+',width='+wt+',height='+ht)
}
