// JavaScript Document
addLoadEvent(initQuotes) ;

var wrap ;
var quoteArr ;

function initQuotes() {
	
	wrap = document.getElementById("quote") ;
	quoteArr = new Array ;
	
	if (document.URL.indexOf("Intermediary") != -1) {
		quoteArr[0] = '"Once again a cracking job and no delays in Commission.  Thank you" <em>T Parkinson, IFA</em>'
		quoteArr[1] = '"Thank you very much, the service you have provided has been 1st class and I will put all my 2nd charge business your way" <em>M McCheyne, IFA</em>'
		quoteArr[2] = '"Very good indeed, my client even phoned to say he was impressed with the service and personal attention" <em>B Ross, IFA</em>'
		quoteArr[3] = '"I feel we would battle to find a company that compare to ISF in their service, speed of response, efficient processing & welcoming manner" <em>K Smith, IFA</em>'
		quoteArr[4] = '"Excellent!  Always helpful &amp; friendly, always called with updates &amp; excellent product knowledge" <em>M Jones, IFA</em>'
		quoteArr[5] = '"You delivered what you promised" <em>Oliver, IFA</em>'
		quoteArr[6] = '"Very confident using your service and would recommend you to other clients/colleagues" <em>B Pew, IFA</em>'
		quoteArr[7] = '"Always confident that the case is being given full attention and communication is good if other information is required" <em>A Whitfield, IFA</em>'
	} else {
		quoteArr[0] = '"The service I received was very good and everything was completed in just over a week which I never expected.  Everything was great!" <em> Nanette, Client</em>'
		quoteArr[1] = '"Very helpful which enabled us to relax while our loan was being processed" <em>Gerard, Client</em>'
		quoteArr[2] = '"Very professional &amp; friendly, assuring and on the ball" <em> David, Client</em>'
		quoteArr[3] = '"First time I\'ve used ISF having been through this experience once, I\'d certainly use ISF again.  Found designated underwriter helpful &amp; professional in their approach" <em>Jayesh, Client</em>'
	}
	wrap.style.width = "200px" ;
	changeQuote(0) ;
}

function changeQuote(quote) {
	if (quote == quoteArr.length) quote = 0 ;
	
	$("#quote").animate({opacity: 'toggle'}, "slow", "easeout", function(){
   	wrap.innerHTML = quoteArr[quote] ;
		$("#quote").animate({opacity: 'toggle'}, "slow", "easein", function() {
			pause(quote) ;
		});
 	});
}
function pause(quote) {
	setTimeout(function() {changeQuote(parseInt(quote) + 1)}, 5000) ;	
}