var quotes = {"Quotes": [
        {"name" : "Project Manager", "company": "US Treasury Department", "quote": "The Co-Star software that we purchased has exceeded our expectation and your support staff has been outstanding to work with. I hear every day from the users here about the great things the software is doing for them."},
        {"name" : "CEO", "company": "Medical Distributor", "quote": "KeyNet software was one of the few we've ever been involved with where we've gotten virtually no complaints - only rave reviews. Thanks KeyNet!"},
        {"name" : "Corporate Controller", "company": "A Large Wholesals Distributor", "quote": "We have constant requests from customers for proof of delivery (POD's). That requires us to have a person on staff to file and to rummage through files or boxes, make copies and fax the POD's to the customers."}
    ]
};
var quotestate = 0;
function switchquote() {
	quotestate++;
	if(quotestate == 3) {
		quotestate = 0;	
	}
	$('#quotebox p').fadeOut(670, function () {switchcontent(quotestate)});
	$('#quote h5').fadeOut(670);
}

function switchcontent(quotestate) {
	$('#quotebox p').html('<p>' + quotes.Quotes[quotestate].quote + '</p>') ;
	$('#quote h5').html(quotes.Quotes[quotestate].name + '<span>' + quotes.Quotes[quotestate].company + '</span>' ) ;
	$('#quotebox p').fadeIn(70);
	$('#quote h5').fadeIn(70);
	if(quotestate == 0)
		$('#state' + 2).removeClass('active');
	else
		$('#state' + (quotestate -1)).removeClass('active');
	$('#state' + quotestate).addClass('active');
}

$(document).ready(function () {
	var searchval = 'Enter search term...';
	var changeMe = ['#search', '#search2'];
		$.each(changeMe, function(index, value) { $(value).focus(function(){
			if(this.value == searchval) {
				this.value = '';
			}
		})
		.blur(function(){
			if(this.value == '')
				this.value = 'Enter search term...';							
		})});
	if(('#quotebox').length != 0) {
		$('#quotebox').html('<p>' + quotes.Quotes[0].quote + '</p>'); 
		setInterval('switchquote()',4000);
	}
});

