
function getDoc(url, doFunc, id, params, img){
	//alert('getdoc');
    if (window.XMLHttpRequest)
  {// code for IE7, Firefox, Opera, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
    xmlhttp.onreadystatechange= function() {
        if (xmlhttp.readyState==1){
			actualizing(id,img);
		}
		if (xmlhttp.readyState==4){
            if (xmlhttp.status==200){
                doFunc(xmlhttp, id);
			}
		}
    }
	//alert(url);
    xmlhttp.open("POST",url,true);
    xmlhttp.send(params);
}


function actualizing(id,img) {
	//alert('asdasd');
    document.getElementById(id).innerHTML = "<div align=\"center\"><img src=\"/images/"+img+"\"   border=\"0\"></div>";
}
function loadIframe(){
	//alert('/index/viewlistdata/fam/'+ escape(document.forms[0].family.value)+'/sub/'+escape(document.forms[0].subfamily.value)+'/hab/'+escape(document.forms[0].free6_es.value)+'/ban/'+escape(document.forms[0].free7_es.value)+'/pre/'+escape(document.forms[0].free22_es.value)+'/tip/'+escape(document.forms[0].free12_es.value)+'/');;
	iframex.datagrid.loadData('/index/viewlistdata/fam/'+ escape(document.forms[0].family.value)+'/sub/'+escape(document.forms[0].subfamily.value)+'/hab/'+escape(document.forms[0].free6_es.value)+'/ban/'+escape(document.forms[0].free7_es.value)+'/pre/'+escape(document.forms[0].free22_es.value)+'/tip/'+escape(document.forms[0].free12_es.value)+'/');
}
function writeHTML(req, id) {
    document.getElementById(id).innerHTML = req.responseText;
}
function writeHTML2(req, id) {
	/*alert('entre '+id);
	id=escape(id);
	alert('entre222 '+id);*/
    document.getElementById(id).innerHTML = req.responseText;

    loadIframe();
}


function check(id){
	//alert('entre '+id);
	var params = "sub=General&id=3";
	
	getDoc(id, writeHTML, 'subfamily-element',params ,"ajax-line.gif");

	
}

function check2(id){
	//alert('entre '+id);
	id=escape(id);
	//alert('entre '+id);
	getDoc(id, writeHTML2, 'Ajax','',"ajax-loader.gif");

}
function check3(id){
	alert('entre '+id);
	id=escape(id);
	getDoc(id, writeHTML, 'iajax','',"ajax-loader.gif");

}
function check4(){
	alert('entre ');

	

}
function checkDel(html){
 	mensaje="¿Desea dar de baja a este Item?";
	if(confirm(mensaje)){
		location.href=html;
	} 
}

function checkSend(html){
 	mensaje="¿Desea enviar este item a los suscriptores?";
	if(confirm(mensaje)){
		location.href=html;
	} 
}
function popup(html){
Popup = window.open(html,'Popup','width=500,height=200,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no');
	Popup.focus();
}

function popup2(html){
Popup = window.open(html,'Popup','width=500,height=500,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no');
	Popup.focus();
}
function popup3(html){
Popup = window.open(html,'Popup','width=650,height=650,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no');
	Popup.focus();
}

function editproducts(html){
Popup = window.open(html,'Popup','width=600,height=400,toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no');
	Popup.focus();
}

function myOpenWin2(html){
Popup = window.open(html,'Popup','width=610,height=470,toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=no,copyhistory=no');
	Popup.focus();
}

function myOpenWin3(html){
Popup = window.open(html,'Popup','width=600,height=400');
	Popup.focus();
}
function openWindowPercent(newURL, percentX,percentY) {
        // Declare and initialize top and left variables
  // Update properties if comp. browser
  	newHeight = 5*percentY;
	newWidth = 5*percentX;
	
    if (parseInt(navigator.appVersion) >= 4){
          newHeight = parseInt((screen.availHeight * percentY) /100);
          newWidth = parseInt((screen.availWidth * percentX) /100);
	}

  // Open the new window using top and left properties
  var newwin = window.open(newURL, 'remote', 'status=yes,toolbar=yes,menubar=no,location=no,scrollbars=yes,width=' + newWidth + ',height=' + newHeight  + ',resizable=yes');
	newwin.focus();
}

function closeWindow(){
	close()
}

function imprimirPagina() {
	  if (window.print)
	    window.print();
	  else
	    alert("!~!NO_POSIBLE_TO_PRINT!~!");
}

function Load(item) {
	alert(item);
	location.href = "http://172.168.0.3/" + item;
}










