var mlkv = {
	isAllChecked: false,
	checkAll: function() {
		this.checkBox = document.getElementsByTagName("input");
		for (var i=0; i<this.checkBox.length; i++) {
			this.checkBox[i].checked = true;
		}
		this.alartChecked();
	},
	toggleChecked: function(id) {
		var checkBox = $(id);
		checkBox.checked = checkBox.checked? false : true;
	},
	alartChecked: function() {
		if (Prototype.Browser.IE || Prototype.Browser.MobileSafari) return;
		var style = {
			boxShadow: "0 0 0 #fff",
			overflow: "visible"
		}
		var scrollToTop = this.scrollToTop.bind(this);
		var checkmarks = document.getElementsByClassName('checkmark');
		for (var i=0; i<checkmarks.length; i++) {
			checkmarks[i].innerHTML = '<img src="img/checkmark.png"/>';
			checkmarks[i].firstChild.setStyle(style);
			checkmarks[i].firstChild.puff(
				{duration: 0.8,
				 from: 0,
				 to: 1,
				 afterFinish: scrollToTop
				}
			);
		}
	},
	scrollToTop: function() {
		if (!this.isAllChecked) {
			this.suggestDownload();
			Effect.ScrollTo('container', {
				delay: 0.4
			});
			this.isAllChecked = true;
		}
	},
	suggestDownload: function() {
		//$('arrow').style.display = "block";
		Effect.Pulsate('arrow', {
			pulses: 2,
			duration: 3,
			delay: 0.5,
			beforeStart: growArrow,
			afterFinish: hideArrow
		});
		function growArrow() {
			Effect.Appear('arrow', {
				duration: 0.5
				//from: 0.3
			});
		}
		function hideArrow() {
			Effect.Fade('arrow', {
				delay: 2.0,
				transition: Effect.Transitions.sinoidal
			});
		}
	}
};

