    //promo_code
    //var code = Math.floor(Math.random()*9) + 1;
    var code = '';
    var cookie = getCookie('__utmv');
    if(cookie == null){
        var rand = '';
        for(i=1;i<=6;i++){
          rand = Math.floor(Math.random()*9) + 1;
          code += rand.toString();     
        }
    }
    else{
        var code_name = 'promo_code=';
        var code_position = cookie.indexOf(code_name, 0);
        if(cookie.indexOf(code_name, 0) == -1){ //means that there is __utmv cookie, but no promo code
            for(i=1;i<=6;i++){
              rand = Math.floor(Math.random()*9) + 1;
              code += rand.toString();     
            }
        } 
        else{
            code_position += code_name.length;
            code = cookie.substr(code_position, 6);
        }    
    }
$(document).ready(function(){  
    jQuery('#promo_code').html(code);
}); 
