var jqf = jQuery.noConflict();
jqf(document).ready(function() {
	/**
	* Homepage arrow animation
	*/
	// preload images//
	var cache = [];
	var images = new Array(
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn1.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown1.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn2.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown2.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn3.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown3.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn4.gif',
		'/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown4.gif'
	);

	jqf(images).each(function() {
		var cacheImage = document.createElement('img');
		cacheImage.src = this;
		cache.push(cacheImage);
	});
	jqf('#hpBannerCollapsing1.hpBannerCollapsing h3 a').mouseover(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrow1\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn1.gif');
		}
	});
	jqf('#hpBannerCollapsing1.hpBannerCollapsing h3 a').mouseout(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowOn1\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow1.gif');
		}
	});

	jqf('#hpBannerCollapsing1.hpBannerCollapsing h3 a').click(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowDown1\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow1.gif');
			jqf('div#d' + this.id).slideUp('slow');
			//jqf('span', this).text('+');
		}
		else {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown1.gif');
			jqf('div#d' + this.id).slideDown('slow');
			//jqf('span', this).html('&ndash;');
		}
		return false;
	});



	jqf('#hpBannerCollapsing2.hpBannerCollapsing h3 a').mouseover(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrow2\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn2.gif');
		}
	});
	jqf('#hpBannerCollapsing2.hpBannerCollapsing h3 a').mouseout(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowOn2\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow2.gif');
		}
	});

	jqf('#hpBannerCollapsing2.hpBannerCollapsing h3 a').click(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowDown2\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow2.gif');
			jqf('div#d' + this.id).slideUp('slow');
			//jqf('span', this).text('+');
		}
		else {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown2.gif');
			jqf('div#d' + this.id).slideDown('slow');
			//jqf('span', this).html('&ndash;');
		}
		return false;
	});



	jqf('#hpBannerCollapsing3.hpBannerCollapsing h3 a').mouseover(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrow3\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn3.gif');
		}
	});
	jqf('#hpBannerCollapsing3.hpBannerCollapsing h3 a').mouseout(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowOn3\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow3.gif');
		}
	});

	jqf('#hpBannerCollapsing3.hpBannerCollapsing h3 a').click(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowDown3\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow3.gif');
			jqf('div#d' + this.id).slideUp('slow');
			//jqf('span', this).text('+');
		}
		else {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown3.gif');
			jqf('div#d' + this.id).slideDown('slow');
			//jqf('span', this).html('&ndash;');
		}
		return false;
	});


	jqf('#hpBannerCollapsing4.hpBannerCollapsing h3 a').mouseover(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrow4\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowOn4.gif');
		}
	});
	jqf('#hpBannerCollapsing4.hpBannerCollapsing h3 a').mouseout(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowOn4\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow4.gif');
		}
	});

	jqf('#hpBannerCollapsing4.hpBannerCollapsing h3 a').click(function() {
		if(jqf('img', this).attr('src').match(/hpBannerCollapsingArrowDown4\.gif/)) {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrow4.gif');
			jqf('div#d' + this.id).slideUp('slow');
			//jqf('span', this).text('+');
		}
		else {
			jqf('img', this).attr('src', '/skin/frontend/p4t/default/images/hpBannerCollapsingArrowDown4.gif');
			jqf('div#d' + this.id).slideDown('slow');
			//jqf('span', this).html('&ndash;');
		}
		return false;
	});

});

