document.write('<div id="ClickTaleDiv" style="display: none;"></div>');
document.write('<script src="/js/clicktale/WRb.js" type="text/javascript"></script>');

function ctTrack(projectid, ratio, partitionid, tracksession, customize) {
    var url = document.location.href;
    if(!url.match(/jsessionid/i)) {
        if(url.indexOf("?") == -1) {
           url = url + ';jsessionid=' + tracksession;
        } else {
           var urlArray = url.split("?");
           url = urlArray[0] + ';jsessionid=' + tracksession + '?' + urlArray[1];
        }
    }
    ClickTaleSSL=1;
    ClickTaleFetchFrom = url;

    if(customize)
        customize();

    if(typeof ClickTale=='function') ClickTale(projectid, ratio, partitionid);
}

function ctImasterdCustom() {
    var url = document.location.href;
    if(url.match(/identificacion.action/)) {
        if(typeof ClickTaleTag=='function') ClickTaleTag("Compra");
    } else if(url.match(/miCuenta.action/) || url.match(/mi-cuenta/)) {
        if(typeof ClickTaleTag=='function') ClickTaleTag("MiCuenta");
    } else if(url.match(/registro.action/)
        || url.match(/sendDatosPersonales.action/)        
        || url.match(/loginRegistro.action/)
        || url.match(/changePasswordRegistro.action/)
        || url.match(/sendNewRegistro.action/)) {
        
        ClickTaleUploadPage('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">', '</html>');
    }
}
