var URL = 'http://www.abcpets.com/';
$(document).ready(function(){
	$.getScript('http://www.pets4you.com/js/home_gallery_conf.js',
		function(){
			HomeGallery.init();
		});
	$.getScript('http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js',
		function(){
			var flashvars = false;
			var params = {
				wmode:"transparent",
				menu:"false",
				flashvars:"site="+URL+"&bordercolor=660033&txtcolor=BF6000"
			};
				
				var attributes = {
					id:"web_gallery",
					name:"web_gallery"
				};
				swfobject.embedSWF("web_slideshow.swf","webgall","150","115","9.0.0","expressInstall.swf",flashvars,params,attributes);
				
		});
});
var hss = '';
var ihss = '';
var totalFiles = 0;
var currentFile = 0;
var HomeGallery = {
	init:function(){
		$('#galimage').click(
			function(){
				window.open('http://www.pets4you.com/gallery/', '_self');	
			});
		totalFiles = gallery.length;
		this.load();
	},
	load:function(){
		if(currentFile == totalFiles){
			currentFile = 0;
		}
		var d = gallery[currentFile];
		$('#galimage div').fadeOut(
			function(){
				$('#petgallcaption').html(d.title);
				$('#galimage div').html('<img src="'+d.source+'" width="'+d.height+'" height="'+d.width+'" alt="'+d.title+'" />');
				ihss = setTimeout("$('#galimage div').fadeIn();",500);
			});
		
		hss = setTimeout("HomeGallery.load();",5000);
		currentFile += 1;
	}
}

