// Initialisation script for Rememberthelittleguy.com

function bgSwitch_DoFSCommand(command, args) {
	if(command == "changeBG") {
	  $("body").css("background-image", "url(assets/images/global/" + args + ")");
	}
}

var mainparams = {
  bgcolor: "d3e38f"
};

var toypaperparams = {
  bgcolor: "b0e3f6"
};

var ilikeparams = {
  bgcolor: "#A690C7"
};

var littlewordsparams = {
  bgcolor: "#f49ac1"
};

var joinhelloparams = {
  bgcolor: "333333"
};

var doodleswordsparams = {
  bgcolor: "b0e3f6"
};

 
var flashvars = {};
swfobject.embedSWF("content/header.swf", "header_flash", "748", "23", "9.0.0", "", "", {allowscriptaccess: "always"}, {name: "bgSwitch"});
//swfobject.embedSWF("content/header.swf", "header_flash", "748", "23", "9.0.0", "", flashvars);
swfobject.embedSWF("content/rtlg_main.swf", "rtlg_main", "760", "512", "9.0.0", "", {allowscriptaccess: "always"}, {name: "bgSwitch"});
swfobject.embedSWF("content/rtlg_toypaper.swf", "rtlg_toypaper", "760", "512", "9.0.0", "", {allowscriptaccess: "always"}, {name: "bgSwitch"});
swfobject.embedSWF("content/rtlg_joinhello.swf", "rtlg_joinhello", "760", "212", "9.0.0", "", flashvars, joinhelloparams);
swfobject.embedSWF("content/rtlg_ilike.swf", "rtlg_ilike", "760", "165", "9.0.0", "", flashvars, ilikeparams);
swfobject.embedSWF("content/rtlg_doodleswords.swf", "rtlg_doodleswords", "760", "423", "9.0.0", "", flashvars, doodleswordsparams);
swfobject.embedSWF("content/footer.swf", "footer_flash", "748", "45", "9.0.0", "", flashvars);
swfobject.embedSWF("content/secretfortune.swf", "secret-fortune", "76", "90", "9.0.0", "", flashvars, {wmode: "transparent"});
var nextHeight = 0;

// Logo for non-flash version
$('#con-top a').click(function(event){
	event.preventDefault();
	nextHeight = parseInt(nextHeight - 44); 
	var elemHeight = '0px ' + nextHeight + 'px';
	$(this).parent('h1').animate({'backgroundPosition':'(' + elemHeight + ')'},"slow");
});

$('#con-top h1').css('background-position', '0px 0px').find('a').removeAttr('title');

/*----- Fix some PNGs on IE6 --------*/
$(document).ready(function() {
	// Fix background images on all TD elements
	$("#con-top, #con-bottom").pngfix();
			
	// Fix all inline PNG images and the element #container with the custom sizingMethod of "scale"
	$("#con-tile").pngfix({
		sizingMethod: "scale"
	});
			
	// $.miseAlphaImageLoader("sdsd");
});
