
	var PREFIX = "www";
	if(location.href.indexOf("/dev.") > 0)
		PREFIX = "dev";

	var so = new SWFObject("/badge/AIRInstallBadge.swf", "Badge", "215", "155", "9.0.115", "#FFFFFF");
	so.useExpressInstall('/badge/expressinstall.swf');
	so.addVariable("airversion", "1.0"); // version of AIR runtime required
	so.addVariable("appname", "TidySongs"); // application name to display to the user
	if (navigator.appVersion.toLowerCase().indexOf("mac") > 0){
		so.addVariable("appurl", "http://"+PREFIX+".tidysongs.com/downloads/TidySongs-Mac-159.air"); // Mac
		so.addVariable("appversion", "1.59M"); // AIR application version
	} else {
		so.addVariable("appurl", "http://"+PREFIX+".tidysongs.com/downloads/TidySongs-PC-159.air"); // Windows
		so.addVariable("appversion", "1.59P"); // AIR application version
	}
	so.addVariable("appid", "tidysongs15"); // the qualified application ID (ex. com.gskinner.air.MyApplication)
	so.addVariable("pubid", ""); // publisher id
	so.addVariable("image", "/images/dl-bg.jpg"); // URL for an image (JPG, PNG, GIF) or SWF to display in the badge (205px wide, 170px high)
	so.addVariable("appinstallarg", "installed from web"); // passed to the application when it is installed from the badge
	so.addVariable("applauncharg", "launched from web"); // passed to the application when it is launched from the badge
	so.addVariable("helpurl", "help.html"); // optional url to a page containing additional help, displayed in the badge's help screen
	so.addVariable("hidehelp", "false"); // hides the help icon if "true"
	so.addVariable("skiptransition", "false"); // skips the initial transition if "true"
	so.addVariable("titlecolor", "#171717"); // changes the color of titles
	so.addVariable("buttonlabelcolor", "#FFFFFF"); // changes the color of the button label
	so.addVariable("appnamecolor", "#00AAFF"); // changes the color of the application name if the image is not specified or loaded
	so.addParam("wmode", "transparent");
	so.write("flashcontent");

	var DownloadGoalDone = false;
	$('#DownloadContainer').hover(function() {
		if(!DownloadGoalDone) {
			DownloadGoalDone = true;
			if (navigator.appVersion.toLowerCase().indexOf("mac") > 0)
				$('body').append('<iframe src="/goal.php?ID=DOWNLOAD-MAC" class="GoalFrame"></iframe>');
			else
				$('body').append('<iframe src="/goal.php?ID=DOWNLOAD-PC" class="GoalFrame"></iframe>');
		}
	});
	
	
	function GetObjectPos(obj) {
		var pos = new Array(0,0);
		if(obj.offsetParent) {
			while (obj.offsetParent) {
		  		pos[0] += obj.offsetLeft;
		  		pos[1] += obj.offsetTop;
		  		obj = obj.offsetParent;
			}
		}
	  	else if(obj.x) {
			pos[0] += obj.x;  
			pos[1] += obj.y;
		}		
		return pos;
	}
	
	