function GetRandomTip()
{
    var dataString = '{ "tipCategories":"' + jQuery('#hfTipCategories').val() + '" }';

    CallServiceMethod("/services/Tips.asmx/GetRandomTip", dataString,
				      function(msg)
				      {
				        var tip = eval('(' + msg.d + ')');
				        jQuery("#tipText").html(tip.Text);

                        //if the flash file is different from the currently loaded, change it
				        if (jQuery("#hfCurrentSWF").val() != tip.FlashPath)
				        {
				            jQuery("#hfCurrentSWF").val(tip.FlashPath);
				            jQuery("#example").empty();
				            showSWF("#example","/flash/" + tip.FlashPath);
				        }
				        
				        if (tip.Url.length > 0)
				        {
				            jQuery("#lnkMoreInfo").attr("href", tip.Url);
				            jQuery("#lnkMoreInfo").show();
				        }
				        else
				        {
				            jQuery("#lnkMoreInfo").hide();
				        }
				      },
				      function(xhr, status, error)
				      {
					    var err = xhr.responseText;
					    document.write(err);
				      });     
}

function NextTip()
{
    var tipText = jQuery("#tipText").text()
    tipText = tipText.replace(/\'/g, "");
    tipText = tipText.replace(/\"/g, "");
    AddMilestone('M29', 'User Clicks on next tip. Tip: ' + tipText);
    GetRandomTip();
}
