/**********************/

function admin_producto_nuevo(a){
	_h = document.getElementById('CpanelLoad-z');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/admin_producto_nuevo.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function admin_producto_info(a){
	_h = document.getElementById('CpanelLoad-w');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/admin_producto_info.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function user_producto_info(a){
	_h = document.getElementById('CpanelLoad-e');
	_c=objetoCiSe();
	_c.open("POST", "panel/globalnet/user_producto_info.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}


function admin_producto_edit(a){
	_h = document.getElementById('CpanelLoad-w');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/admin_producto_edit.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function admin_producto_delete(a){
	_h = document.getElementById('CpanelLoad-w');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/admin_producto_delete.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

/**********************/



function LinkAyuda(a){
	_h = document.getElementById('CpanelLoad-a');
	_c=objetoCiSe();
	_c.open("POST", "help/help.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function testimonios(a){
	_h = document.getElementById('CpanelLoad-b');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/testimonios.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}
function testimonios_nuevo(a){
	_h = document.getElementById('CpanelLoad-c');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/testimonios_nuevo.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function testimonios_edit(a){
	_h = document.getElementById('CpanelLoad-c');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/testimonios_edit.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function Clinks_edit(a){
	_h = document.getElementById('CpanelLoad-c');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/links_edit.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}


function testimonios_ver(a){
	_h = document.getElementById('CpanelLoad-c');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/testimonios_ver.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function links_ver(a){
	_h = document.getElementById('CpanelLoad-c');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/links_ver.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}


function testimonios_delete(a){
	var cisev = confirm("Esta seguro de eliminar")
			if (cisev){
			
				_h = document.getElementById('CpanelLoad-c');
				_c=objetoCiSe();
				_c.open("POST", "globalnet/testimonios_delete.php?q="+a);
				_h.innerHTML= '<img src="img/body/blue-loading.gif">';
				_c.onreadystatechange=function() {
					if (_c.readyState==4) {
						_h.innerHTML = _c.responseText
					}
				}
				_c.send(null)
			}
			else{
					return false;
			}
	
	
}

function Clinks_delete(a){
	var cisev = confirm("Esta seguro de eliminar")
			if (cisev){
			
				_h = document.getElementById('CpanelLoad-c');
				_c=objetoCiSe();
				_c.open("POST", "globalnet/links_delete.php?q="+a);
				_h.innerHTML= '<img src="img/body/blue-loading.gif">';
				_c.onreadystatechange=function() {
					if (_c.readyState==4) {
						_h.innerHTML = _c.responseText
					}
				}
				_c.send(null)
			}
			else{
					return false;
			}
	
	
}


function Clinks(a){
	_h = document.getElementById('CpanelLoad-b');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/links.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}

function Clinks_nuevo(a){
	_h = document.getElementById('CpanelLoad-c');
	_c=objetoCiSe();
	_c.open("POST", "globalnet/links_nuevo.php?q="+a);
	_h.innerHTML= '<img src="img/body/blue-loading.gif">';
	_c.onreadystatechange=function() {
		if (_c.readyState==4) {
			_h.innerHTML = _c.responseText
		}
	}
	_c.send(null)
}


function testimonios_nuevo_post(str)
{
form=document.getElementById("TestPost");
urlDestino="globalnet/testimonios_procesa.php";
hLl=GetXmlHttpObject();
if (hLl==null)  {  alert ("Browser does not support HTTP Request");  return;  }

var a=form.id_a.value;
var b=form.id_b.value;
hLl.open("POST",urlDestino,true);
hLl.onreadystatechange=_testPost;
hLl.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
hLl.send("&a="+a+"&b="+b);
}
function _testPost()
{ if (hLl.readyState==4)
{ document.getElementById("CpanelLoad-c").innerHTML=hLl.responseText;}}

function testimonios_nuevo_postEdit(str)
{
form=document.getElementById("TestPostEdit");
urlDestino="globalnet/testimonios_procesa_edit.php";
hLl=GetXmlHttpObject();
if (hLl==null)  {  alert ("Browser does not support HTTP Request");  return;  }

var a=form.id_a.value;
var b=form.id_b.value;
var c=form.id_c.value;
hLl.open("POST",urlDestino,true);
hLl.onreadystatechange=_testPostEdit;
hLl.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
hLl.send("&a="+a+"&b="+b+"&c="+c);
}

function link_nuevo_postEdit(str)
{
form=document.getElementById("LinkPostEdit");
urlDestino="globalnet/links_procesa_edit.php";
hLl=GetXmlHttpObject();
if (hLl==null)  {  alert ("Browser does not support HTTP Request");  return;  }

var a=form.id_a.value;
var b=form.id_b.value;
var c=form.id_c.value;
var d=form.id_d.value;

hLl.open("POST",urlDestino,true);
hLl.onreadystatechange=_linkPostEdit;
hLl.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
hLl.send("&a="+a+"&b="+b+"&c="+c+"&d="+d);
}
function _linkPostEdit()
{ if (hLl.readyState==4)
{ document.getElementById("CpanelLoad-c").innerHTML=hLl.responseText;}}

//****************** GET XMLHTTP  ***********************
function GetXmlHttpObject()
{ if(window.XMLHttpRequest) { return new XMLHttpRequest(); } if (window.ActiveXObject)
{return new ActiveXObject("Microsoft.XMLHTTP");}return null;}



//**************** objetoCiSe ************************
function objetoCiSe(){
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;}
//**************** objetoCiSe ************************

function VerifylistOptiondelete(){

	msg = "estass eguro de  confirmar";
    //all we have to do is return the return value of the confirm() method
	
	if (document.formReg.N1.value.length==0){
		alert("digite  una nota")

		return false;
	
	}
	
    return confirm(msg);
    
    }

function cargarpagina(){document.location.reload()}


function validarEmail(valor) {
if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(valor)){
alert("La direccion de email " + valor + " es correcta.") 
return (true)
} else {
alert("La dirección de email es incorrecta.");
return (false);
}
}

/****Consult user****/
var TINY={};

function T$(i){return document.getElementById(i)}
function T$$(e,p){return p.getElementsByTagName(e)}

TINY.table=function(){
	function sorter(n){this.n=n; this.pagesize=10; this.paginate=0}
	sorter.prototype.init=function(e,f){
		var t=ge(e), i=0; this.e=e; this.l=t.r.length; t.a=[];
		t.h=T$$('thead',T$(e))[0].rows[0]; t.w=t.h.cells.length;
		for(i;i<t.w;i++){
			var c=t.h.cells[i];
			if(c.className!='nosort'){
				c.className=this.head; c.onclick=new Function(this.n+'.wk(this.cellIndex)')
			}
		}
		for(i=0;i<this.l;i++){t.a[i]={}}
		if(f!=null){var a=new Function(this.n+'.wk('+f+')'); a()}
		if(this.paginate){this.g=1; this.pages()}
	};
	sorter.prototype.wk=function(y){
		var t=ge(this.e), x=t.h.cells[y], i=0;
		for(i;i<this.l;i++){
      t.a[i].o=i; var v=t.r[i].cells[y]; t.r[i].style.display='';
      while(v.hasChildNodes()){v=v.firstChild}
      t.a[i].v=v.nodeValue?v.nodeValue:''
    }
		for(i=0;i<t.w;i++){var c=t.h.cells[i]; if(c.className!='nosort'){c.className=this.head}}
		if(t.p==y){t.a.reverse(); x.className=t.d?this.asc:this.desc; t.d=t.d?0:1}
		else{t.p=y; t.a.reverse(cp); t.d=0; x.className=this.asc}
		var n=document.createElement('tbody');
		for(i=0;i<this.l;i++){
			var r=t.r[t.a[i].o].cloneNode(true); n.appendChild(r);
			r.className=i%2==0?this.even:this.odd; var cells=T$$('td',r);
			for(var z=0;z<t.w;z++){cells[z].className=y==z?i%2==0?this.evensel:this.oddsel:''}
		}
		t.replaceChild(n,t.b); if(this.paginate){this.size(this.pagesize)}
	};
	sorter.prototype.page=function(s){
		var t=ge(this.e), i=0, l=s+parseInt(this.pagesize);
		if(this.currentid&&this.limitid){T$(this.currentid).innerHTML=this.g}
		for(i;i<this.l;i++){t.r[i].style.display=i>=s&&i<l?'':'none'}
	};
	sorter.prototype.move=function(d,m){
		var s=d==1?(m?this.d:this.g+1):(m?1:this.g-1);
		if(s<=this.d&&s>0){this.g=s; this.page((s-1)*this.pagesize)}
	};
	sorter.prototype.size=function(s){
		this.pagesize=s; this.g=1; this.pages(); this.page(0);
		if(this.currentid&&this.limitid){T$(this.limitid).innerHTML=this.d}
	};
	sorter.prototype.pages=function(){this.d=Math.ceil(this.l/this.pagesize)};
	function ge(e){var t=T$(e); t.b=T$$('tbody',t)[0]; t.r=t.b.rows; return t};
	function cp(f,c){
		var g,h; f=g=f.v.toLowerCase(), c=h=c.v.toLowerCase();
		var i=parseFloat(f.replace(/(\$|\,)/g,'')), n=parseFloat(c.replace(/(\$|\,)/g,''));
		if(!isNaN(i)&&!isNaN(n)){g=i,h=n}
		i=Date.parse(f); n=Date.parse(c);
		if(!isNaN(i)&&!isNaN(n)){g=i; h=n}
		return g>h?1:(g<h?-1:0)
	};
	return{sorter:sorter}
}();

