I have developed an onclick javascript. I want to show some alert based on some conditions. How to implement this?

```
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")}
var carset = new sforce.SObject("Rfleet_Car_Set__c ");
carset.Id = '{!Rfleet_Car_Set__c.Id}';
var a = sforce.connection.query("select Name,Net_Price__c,
    (select Name,Net_Price__c,Price_HT__c from Services__r) 
        from Rfleet_Car_Set__c where id ='{!Rfleet_Car_Set__c.Id}'" ); 

var records = a.getArray("records");
var netPrice = records[0].Net_Price__c ;
 // get related services records for current carset record
var services = records[0].Services__r.getArray('records');
for (var i = 0; i < services.length; i++) {
    var service = services[i];
    var price = service.Price_HT__c;
    alert(price );
    if(netPrice == null || price == null){
    alert('hello,please enter the valid value of netprice');
    } else {

    alert('yes,you have already entered the net price value');
    window.location.reload()
    }
} 

```

My need is if Carset NetPrice=0 and any of the service Price\_Ht is 0 ,then I want show "some message " msg.otherwise I

But now i have put this in for loop. So for every service record PriceHT is checked and alert is coming.Hoe to overcome this ?