// red de sucursales 
function red_sucursales()	{ 
	var url="http://sucursalesycajeros.bancopatagonia.com.ar/sucursales/";
	var Wnd=window.open(url,"H1",
"toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=753,height=530");
}

// Programa de Puntos 
function programadepremios()	{ 
	var url="http://programadepuntos.bancopatagonia.com.ar/ClubPatagonia/";
	var Wnd=window.open(url,"H2",
"toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,width=800,height=580,top=50, left=50");
}

//aclaración AbrirPopUpCambiaDeSitio:
//destino es el destino del link y nivelessubida es la cantidad de dirs arriba que hay que hacer 
//para entontrar a /confirm.shtml según en qué nivel de subdirectorios esté la página que llama
//a la función
function AbrirPopUpCambiaDeSitio(destino, nivelessubida, Param) {
    //	window.open(nivelessubida + 'confirm/confirm.shtml?Redir=' + destino, 'popup', 'width=300,height=400,top=200,left=200,noresize,directories=no,menubar=no,status=no'); return false;
    if (Param != null) {
        window.open(nivelessubida + '/confirm/confirm.html?Redir=' + destino + '&Param=' + Param, 'popup', 'width=630,height=230,top=200,left=200,noresize,scrollbars=no'); return false;
    }
    else {
        window.open(nivelessubida + '/confirm/confirm.html?Redir=' + destino, 'popup', 'width=630,height=230,top=200,left=200,noresize,scrollbars=no'); return false;

    }
}

function getParams() { 
    var url = window.location.href;
    var qparts = url.split("?");
    //Elimino el string Params=
    if (qparts[1].indexOf('Param=') == -1) return "";
    var parametros = qparts[1].substring(qparts[1].indexOf('Param=') + 6);
    return parametros;
   
}

//devuelve el valor del campo del get recibido en el parámetro varname
function getValue(varname) {
    // First, we load the URL into a variable
    var url = window.location.href;

    // Next, split the url by the ?
    var qparts = url.split("?");
    
    // Check that there is a querystring, return "" if not
    if (qparts.length == 1) {
        return "";
    }
    else {
        // Then find the querystring, everything after the ?
        var query = qparts[1];
       
        // Split the query string into variables (separates by &s)
        var vars = query.split("&");
             
        // Initialize the value with "" as default
        var value = "";
        
        // Iterate through vars, checking each one for varname
        for (i = 0; i < vars.length; i++) {
            // Split the variable by =, which splits name and value
            var parts = vars[i].split("=");

            // Check if the correct variable
            if (parts[0] == varname) {
                // Load value into variable
                value = parts[1];

                // End the loop
                break;
            }
        }
    }

    // Convert escape code
    value = unescape(value);
    
    // Convert "+"s to " "s
    value.replace(/\+/g, " ");
    // Return the value
    return value;
}

function CambiaDeSitio(destino) {
    window.open(destino);
}
