  jQuery(document).ready(function(){	 
        jQuery(function () {
            jQuery('#btnFreeTrialNow').click(function(event) {
                event.preventDefault();
                                                
                var totalField = document.getElementById('lblTotal');                
                var total =  totalField.innerHTML;                 
                

                jQuery('#dialog-terms-conditions').dialog({
                    modal: true,
                    title: '<h1 style="color:#fff;">IMPORTANT NOTICE: - August 23, 2010</h1>',
                    resizable: false,
                    width: 700,
                    height: 500,
                    buttons: {
                        'I agree': function () {
                            jQuery(this).dialog("close");                                    
                            
                               var asxStockExchange =document.getElementById('chkAsxData');                               
                               
                               var url = "";
							   url = "http://members.mdsfinancial.com.au/ProductOffer/Offer.aspx?ref=e00a332a-9035-4b66-b3b4-872b3735fa16&skin=metastock";                               							   
                                          
                             // Open New Window with The Offer URLs                              
                             var newWindow = window.open(url,'_blank');
                             newWindow.focus();          
                                                                                 
                            return false;
                        },
                        'I disagree': function() { $(this).dialog("close"); }
                    }
                });
            });
        });
           
 });
         function UpdateFreeTrialValue(id,value)
         {            
            var val = value.toString();            
            if(val.indexOf("$") >= 0)
            {
                val = val.replace("$","");
                val = Number(val);
            }
            if(id.checked == true)
            { 
                UpdateFreeTrialField(val,true);
            }
            else
            {
                UpdateFreeTrialField(val,false);                
                
                if(id.id == "chkAsxData")
                {
                    var totalField = document.getElementById('lblTotal');
                    var asxStockExchange =document.getElementById('chkAsxData');
                }
            }
         }
         function UpdateFreeTrialField(val,isAddOn)
         {
            var totalField = document.getElementById('lblTotal');                                   
            var total = totalField.innerHTML.replace("$","");
			total = total.replace("&nbsp;","");
            if(isAddOn == true)
            {
                totalField.innerHTML =Number(val) + Number(total);
            }
            else
            {
                totalField.innerHTML = Number(total) - Number(val);
            }
            if(totalField.innerHTML.indexOf("$") <0)
            {
                totalField.innerHTML = "$" + totalField.innerHTML;  
            }    
         }
         function UpdateFTWorldData(id,value)
         {
            var totalField = document.getElementById('lblTotal');              
            var asxField = document.getElementById('chkAsxData');            
            
            var isAsxTrue = false;
            if(id.checked == true)
            {         
                UpdateFreeTrialValue(id,value);
            }            
         }
 
        $(function () {
            $('#btnFTAustStockData').click(function(event) {
                event.preventDefault();                
                $('#dialog-austStock').dialog(
                {
                    show:'slide',
                    modal: true,
                    title: 'Australian Equities and Indices Data',
                    resizable: false,
                    width: 350,
                    height: 300,
                    closeOnEscape:true
                });
            });                  
        });

