// JavaScript Document

var $ = jQuery.noConflict();

jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}

$.preloadImages("http://www.upmarketpets.com/wp-content/themes/lollypop/banner/images/birds_on.gif", "http://www.upmarketpets.com/wp-content/themes/lollypop/banner/images/guineaPig_on.gif", "http://www.upmarketpets.com/wp-content/themes/lollypop/banner/images/cat_on.gif", "http://www.upmarketpets.com/wp-content/themes/lollypop/banner/images/rabbit_on.gf", "http://www.upmarketpets.com/wp-content/themes/lollypop/banner/images/dog_on.gif", "http://www.upmarketpets.com/wp-content/themes/lollypop/banner/images/mouse_on.gif");
$(
	function()
	{
		// set up rollover
		$("#test img").hover(
			function()
			{
				this.src = this.src.replace("_off","_on");
			},
			function()
			{
				this.src = this.src.replace("_on","_off");
			}
		);
		
		$(document).ready(function(){
      $('#test div').hover(function(){
       $(this).siblings().removeClass('on_hover'); 
       $(this).addClass('on_hover');
      },
      function(){
      });

   });

	}
)

function playBird(soundfile) {
 document.getElementById("birdSound").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 
 function playGuineaPig(soundfile) {
 document.getElementById("guineaPigSound").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 
 function playCat(soundfile) {
 document.getElementById("catSound").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 
 function playRabbit(soundfile) {
 document.getElementById("rabbitSound").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 
 function playDog(soundfile) {
 document.getElementById("dogSound").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
 
 function playMouse(soundfile) {
 document.getElementById("mouseSound").innerHTML=
 "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
 }
