$(document).ready(function(){
$('img.help-icon').hide();

$('input').live("focus", function(){							  
 	$(this).nextAll('.help-icon').show();
});



$('select').live("focus", function(){
 	$(this).nextAll('.help-icon').show();
	
});

$('input:radio').live("focus", function(){
 	$(this).parent().nextAll('.help-icon').show();
	
});

$('input').live("blur", function(){		
	$(this).nextAll(".help-icon").hide();
	$(this).parent().nextAll('.help-icon').hide();
});

$('select').live("blur", function(){		
	$(this).nextAll(".help-icon").hide();
	});


$('.qtip').live("click", function(){
 	$(this).hide();

});

$('img.help-icon').live("click", function(){
	$(this).prevAll('input').qtip("show");
	$(this).prevAll('input:radio').qtip("show");
	$(this).prevAll('select').qtip("show");
});






$.fn.qtip.defaults.style = {
		
    
      padding: 0,
      background: 'none',
      color: 'black',
      textAlign: 'left',
      border: {
         width: 0,
         radius: 0
      }
};

$.fn.qtip.defaults.position.corner = {
           target: 'rightTop',
		   tooltip: 'topLeft'
};

$.fn.qtip.defaults.show.when.event = 'focus' ;

//$.fn.qtip.defaults.show.solo =  true	

$.fn.qtip.defaults.hide.when.event = 'focusout' ;


$('#firstname').qtip( $.extend(true, {}, {
   content: 'This is the first name that will appear on related correspondence from us.'
}));

$('#surname').qtip( $.extend(true, {}, {
   content: 'This is the surname that will appear on all related correspondence from us.'
}));

$('#dob').qtip( $.extend(true, {}, {
   content: 'This information will  help us to protect your data. Please enter your date of birth in the following format dd/mm/yyyy.' 
}));


$('#email1').qtip( $.extend(true, {}, {
   content: 'We will send an email confirming your details to this email address.' 
}));

$('#email2').qtip( $.extend(true, {}, {
   content: 'Entering your email address a second time will ensure we have recorded it correctly.' 
}));


$('#emailConfirm').qtip( $.extend(true, {}, {
   content: 'We will send an email confirming your details to this email address. You must have access to emails received'
}));

$('#phone').qtip( $.extend(true, {}, {
   content: 'We might need to contact you by phone about your application. You can enter a mobile or landline number. If using a landline remember to include your area code (e.g. 01 for Dublin).',
   position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));

$('#phoneConfirm').qtip( $.extend(true, {}, {
   content: 'Entering your phone number a second time will ensure we have recorded it correctly.',
   position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));

/* Step 2 */

$('#esbElecAccNum').qtip( $.extend(true, {}, {
   content: 'Your account number is a nine digit number starting with the number 9. It can be found on your electricity bill.'
}));

$('#mprn').qtip( $.extend(true, {}, {
   content: 'Your MPRN (Meter Point Reference Number) is a unique 11 digit number that identifies your electricity connection. It begins with 10 and can be found on your latest electricity bill.'
}));

$('#prevSupplyRadio-yes').qtip( $.extend(true, {}, {
   content: 'As a returning customer we need to know your previous supply address.'
}));


$('#prevSupplyRadio-no').qtip( $.extend(true, {}, {
   content: 'As a returning customer we need to know your previous supply address.'
}));


$('#billingRadio-yes').qtip( $.extend(true, {}, {
   content: 'Select "Yes" if your supply and bill addresses are the same. Select "No" if you want your  bill to go to a different address .'
}));


$('#billingRadio-no').qtip( $.extend(true, {}, {
   content: 'Select "Yes" if your supply and bill addresses are the same. Select "No" if you want your  bill to go to a different address .'
}));

$('input[name$="typeOfBillingAddress"]').qtip( $.extend(true, {}, {
   content: 'Please select type of Billing address.'
}));



$('#irishStdBillingAddress_houseNo').qtip( $.extend(true, {}, {
   content: 'Please enter the house number of your billing address.'
}));

$('#irishStdBillingAddress_aptNo').qtip( $.extend(true, {}, {
   content: 'If applicable please enter your apartment number.'
}));


$('#irishStdBillingAddress_buildingName').qtip( $.extend(true, {}, {
   content: 'If applicable please enter your building name.'
}));

$('#irishStdBillingAddress_street').qtip( $.extend(true, {}, {
   content: 'Please enter your street name.'
}));


$('#prevSupplyAddress_houseNo').qtip( $.extend(true, {}, {
   content: 'Please enter the house number of your previous premises.'
}));

$('#prevSupplyAddress_aptNo').qtip( $.extend(true, {}, {
   content: 'If applicable please enter your apartment number.'
}));


$('#prevSupplyAddress_buildingName').qtip( $.extend(true, {}, {
   content: 'If applicable please enter your building name.'
}));

$('#prevSupplyAddress_street').qtip( $.extend(true, {}, {
   content: 'Please enter your street name.'
}));

$('#poBoxBillingAddress_poBoxNumber').qtip( $.extend(true, {}, {
   content: 'Please enter PO box number.'
}));

$('#poBoxBillingAddress_postCode').qtip( $.extend(true, {}, {
   content: 'Please enter PO box post code.'
}));

$('#poBoxBillingAddress_countyState').qtip( $.extend(true, {}, {
   content: 'Please enter county /state.'
}));

$('#poBoxBillingAddress_countryCode').qtip( $.extend(true, {}, {
   content: 'Please select country.'
}));

$('#internationalBillingAddress_house').qtip( $.extend(true, {}, {
   content: 'Please enter the name or number of your premises.'
}));

$('#internationalBillingAddress_street1').qtip( $.extend(true, {}, {
   content: 'Please enter the first line of your address.'
}));

$('#internationalBillingAddress_street2').qtip( $.extend(true, {}, {
   content: 'Please enter the second line of your address.'
}));

$('#internationalBillingAddress_city').qtip( $.extend(true, {}, {
   content: 'Please enter  town or city.'
}));

$('#internationalBillingAddress_countyState').qtip( $.extend(true, {}, {
   content: 'Please enter county/state.'
}));


$('#internationalBillingAddress_countryCode').qtip( $.extend(true, {}, {
   content: 'Please enter country.'
}));


$('#elecMeterReading').qtip( $.extend(true, {}, {
   content: 'Please enter your meter reading. This is a five digit number- ignore digits in red or figures surrounded by a red box.'
}));

$('#elecNightMeterReading').qtip( $.extend(true, {}, {
   content: 'Please enter your meter reading. This is a five digit number- ignore digits in red or figures surrounded by a red box. This field is not mandatory it is only applicable to consumers with multiple meters (Night rate/Night storage meter etc.)'
}));


$('#elecDependRadio-yes').qtip( $.extend(true, {}, {
   content: 'Please let us know if you or someone in your home depends on electrical medical equipment, such as a home dialysis machine, an oxygen concentrator or an artificial ventilator.We will note your priority support status on our record and advise ESB Networks, who will make every effort to keep a continuous supply of electricity to your home.',
    position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));


$('#elecDependRadio-no').qtip( $.extend(true, {}, {
   content: 'Please let us know if you or someone in your home depends on electrical medical equipment, such as a home dialysis machine, an oxygen concentrator or an artificial ventilator.We will note your priority support status on our record and advise ESB Networks, who will make every effort to keep a continuous supply of electricity to your home.',
    position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));




$('#ageRadio').qtip( $.extend(true, {}, {
   content: 'Please select yes or no. It is our policy to ensure that certain categories of customers, such as those of an advanced age that are likely to be particularly vulnerable to the impact of disconnection during the winter months [November to March inclusive], are provided with the opportunity to be recorded on a register and protected from such disconnections.',
    position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));



$('#specialNeedType').qtip( $.extend(true, {}, {
   content: 'It is our policy to ensure that certain categories of customers, that are likely to be particularly vulnerable to the impact of disconnection during the winter months [November to March inclusive], are provided with the opportunity to be recorded on a register and protected from such disconnections.'
}));

$('#gprnNumber').qtip( $.extend(true, {}, {
   content: 'A GPRN is a unique five to seven  digit number that identifies your gas supply. It can be found on your latest gas bill.'
}));

$('#gasMeterNumber').qtip( $.extend(true, {}, {
   content: 'Your gas meter number is between 4 and 24 characters and can be found on your bill.'
}));

$('#gasMeterReading').qtip( $.extend(true, {}, {
   content: 'Your gas meter reading can be found on your gas meter. By providing an accurate meter reading you will help us speed up your application'
}));

$('#currentSupplier').qtip( $.extend(true, {}, {
   content: 'What is the name of your current gas supplier?',
   position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));



$('#otherCurrentSupplier').qtip( $.extend(true, {}, {
   content: 'Please enter you current gas supplier',
    position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));


$('#currentElecSupplier').qtip( $.extend(true, {}, {
   content: 'What is the name of your current electricity supplier?',
    position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));

$('#otherCurrentElecSupplier').qtip( $.extend(true, {}, {
   content: 'Please enter your current electricity supplier',
    position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));


$('#newBillingRadio-yes').qtip( $.extend(true, {}, {
   content: 'By choosing to use Online Billing you will receive a discount. A paper bill will not be issued.',
   position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));

$('#newBillingRadio-no').qtip( $.extend(true, {}, {
   content: 'By choosing to use Online Billing you will receive a discount. A paper bill will not be issued.',
   position: {
			corner: {
			 target: 'bottomRight',
			 tooltip: 'bottomLeft'
			}
	}
}));


$('#bankAccountNo').qtip( $.extend(true, {}, {
   content: 'This will be the bank account used for your Direct Debit. Your bank account number will be 8 digits long.'
}));

$('#bankSortCode').qtip( $.extend(true, {}, {
   content: 'Your bank sort sode can be found on your latest bank statement. It is 6 digits long.'
}));

$('#recaptcha_response_field').qtip( $.extend(true, {}, {
   content: 'Please enter the letters in the image above.'
}));


});


























































