/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if('atob' == typeof window.noFunc) {
    function atob (text) {
        text = text.replace(/\s/g,"");

        if(!(/^[a-z0-9\+\/\s]+\={0,2}$/i.test(text)) || text.length % 4 > 0){
            throw new Error("Not a base64-encoded string.");
        }   

        //local variables
        var digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
                        cur, prev, digitNum,
                        i=0,
                        result = [];

        text = text.replace(/=/g, "");

        while(i < text.length){

            cur = digits.indexOf(text.charAt(i));
            digitNum = i % 4;

            switch(digitNum){

                //case 0: first digit - do nothing, not enough info to work with

                case 1: //second digit
                    result.push(String.fromCharCode(prev << 2 | cur >> 4));
                    break;

                case 2: //third digit
                    result.push(String.fromCharCode((prev & 0x0f) << 4 | cur >> 2));
                    break;

                case 3: //fourth digit
                    result.push(String.fromCharCode((prev & 3) << 6 | cur));
                    break;
            }

            prev = cur;
            i++;
        }

        return result.join("");
    }
}

function qs(k,w) { // get GET param from referrer or location (when w='l')
    if(!qs.l) {
        qs.l=window.location.href;
        qs.l=((p=qs.l.indexOf('?'))>0)?qs.l.substring(p):'';
        qs.r=document.referrer;
        qs.r=((p=qs.r.indexOf('?'))>0)?qs.r.substring(p):'';
    }
    var re = new RegExp( "[\?&]" + k + "=([^&$#]*)", "i" );
    var o = qs.l.match( re );
    
    return ( o == null )?false:o[1];
}
var openstat_text=qs('_openstat','l');
url = document.location.href.indexOf('&utm_content');
if(url == -1 && openstat_text){
    
    var mass = atob(openstat_text).split(';');
    document.location.href = document.location.href + '&utm_content=' + mass[mass.length - 1];
}
//console.log(document.location.href);
