﻿
(function ($) {

	$(document).ready(function () {
		HomepageHelper.hasImages();
		//HomepageHelper.getPhotoupload();
		HomepageHelper.formatBrandTiles(7);
		HomepageHelper.formatPlaytimeTiles(7);
		
			// popunder:
			// fpstore get 50% of weight; 
			// window name "ecommpop" is used by ecomm site for pop under tracking, thus it can't be changed.
			// ecomm keycode "F25348" is used to track the sales generated by fp.com pop-under and has to stay - update: took keycode down on 11/10/2010.
		var urls = [
			//'/moments/default_popunder.aspx|800|600|FacebookLandingPopunder|menubar|toolbar|location|scrollbars|resizable',
			//'/moments/default_popunder.aspx|800|600|FacebookLandingPopunder|menubar|toolbar|location|scrollbars|resizable',
			//'/us/infantcoupon_pop_under.asp|600|470|InfPopunder',
			//'/us/trio_pop_under.asp|700|630|TrioPopunder',
			//'/us/infant_cbs/infant_cbs_pop_under.asp|900|690|InfPopunder|menubar|toolbar|location|scrollbars|resizable',
			'/fp.aspx?st=10&e=storelanding|800|600|EcommPop|menubar|toolbar|location|scrollbars|resizable'
		];
		if(!noPup && (urls.length > 0) && (!readCookie("ecommnopup") || readCookie("ecommnopup")!="1")) {
			HomepageHelper.popUnder(urls, '', 0);
		} else { 
			document.cookie = "ecommnopup=1";
		}
	});

}) (jQuery);

window.alert = function() {return;};

// rich media tiles
var rma_datafile = 'rma_data' + HomepageHelper.getRMASequence(1);
var rma = {
	src: '/us/swf/home_tiles/rma/fp_home_rma.swf',
	id: 'toptiles_swf',
	width: '575',
	height: '225',
	version: '9.0.0',
	express_install: '',
	
	flashvars: {datafile:rma_datafile},
	params: {wmode: 'transparent'},
	attributes: { }
};
swfobject.embedSWF(rma.src, rma.id, rma.width, rma.height, rma.version, rma.express_install, rma.flashvars, rma.params, rma.attributes);

loadrma = function () {
	$('#test_swf').remove();
	var flashvars = { datafile:rma_datafile, altstart:1, delay:25 };
	swfobject.embedSWF(rma.src, rma.id, rma.width, rma.height, rma.version, rma.express_install, flashvars, rma.params, rma.attributes);
};

/* var shosh = {
	swf: '/us/swf/home_tiles/fplogo_eddie_drive.swf',
	id: 'shosh',
	width: '770',
	height: '560',
	version: '9.0.0',
	expressInstallSwfUrl: '',

	params: {
		loop: 'false',
		wmode: 'transparent'
	},
	vars: {},
	attrs: {}
};*/
var curCount = 0;
//if ((!readCookie("bfshoshct") || (curCount = parseInt(readCookie("bfshoshct"))) < 3)) {
//	swfobject.embedSWF('/us/swf/home_tiles/blank.swf', 'test_swf', '575', '225', '9.0.0', '', {}, { wmode: 'transparent' }, {});
//	//loadrma();
//	swfobject.embedSWF(shosh.swf, shosh.id, shosh.width, shosh.height, shosh.version, shosh.expressInstallSwfUrl, shosh.vars, shosh.params, shosh.attrs);
//	writeCookie("bfshoshct", curCount + 1);
//} else {
//	//loadrma();
//	swfobject.embedSWF(rma.src, rma.id, rma.width, rma.height, rma.version, rma.express_install, rma.flashvars, rma.params, rma.attributes);
//}

// flash brands scroller
var scroller = {
	src: '/us/swf/home_tiles/brand_scroller/brand_scroller.swf',
	id: 'brandtiles_swf',
	width: '770',
	height: '56',
	version: '9.0.0',
	express_install: '',
	
	flashvars: { },
	params: {wmode: 'transparent'},
	attributes: { }
};
//swfobject.embedSWF(scroller.src, scroller.id, scroller.width, scroller.height, scroller.version, scroller.express_install, scroller.flashvars, scroller.params, scroller.attributes);
