//---------------------------
// FLASH_SETTING
//---------------------------

var flashvars = {};
var params = {
	wmode: "transparent",
	menu: "false",
	bgcolor: "#FFFFFF",
	allowScriptAccess: 'always'
};
var attributes = {
	id: "mvSwf",
	name: "mvSwf"
};
var flashvars2 = {};
var params2 = {
	wmode: "transparent",
	menu: "false",
	bgcolor: "#FFFFFF",
	allowScriptAccess: 'always'
};
var attributes2 = {
	id: "moneySwf",
	name: "moneySwf"
};

//---------------------------
// RANDOM_BANNER_SETTING
//---------------------------
var bnrSetup = {
	bnCnt: 3,
	interviewBn: "#interviewBn",
	loader: ".loader"
}


$.toppageSet = {
	init: function(){
		for(module in $.toppageSet){
			if($.toppageSet[module].init){
				$.toppageSet[module].init();
			}
		}
	}
}

$.toppageSet.setFlash = {
	/*
	init: function(){
		swfobject.embedSWF("/shared/swf/main.swf", "mvSwf", "840", "330", "8.0.0", null, flashvars, params, attributes);
		swfobject.embedSWF("/shared/swf/money.swf", "moneySwf", "840", "92", "8.0.0", null, flashvars2, params2, attributes2);
	}
	*/
	init: function(){
		$(window).bind('load', this.swfSetFn);
	},
	swfSetFn: function(){
		swfobject.embedSWF("/shared/swf/main.swf", "mvSwf", "840", "330", "8.0.0", null, flashvars, params, attributes);
		swfobject.embedSWF("/shared/swf/money.swf", "moneySwf", "840", "92", "8.0.0", null, flashvars2, params2, attributes2);
	}
}

$.toppageSet.setColorBox = {
	init: function(){
		$('.item').colorbox();
	}
}

$.toppageSet.setRandomBnr = {
	init: function(){
	 	var numList = new Array();
	 	var randomNum = new Array();
	 	$(bnrSetup.interviewBn+' li').each(function(index){
	 		numList.push(index);
	 	});
	 	for(var i=numList.length-1; i>0; i--){
	 		var j = Math.floor(Math.random()*(i+1));
	 		var tmp = numList[i];
	 		numList[i] = numList[j];
	 		numList[j] = tmp;
	 	}
	 	for(var i=0; i<bnrSetup.bnCnt; i++){
	 		randomNum.push(numList[i]);
	 	}
	 	$(bnrSetup.loader).fadeOut(1500, function(){
	 		$(randomNum).each(function(index){
	 			$(bnrSetup.interviewBn+' li:eq('+randomNum[index]+')').fadeIn(300);
	 		});
	 	});
	}
}

$(function(){
	$.toppageSet.init();
});

function getvalue(str1, str2) {
	document.hiddenForm.item_id.value = str1;	// アイテムID
	document.hiddenForm.donors_id.value = str2;	// 寄付先ID
}

