function from_a()
{
	qs = window.location.search.substring(1);
    gy = qs.split("&");
    for (i=0;i<gy.length;i++) 
    {
        ft = gy[i].split("=");
        if (ft[0] == "from") 
        {
            return true;
        }
        return false;
    }
}

function getUsrProfile()
{
	qs = window.location.search.substring(1);
	
    gy = qs.split("&");
    if(gy.length>1)//if there is from=a
    {
        for (i=0;i<gy.length;i++) 
        {
            ft = gy[i].split("=");
            if (ft[0].toLowerCase() == "up") 
            {
                return ft[1];
            }
        }
    }
    else //if there is no from=a
    {
        ft = qs.split("=");
        if (ft[0].toLowerCase() == "up") 
        {
            return ft[1];
        }
        
    }
    
    return "";
}


function getTipsByProfileId(id)
{
    if (id == 1) 
    {
        return " <div class='divTips divTips1'> " +
              "  <h4 style='text-transform:uppercase;'>If you smoke due to nicotine addiction</h4>" +
              "  <ul>" +
              "    <li>Spend more time in places where smoking is banned, e.g. cinemas, shopping centres and libraries.</li>" +
              "    <li>Avoid smokers and places where they hang out.</li>" +
              "    <li>Keep family and friends informed of your desire to quit smoking and let them know that you need their support.</li>" +
              "  </ul>" +
              "</div>";
    }
    else if (id == 2) 
    {
        return "<div class='divTips divTips2'>" +
             "   <h4 style='text-transform:uppercase;'>If you smoke to feel better</h4>" +
             "   <ul>" +
             "       <li>Learn ways to cope with stress, e.g. listening to soothing music, going for a walk in the park with family members or friends who are smoke-free.</li>" +
             "       <li>Exercise regularly to relieve stress and feel more energetic.</li>" +
             "       <li>Take up new hobbies to fight boredom.</li>" +
             "       <li>Think positively and keep motivating yourself.</li>" +
             "    </ul>" +
             "</div>" ;
    }
    else if (id == 3)
    {
        return "<div class='divTips divTips3 removeBorderBottom'>" +
              "<h4 style='text-transform:uppercase;'>If you smoke out of habit</h4>" +
              "<ul>" +
                "<li>Be aware of your habit. Each time you are about to smoke, ask yourself if you really need that cigarette.</li>" +
                "<li>Break your pattern by changing daily routines, e.g. brushing your teeth after meals instead of smoking.</li>" +
                "<li>Keep busy, e.g. play a game on your mobile phone or help with household chores.</li>" +
                "<li>Munch on healthy snacks, like fruits, if you miss having something in your mouth.</li>" +
              "</ul>" +
			  "<p class=\"mainTip\"><strong>You know yourself best, so try to come up with your own ideas or ask a friend to help you to stay away from cigarettes.</strong></p>" +
            "</div>";
    }
}
