var sal_ph11 = false;
try{
	sal_ph11 = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
	try{
		sal_ph11 = new ActiveXObject("Microsoft.XMLHTTP");
	}catch(E){
		sal_ph11 = false;
	}
}
if (!sal_ph11 && typeof XMLHttpRequest != 'undefined'){
	sal_ph11 = new XMLHttpRequest();
}

function extScript(text_response){
    var ini = 0;
    while (ini!=-1){
        ini = text_response.indexOf('<script', ini);
        if (ini >=0){
            ini = text_response.indexOf('>', ini) + 1;
            var fim = text_response.indexOf('</script>', ini);
            codigo = text_response.substring(ini,fim);
            eval(codigo);
        }
    }
}

function pagin(){
sal_ph11.open("GET","pagin.php?qua="+document.getElementById('qua_rel_cli').value+"&ver=10&ind="+document.getElementById('ind_rel_cli').value);
sal_ph11.onreadystatechange= function(){
	if (sal_ph11.readyState == 4 && sal_ph11.status == 200){
        text_response = sal_ph11.responseText;
		document.getElementById('pagi').innerHTML = text_response;
        extScript(text_response);
	}
}
update_pagin();
sal_ph11.send(null);
}

function update_pagin(){
	document.getElementById('pagi').innerHTML = "<br /><span style='font-size:12px; font-face:arial; font-color:#CCCCCC;'> <img src='puzzle/loading.gif'></span>";
}

function pagin_prod(){
sal_ph11.open("GET","pagin.php?qua="+document.getElementById('qua_rel_cli').value+"&ver=20&ind="+document.getElementById('ind_rel_cli').value);
sal_ph11.onreadystatechange= function(){
	if (sal_ph11.readyState == 4 && sal_ph11.status == 200){
        text_response = sal_ph11.responseText;
		document.getElementById('pagi').innerHTML = text_response;
        extScript(text_response);
	}
}
update_pagin();
sal_ph11.send(null);
}
