toaster = function(startVal, repeatVal, message){
    var regFooterVar = document.createElement('div');
	
    $(regFooterVar).attr("id", "regFooter");
    $(regFooterVar).css({
        'display': 'none'
    });
	
	if(userEmail != "" &&  userEmail != null){
		$('#regFooter #regFooterSign').attr('href','/join');
		$('#regFooter').css('display','block');
    } else {
	 	$('#regFooter #regFooterSign').attr('href','/sign-up');
	 	$('#regFooter').css('display','block');
     }
	 
    //$("#footer").append(regFooterVar);
    
    
    
    if ($('li.signup a').length != 0) {
        userVisitCount = $.cookie("userVisits2");
        userVCount = parseInt(userVisitCount);
        userVCountPhase2 = parseInt($.cookie("userVisits2Phase2"));
        
        if (userVisitCount == null) {
            userVCount = 1;
        }
        else {
            userVCount = userVCount + 1;
            if (null != parseInt($.cookie("userVisits2Phase2"))) {
                userVCountPhase2 = userVCountPhase2 + 1;
            }
        }
        writeToConsole(userVCount);
        
        if (userVCount == startVal) {
			$("#footer").append(regFooterVar);
            $("#regFooter").slideToggle();
            $.cookie("showJoinError1", "Yes", {
                path: '/'
            });
            $.cookie("showMusicRstError1", "No", {
                path: '/'
            });
            
            userVCountPhase2 = 0;
            
        }
        else if (userVCount != startVal && null != userVCountPhase2 && userVCountPhase2 % repeatVal == 0) {
                $("#footer").append(regFooterVar);
				$("#regFooter").slideToggle();
   		}
		
		$(function(){
        $("#regFooter a#regFooterClose").bind('click', function(event){
            $("#regFooter").slideToggle();
        });
    	});
        
        var date = new Date();
        date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
        $.cookie("userVisits2", userVCount, {
            path: '/',
            expires: date
        });
        if (userVCount >= startVal) {
            $.cookie("userVisits2Phase2", userVCountPhase2, {
                path: '/',
                expires: date
            });
        }
    }
    else {
        $.cookie("userVisits2", null);
		$.cookie("userVisits2Phase2", null);
    }
    
}

