// Basic Functions
//
//----------------------------------------------------------------------------------------------------------
function popUp(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=380,height=160,left = 250,top = 150');");
}

//----------------------------------------------------------------------------------------------------------
function reset_timer() {
  //parent.frames['middle_right'].Cron(1);
}

//----------------------------------------------------------------------------------------------------------
function Mouse(Code) {
	//if(Code>1){alert("<?php echo $company_url; ?>")}
}

//----------------------------------------------------------------------------------------------------------
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject();

//----------------------------------------------------------------------------------------------------------
function pesquisar_dados(table,field,information)
{
	reset_timer();

	if(information != "") {
		http.open("GET", "consult.php?table=" + table + "&field=" + field + "&data=" + information , false);
//		http.onreadystatechange =  handleHttpResponse;
		http.send(null);
    	results = http.responseText;
		if(results == "FOUND") {
//			alert("<?php echo $txt_exist_data; ?>");
			return(false); 
		} else { 
			return(true);
		}
	} else {
		return(true);
	}
}

//----------------------------------------------------------------------------------------------------------

function removeHTMLTags(elemento){
 	if(document.getElementById && document.getElementById(elemento)){
 		var strInputCode = document.getElementById(elemento).innerHTML;
 		/* 
  			This line is optional, it replaces escaped brackets with real ones, 
  			i.e. < is replaced with < and > is replaced with >
 		*/	
 	 	strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
 		 	return (p1 == "lt")? "<" : ">";
 		});
 		var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
   //	alert("Output text:\n" + strTagStrippedText);	
   // Use the alert below if you want to show the input and the output text
   //		alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);	
 	}	
	return true;
}

