var Monhyip = {};
Monhyip.Common = {
	hyipImageLinkSelector: 'a.hyipimage',
	
	initMonhyipSelectOtherMenu : function(select, input_to_hide) {

		if (select && input_to_hide) {
			disableInput();
			select.observe('change', function() {
				disableInput();
			}, true);
		}
		function disableInput() {
			if (select.value != '') {
				input_to_hide.value = '';
			}
			select.value == '' ? input_to_hide.show() : input_to_hide.hide();
		}
	},
	initHyipImageLinks : function(links) {
		links.each(function(el) {

			image = null;
			el.observe('mouseover', function(event) {
				href = el.next('a').href;
				if (!image) {
					image = new Element('img', {
						'id' : 'projectimage',
						'src' : href
					})
					el.insert( {
						'after' : image
					});

				}
			});

			el.observe('mouseout', function(event) {
				image.remove();
				image = null;
			});
		});

	}
}
