
/*
 * Image preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
/*
 * Image preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
/*
 * Image preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
var scrOfX = 0, scrOfY = 0, pageX = 0, pageY = 0;
var myWidth = 0, myHeight = 0;
function getWindowHeightWidth() {
	if (typeof (window.innerWidth) == "number") {
    //Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else {
		if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
    //IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
    //IE 4 compatible
				myWidth = document.body.clientWidth;
				myHeight = document.body.clientHeight;
			}
		}
	}
}
function getScrollXY() {
	if (typeof (window.pageYOffset) == "number") {
    //Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else {
		if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
    //DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		} else {
			if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
    //IE6 standards compliant mode
				scrOfY = document.documentElement.scrollTop;
				scrOfX = document.documentElement.scrollLeft;
			}
		}
	}
}
this.imagePreview = function () {
	/* CONFIG */
	xOffset = 10;
	yOffset = 30;
	$("a.preview").hover(function (e) {
		pageX = e.pageX;
		if (pageX > 720) {
			pageX = 300;
		}
		this.t = this.title;
		this.title = "";
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='" + this.href + "' alt='Image preview' />" + c + "</p>");
		$("#preview").css("top", (e.pageY - xOffset) + "px").css("left", (pageX + yOffset) + "px").fadeIn("fast");
	}, function () {
		this.title = this.t;
		$("#preview").remove();
	});
	$("a.preview").mousemove(function (e) {
		pageX = e.pageX;
		if (pageX > 720) {
			pageX = 300;
		}
		$("#preview").css("top", (e.pageY - xOffset) + "px").css("left", (pageX + yOffset) + "px");
	});
};
AudioPlayer.setup("http://www.waggingtailpets.com/scripts/player/audio/player.swf", {width:494, initialvolume:100, transparentpagebg:"yes", left:"000000", lefticon:"FFFFFF"});
function palyBgMusic() {
	var audioURL = "http://www.waggingtailpets.com/scripts/player/wholetdogfull.mp3";
	AudioPlayer.embed("audioplayer_1", {soundFile:audioURL, autostart:"yes"});
}

// starting the script on page load
$(document).ready(function () {
	imagePreview();
	
	getScrollXY();
	getWindowHeightWidth();
});


